babel.js 1.8 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193381943819538196381973819838199382003820138202382033820438205382063820738208382093821038211382123821338214382153821638217382183821938220382213822238223382243822538226382273822838229382303823138232382333823438235382363823738238382393824038241382423824338244382453824638247382483824938250382513825238253382543825538256382573825838259382603826138262382633826438265382663826738268382693827038271382723827338274382753827638277382783827938280382813828238283382843828538286382873828838289382903829138292382933829438295382963829738298382993830038301383023830338304383053830638307383083830938310383113831238313383143831538316383173831838319383203832138322383233832438325383263832738328383293833038331383323833338334383353833638337383383833938340383413834238343383443834538346383473834838349383503835138352383533835438355383563835738358383593836038361383623836338364383653836638367383683836938370383713837238373383743837538376383773837838379383803838138382383833838438385383863838738388383893839038391383923839338394383953839638397383983839938400384013840238403384043840538406384073840838409384103841138412384133841438415384163841738418384193842038421384223842338424384253842638427384283842938430384313843238433384343843538436384373843838439384403844138442384433844438445384463844738448384493845038451384523845338454384553845638457384583845938460384613846238463384643846538466384673846838469384703847138472384733847438475384763847738478384793848038481384823848338484384853848638487384883848938490384913849238493384943849538496384973849838499385003850138502385033850438505385063850738508385093851038511385123851338514385153851638517385183851938520385213852238523385243852538526385273852838529385303853138532385333853438535385363853738538385393854038541385423854338544385453854638547385483854938550385513855238553385543855538556385573855838559385603856138562385633856438565385663856738568385693857038571385723857338574385753857638577385783857938580385813858238583385843858538586385873858838589385903859138592385933859438595385963859738598385993860038601386023860338604386053860638607386083860938610386113861238613386143861538616386173861838619386203862138622386233862438625386263862738628386293863038631386323863338634386353863638637386383863938640386413864238643386443864538646386473864838649386503865138652386533865438655386563865738658386593866038661386623866338664386653866638667386683866938670386713867238673386743867538676386773867838679386803868138682386833868438685386863868738688386893869038691386923869338694386953869638697386983869938700387013870238703387043870538706387073870838709387103871138712387133871438715387163871738718387193872038721387223872338724387253872638727387283872938730387313873238733387343873538736387373873838739387403874138742387433874438745387463874738748387493875038751387523875338754387553875638757387583875938760387613876238763387643876538766387673876838769387703877138772387733877438775387763877738778387793878038781387823878338784387853878638787387883878938790387913879238793387943879538796387973879838799388003880138802388033880438805388063880738808388093881038811388123881338814388153881638817388183881938820388213882238823388243882538826388273882838829388303883138832388333883438835388363883738838388393884038841388423884338844388453884638847388483884938850388513885238853388543885538856388573885838859388603886138862388633886438865388663886738868388693887038871388723887338874388753887638877388783887938880388813888238883388843888538886388873888838889388903889138892388933889438895388963889738898388993890038901389023890338904389053890638907389083890938910389113891238913389143891538916389173891838919389203892138922389233892438925389263892738928389293893038931389323893338934389353893638937389383893938940389413894238943389443894538946389473894838949389503895138952389533895438955389563895738958389593896038961389623896338964389653896638967389683896938970389713897238973389743897538976389773897838979389803898138982389833898438985389863898738988389893899038991389923899338994389953899638997389983899939000390013900239003390043900539006390073900839009390103901139012390133901439015390163901739018390193902039021390223902339024390253902639027390283902939030390313903239033390343903539036390373903839039390403904139042390433904439045390463904739048390493905039051390523905339054390553905639057390583905939060390613906239063390643906539066390673906839069390703907139072390733907439075390763907739078390793908039081390823908339084390853908639087390883908939090390913909239093390943909539096390973909839099391003910139102391033910439105391063910739108391093911039111391123911339114391153911639117391183911939120391213912239123391243912539126391273912839129391303913139132391333913439135391363913739138391393914039141391423914339144391453914639147391483914939150391513915239153391543915539156391573915839159391603916139162391633916439165391663916739168391693917039171391723917339174391753917639177391783917939180391813918239183391843918539186391873918839189391903919139192391933919439195391963919739198391993920039201392023920339204392053920639207392083920939210392113921239213392143921539216392173921839219392203922139222392233922439225392263922739228392293923039231392323923339234392353923639237392383923939240392413924239243392443924539246392473924839249392503925139252392533925439255392563925739258392593926039261392623926339264392653926639267392683926939270392713927239273392743927539276392773927839279392803928139282392833928439285392863928739288392893929039291392923929339294392953929639297392983929939300393013930239303393043930539306393073930839309393103931139312393133931439315393163931739318393193932039321393223932339324393253932639327393283932939330393313933239333393343933539336393373933839339393403934139342393433934439345393463934739348393493935039351393523935339354393553935639357393583935939360393613936239363393643936539366393673936839369393703937139372393733937439375393763937739378393793938039381393823938339384393853938639387393883938939390393913939239393393943939539396393973939839399394003940139402394033940439405394063940739408394093941039411394123941339414394153941639417394183941939420394213942239423394243942539426394273942839429394303943139432394333943439435394363943739438394393944039441394423944339444394453944639447394483944939450394513945239453394543945539456394573945839459394603946139462394633946439465394663946739468394693947039471394723947339474394753947639477394783947939480394813948239483394843948539486394873948839489394903949139492394933949439495394963949739498394993950039501395023950339504395053950639507395083950939510395113951239513395143951539516395173951839519395203952139522395233952439525395263952739528395293953039531395323953339534395353953639537395383953939540395413954239543395443954539546395473954839549395503955139552395533955439555395563955739558395593956039561395623956339564395653956639567395683956939570395713957239573395743957539576395773957839579395803958139582395833958439585395863958739588395893959039591395923959339594395953959639597395983959939600396013960239603396043960539606396073960839609396103961139612396133961439615396163961739618396193962039621396223962339624396253962639627396283962939630396313963239633396343963539636396373963839639396403964139642396433964439645396463964739648396493965039651396523965339654396553965639657396583965939660396613966239663396643966539666396673966839669396703967139672396733967439675396763967739678396793968039681396823968339684396853968639687396883968939690396913969239693396943969539696396973969839699397003970139702397033970439705397063970739708397093971039711397123971339714397153971639717397183971939720397213972239723397243972539726397273972839729397303973139732397333973439735397363973739738397393974039741397423974339744397453974639747397483974939750397513975239753397543975539756397573975839759397603976139762397633976439765397663976739768397693977039771397723977339774397753977639777397783977939780397813978239783397843978539786397873978839789397903979139792397933979439795397963979739798397993980039801398023980339804398053980639807398083980939810398113981239813398143981539816398173981839819398203982139822398233982439825398263982739828398293983039831398323983339834398353983639837398383983939840398413984239843398443984539846398473984839849398503985139852398533985439855398563985739858398593986039861398623986339864398653986639867398683986939870398713987239873398743987539876398773987839879398803988139882398833988439885398863988739888398893989039891398923989339894398953989639897398983989939900399013990239903399043990539906399073990839909399103991139912399133991439915399163991739918399193992039921399223992339924399253992639927399283992939930399313993239933399343993539936399373993839939399403994139942399433994439945399463994739948399493995039951399523995339954399553995639957399583995939960399613996239963399643996539966399673996839969399703997139972399733997439975399763997739978399793998039981399823998339984399853998639987399883998939990399913999239993399943999539996399973999839999400004000140002400034000440005400064000740008400094001040011400124001340014400154001640017400184001940020400214002240023400244002540026400274002840029400304003140032400334003440035400364003740038400394004040041400424004340044400454004640047400484004940050400514005240053400544005540056400574005840059400604006140062400634006440065400664006740068400694007040071400724007340074400754007640077400784007940080400814008240083400844008540086400874008840089400904009140092400934009440095400964009740098400994010040101401024010340104401054010640107401084010940110401114011240113401144011540116401174011840119401204012140122401234012440125401264012740128401294013040131401324013340134401354013640137401384013940140401414014240143401444014540146401474014840149401504015140152401534015440155401564015740158401594016040161401624016340164401654016640167401684016940170401714017240173401744017540176401774017840179401804018140182401834018440185401864018740188401894019040191401924019340194401954019640197401984019940200402014020240203402044020540206402074020840209402104021140212402134021440215402164021740218402194022040221402224022340224402254022640227402284022940230402314023240233402344023540236402374023840239402404024140242402434024440245402464024740248402494025040251402524025340254402554025640257402584025940260402614026240263402644026540266402674026840269402704027140272402734027440275402764027740278402794028040281402824028340284402854028640287402884028940290402914029240293402944029540296402974029840299403004030140302403034030440305403064030740308403094031040311403124031340314403154031640317403184031940320403214032240323403244032540326403274032840329403304033140332403334033440335403364033740338403394034040341403424034340344403454034640347403484034940350403514035240353403544035540356403574035840359403604036140362403634036440365403664036740368403694037040371403724037340374403754037640377403784037940380403814038240383403844038540386403874038840389403904039140392403934039440395403964039740398403994040040401404024040340404404054040640407404084040940410404114041240413404144041540416404174041840419404204042140422404234042440425404264042740428404294043040431404324043340434404354043640437404384043940440404414044240443404444044540446404474044840449404504045140452404534045440455404564045740458404594046040461404624046340464404654046640467404684046940470404714047240473404744047540476404774047840479404804048140482404834048440485404864048740488404894049040491404924049340494404954049640497404984049940500405014050240503405044050540506405074050840509405104051140512405134051440515405164051740518405194052040521405224052340524405254052640527405284052940530405314053240533405344053540536405374053840539405404054140542405434054440545405464054740548405494055040551405524055340554405554055640557405584055940560405614056240563405644056540566405674056840569405704057140572405734057440575405764057740578405794058040581405824058340584405854058640587405884058940590405914059240593405944059540596405974059840599406004060140602406034060440605406064060740608406094061040611406124061340614406154061640617406184061940620406214062240623406244062540626406274062840629406304063140632406334063440635406364063740638406394064040641406424064340644406454064640647406484064940650406514065240653406544065540656406574065840659406604066140662406634066440665406664066740668406694067040671406724067340674406754067640677406784067940680406814068240683406844068540686406874068840689406904069140692406934069440695406964069740698406994070040701407024070340704407054070640707407084070940710407114071240713407144071540716407174071840719407204072140722407234072440725407264072740728407294073040731407324073340734407354073640737407384073940740407414074240743407444074540746407474074840749407504075140752407534075440755407564075740758407594076040761407624076340764407654076640767407684076940770407714077240773407744077540776407774077840779407804078140782407834078440785407864078740788407894079040791407924079340794407954079640797407984079940800408014080240803408044080540806408074080840809408104081140812408134081440815408164081740818408194082040821408224082340824408254082640827408284082940830408314083240833408344083540836408374083840839408404084140842408434084440845408464084740848408494085040851408524085340854408554085640857408584085940860408614086240863408644086540866408674086840869408704087140872408734087440875408764087740878408794088040881408824088340884408854088640887408884088940890408914089240893408944089540896408974089840899409004090140902409034090440905409064090740908409094091040911409124091340914409154091640917409184091940920409214092240923409244092540926409274092840929409304093140932409334093440935409364093740938409394094040941409424094340944409454094640947409484094940950409514095240953409544095540956409574095840959409604096140962409634096440965409664096740968409694097040971409724097340974409754097640977409784097940980409814098240983409844098540986409874098840989409904099140992409934099440995409964099740998409994100041001410024100341004410054100641007410084100941010410114101241013410144101541016410174101841019410204102141022410234102441025410264102741028410294103041031410324103341034410354103641037410384103941040410414104241043410444104541046410474104841049410504105141052410534105441055410564105741058410594106041061410624106341064410654106641067410684106941070410714107241073410744107541076410774107841079410804108141082410834108441085410864108741088410894109041091410924109341094410954109641097410984109941100411014110241103411044110541106411074110841109411104111141112411134111441115411164111741118411194112041121411224112341124411254112641127411284112941130411314113241133411344113541136411374113841139411404114141142411434114441145411464114741148411494115041151411524115341154411554115641157411584115941160411614116241163411644116541166411674116841169411704117141172411734117441175411764117741178411794118041181411824118341184411854118641187411884118941190411914119241193411944119541196411974119841199412004120141202412034120441205412064120741208412094121041211412124121341214412154121641217412184121941220412214122241223412244122541226412274122841229412304123141232412334123441235412364123741238412394124041241412424124341244412454124641247412484124941250412514125241253412544125541256412574125841259412604126141262412634126441265412664126741268412694127041271412724127341274412754127641277412784127941280412814128241283412844128541286412874128841289412904129141292412934129441295412964129741298412994130041301413024130341304413054130641307413084130941310413114131241313413144131541316413174131841319413204132141322413234132441325413264132741328413294133041331413324133341334413354133641337413384133941340413414134241343413444134541346413474134841349413504135141352413534135441355413564135741358413594136041361413624136341364413654136641367413684136941370413714137241373413744137541376413774137841379413804138141382413834138441385413864138741388413894139041391413924139341394413954139641397413984139941400414014140241403414044140541406414074140841409414104141141412414134141441415414164141741418414194142041421414224142341424414254142641427414284142941430414314143241433414344143541436414374143841439414404144141442414434144441445414464144741448414494145041451414524145341454414554145641457414584145941460414614146241463414644146541466414674146841469414704147141472414734147441475414764147741478414794148041481414824148341484414854148641487414884148941490414914149241493414944149541496414974149841499415004150141502415034150441505415064150741508415094151041511415124151341514415154151641517415184151941520415214152241523415244152541526415274152841529415304153141532415334153441535415364153741538415394154041541415424154341544415454154641547415484154941550415514155241553415544155541556415574155841559415604156141562415634156441565415664156741568415694157041571415724157341574415754157641577415784157941580415814158241583415844158541586415874158841589415904159141592415934159441595415964159741598415994160041601416024160341604416054160641607416084160941610416114161241613416144161541616416174161841619416204162141622416234162441625416264162741628416294163041631416324163341634416354163641637416384163941640416414164241643416444164541646416474164841649416504165141652416534165441655416564165741658416594166041661416624166341664416654166641667416684166941670416714167241673416744167541676416774167841679416804168141682416834168441685416864168741688416894169041691416924169341694416954169641697416984169941700417014170241703417044170541706417074170841709417104171141712417134171441715417164171741718417194172041721417224172341724417254172641727417284172941730417314173241733417344173541736417374173841739417404174141742417434174441745417464174741748417494175041751417524175341754417554175641757417584175941760417614176241763417644176541766417674176841769417704177141772417734177441775417764177741778417794178041781417824178341784417854178641787417884178941790417914179241793417944179541796417974179841799418004180141802418034180441805418064180741808418094181041811418124181341814418154181641817418184181941820418214182241823418244182541826418274182841829418304183141832418334183441835418364183741838418394184041841418424184341844418454184641847418484184941850418514185241853418544185541856418574185841859418604186141862418634186441865418664186741868418694187041871418724187341874418754187641877418784187941880418814188241883418844188541886418874188841889418904189141892418934189441895418964189741898418994190041901419024190341904419054190641907419084190941910419114191241913419144191541916419174191841919419204192141922419234192441925419264192741928419294193041931419324193341934419354193641937419384193941940419414194241943419444194541946419474194841949419504195141952419534195441955419564195741958419594196041961419624196341964419654196641967419684196941970419714197241973419744197541976419774197841979419804198141982419834198441985419864198741988419894199041991419924199341994419954199641997419984199942000420014200242003420044200542006420074200842009420104201142012420134201442015420164201742018420194202042021420224202342024420254202642027420284202942030420314203242033420344203542036420374203842039420404204142042420434204442045420464204742048420494205042051420524205342054420554205642057420584205942060420614206242063420644206542066420674206842069420704207142072420734207442075420764207742078420794208042081420824208342084420854208642087420884208942090420914209242093420944209542096420974209842099421004210142102421034210442105421064210742108421094211042111421124211342114421154211642117421184211942120421214212242123421244212542126421274212842129421304213142132421334213442135421364213742138421394214042141421424214342144421454214642147421484214942150421514215242153421544215542156421574215842159421604216142162421634216442165421664216742168421694217042171421724217342174421754217642177421784217942180421814218242183421844218542186421874218842189421904219142192421934219442195421964219742198421994220042201422024220342204422054220642207422084220942210422114221242213422144221542216422174221842219422204222142222422234222442225422264222742228422294223042231422324223342234422354223642237422384223942240422414224242243422444224542246422474224842249422504225142252422534225442255422564225742258422594226042261422624226342264422654226642267422684226942270422714227242273422744227542276422774227842279422804228142282422834228442285422864228742288422894229042291422924229342294422954229642297422984229942300423014230242303423044230542306423074230842309423104231142312423134231442315423164231742318423194232042321423224232342324423254232642327423284232942330423314233242333423344233542336423374233842339423404234142342423434234442345423464234742348423494235042351423524235342354423554235642357423584235942360423614236242363423644236542366423674236842369423704237142372423734237442375423764237742378423794238042381423824238342384423854238642387423884238942390423914239242393423944239542396423974239842399424004240142402424034240442405424064240742408424094241042411424124241342414424154241642417424184241942420424214242242423424244242542426424274242842429424304243142432424334243442435424364243742438424394244042441424424244342444424454244642447424484244942450424514245242453424544245542456424574245842459424604246142462424634246442465424664246742468424694247042471424724247342474424754247642477424784247942480424814248242483424844248542486424874248842489424904249142492424934249442495424964249742498424994250042501425024250342504425054250642507425084250942510425114251242513425144251542516425174251842519425204252142522425234252442525425264252742528425294253042531425324253342534425354253642537425384253942540425414254242543425444254542546425474254842549425504255142552425534255442555425564255742558425594256042561425624256342564425654256642567425684256942570425714257242573425744257542576425774257842579425804258142582425834258442585425864258742588425894259042591425924259342594425954259642597425984259942600426014260242603426044260542606426074260842609426104261142612426134261442615426164261742618426194262042621426224262342624426254262642627426284262942630426314263242633426344263542636426374263842639426404264142642426434264442645426464264742648426494265042651426524265342654426554265642657426584265942660426614266242663426644266542666426674266842669426704267142672426734267442675426764267742678426794268042681426824268342684426854268642687426884268942690426914269242693426944269542696426974269842699427004270142702427034270442705427064270742708427094271042711427124271342714427154271642717427184271942720427214272242723427244272542726427274272842729427304273142732427334273442735427364273742738427394274042741427424274342744427454274642747427484274942750427514275242753427544275542756427574275842759427604276142762427634276442765427664276742768427694277042771427724277342774427754277642777427784277942780427814278242783427844278542786427874278842789427904279142792427934279442795427964279742798427994280042801428024280342804428054280642807428084280942810428114281242813428144281542816428174281842819428204282142822428234282442825428264282742828428294283042831428324283342834428354283642837428384283942840428414284242843428444284542846428474284842849428504285142852428534285442855428564285742858428594286042861428624286342864428654286642867428684286942870428714287242873428744287542876428774287842879428804288142882428834288442885428864288742888428894289042891428924289342894428954289642897428984289942900429014290242903429044290542906429074290842909429104291142912429134291442915429164291742918429194292042921429224292342924429254292642927429284292942930429314293242933429344293542936429374293842939429404294142942429434294442945429464294742948429494295042951429524295342954429554295642957429584295942960429614296242963429644296542966429674296842969429704297142972429734297442975429764297742978429794298042981429824298342984429854298642987429884298942990429914299242993429944299542996429974299842999430004300143002430034300443005430064300743008430094301043011430124301343014430154301643017430184301943020430214302243023430244302543026430274302843029430304303143032430334303443035430364303743038430394304043041430424304343044430454304643047430484304943050430514305243053430544305543056430574305843059430604306143062430634306443065430664306743068430694307043071430724307343074430754307643077430784307943080430814308243083430844308543086430874308843089430904309143092430934309443095430964309743098430994310043101431024310343104431054310643107431084310943110431114311243113431144311543116431174311843119431204312143122431234312443125431264312743128431294313043131431324313343134431354313643137431384313943140431414314243143431444314543146431474314843149431504315143152431534315443155431564315743158431594316043161431624316343164431654316643167431684316943170431714317243173431744317543176431774317843179431804318143182431834318443185431864318743188431894319043191431924319343194431954319643197431984319943200432014320243203432044320543206432074320843209432104321143212432134321443215432164321743218432194322043221432224322343224432254322643227432284322943230432314323243233432344323543236432374323843239432404324143242432434324443245432464324743248432494325043251432524325343254432554325643257432584325943260432614326243263432644326543266432674326843269432704327143272432734327443275432764327743278432794328043281432824328343284432854328643287432884328943290432914329243293432944329543296432974329843299433004330143302433034330443305433064330743308433094331043311433124331343314433154331643317433184331943320433214332243323433244332543326433274332843329433304333143332433334333443335433364333743338433394334043341433424334343344433454334643347433484334943350433514335243353433544335543356433574335843359433604336143362433634336443365433664336743368433694337043371433724337343374433754337643377433784337943380433814338243383433844338543386433874338843389433904339143392433934339443395433964339743398433994340043401434024340343404434054340643407434084340943410434114341243413434144341543416434174341843419434204342143422434234342443425434264342743428434294343043431434324343343434434354343643437434384343943440434414344243443434444344543446434474344843449434504345143452434534345443455434564345743458434594346043461434624346343464434654346643467434684346943470434714347243473434744347543476434774347843479434804348143482434834348443485434864348743488434894349043491434924349343494434954349643497434984349943500435014350243503435044350543506435074350843509435104351143512435134351443515435164351743518435194352043521435224352343524435254352643527435284352943530435314353243533435344353543536435374353843539435404354143542435434354443545435464354743548435494355043551435524355343554435554355643557435584355943560435614356243563435644356543566435674356843569435704357143572435734357443575435764357743578435794358043581435824358343584435854358643587435884358943590435914359243593435944359543596435974359843599436004360143602436034360443605436064360743608436094361043611436124361343614436154361643617436184361943620436214362243623436244362543626436274362843629436304363143632436334363443635436364363743638436394364043641436424364343644436454364643647436484364943650436514365243653436544365543656436574365843659436604366143662436634366443665436664366743668436694367043671436724367343674436754367643677436784367943680436814368243683436844368543686436874368843689436904369143692436934369443695436964369743698436994370043701437024370343704437054370643707437084370943710437114371243713437144371543716437174371843719437204372143722437234372443725437264372743728437294373043731437324373343734437354373643737437384373943740437414374243743437444374543746437474374843749437504375143752437534375443755437564375743758437594376043761437624376343764437654376643767437684376943770437714377243773437744377543776437774377843779437804378143782437834378443785437864378743788437894379043791437924379343794437954379643797437984379943800438014380243803438044380543806438074380843809438104381143812438134381443815438164381743818438194382043821438224382343824438254382643827438284382943830438314383243833438344383543836438374383843839438404384143842438434384443845438464384743848438494385043851438524385343854438554385643857438584385943860438614386243863438644386543866438674386843869438704387143872438734387443875438764387743878438794388043881438824388343884438854388643887438884388943890438914389243893438944389543896438974389843899439004390143902439034390443905439064390743908439094391043911439124391343914439154391643917439184391943920439214392243923439244392543926439274392843929439304393143932439334393443935439364393743938439394394043941439424394343944439454394643947439484394943950439514395243953439544395543956439574395843959439604396143962439634396443965439664396743968439694397043971439724397343974439754397643977439784397943980439814398243983439844398543986439874398843989439904399143992439934399443995439964399743998439994400044001440024400344004440054400644007440084400944010440114401244013440144401544016440174401844019440204402144022440234402444025440264402744028440294403044031440324403344034440354403644037440384403944040440414404244043440444404544046440474404844049440504405144052440534405444055440564405744058440594406044061440624406344064440654406644067440684406944070440714407244073440744407544076440774407844079440804408144082440834408444085440864408744088440894409044091440924409344094440954409644097440984409944100441014410244103441044410544106441074410844109441104411144112441134411444115441164411744118441194412044121441224412344124441254412644127441284412944130441314413244133441344413544136441374413844139441404414144142441434414444145441464414744148441494415044151441524415344154441554415644157441584415944160441614416244163441644416544166441674416844169441704417144172441734417444175441764417744178441794418044181441824418344184441854418644187441884418944190441914419244193441944419544196441974419844199442004420144202442034420444205442064420744208442094421044211442124421344214442154421644217442184421944220442214422244223442244422544226442274422844229442304423144232442334423444235442364423744238442394424044241442424424344244442454424644247442484424944250442514425244253442544425544256442574425844259442604426144262442634426444265442664426744268442694427044271442724427344274442754427644277442784427944280442814428244283442844428544286442874428844289442904429144292442934429444295442964429744298442994430044301443024430344304443054430644307443084430944310443114431244313443144431544316443174431844319443204432144322443234432444325443264432744328443294433044331443324433344334443354433644337443384433944340443414434244343443444434544346443474434844349443504435144352443534435444355443564435744358443594436044361443624436344364443654436644367443684436944370443714437244373443744437544376443774437844379443804438144382443834438444385443864438744388443894439044391443924439344394443954439644397443984439944400444014440244403444044440544406444074440844409444104441144412444134441444415444164441744418444194442044421444224442344424444254442644427444284442944430444314443244433444344443544436444374443844439444404444144442444434444444445444464444744448444494445044451444524445344454444554445644457444584445944460444614446244463444644446544466444674446844469444704447144472444734447444475444764447744478444794448044481444824448344484444854448644487444884448944490444914449244493444944449544496444974449844499445004450144502445034450444505445064450744508445094451044511445124451344514445154451644517445184451944520445214452244523445244452544526445274452844529445304453144532445334453444535445364453744538445394454044541445424454344544445454454644547445484454944550445514455244553445544455544556445574455844559445604456144562445634456444565445664456744568445694457044571445724457344574445754457644577445784457944580445814458244583445844458544586445874458844589445904459144592445934459444595445964459744598445994460044601446024460344604446054460644607446084460944610446114461244613446144461544616446174461844619446204462144622446234462444625446264462744628446294463044631446324463344634446354463644637446384463944640446414464244643446444464544646446474464844649446504465144652446534465444655446564465744658446594466044661446624466344664446654466644667446684466944670446714467244673446744467544676446774467844679446804468144682446834468444685446864468744688446894469044691446924469344694446954469644697446984469944700447014470244703447044470544706447074470844709447104471144712447134471444715447164471744718447194472044721447224472344724447254472644727447284472944730447314473244733447344473544736447374473844739447404474144742447434474444745447464474744748447494475044751447524475344754447554475644757447584475944760447614476244763447644476544766447674476844769447704477144772447734477444775447764477744778447794478044781447824478344784447854478644787447884478944790447914479244793447944479544796447974479844799448004480144802448034480444805448064480744808448094481044811448124481344814448154481644817448184481944820448214482244823448244482544826448274482844829448304483144832448334483444835448364483744838448394484044841448424484344844448454484644847448484484944850448514485244853448544485544856448574485844859448604486144862448634486444865448664486744868448694487044871448724487344874448754487644877448784487944880448814488244883448844488544886448874488844889448904489144892448934489444895448964489744898448994490044901449024490344904449054490644907449084490944910449114491244913449144491544916449174491844919449204492144922449234492444925449264492744928449294493044931449324493344934449354493644937449384493944940449414494244943449444494544946449474494844949449504495144952449534495444955449564495744958449594496044961449624496344964449654496644967449684496944970449714497244973449744497544976449774497844979449804498144982449834498444985449864498744988449894499044991449924499344994449954499644997449984499945000450014500245003450044500545006450074500845009450104501145012450134501445015450164501745018450194502045021450224502345024450254502645027450284502945030450314503245033450344503545036450374503845039450404504145042450434504445045450464504745048450494505045051450524505345054450554505645057450584505945060450614506245063450644506545066450674506845069450704507145072450734507445075450764507745078450794508045081450824508345084450854508645087450884508945090450914509245093450944509545096450974509845099451004510145102451034510445105451064510745108451094511045111451124511345114451154511645117451184511945120451214512245123451244512545126451274512845129451304513145132451334513445135451364513745138451394514045141451424514345144451454514645147451484514945150451514515245153451544515545156451574515845159451604516145162451634516445165451664516745168451694517045171451724517345174451754517645177451784517945180451814518245183451844518545186451874518845189451904519145192451934519445195451964519745198451994520045201452024520345204452054520645207452084520945210452114521245213452144521545216452174521845219452204522145222452234522445225452264522745228452294523045231452324523345234452354523645237452384523945240452414524245243452444524545246452474524845249452504525145252452534525445255452564525745258452594526045261452624526345264452654526645267452684526945270452714527245273452744527545276452774527845279452804528145282452834528445285452864528745288452894529045291452924529345294452954529645297452984529945300453014530245303453044530545306453074530845309453104531145312453134531445315453164531745318453194532045321453224532345324453254532645327453284532945330453314533245333453344533545336453374533845339453404534145342453434534445345453464534745348453494535045351453524535345354453554535645357453584535945360453614536245363453644536545366453674536845369453704537145372453734537445375453764537745378453794538045381453824538345384453854538645387453884538945390453914539245393453944539545396453974539845399454004540145402454034540445405454064540745408454094541045411454124541345414454154541645417454184541945420454214542245423454244542545426454274542845429454304543145432454334543445435454364543745438454394544045441454424544345444454454544645447454484544945450454514545245453454544545545456454574545845459454604546145462454634546445465454664546745468454694547045471454724547345474454754547645477454784547945480454814548245483454844548545486454874548845489454904549145492454934549445495454964549745498454994550045501455024550345504455054550645507455084550945510455114551245513455144551545516455174551845519455204552145522455234552445525455264552745528455294553045531455324553345534455354553645537455384553945540455414554245543455444554545546455474554845549455504555145552455534555445555455564555745558455594556045561455624556345564455654556645567455684556945570455714557245573455744557545576455774557845579455804558145582455834558445585455864558745588455894559045591455924559345594455954559645597455984559945600456014560245603456044560545606456074560845609456104561145612456134561445615456164561745618456194562045621456224562345624456254562645627456284562945630456314563245633456344563545636456374563845639456404564145642456434564445645456464564745648456494565045651456524565345654456554565645657456584565945660456614566245663456644566545666456674566845669456704567145672456734567445675456764567745678456794568045681456824568345684456854568645687456884568945690456914569245693456944569545696456974569845699457004570145702457034570445705457064570745708457094571045711457124571345714457154571645717457184571945720457214572245723457244572545726457274572845729457304573145732457334573445735457364573745738457394574045741457424574345744457454574645747457484574945750457514575245753457544575545756457574575845759457604576145762457634576445765457664576745768457694577045771457724577345774457754577645777457784577945780457814578245783457844578545786457874578845789457904579145792457934579445795457964579745798457994580045801458024580345804458054580645807458084580945810458114581245813458144581545816458174581845819458204582145822458234582445825458264582745828458294583045831458324583345834458354583645837458384583945840458414584245843458444584545846458474584845849458504585145852458534585445855458564585745858458594586045861458624586345864458654586645867458684586945870458714587245873458744587545876458774587845879458804588145882458834588445885458864588745888458894589045891458924589345894458954589645897458984589945900459014590245903459044590545906459074590845909459104591145912459134591445915459164591745918459194592045921459224592345924459254592645927459284592945930459314593245933459344593545936459374593845939459404594145942459434594445945459464594745948459494595045951459524595345954459554595645957459584595945960459614596245963459644596545966459674596845969459704597145972459734597445975459764597745978459794598045981459824598345984459854598645987459884598945990459914599245993459944599545996459974599845999460004600146002460034600446005460064600746008460094601046011460124601346014460154601646017460184601946020460214602246023460244602546026460274602846029460304603146032460334603446035460364603746038460394604046041460424604346044460454604646047460484604946050460514605246053460544605546056460574605846059460604606146062460634606446065460664606746068460694607046071460724607346074460754607646077460784607946080460814608246083460844608546086460874608846089460904609146092460934609446095460964609746098460994610046101461024610346104461054610646107461084610946110461114611246113461144611546116461174611846119461204612146122461234612446125461264612746128461294613046131461324613346134461354613646137461384613946140461414614246143461444614546146461474614846149461504615146152461534615446155461564615746158461594616046161461624616346164461654616646167461684616946170461714617246173461744617546176461774617846179461804618146182461834618446185461864618746188461894619046191461924619346194461954619646197461984619946200462014620246203462044620546206462074620846209462104621146212462134621446215462164621746218462194622046221462224622346224462254622646227462284622946230462314623246233462344623546236462374623846239462404624146242462434624446245462464624746248462494625046251462524625346254462554625646257462584625946260462614626246263462644626546266462674626846269462704627146272462734627446275462764627746278462794628046281462824628346284462854628646287462884628946290462914629246293462944629546296462974629846299463004630146302463034630446305463064630746308463094631046311463124631346314463154631646317463184631946320463214632246323463244632546326463274632846329463304633146332463334633446335463364633746338463394634046341463424634346344463454634646347463484634946350463514635246353463544635546356463574635846359463604636146362463634636446365463664636746368463694637046371463724637346374463754637646377463784637946380463814638246383463844638546386463874638846389463904639146392463934639446395463964639746398463994640046401464024640346404464054640646407464084640946410464114641246413464144641546416464174641846419464204642146422464234642446425464264642746428464294643046431464324643346434464354643646437464384643946440464414644246443464444644546446464474644846449464504645146452464534645446455464564645746458464594646046461464624646346464464654646646467464684646946470464714647246473464744647546476464774647846479464804648146482464834648446485464864648746488464894649046491464924649346494464954649646497464984649946500465014650246503465044650546506465074650846509465104651146512465134651446515465164651746518465194652046521465224652346524465254652646527465284652946530465314653246533465344653546536465374653846539465404654146542465434654446545465464654746548465494655046551465524655346554465554655646557465584655946560465614656246563465644656546566465674656846569465704657146572465734657446575465764657746578465794658046581465824658346584465854658646587465884658946590465914659246593465944659546596465974659846599466004660146602466034660446605466064660746608466094661046611466124661346614466154661646617466184661946620466214662246623466244662546626466274662846629466304663146632466334663446635466364663746638466394664046641466424664346644466454664646647466484664946650466514665246653466544665546656466574665846659466604666146662466634666446665466664666746668466694667046671466724667346674466754667646677466784667946680466814668246683466844668546686466874668846689466904669146692466934669446695466964669746698466994670046701467024670346704467054670646707467084670946710467114671246713467144671546716467174671846719467204672146722467234672446725467264672746728467294673046731467324673346734467354673646737467384673946740467414674246743467444674546746467474674846749467504675146752467534675446755467564675746758467594676046761467624676346764467654676646767467684676946770467714677246773467744677546776467774677846779467804678146782467834678446785467864678746788467894679046791467924679346794467954679646797467984679946800468014680246803468044680546806468074680846809468104681146812468134681446815468164681746818468194682046821468224682346824468254682646827468284682946830468314683246833468344683546836468374683846839468404684146842468434684446845468464684746848468494685046851468524685346854468554685646857468584685946860468614686246863468644686546866468674686846869468704687146872468734687446875468764687746878468794688046881468824688346884468854688646887468884688946890468914689246893468944689546896468974689846899469004690146902469034690446905469064690746908469094691046911469124691346914469154691646917469184691946920469214692246923469244692546926469274692846929469304693146932469334693446935469364693746938469394694046941469424694346944469454694646947469484694946950469514695246953469544695546956469574695846959469604696146962469634696446965469664696746968469694697046971469724697346974469754697646977469784697946980469814698246983469844698546986469874698846989469904699146992469934699446995469964699746998469994700047001470024700347004470054700647007470084700947010470114701247013470144701547016470174701847019470204702147022470234702447025470264702747028470294703047031470324703347034470354703647037470384703947040470414704247043470444704547046470474704847049470504705147052470534705447055470564705747058470594706047061470624706347064470654706647067470684706947070470714707247073470744707547076470774707847079470804708147082470834708447085470864708747088470894709047091470924709347094470954709647097470984709947100471014710247103471044710547106471074710847109471104711147112471134711447115471164711747118471194712047121471224712347124471254712647127471284712947130471314713247133471344713547136471374713847139471404714147142471434714447145471464714747148471494715047151471524715347154471554715647157471584715947160471614716247163471644716547166471674716847169471704717147172471734717447175471764717747178471794718047181471824718347184471854718647187471884718947190471914719247193471944719547196471974719847199472004720147202472034720447205472064720747208472094721047211472124721347214472154721647217472184721947220472214722247223472244722547226472274722847229472304723147232472334723447235472364723747238472394724047241472424724347244472454724647247472484724947250472514725247253472544725547256472574725847259472604726147262472634726447265472664726747268472694727047271472724727347274472754727647277472784727947280472814728247283472844728547286472874728847289472904729147292472934729447295472964729747298472994730047301473024730347304473054730647307473084730947310473114731247313473144731547316473174731847319473204732147322473234732447325473264732747328473294733047331473324733347334473354733647337473384733947340473414734247343473444734547346473474734847349473504735147352473534735447355473564735747358473594736047361473624736347364473654736647367473684736947370473714737247373473744737547376473774737847379473804738147382473834738447385473864738747388473894739047391473924739347394473954739647397473984739947400474014740247403474044740547406474074740847409474104741147412474134741447415474164741747418474194742047421474224742347424474254742647427474284742947430474314743247433474344743547436474374743847439474404744147442474434744447445474464744747448474494745047451474524745347454474554745647457474584745947460474614746247463474644746547466474674746847469474704747147472474734747447475474764747747478474794748047481474824748347484474854748647487474884748947490474914749247493474944749547496474974749847499475004750147502475034750447505475064750747508475094751047511475124751347514475154751647517475184751947520475214752247523475244752547526475274752847529475304753147532475334753447535475364753747538475394754047541475424754347544475454754647547475484754947550475514755247553475544755547556475574755847559475604756147562475634756447565475664756747568475694757047571475724757347574475754757647577475784757947580475814758247583475844758547586475874758847589475904759147592475934759447595475964759747598475994760047601476024760347604476054760647607476084760947610476114761247613476144761547616476174761847619476204762147622476234762447625476264762747628476294763047631476324763347634476354763647637476384763947640476414764247643476444764547646476474764847649476504765147652476534765447655476564765747658476594766047661476624766347664476654766647667476684766947670476714767247673476744767547676476774767847679476804768147682476834768447685476864768747688476894769047691476924769347694476954769647697476984769947700477014770247703477044770547706477074770847709477104771147712477134771447715477164771747718477194772047721477224772347724477254772647727477284772947730477314773247733477344773547736477374773847739477404774147742477434774447745477464774747748477494775047751477524775347754477554775647757477584775947760477614776247763477644776547766477674776847769477704777147772477734777447775477764777747778477794778047781477824778347784477854778647787477884778947790477914779247793477944779547796477974779847799478004780147802478034780447805478064780747808478094781047811478124781347814478154781647817478184781947820478214782247823478244782547826478274782847829478304783147832478334783447835478364783747838478394784047841478424784347844478454784647847478484784947850478514785247853478544785547856478574785847859478604786147862478634786447865478664786747868478694787047871478724787347874478754787647877478784787947880478814788247883478844788547886478874788847889478904789147892478934789447895478964789747898478994790047901479024790347904479054790647907479084790947910479114791247913479144791547916479174791847919479204792147922479234792447925479264792747928479294793047931479324793347934479354793647937479384793947940479414794247943479444794547946479474794847949479504795147952479534795447955479564795747958479594796047961479624796347964479654796647967479684796947970479714797247973479744797547976479774797847979479804798147982479834798447985479864798747988479894799047991479924799347994479954799647997479984799948000480014800248003480044800548006480074800848009480104801148012480134801448015480164801748018480194802048021480224802348024480254802648027480284802948030480314803248033480344803548036480374803848039480404804148042480434804448045480464804748048480494805048051480524805348054480554805648057480584805948060480614806248063480644806548066480674806848069480704807148072480734807448075480764807748078480794808048081480824808348084480854808648087480884808948090480914809248093480944809548096480974809848099481004810148102481034810448105481064810748108481094811048111481124811348114481154811648117481184811948120481214812248123481244812548126481274812848129481304813148132481334813448135481364813748138481394814048141481424814348144481454814648147481484814948150481514815248153481544815548156481574815848159481604816148162481634816448165481664816748168481694817048171481724817348174481754817648177481784817948180481814818248183481844818548186481874818848189481904819148192481934819448195481964819748198481994820048201482024820348204482054820648207482084820948210482114821248213482144821548216482174821848219482204822148222482234822448225482264822748228482294823048231482324823348234482354823648237482384823948240482414824248243482444824548246482474824848249482504825148252482534825448255482564825748258482594826048261482624826348264482654826648267482684826948270482714827248273482744827548276482774827848279482804828148282482834828448285482864828748288482894829048291482924829348294482954829648297482984829948300483014830248303483044830548306483074830848309483104831148312483134831448315483164831748318483194832048321483224832348324483254832648327483284832948330483314833248333483344833548336483374833848339483404834148342483434834448345483464834748348483494835048351483524835348354483554835648357483584835948360483614836248363483644836548366483674836848369483704837148372483734837448375483764837748378483794838048381483824838348384483854838648387483884838948390483914839248393483944839548396483974839848399484004840148402484034840448405484064840748408484094841048411484124841348414484154841648417484184841948420484214842248423484244842548426484274842848429484304843148432484334843448435484364843748438484394844048441484424844348444484454844648447484484844948450484514845248453484544845548456484574845848459484604846148462484634846448465484664846748468484694847048471484724847348474484754847648477484784847948480484814848248483484844848548486484874848848489484904849148492484934849448495484964849748498484994850048501485024850348504485054850648507485084850948510485114851248513485144851548516485174851848519485204852148522485234852448525485264852748528485294853048531485324853348534485354853648537485384853948540485414854248543485444854548546485474854848549485504855148552485534855448555485564855748558485594856048561485624856348564485654856648567485684856948570485714857248573485744857548576485774857848579485804858148582485834858448585485864858748588485894859048591485924859348594485954859648597485984859948600486014860248603486044860548606486074860848609486104861148612486134861448615486164861748618486194862048621486224862348624486254862648627486284862948630486314863248633486344863548636486374863848639486404864148642486434864448645486464864748648486494865048651486524865348654486554865648657486584865948660486614866248663486644866548666486674866848669486704867148672486734867448675486764867748678486794868048681486824868348684486854868648687486884868948690486914869248693486944869548696486974869848699487004870148702487034870448705487064870748708487094871048711487124871348714487154871648717487184871948720487214872248723487244872548726487274872848729487304873148732487334873448735487364873748738487394874048741487424874348744487454874648747487484874948750487514875248753487544875548756487574875848759487604876148762487634876448765487664876748768487694877048771487724877348774487754877648777487784877948780487814878248783487844878548786487874878848789487904879148792487934879448795487964879748798487994880048801488024880348804488054880648807488084880948810488114881248813488144881548816488174881848819488204882148822488234882448825488264882748828488294883048831488324883348834488354883648837488384883948840488414884248843488444884548846488474884848849488504885148852488534885448855488564885748858488594886048861488624886348864488654886648867488684886948870488714887248873488744887548876488774887848879488804888148882488834888448885488864888748888488894889048891488924889348894488954889648897488984889948900489014890248903489044890548906489074890848909489104891148912489134891448915489164891748918489194892048921489224892348924489254892648927489284892948930489314893248933489344893548936489374893848939489404894148942489434894448945489464894748948489494895048951489524895348954489554895648957489584895948960489614896248963489644896548966489674896848969489704897148972489734897448975489764897748978489794898048981489824898348984489854898648987489884898948990489914899248993489944899548996489974899848999490004900149002490034900449005490064900749008490094901049011490124901349014490154901649017490184901949020490214902249023490244902549026490274902849029490304903149032490334903449035490364903749038490394904049041490424904349044490454904649047490484904949050490514905249053490544905549056490574905849059490604906149062490634906449065490664906749068490694907049071490724907349074490754907649077490784907949080490814908249083490844908549086490874908849089490904909149092490934909449095490964909749098490994910049101491024910349104491054910649107491084910949110491114911249113491144911549116491174911849119491204912149122491234912449125491264912749128491294913049131491324913349134491354913649137491384913949140491414914249143491444914549146491474914849149491504915149152491534915449155491564915749158491594916049161491624916349164491654916649167491684916949170491714917249173491744917549176491774917849179491804918149182491834918449185491864918749188491894919049191491924919349194491954919649197491984919949200492014920249203492044920549206492074920849209492104921149212492134921449215492164921749218492194922049221492224922349224492254922649227492284922949230492314923249233492344923549236492374923849239492404924149242492434924449245492464924749248492494925049251492524925349254492554925649257492584925949260492614926249263492644926549266492674926849269492704927149272492734927449275492764927749278492794928049281492824928349284492854928649287492884928949290492914929249293492944929549296492974929849299493004930149302493034930449305493064930749308493094931049311493124931349314493154931649317493184931949320493214932249323493244932549326493274932849329493304933149332493334933449335493364933749338493394934049341493424934349344493454934649347493484934949350493514935249353493544935549356493574935849359493604936149362493634936449365493664936749368493694937049371493724937349374493754937649377493784937949380493814938249383493844938549386493874938849389493904939149392493934939449395493964939749398493994940049401494024940349404494054940649407494084940949410494114941249413494144941549416494174941849419494204942149422494234942449425494264942749428494294943049431494324943349434494354943649437494384943949440494414944249443494444944549446494474944849449494504945149452494534945449455494564945749458494594946049461494624946349464494654946649467494684946949470494714947249473494744947549476494774947849479494804948149482494834948449485494864948749488494894949049491494924949349494494954949649497494984949949500495014950249503495044950549506495074950849509495104951149512495134951449515495164951749518495194952049521495224952349524495254952649527495284952949530495314953249533495344953549536495374953849539495404954149542495434954449545495464954749548495494955049551495524955349554495554955649557495584955949560495614956249563495644956549566495674956849569495704957149572495734957449575495764957749578495794958049581495824958349584495854958649587495884958949590495914959249593495944959549596495974959849599496004960149602496034960449605496064960749608496094961049611496124961349614496154961649617496184961949620496214962249623496244962549626496274962849629496304963149632496334963449635496364963749638496394964049641496424964349644496454964649647496484964949650496514965249653496544965549656496574965849659496604966149662496634966449665496664966749668496694967049671496724967349674496754967649677496784967949680496814968249683496844968549686496874968849689496904969149692496934969449695496964969749698496994970049701497024970349704497054970649707497084970949710497114971249713497144971549716497174971849719497204972149722497234972449725497264972749728497294973049731497324973349734497354973649737497384973949740497414974249743497444974549746497474974849749497504975149752497534975449755497564975749758497594976049761497624976349764497654976649767497684976949770497714977249773497744977549776497774977849779497804978149782497834978449785497864978749788497894979049791497924979349794497954979649797497984979949800498014980249803498044980549806498074980849809498104981149812498134981449815498164981749818498194982049821498224982349824498254982649827498284982949830498314983249833498344983549836498374983849839498404984149842498434984449845498464984749848498494985049851498524985349854498554985649857498584985949860498614986249863498644986549866498674986849869498704987149872498734987449875498764987749878498794988049881498824988349884498854988649887498884988949890498914989249893498944989549896498974989849899499004990149902499034990449905499064990749908499094991049911499124991349914499154991649917499184991949920499214992249923499244992549926499274992849929499304993149932499334993449935499364993749938499394994049941499424994349944499454994649947499484994949950499514995249953499544995549956499574995849959499604996149962499634996449965499664996749968499694997049971499724997349974499754997649977499784997949980499814998249983499844998549986499874998849989499904999149992499934999449995499964999749998499995000050001500025000350004500055000650007500085000950010500115001250013500145001550016500175001850019500205002150022500235002450025500265002750028500295003050031500325003350034500355003650037500385003950040500415004250043500445004550046500475004850049500505005150052500535005450055500565005750058500595006050061500625006350064500655006650067500685006950070500715007250073500745007550076500775007850079500805008150082500835008450085500865008750088500895009050091500925009350094500955009650097500985009950100501015010250103501045010550106501075010850109501105011150112501135011450115501165011750118501195012050121501225012350124501255012650127501285012950130501315013250133501345013550136501375013850139501405014150142501435014450145501465014750148501495015050151501525015350154501555015650157501585015950160501615016250163501645016550166501675016850169501705017150172501735017450175501765017750178501795018050181501825018350184501855018650187501885018950190501915019250193501945019550196501975019850199502005020150202502035020450205502065020750208502095021050211502125021350214502155021650217502185021950220502215022250223502245022550226502275022850229502305023150232502335023450235502365023750238502395024050241502425024350244502455024650247502485024950250502515025250253502545025550256502575025850259502605026150262502635026450265502665026750268502695027050271502725027350274502755027650277502785027950280502815028250283502845028550286502875028850289502905029150292502935029450295502965029750298502995030050301503025030350304503055030650307503085030950310503115031250313503145031550316503175031850319503205032150322503235032450325503265032750328503295033050331503325033350334503355033650337503385033950340503415034250343503445034550346503475034850349503505035150352503535035450355503565035750358503595036050361503625036350364503655036650367503685036950370503715037250373503745037550376503775037850379503805038150382503835038450385503865038750388503895039050391503925039350394503955039650397503985039950400504015040250403504045040550406504075040850409504105041150412504135041450415504165041750418504195042050421504225042350424504255042650427504285042950430504315043250433504345043550436504375043850439504405044150442504435044450445504465044750448504495045050451504525045350454504555045650457504585045950460504615046250463504645046550466504675046850469504705047150472504735047450475504765047750478504795048050481504825048350484504855048650487504885048950490504915049250493504945049550496504975049850499505005050150502505035050450505505065050750508505095051050511505125051350514505155051650517505185051950520505215052250523505245052550526505275052850529505305053150532505335053450535505365053750538505395054050541505425054350544505455054650547505485054950550505515055250553505545055550556505575055850559505605056150562505635056450565505665056750568505695057050571505725057350574505755057650577505785057950580505815058250583505845058550586505875058850589505905059150592505935059450595505965059750598505995060050601506025060350604506055060650607506085060950610506115061250613506145061550616506175061850619506205062150622506235062450625506265062750628506295063050631506325063350634506355063650637506385063950640506415064250643506445064550646506475064850649506505065150652506535065450655506565065750658506595066050661506625066350664506655066650667506685066950670506715067250673506745067550676506775067850679506805068150682506835068450685506865068750688506895069050691506925069350694506955069650697506985069950700507015070250703507045070550706507075070850709507105071150712507135071450715507165071750718507195072050721507225072350724507255072650727507285072950730507315073250733507345073550736507375073850739507405074150742507435074450745507465074750748507495075050751507525075350754507555075650757507585075950760507615076250763507645076550766507675076850769507705077150772507735077450775507765077750778507795078050781507825078350784507855078650787507885078950790507915079250793507945079550796507975079850799508005080150802508035080450805508065080750808508095081050811508125081350814508155081650817508185081950820508215082250823508245082550826508275082850829508305083150832508335083450835508365083750838508395084050841508425084350844508455084650847508485084950850508515085250853508545085550856508575085850859508605086150862508635086450865508665086750868508695087050871508725087350874508755087650877508785087950880508815088250883508845088550886508875088850889508905089150892508935089450895508965089750898508995090050901509025090350904509055090650907509085090950910509115091250913509145091550916509175091850919509205092150922509235092450925509265092750928509295093050931509325093350934509355093650937509385093950940509415094250943509445094550946509475094850949509505095150952509535095450955509565095750958509595096050961509625096350964509655096650967509685096950970509715097250973509745097550976509775097850979509805098150982509835098450985509865098750988509895099050991509925099350994509955099650997509985099951000510015100251003510045100551006510075100851009510105101151012510135101451015510165101751018510195102051021510225102351024510255102651027510285102951030510315103251033510345103551036510375103851039510405104151042510435104451045510465104751048510495105051051510525105351054510555105651057510585105951060510615106251063510645106551066510675106851069510705107151072510735107451075510765107751078510795108051081510825108351084510855108651087510885108951090510915109251093510945109551096510975109851099511005110151102511035110451105511065110751108511095111051111511125111351114511155111651117511185111951120511215112251123511245112551126511275112851129511305113151132511335113451135511365113751138511395114051141511425114351144511455114651147511485114951150511515115251153511545115551156511575115851159511605116151162511635116451165511665116751168511695117051171511725117351174511755117651177511785117951180511815118251183511845118551186511875118851189511905119151192511935119451195511965119751198511995120051201512025120351204512055120651207512085120951210512115121251213512145121551216512175121851219512205122151222512235122451225512265122751228512295123051231512325123351234512355123651237512385123951240512415124251243512445124551246512475124851249512505125151252512535125451255512565125751258512595126051261512625126351264512655126651267512685126951270512715127251273512745127551276512775127851279512805128151282512835128451285512865128751288512895129051291512925129351294512955129651297512985129951300513015130251303513045130551306513075130851309513105131151312513135131451315513165131751318513195132051321513225132351324513255132651327513285132951330513315133251333513345133551336513375133851339513405134151342513435134451345513465134751348513495135051351513525135351354513555135651357513585135951360513615136251363513645136551366513675136851369513705137151372513735137451375513765137751378513795138051381513825138351384513855138651387513885138951390513915139251393513945139551396513975139851399514005140151402514035140451405514065140751408514095141051411514125141351414514155141651417514185141951420514215142251423514245142551426514275142851429514305143151432514335143451435514365143751438514395144051441514425144351444514455144651447514485144951450514515145251453514545145551456514575145851459514605146151462514635146451465514665146751468514695147051471514725147351474514755147651477514785147951480514815148251483514845148551486514875148851489514905149151492514935149451495514965149751498514995150051501515025150351504515055150651507515085150951510515115151251513515145151551516515175151851519515205152151522515235152451525515265152751528515295153051531515325153351534515355153651537515385153951540515415154251543515445154551546515475154851549515505155151552515535155451555515565155751558515595156051561515625156351564515655156651567515685156951570515715157251573515745157551576515775157851579515805158151582515835158451585515865158751588515895159051591515925159351594515955159651597515985159951600516015160251603516045160551606516075160851609516105161151612516135161451615516165161751618516195162051621516225162351624516255162651627516285162951630516315163251633516345163551636516375163851639516405164151642516435164451645516465164751648516495165051651516525165351654516555165651657516585165951660516615166251663516645166551666516675166851669516705167151672516735167451675516765167751678516795168051681516825168351684516855168651687516885168951690516915169251693516945169551696516975169851699517005170151702517035170451705517065170751708517095171051711517125171351714517155171651717517185171951720517215172251723517245172551726517275172851729517305173151732517335173451735517365173751738517395174051741517425174351744517455174651747517485174951750517515175251753517545175551756517575175851759517605176151762517635176451765517665176751768517695177051771517725177351774517755177651777517785177951780517815178251783517845178551786517875178851789517905179151792517935179451795517965179751798517995180051801518025180351804518055180651807518085180951810518115181251813518145181551816518175181851819518205182151822518235182451825518265182751828518295183051831518325183351834518355183651837518385183951840518415184251843518445184551846518475184851849518505185151852518535185451855518565185751858518595186051861518625186351864518655186651867518685186951870518715187251873518745187551876518775187851879518805188151882518835188451885518865188751888518895189051891518925189351894518955189651897518985189951900519015190251903519045190551906519075190851909519105191151912519135191451915519165191751918519195192051921519225192351924519255192651927519285192951930519315193251933519345193551936519375193851939519405194151942519435194451945519465194751948519495195051951519525195351954519555195651957519585195951960519615196251963519645196551966519675196851969519705197151972519735197451975519765197751978519795198051981519825198351984519855198651987519885198951990519915199251993519945199551996519975199851999520005200152002520035200452005520065200752008520095201052011520125201352014520155201652017520185201952020520215202252023520245202552026520275202852029520305203152032520335203452035520365203752038520395204052041520425204352044520455204652047520485204952050520515205252053520545205552056520575205852059520605206152062520635206452065520665206752068520695207052071520725207352074520755207652077520785207952080520815208252083520845208552086520875208852089520905209152092520935209452095520965209752098520995210052101521025210352104521055210652107521085210952110521115211252113521145211552116521175211852119521205212152122521235212452125521265212752128521295213052131521325213352134521355213652137521385213952140521415214252143521445214552146521475214852149521505215152152521535215452155521565215752158521595216052161521625216352164521655216652167521685216952170521715217252173521745217552176521775217852179521805218152182521835218452185521865218752188521895219052191521925219352194521955219652197521985219952200522015220252203522045220552206522075220852209522105221152212522135221452215522165221752218522195222052221522225222352224522255222652227522285222952230522315223252233522345223552236522375223852239522405224152242522435224452245522465224752248522495225052251522525225352254522555225652257522585225952260522615226252263522645226552266522675226852269522705227152272522735227452275522765227752278522795228052281522825228352284522855228652287522885228952290522915229252293522945229552296522975229852299523005230152302523035230452305523065230752308523095231052311523125231352314523155231652317523185231952320523215232252323523245232552326523275232852329523305233152332523335233452335523365233752338523395234052341523425234352344523455234652347523485234952350523515235252353523545235552356523575235852359523605236152362523635236452365523665236752368523695237052371523725237352374523755237652377523785237952380523815238252383523845238552386523875238852389523905239152392523935239452395523965239752398523995240052401524025240352404524055240652407524085240952410524115241252413524145241552416524175241852419524205242152422524235242452425524265242752428524295243052431524325243352434524355243652437524385243952440524415244252443524445244552446524475244852449524505245152452524535245452455524565245752458524595246052461524625246352464524655246652467524685246952470524715247252473524745247552476524775247852479524805248152482524835248452485524865248752488524895249052491524925249352494524955249652497524985249952500525015250252503525045250552506525075250852509525105251152512525135251452515525165251752518525195252052521525225252352524525255252652527525285252952530525315253252533525345253552536525375253852539525405254152542525435254452545525465254752548525495255052551525525255352554525555255652557525585255952560525615256252563525645256552566525675256852569525705257152572525735257452575525765257752578525795258052581525825258352584525855258652587525885258952590525915259252593525945259552596525975259852599526005260152602526035260452605526065260752608526095261052611526125261352614526155261652617526185261952620526215262252623526245262552626526275262852629526305263152632526335263452635526365263752638526395264052641526425264352644526455264652647526485264952650526515265252653526545265552656526575265852659526605266152662526635266452665526665266752668526695267052671526725267352674526755267652677526785267952680526815268252683526845268552686526875268852689526905269152692526935269452695526965269752698526995270052701527025270352704527055270652707527085270952710527115271252713527145271552716527175271852719527205272152722527235272452725527265272752728527295273052731527325273352734527355273652737527385273952740527415274252743527445274552746527475274852749527505275152752527535275452755527565275752758527595276052761527625276352764527655276652767527685276952770527715277252773527745277552776527775277852779527805278152782527835278452785527865278752788527895279052791527925279352794527955279652797527985279952800528015280252803528045280552806528075280852809528105281152812528135281452815528165281752818528195282052821528225282352824528255282652827528285282952830528315283252833528345283552836528375283852839528405284152842528435284452845528465284752848528495285052851528525285352854528555285652857528585285952860528615286252863528645286552866528675286852869528705287152872528735287452875528765287752878528795288052881528825288352884528855288652887528885288952890528915289252893528945289552896528975289852899529005290152902529035290452905529065290752908529095291052911529125291352914529155291652917529185291952920529215292252923529245292552926529275292852929529305293152932529335293452935529365293752938529395294052941529425294352944529455294652947529485294952950529515295252953529545295552956529575295852959529605296152962529635296452965529665296752968529695297052971529725297352974529755297652977529785297952980529815298252983529845298552986529875298852989529905299152992529935299452995529965299752998529995300053001530025300353004530055300653007530085300953010530115301253013530145301553016530175301853019530205302153022530235302453025530265302753028530295303053031530325303353034530355303653037530385303953040530415304253043530445304553046530475304853049530505305153052530535305453055530565305753058530595306053061530625306353064530655306653067530685306953070530715307253073530745307553076530775307853079530805308153082530835308453085530865308753088530895309053091530925309353094530955309653097530985309953100531015310253103531045310553106531075310853109531105311153112531135311453115531165311753118531195312053121531225312353124531255312653127531285312953130531315313253133531345313553136531375313853139531405314153142531435314453145531465314753148531495315053151531525315353154531555315653157531585315953160531615316253163531645316553166531675316853169531705317153172531735317453175531765317753178531795318053181531825318353184531855318653187531885318953190531915319253193531945319553196531975319853199532005320153202532035320453205532065320753208532095321053211532125321353214532155321653217532185321953220532215322253223532245322553226532275322853229532305323153232532335323453235532365323753238532395324053241532425324353244532455324653247532485324953250532515325253253532545325553256532575325853259532605326153262532635326453265532665326753268532695327053271532725327353274532755327653277532785327953280532815328253283532845328553286532875328853289532905329153292532935329453295532965329753298532995330053301533025330353304533055330653307533085330953310533115331253313533145331553316533175331853319533205332153322533235332453325533265332753328533295333053331533325333353334533355333653337533385333953340533415334253343533445334553346533475334853349533505335153352533535335453355533565335753358533595336053361533625336353364533655336653367533685336953370533715337253373533745337553376533775337853379533805338153382533835338453385533865338753388533895339053391533925339353394533955339653397533985339953400534015340253403534045340553406534075340853409534105341153412534135341453415534165341753418534195342053421534225342353424534255342653427534285342953430534315343253433534345343553436534375343853439534405344153442534435344453445534465344753448534495345053451534525345353454534555345653457534585345953460534615346253463534645346553466534675346853469534705347153472534735347453475534765347753478534795348053481534825348353484534855348653487534885348953490534915349253493534945349553496534975349853499535005350153502535035350453505535065350753508535095351053511535125351353514535155351653517535185351953520535215352253523535245352553526535275352853529535305353153532535335353453535535365353753538535395354053541535425354353544535455354653547535485354953550535515355253553535545355553556535575355853559535605356153562535635356453565535665356753568535695357053571535725357353574535755357653577535785357953580535815358253583535845358553586535875358853589535905359153592535935359453595535965359753598535995360053601536025360353604536055360653607536085360953610536115361253613536145361553616536175361853619536205362153622536235362453625536265362753628536295363053631536325363353634536355363653637536385363953640536415364253643536445364553646536475364853649536505365153652536535365453655536565365753658536595366053661536625366353664536655366653667536685366953670536715367253673536745367553676536775367853679536805368153682536835368453685536865368753688536895369053691536925369353694536955369653697536985369953700537015370253703537045370553706537075370853709537105371153712537135371453715537165371753718537195372053721537225372353724537255372653727537285372953730537315373253733537345373553736537375373853739537405374153742537435374453745537465374753748537495375053751537525375353754537555375653757537585375953760537615376253763537645376553766537675376853769537705377153772537735377453775537765377753778537795378053781537825378353784537855378653787537885378953790537915379253793537945379553796537975379853799538005380153802538035380453805538065380753808538095381053811538125381353814538155381653817538185381953820538215382253823538245382553826538275382853829538305383153832538335383453835538365383753838538395384053841538425384353844538455384653847538485384953850538515385253853538545385553856538575385853859538605386153862538635386453865538665386753868538695387053871538725387353874538755387653877538785387953880538815388253883538845388553886538875388853889538905389153892538935389453895538965389753898538995390053901539025390353904539055390653907539085390953910539115391253913539145391553916539175391853919539205392153922539235392453925539265392753928539295393053931539325393353934539355393653937539385393953940539415394253943539445394553946539475394853949539505395153952539535395453955539565395753958539595396053961539625396353964539655396653967539685396953970539715397253973539745397553976539775397853979539805398153982539835398453985539865398753988539895399053991539925399353994539955399653997539985399954000540015400254003540045400554006540075400854009540105401154012540135401454015540165401754018540195402054021540225402354024540255402654027540285402954030540315403254033540345403554036540375403854039540405404154042540435404454045540465404754048540495405054051540525405354054540555405654057540585405954060540615406254063540645406554066540675406854069540705407154072540735407454075540765407754078540795408054081540825408354084540855408654087540885408954090540915409254093540945409554096540975409854099541005410154102541035410454105541065410754108541095411054111541125411354114541155411654117541185411954120541215412254123541245412554126541275412854129541305413154132541335413454135541365413754138541395414054141541425414354144541455414654147541485414954150541515415254153541545415554156541575415854159541605416154162541635416454165541665416754168541695417054171541725417354174541755417654177541785417954180541815418254183541845418554186541875418854189541905419154192541935419454195541965419754198541995420054201542025420354204542055420654207542085420954210542115421254213542145421554216542175421854219542205422154222542235422454225542265422754228542295423054231542325423354234542355423654237542385423954240542415424254243542445424554246542475424854249542505425154252542535425454255542565425754258542595426054261542625426354264542655426654267542685426954270542715427254273542745427554276542775427854279542805428154282542835428454285542865428754288542895429054291542925429354294542955429654297542985429954300543015430254303543045430554306543075430854309543105431154312543135431454315543165431754318543195432054321543225432354324543255432654327543285432954330543315433254333543345433554336543375433854339543405434154342543435434454345543465434754348543495435054351543525435354354543555435654357543585435954360543615436254363543645436554366543675436854369543705437154372543735437454375543765437754378543795438054381543825438354384543855438654387543885438954390543915439254393543945439554396543975439854399544005440154402544035440454405544065440754408544095441054411544125441354414544155441654417544185441954420544215442254423544245442554426544275442854429544305443154432544335443454435544365443754438544395444054441544425444354444544455444654447544485444954450544515445254453544545445554456544575445854459544605446154462544635446454465544665446754468544695447054471544725447354474544755447654477544785447954480544815448254483544845448554486544875448854489544905449154492544935449454495544965449754498544995450054501545025450354504545055450654507545085450954510545115451254513545145451554516545175451854519545205452154522545235452454525545265452754528545295453054531545325453354534545355453654537545385453954540545415454254543545445454554546545475454854549545505455154552545535455454555545565455754558545595456054561545625456354564545655456654567545685456954570545715457254573545745457554576545775457854579545805458154582545835458454585545865458754588545895459054591545925459354594545955459654597545985459954600546015460254603546045460554606546075460854609546105461154612546135461454615546165461754618546195462054621546225462354624546255462654627546285462954630546315463254633546345463554636546375463854639546405464154642546435464454645546465464754648546495465054651546525465354654546555465654657546585465954660546615466254663546645466554666546675466854669546705467154672546735467454675546765467754678546795468054681546825468354684546855468654687546885468954690546915469254693546945469554696546975469854699547005470154702547035470454705547065470754708547095471054711547125471354714547155471654717547185471954720547215472254723547245472554726547275472854729547305473154732547335473454735547365473754738547395474054741547425474354744547455474654747547485474954750547515475254753547545475554756547575475854759547605476154762547635476454765547665476754768547695477054771547725477354774547755477654777547785477954780547815478254783547845478554786547875478854789547905479154792547935479454795547965479754798547995480054801548025480354804548055480654807548085480954810548115481254813548145481554816548175481854819548205482154822548235482454825548265482754828548295483054831548325483354834548355483654837548385483954840548415484254843548445484554846548475484854849548505485154852548535485454855548565485754858548595486054861548625486354864548655486654867548685486954870548715487254873548745487554876548775487854879548805488154882548835488454885548865488754888548895489054891548925489354894548955489654897548985489954900549015490254903549045490554906549075490854909549105491154912549135491454915549165491754918549195492054921549225492354924549255492654927549285492954930549315493254933549345493554936549375493854939549405494154942549435494454945549465494754948549495495054951549525495354954549555495654957549585495954960549615496254963549645496554966549675496854969549705497154972549735497454975549765497754978549795498054981549825498354984549855498654987549885498954990549915499254993549945499554996549975499854999550005500155002550035500455005550065500755008550095501055011550125501355014550155501655017550185501955020550215502255023550245502555026550275502855029550305503155032550335503455035550365503755038550395504055041550425504355044550455504655047550485504955050550515505255053550545505555056550575505855059550605506155062550635506455065550665506755068550695507055071550725507355074550755507655077550785507955080550815508255083550845508555086550875508855089550905509155092550935509455095550965509755098550995510055101551025510355104551055510655107551085510955110551115511255113551145511555116551175511855119551205512155122551235512455125551265512755128551295513055131551325513355134551355513655137551385513955140551415514255143551445514555146551475514855149551505515155152551535515455155551565515755158551595516055161551625516355164551655516655167551685516955170551715517255173551745517555176551775517855179551805518155182551835518455185551865518755188551895519055191551925519355194551955519655197551985519955200552015520255203552045520555206552075520855209552105521155212552135521455215552165521755218552195522055221552225522355224552255522655227552285522955230552315523255233552345523555236552375523855239552405524155242552435524455245552465524755248552495525055251552525525355254552555525655257552585525955260552615526255263552645526555266552675526855269552705527155272552735527455275552765527755278552795528055281552825528355284552855528655287552885528955290552915529255293552945529555296552975529855299553005530155302553035530455305553065530755308553095531055311553125531355314553155531655317553185531955320553215532255323553245532555326553275532855329553305533155332553335533455335553365533755338553395534055341553425534355344553455534655347553485534955350553515535255353553545535555356553575535855359553605536155362553635536455365553665536755368553695537055371553725537355374553755537655377553785537955380553815538255383553845538555386553875538855389553905539155392553935539455395553965539755398553995540055401554025540355404554055540655407554085540955410554115541255413554145541555416554175541855419554205542155422554235542455425554265542755428554295543055431554325543355434554355543655437554385543955440554415544255443554445544555446554475544855449554505545155452554535545455455554565545755458554595546055461554625546355464554655546655467554685546955470554715547255473554745547555476554775547855479554805548155482554835548455485554865548755488554895549055491554925549355494554955549655497554985549955500555015550255503555045550555506555075550855509555105551155512555135551455515555165551755518555195552055521555225552355524555255552655527555285552955530555315553255533555345553555536555375553855539555405554155542555435554455545555465554755548555495555055551555525555355554555555555655557555585555955560555615556255563555645556555566555675556855569555705557155572555735557455575555765557755578555795558055581555825558355584555855558655587555885558955590555915559255593555945559555596555975559855599556005560155602556035560455605556065560755608556095561055611556125561355614556155561655617556185561955620556215562255623556245562555626556275562855629556305563155632556335563455635556365563755638556395564055641556425564355644556455564655647556485564955650556515565255653556545565555656556575565855659556605566155662556635566455665556665566755668556695567055671556725567355674556755567655677556785567955680556815568255683556845568555686556875568855689556905569155692556935569455695556965569755698556995570055701557025570355704557055570655707557085570955710557115571255713557145571555716557175571855719557205572155722557235572455725557265572755728557295573055731557325573355734557355573655737557385573955740557415574255743557445574555746557475574855749557505575155752557535575455755557565575755758557595576055761557625576355764557655576655767557685576955770557715577255773557745577555776557775577855779557805578155782557835578455785557865578755788557895579055791557925579355794557955579655797557985579955800558015580255803558045580555806558075580855809558105581155812558135581455815558165581755818558195582055821558225582355824558255582655827558285582955830558315583255833558345583555836558375583855839558405584155842558435584455845558465584755848558495585055851558525585355854558555585655857558585585955860558615586255863558645586555866558675586855869558705587155872558735587455875558765587755878558795588055881558825588355884558855588655887558885588955890558915589255893558945589555896558975589855899559005590155902559035590455905559065590755908559095591055911559125591355914559155591655917559185591955920559215592255923559245592555926559275592855929559305593155932559335593455935559365593755938559395594055941559425594355944559455594655947559485594955950559515595255953559545595555956559575595855959559605596155962559635596455965559665596755968559695597055971559725597355974559755597655977559785597955980559815598255983559845598555986559875598855989559905599155992559935599455995559965599755998559995600056001560025600356004560055600656007560085600956010560115601256013560145601556016560175601856019560205602156022560235602456025560265602756028560295603056031560325603356034560355603656037560385603956040560415604256043560445604556046560475604856049560505605156052560535605456055560565605756058560595606056061560625606356064560655606656067560685606956070560715607256073560745607556076560775607856079560805608156082560835608456085560865608756088560895609056091560925609356094560955609656097560985609956100561015610256103561045610556106561075610856109561105611156112561135611456115561165611756118561195612056121561225612356124561255612656127561285612956130561315613256133561345613556136561375613856139561405614156142561435614456145561465614756148561495615056151561525615356154561555615656157561585615956160561615616256163561645616556166561675616856169561705617156172561735617456175561765617756178561795618056181561825618356184561855618656187561885618956190561915619256193561945619556196561975619856199562005620156202562035620456205562065620756208562095621056211562125621356214562155621656217562185621956220562215622256223562245622556226562275622856229562305623156232562335623456235562365623756238562395624056241562425624356244562455624656247562485624956250562515625256253562545625556256562575625856259562605626156262562635626456265562665626756268562695627056271562725627356274562755627656277562785627956280562815628256283562845628556286562875628856289562905629156292562935629456295562965629756298562995630056301563025630356304563055630656307563085630956310563115631256313563145631556316563175631856319563205632156322563235632456325563265632756328563295633056331563325633356334563355633656337563385633956340563415634256343563445634556346563475634856349563505635156352563535635456355563565635756358563595636056361563625636356364563655636656367563685636956370563715637256373563745637556376563775637856379563805638156382563835638456385563865638756388563895639056391563925639356394563955639656397563985639956400564015640256403564045640556406564075640856409564105641156412564135641456415564165641756418564195642056421564225642356424564255642656427564285642956430564315643256433564345643556436564375643856439564405644156442564435644456445564465644756448564495645056451564525645356454564555645656457564585645956460564615646256463564645646556466564675646856469564705647156472564735647456475564765647756478564795648056481564825648356484564855648656487564885648956490564915649256493564945649556496564975649856499565005650156502565035650456505565065650756508565095651056511565125651356514565155651656517565185651956520565215652256523565245652556526565275652856529565305653156532565335653456535565365653756538565395654056541565425654356544565455654656547565485654956550565515655256553565545655556556565575655856559565605656156562565635656456565565665656756568565695657056571565725657356574565755657656577565785657956580565815658256583565845658556586565875658856589565905659156592565935659456595565965659756598565995660056601566025660356604566055660656607566085660956610566115661256613566145661556616566175661856619566205662156622566235662456625566265662756628566295663056631566325663356634566355663656637566385663956640566415664256643566445664556646566475664856649566505665156652566535665456655566565665756658566595666056661566625666356664566655666656667566685666956670566715667256673566745667556676566775667856679566805668156682566835668456685566865668756688566895669056691566925669356694566955669656697566985669956700567015670256703567045670556706567075670856709567105671156712567135671456715567165671756718567195672056721567225672356724567255672656727567285672956730567315673256733567345673556736567375673856739567405674156742567435674456745567465674756748567495675056751567525675356754567555675656757567585675956760567615676256763567645676556766567675676856769567705677156772567735677456775567765677756778567795678056781567825678356784567855678656787567885678956790567915679256793567945679556796567975679856799568005680156802568035680456805568065680756808568095681056811568125681356814568155681656817568185681956820568215682256823568245682556826568275682856829568305683156832568335683456835568365683756838568395684056841568425684356844568455684656847568485684956850568515685256853568545685556856568575685856859568605686156862568635686456865568665686756868568695687056871568725687356874568755687656877568785687956880568815688256883568845688556886568875688856889568905689156892568935689456895568965689756898568995690056901569025690356904569055690656907569085690956910569115691256913569145691556916569175691856919569205692156922569235692456925569265692756928569295693056931569325693356934569355693656937569385693956940569415694256943569445694556946569475694856949569505695156952569535695456955569565695756958569595696056961569625696356964569655696656967569685696956970569715697256973569745697556976569775697856979569805698156982569835698456985569865698756988569895699056991569925699356994569955699656997569985699957000570015700257003570045700557006570075700857009570105701157012570135701457015570165701757018570195702057021570225702357024570255702657027570285702957030570315703257033570345703557036570375703857039570405704157042570435704457045570465704757048570495705057051570525705357054570555705657057570585705957060570615706257063570645706557066570675706857069570705707157072570735707457075570765707757078570795708057081570825708357084570855708657087570885708957090570915709257093570945709557096570975709857099571005710157102571035710457105571065710757108571095711057111571125711357114571155711657117571185711957120571215712257123571245712557126571275712857129571305713157132571335713457135571365713757138571395714057141571425714357144571455714657147571485714957150571515715257153571545715557156571575715857159571605716157162571635716457165571665716757168571695717057171571725717357174571755717657177571785717957180571815718257183571845718557186571875718857189571905719157192571935719457195571965719757198571995720057201572025720357204572055720657207572085720957210572115721257213572145721557216572175721857219572205722157222572235722457225572265722757228572295723057231572325723357234572355723657237572385723957240572415724257243572445724557246572475724857249572505725157252572535725457255572565725757258572595726057261572625726357264572655726657267572685726957270572715727257273572745727557276572775727857279572805728157282572835728457285572865728757288572895729057291572925729357294572955729657297572985729957300573015730257303573045730557306573075730857309573105731157312573135731457315573165731757318573195732057321573225732357324573255732657327573285732957330573315733257333573345733557336573375733857339573405734157342573435734457345573465734757348573495735057351573525735357354573555735657357573585735957360573615736257363573645736557366573675736857369573705737157372573735737457375573765737757378573795738057381573825738357384573855738657387573885738957390573915739257393573945739557396573975739857399574005740157402574035740457405574065740757408574095741057411574125741357414574155741657417574185741957420574215742257423574245742557426574275742857429574305743157432574335743457435574365743757438574395744057441574425744357444574455744657447574485744957450574515745257453574545745557456574575745857459574605746157462574635746457465574665746757468574695747057471574725747357474574755747657477574785747957480574815748257483574845748557486574875748857489574905749157492574935749457495574965749757498574995750057501575025750357504575055750657507575085750957510575115751257513575145751557516575175751857519575205752157522575235752457525575265752757528575295753057531575325753357534575355753657537575385753957540575415754257543575445754557546575475754857549575505755157552575535755457555575565755757558575595756057561575625756357564575655756657567575685756957570575715757257573575745757557576575775757857579575805758157582575835758457585575865758757588575895759057591575925759357594575955759657597575985759957600576015760257603576045760557606576075760857609576105761157612576135761457615576165761757618576195762057621576225762357624576255762657627576285762957630576315763257633576345763557636576375763857639576405764157642576435764457645576465764757648576495765057651576525765357654576555765657657576585765957660576615766257663576645766557666576675766857669576705767157672576735767457675576765767757678576795768057681576825768357684576855768657687576885768957690576915769257693576945769557696576975769857699577005770157702577035770457705577065770757708577095771057711577125771357714577155771657717577185771957720577215772257723577245772557726577275772857729577305773157732577335773457735577365773757738577395774057741577425774357744577455774657747577485774957750577515775257753577545775557756577575775857759577605776157762577635776457765577665776757768577695777057771577725777357774577755777657777577785777957780577815778257783577845778557786577875778857789577905779157792577935779457795577965779757798577995780057801578025780357804578055780657807578085780957810578115781257813578145781557816578175781857819578205782157822578235782457825578265782757828578295783057831578325783357834578355783657837578385783957840578415784257843578445784557846578475784857849578505785157852578535785457855578565785757858578595786057861578625786357864578655786657867578685786957870578715787257873578745787557876578775787857879578805788157882578835788457885578865788757888578895789057891578925789357894578955789657897578985789957900579015790257903579045790557906579075790857909579105791157912579135791457915579165791757918579195792057921579225792357924579255792657927579285792957930579315793257933579345793557936579375793857939579405794157942579435794457945579465794757948579495795057951579525795357954579555795657957579585795957960579615796257963579645796557966579675796857969579705797157972579735797457975579765797757978579795798057981579825798357984579855798657987579885798957990579915799257993579945799557996579975799857999580005800158002580035800458005580065800758008580095801058011580125801358014580155801658017580185801958020580215802258023580245802558026580275802858029580305803158032580335803458035580365803758038580395804058041580425804358044580455804658047580485804958050580515805258053580545805558056580575805858059580605806158062580635806458065580665806758068580695807058071580725807358074580755807658077580785807958080580815808258083580845808558086580875808858089580905809158092580935809458095580965809758098580995810058101581025810358104581055810658107581085810958110581115811258113581145811558116581175811858119581205812158122581235812458125581265812758128581295813058131581325813358134581355813658137581385813958140581415814258143581445814558146581475814858149581505815158152581535815458155581565815758158581595816058161581625816358164581655816658167581685816958170581715817258173581745817558176581775817858179581805818158182581835818458185581865818758188581895819058191581925819358194581955819658197581985819958200582015820258203582045820558206582075820858209582105821158212582135821458215582165821758218582195822058221582225822358224582255822658227582285822958230582315823258233582345823558236582375823858239582405824158242582435824458245582465824758248582495825058251582525825358254582555825658257582585825958260582615826258263582645826558266582675826858269582705827158272582735827458275582765827758278582795828058281582825828358284582855828658287582885828958290582915829258293582945829558296582975829858299583005830158302583035830458305583065830758308583095831058311583125831358314583155831658317583185831958320583215832258323583245832558326583275832858329583305833158332583335833458335583365833758338583395834058341583425834358344583455834658347583485834958350583515835258353583545835558356583575835858359583605836158362583635836458365583665836758368583695837058371583725837358374583755837658377583785837958380583815838258383583845838558386583875838858389583905839158392583935839458395583965839758398583995840058401584025840358404584055840658407584085840958410584115841258413584145841558416584175841858419584205842158422584235842458425584265842758428584295843058431584325843358434584355843658437584385843958440584415844258443584445844558446584475844858449584505845158452584535845458455584565845758458584595846058461584625846358464584655846658467584685846958470584715847258473584745847558476584775847858479584805848158482584835848458485584865848758488584895849058491584925849358494584955849658497584985849958500585015850258503585045850558506585075850858509585105851158512585135851458515585165851758518585195852058521585225852358524585255852658527585285852958530585315853258533585345853558536585375853858539585405854158542585435854458545585465854758548585495855058551585525855358554585555855658557585585855958560585615856258563585645856558566585675856858569585705857158572585735857458575585765857758578585795858058581585825858358584585855858658587585885858958590585915859258593585945859558596585975859858599586005860158602586035860458605586065860758608586095861058611586125861358614586155861658617586185861958620586215862258623586245862558626586275862858629586305863158632586335863458635586365863758638586395864058641586425864358644586455864658647586485864958650586515865258653586545865558656586575865858659586605866158662586635866458665586665866758668586695867058671586725867358674586755867658677586785867958680586815868258683586845868558686586875868858689586905869158692586935869458695586965869758698586995870058701587025870358704587055870658707587085870958710587115871258713587145871558716587175871858719587205872158722587235872458725587265872758728587295873058731587325873358734587355873658737587385873958740587415874258743587445874558746587475874858749587505875158752587535875458755587565875758758587595876058761587625876358764587655876658767587685876958770587715877258773587745877558776587775877858779587805878158782587835878458785587865878758788587895879058791587925879358794587955879658797587985879958800588015880258803588045880558806588075880858809588105881158812588135881458815588165881758818588195882058821588225882358824588255882658827588285882958830588315883258833588345883558836588375883858839588405884158842588435884458845588465884758848588495885058851588525885358854588555885658857588585885958860588615886258863588645886558866588675886858869588705887158872588735887458875588765887758878588795888058881588825888358884588855888658887588885888958890588915889258893588945889558896588975889858899589005890158902589035890458905589065890758908589095891058911589125891358914589155891658917589185891958920589215892258923589245892558926589275892858929589305893158932589335893458935589365893758938589395894058941589425894358944589455894658947589485894958950589515895258953589545895558956589575895858959589605896158962589635896458965589665896758968589695897058971589725897358974589755897658977589785897958980589815898258983589845898558986589875898858989589905899158992589935899458995589965899758998589995900059001590025900359004590055900659007590085900959010590115901259013590145901559016590175901859019590205902159022590235902459025590265902759028590295903059031590325903359034590355903659037590385903959040590415904259043590445904559046590475904859049590505905159052590535905459055590565905759058590595906059061590625906359064590655906659067590685906959070590715907259073590745907559076590775907859079590805908159082590835908459085590865908759088590895909059091590925909359094590955909659097590985909959100591015910259103591045910559106591075910859109591105911159112591135911459115591165911759118591195912059121591225912359124591255912659127591285912959130591315913259133591345913559136591375913859139591405914159142591435914459145591465914759148591495915059151591525915359154591555915659157591585915959160591615916259163591645916559166591675916859169591705917159172591735917459175591765917759178591795918059181591825918359184591855918659187591885918959190591915919259193591945919559196591975919859199592005920159202592035920459205592065920759208592095921059211592125921359214592155921659217592185921959220592215922259223592245922559226592275922859229592305923159232592335923459235592365923759238592395924059241592425924359244592455924659247592485924959250592515925259253592545925559256592575925859259592605926159262592635926459265592665926759268592695927059271592725927359274592755927659277592785927959280592815928259283592845928559286592875928859289592905929159292592935929459295592965929759298592995930059301593025930359304593055930659307593085930959310593115931259313593145931559316593175931859319593205932159322593235932459325593265932759328593295933059331593325933359334593355933659337593385933959340593415934259343593445934559346593475934859349593505935159352593535935459355593565935759358593595936059361593625936359364593655936659367593685936959370593715937259373593745937559376593775937859379593805938159382593835938459385593865938759388593895939059391593925939359394593955939659397593985939959400594015940259403594045940559406594075940859409594105941159412594135941459415594165941759418594195942059421594225942359424594255942659427594285942959430594315943259433594345943559436594375943859439594405944159442594435944459445594465944759448594495945059451594525945359454594555945659457594585945959460594615946259463594645946559466594675946859469594705947159472594735947459475594765947759478594795948059481594825948359484594855948659487594885948959490594915949259493594945949559496594975949859499595005950159502595035950459505595065950759508595095951059511595125951359514595155951659517595185951959520595215952259523595245952559526595275952859529595305953159532595335953459535595365953759538595395954059541595425954359544595455954659547595485954959550595515955259553595545955559556595575955859559595605956159562595635956459565595665956759568595695957059571595725957359574595755957659577595785957959580595815958259583595845958559586595875958859589595905959159592595935959459595595965959759598595995960059601596025960359604596055960659607596085960959610596115961259613596145961559616596175961859619596205962159622596235962459625596265962759628596295963059631596325963359634596355963659637596385963959640596415964259643596445964559646596475964859649596505965159652596535965459655596565965759658596595966059661596625966359664596655966659667596685966959670596715967259673596745967559676596775967859679596805968159682596835968459685596865968759688596895969059691596925969359694596955969659697596985969959700597015970259703597045970559706597075970859709597105971159712597135971459715597165971759718597195972059721597225972359724597255972659727597285972959730597315973259733597345973559736597375973859739597405974159742597435974459745597465974759748597495975059751597525975359754597555975659757597585975959760597615976259763597645976559766597675976859769597705977159772597735977459775597765977759778597795978059781597825978359784597855978659787597885978959790597915979259793597945979559796597975979859799598005980159802598035980459805598065980759808598095981059811598125981359814598155981659817598185981959820598215982259823598245982559826598275982859829598305983159832598335983459835598365983759838598395984059841598425984359844598455984659847598485984959850598515985259853598545985559856598575985859859598605986159862598635986459865598665986759868598695987059871598725987359874598755987659877598785987959880598815988259883598845988559886598875988859889598905989159892598935989459895598965989759898598995990059901599025990359904599055990659907599085990959910599115991259913599145991559916599175991859919599205992159922599235992459925599265992759928599295993059931599325993359934599355993659937599385993959940599415994259943599445994559946599475994859949599505995159952599535995459955599565995759958599595996059961599625996359964599655996659967599685996959970599715997259973599745997559976599775997859979599805998159982599835998459985599865998759988599895999059991599925999359994599955999659997599985999960000600016000260003600046000560006600076000860009600106001160012600136001460015600166001760018600196002060021600226002360024600256002660027600286002960030600316003260033600346003560036600376003860039600406004160042600436004460045600466004760048600496005060051600526005360054600556005660057600586005960060600616006260063600646006560066600676006860069600706007160072600736007460075600766007760078600796008060081600826008360084600856008660087600886008960090600916009260093600946009560096600976009860099601006010160102601036010460105601066010760108601096011060111601126011360114601156011660117601186011960120601216012260123601246012560126601276012860129601306013160132601336013460135601366013760138601396014060141601426014360144601456014660147601486014960150601516015260153601546015560156601576015860159601606016160162601636016460165601666016760168601696017060171601726017360174601756017660177601786017960180601816018260183601846018560186601876018860189601906019160192601936019460195601966019760198601996020060201602026020360204602056020660207602086020960210602116021260213602146021560216602176021860219602206022160222602236022460225602266022760228602296023060231602326023360234602356023660237602386023960240602416024260243602446024560246602476024860249602506025160252602536025460255602566025760258602596026060261602626026360264602656026660267602686026960270602716027260273602746027560276602776027860279602806028160282602836028460285602866028760288602896029060291602926029360294602956029660297602986029960300603016030260303603046030560306603076030860309603106031160312603136031460315603166031760318603196032060321603226032360324603256032660327603286032960330603316033260333603346033560336603376033860339603406034160342603436034460345603466034760348603496035060351603526035360354603556035660357603586035960360603616036260363603646036560366603676036860369603706037160372603736037460375603766037760378603796038060381603826038360384603856038660387603886038960390603916039260393603946039560396603976039860399604006040160402604036040460405604066040760408604096041060411604126041360414604156041660417604186041960420604216042260423604246042560426604276042860429604306043160432604336043460435604366043760438604396044060441604426044360444604456044660447604486044960450604516045260453604546045560456604576045860459604606046160462604636046460465604666046760468604696047060471604726047360474604756047660477604786047960480604816048260483604846048560486604876048860489604906049160492604936049460495604966049760498604996050060501605026050360504605056050660507605086050960510605116051260513605146051560516605176051860519605206052160522605236052460525605266052760528605296053060531605326053360534605356053660537605386053960540605416054260543605446054560546605476054860549605506055160552605536055460555605566055760558605596056060561605626056360564605656056660567605686056960570605716057260573605746057560576605776057860579605806058160582605836058460585605866058760588605896059060591605926059360594605956059660597605986059960600606016060260603606046060560606606076060860609606106061160612606136061460615606166061760618606196062060621606226062360624606256062660627606286062960630606316063260633606346063560636606376063860639606406064160642606436064460645606466064760648606496065060651606526065360654606556065660657606586065960660606616066260663606646066560666606676066860669606706067160672606736067460675606766067760678606796068060681606826068360684606856068660687606886068960690606916069260693606946069560696606976069860699607006070160702607036070460705607066070760708607096071060711607126071360714607156071660717607186071960720607216072260723607246072560726607276072860729607306073160732607336073460735607366073760738607396074060741607426074360744607456074660747607486074960750607516075260753607546075560756607576075860759607606076160762607636076460765607666076760768607696077060771607726077360774607756077660777607786077960780607816078260783607846078560786607876078860789607906079160792607936079460795607966079760798607996080060801608026080360804608056080660807608086080960810608116081260813608146081560816608176081860819608206082160822608236082460825608266082760828608296083060831608326083360834608356083660837608386083960840608416084260843608446084560846608476084860849608506085160852608536085460855608566085760858608596086060861608626086360864608656086660867608686086960870608716087260873608746087560876608776087860879608806088160882608836088460885608866088760888608896089060891608926089360894608956089660897608986089960900609016090260903609046090560906609076090860909609106091160912609136091460915609166091760918609196092060921609226092360924609256092660927609286092960930609316093260933609346093560936609376093860939609406094160942609436094460945609466094760948609496095060951609526095360954609556095660957609586095960960609616096260963609646096560966609676096860969609706097160972609736097460975609766097760978609796098060981609826098360984609856098660987609886098960990609916099260993609946099560996609976099860999610006100161002610036100461005610066100761008610096101061011610126101361014610156101661017610186101961020610216102261023610246102561026610276102861029610306103161032610336103461035610366103761038610396104061041610426104361044610456104661047610486104961050610516105261053610546105561056610576105861059610606106161062610636106461065610666106761068610696107061071610726107361074610756107661077610786107961080610816108261083610846108561086610876108861089610906109161092610936109461095610966109761098610996110061101611026110361104611056110661107611086110961110611116111261113611146111561116611176111861119611206112161122611236112461125611266112761128611296113061131611326113361134611356113661137611386113961140611416114261143611446114561146611476114861149611506115161152611536115461155611566115761158611596116061161611626116361164611656116661167611686116961170611716117261173611746117561176611776117861179611806118161182611836118461185611866118761188611896119061191611926119361194611956119661197611986119961200612016120261203612046120561206612076120861209612106121161212612136121461215612166121761218612196122061221612226122361224612256122661227612286122961230612316123261233612346123561236612376123861239612406124161242612436124461245612466124761248612496125061251612526125361254612556125661257612586125961260612616126261263612646126561266612676126861269612706127161272612736127461275612766127761278612796128061281612826128361284612856128661287612886128961290612916129261293612946129561296612976129861299613006130161302613036130461305613066130761308613096131061311613126131361314613156131661317613186131961320613216132261323613246132561326613276132861329613306133161332613336133461335613366133761338613396134061341613426134361344613456134661347613486134961350613516135261353613546135561356613576135861359613606136161362613636136461365613666136761368613696137061371613726137361374613756137661377613786137961380613816138261383613846138561386613876138861389613906139161392613936139461395613966139761398613996140061401614026140361404614056140661407614086140961410614116141261413614146141561416614176141861419614206142161422614236142461425614266142761428614296143061431614326143361434614356143661437614386143961440614416144261443614446144561446614476144861449614506145161452614536145461455614566145761458614596146061461614626146361464614656146661467614686146961470614716147261473614746147561476614776147861479614806148161482614836148461485614866148761488614896149061491614926149361494614956149661497614986149961500615016150261503615046150561506615076150861509615106151161512615136151461515615166151761518615196152061521615226152361524615256152661527615286152961530615316153261533615346153561536615376153861539615406154161542615436154461545615466154761548615496155061551615526155361554615556155661557615586155961560615616156261563615646156561566615676156861569615706157161572615736157461575615766157761578615796158061581615826158361584615856158661587615886158961590615916159261593615946159561596615976159861599616006160161602616036160461605616066160761608616096161061611616126161361614616156161661617616186161961620616216162261623616246162561626616276162861629616306163161632616336163461635616366163761638616396164061641616426164361644616456164661647616486164961650616516165261653616546165561656616576165861659616606166161662616636166461665616666166761668616696167061671616726167361674616756167661677616786167961680616816168261683616846168561686
  1. (function webpackUniversalModuleDefinition(root, factory) {
  2. if(typeof exports === 'object' && typeof module === 'object')
  3. module.exports = factory();
  4. else if(typeof define === 'function' && define.amd)
  5. define([], factory);
  6. else if(typeof exports === 'object')
  7. exports["Babel"] = factory();
  8. else
  9. root["Babel"] = factory();
  10. })(this, function() {
  11. return /******/ (function(modules) { // webpackBootstrap
  12. /******/ // The module cache
  13. /******/ var installedModules = {};
  14. /******/ // The require function
  15. /******/ function __webpack_require__(moduleId) {
  16. /******/ // Check if module is in cache
  17. /******/ if(installedModules[moduleId])
  18. /******/ return installedModules[moduleId].exports;
  19. /******/ // Create a new module (and put it into the cache)
  20. /******/ var module = installedModules[moduleId] = {
  21. /******/ exports: {},
  22. /******/ id: moduleId,
  23. /******/ loaded: false
  24. /******/ };
  25. /******/ // Execute the module function
  26. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  27. /******/ // Flag the module as loaded
  28. /******/ module.loaded = true;
  29. /******/ // Return the exports of the module
  30. /******/ return module.exports;
  31. /******/ }
  32. /******/ // expose the modules object (__webpack_modules__)
  33. /******/ __webpack_require__.m = modules;
  34. /******/ // expose the module cache
  35. /******/ __webpack_require__.c = installedModules;
  36. /******/ // __webpack_public_path__
  37. /******/ __webpack_require__.p = "";
  38. /******/ // Load entry module and return exports
  39. /******/ return __webpack_require__(0);
  40. /******/ })
  41. /************************************************************************/
  42. /******/ ((function(modules) {
  43. // Check all modules for deduplicated modules
  44. for(var i in modules) {
  45. if(Object.prototype.hasOwnProperty.call(modules, i)) {
  46. switch(typeof modules[i]) {
  47. case "function": break;
  48. case "object":
  49. // Module can be created from a template
  50. modules[i] = (function(_m) {
  51. var args = _m.slice(1), fn = modules[_m[0]];
  52. return function (a,b,c) {
  53. fn.apply(this, [a,b,c].concat(args));
  54. };
  55. }(modules[i]));
  56. break;
  57. default:
  58. // Module is a copy of another module
  59. modules[i] = modules[modules[i]];
  60. break;
  61. }
  62. }
  63. }
  64. return modules;
  65. }([
  66. /* 0 */
  67. /***/ (function(module, exports, __webpack_require__) {
  68. 'use strict';
  69. Object.defineProperty(exports, "__esModule", {
  70. value: true
  71. });
  72. exports.version = exports.buildExternalHelpers = exports.availablePresets = exports.availablePlugins = undefined;
  73. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  74. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  75. exports.transform = transform;
  76. exports.transformFromAst = transformFromAst;
  77. exports.registerPlugin = registerPlugin;
  78. exports.registerPlugins = registerPlugins;
  79. exports.registerPreset = registerPreset;
  80. exports.registerPresets = registerPresets;
  81. exports.transformScriptTags = transformScriptTags;
  82. exports.disableScriptTags = disableScriptTags;
  83. var _babelCore = __webpack_require__(290);
  84. var Babel = _interopRequireWildcard(_babelCore);
  85. var _transformScriptTags = __webpack_require__(629);
  86. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  87. var isArray = Array.isArray || function (arg) {
  88. return Object.prototype.toString.call(arg) === '[object Array]';
  89. };
  90. /**
  91. * Loads the given name (or [name, options] pair) from the given table object
  92. * holding the available presets or plugins.
  93. *
  94. * Returns undefined if the preset or plugin is not available; passes through
  95. * name unmodified if it (or the first element of the pair) is not a string.
  96. */
  97. function loadBuiltin(builtinTable, name) {
  98. if (isArray(name) && typeof name[0] === 'string') {
  99. if (builtinTable.hasOwnProperty(name[0])) {
  100. return [builtinTable[name[0]]].concat(name.slice(1));
  101. }
  102. return;
  103. } else if (typeof name === 'string') {
  104. return builtinTable[name];
  105. }
  106. // Could be an actual preset/plugin module
  107. return name;
  108. }
  109. /**
  110. * Parses plugin names and presets from the specified options.
  111. */
  112. function processOptions(options) {
  113. // Parse preset names
  114. var presets = (options.presets || []).map(function (presetName) {
  115. var preset = loadBuiltin(availablePresets, presetName);
  116. if (preset) {
  117. // workaround for babel issue
  118. // at some point, babel copies the preset, losing the non-enumerable
  119. // buildPreset key; convert it into an enumerable key.
  120. if (isArray(preset) && _typeof(preset[0]) === 'object' && preset[0].hasOwnProperty('buildPreset')) {
  121. preset[0] = _extends({}, preset[0], { buildPreset: preset[0].buildPreset });
  122. }
  123. } else {
  124. throw new Error('Invalid preset specified in Babel options: "' + presetName + '"');
  125. }
  126. return preset;
  127. });
  128. // Parse plugin names
  129. var plugins = (options.plugins || []).map(function (pluginName) {
  130. var plugin = loadBuiltin(availablePlugins, pluginName);
  131. if (!plugin) {
  132. throw new Error('Invalid plugin specified in Babel options: "' + pluginName + '"');
  133. }
  134. return plugin;
  135. });
  136. return _extends({
  137. babelrc: false
  138. }, options, {
  139. presets: presets,
  140. plugins: plugins
  141. });
  142. }
  143. function transform(code, options) {
  144. return Babel.transform(code, processOptions(options));
  145. }
  146. function transformFromAst(ast, code, options) {
  147. return Babel.transformFromAst(ast, code, processOptions(options));
  148. }
  149. var availablePlugins = exports.availablePlugins = {};
  150. var availablePresets = exports.availablePresets = {};
  151. var buildExternalHelpers = exports.buildExternalHelpers = Babel.buildExternalHelpers;
  152. /**
  153. * Registers a named plugin for use with Babel.
  154. */
  155. function registerPlugin(name, plugin) {
  156. if (availablePlugins.hasOwnProperty(name)) {
  157. console.warn('A plugin named "' + name + '" is already registered, it will be overridden');
  158. }
  159. availablePlugins[name] = plugin;
  160. }
  161. /**
  162. * Registers multiple plugins for use with Babel. `newPlugins` should be an object where the key
  163. * is the name of the plugin, and the value is the plugin itself.
  164. */
  165. function registerPlugins(newPlugins) {
  166. Object.keys(newPlugins).forEach(function (name) {
  167. return registerPlugin(name, newPlugins[name]);
  168. });
  169. }
  170. /**
  171. * Registers a named preset for use with Babel.
  172. */
  173. function registerPreset(name, preset) {
  174. if (availablePresets.hasOwnProperty(name)) {
  175. console.warn('A preset named "' + name + '" is already registered, it will be overridden');
  176. }
  177. availablePresets[name] = preset;
  178. }
  179. /**
  180. * Registers multiple presets for use with Babel. `newPresets` should be an object where the key
  181. * is the name of the preset, and the value is the preset itself.
  182. */
  183. function registerPresets(newPresets) {
  184. Object.keys(newPresets).forEach(function (name) {
  185. return registerPreset(name, newPresets[name]);
  186. });
  187. }
  188. // All the plugins we should bundle
  189. registerPlugins({
  190. 'check-es2015-constants': __webpack_require__(66),
  191. 'external-helpers': __webpack_require__(322),
  192. 'inline-replace-variables': __webpack_require__(323),
  193. 'syntax-async-functions': __webpack_require__(67),
  194. 'syntax-async-generators': __webpack_require__(195),
  195. 'syntax-class-constructor-call': __webpack_require__(196),
  196. 'syntax-class-properties': __webpack_require__(197),
  197. 'syntax-decorators': __webpack_require__(125),
  198. 'syntax-do-expressions': __webpack_require__(198),
  199. 'syntax-exponentiation-operator': __webpack_require__(199),
  200. 'syntax-export-extensions': __webpack_require__(200),
  201. 'syntax-flow': __webpack_require__(126),
  202. 'syntax-function-bind': __webpack_require__(201),
  203. 'syntax-function-sent': __webpack_require__(325),
  204. 'syntax-jsx': __webpack_require__(127),
  205. 'syntax-object-rest-spread': __webpack_require__(202),
  206. 'syntax-trailing-function-commas': __webpack_require__(128),
  207. 'transform-async-functions': __webpack_require__(326),
  208. 'transform-async-to-generator': __webpack_require__(129),
  209. 'transform-async-to-module-method': __webpack_require__(328),
  210. 'transform-class-constructor-call': __webpack_require__(203),
  211. 'transform-class-properties': __webpack_require__(204),
  212. 'transform-decorators': __webpack_require__(205),
  213. 'transform-decorators-legacy': __webpack_require__(329).default, // <- No clue. Nope.
  214. 'transform-do-expressions': __webpack_require__(206),
  215. 'transform-es2015-arrow-functions': __webpack_require__(68),
  216. 'transform-es2015-block-scoped-functions': __webpack_require__(69),
  217. 'transform-es2015-block-scoping': __webpack_require__(70),
  218. 'transform-es2015-classes': __webpack_require__(71),
  219. 'transform-es2015-computed-properties': __webpack_require__(72),
  220. 'transform-es2015-destructuring': __webpack_require__(73),
  221. 'transform-es2015-duplicate-keys': __webpack_require__(130),
  222. 'transform-es2015-for-of': __webpack_require__(74),
  223. 'transform-es2015-function-name': __webpack_require__(75),
  224. 'transform-es2015-instanceof': __webpack_require__(332),
  225. 'transform-es2015-literals': __webpack_require__(76),
  226. 'transform-es2015-modules-amd': __webpack_require__(131),
  227. 'transform-es2015-modules-commonjs': __webpack_require__(77),
  228. 'transform-es2015-modules-systemjs': __webpack_require__(208),
  229. 'transform-es2015-modules-umd': __webpack_require__(209),
  230. 'transform-es2015-object-super': __webpack_require__(78),
  231. 'transform-es2015-parameters': __webpack_require__(79),
  232. 'transform-es2015-shorthand-properties': __webpack_require__(80),
  233. 'transform-es2015-spread': __webpack_require__(81),
  234. 'transform-es2015-sticky-regex': __webpack_require__(82),
  235. 'transform-es2015-template-literals': __webpack_require__(83),
  236. 'transform-es2015-typeof-symbol': __webpack_require__(84),
  237. 'transform-es2015-unicode-regex': __webpack_require__(85),
  238. 'transform-es3-member-expression-literals': __webpack_require__(336),
  239. 'transform-es3-property-literals': __webpack_require__(337),
  240. 'transform-es5-property-mutators': __webpack_require__(338),
  241. 'transform-eval': __webpack_require__(339),
  242. 'transform-exponentiation-operator': __webpack_require__(132),
  243. 'transform-export-extensions': __webpack_require__(210),
  244. 'transform-flow-comments': __webpack_require__(340),
  245. 'transform-flow-strip-types': __webpack_require__(211),
  246. 'transform-function-bind': __webpack_require__(212),
  247. 'transform-jscript': __webpack_require__(341),
  248. 'transform-object-assign': __webpack_require__(342),
  249. 'transform-object-rest-spread': __webpack_require__(213),
  250. 'transform-object-set-prototype-of-to-assign': __webpack_require__(343),
  251. 'transform-proto-to-assign': __webpack_require__(344),
  252. 'transform-react-constant-elements': __webpack_require__(345),
  253. 'transform-react-display-name': __webpack_require__(214),
  254. 'transform-react-inline-elements': __webpack_require__(346),
  255. 'transform-react-jsx': __webpack_require__(215),
  256. 'transform-react-jsx-compat': __webpack_require__(347),
  257. 'transform-react-jsx-self': __webpack_require__(349),
  258. 'transform-react-jsx-source': __webpack_require__(350),
  259. 'transform-regenerator': __webpack_require__(86),
  260. 'transform-runtime': __webpack_require__(353),
  261. 'transform-strict-mode': __webpack_require__(216),
  262. 'undeclared-variables-check': __webpack_require__(354)
  263. });
  264. // All the presets we should bundle
  265. registerPresets({
  266. es2015: __webpack_require__(217),
  267. es2016: __webpack_require__(218),
  268. es2017: __webpack_require__(219),
  269. latest: __webpack_require__(356),
  270. react: __webpack_require__(357),
  271. 'stage-0': __webpack_require__(358),
  272. 'stage-1': __webpack_require__(220),
  273. 'stage-2': __webpack_require__(221),
  274. 'stage-3': __webpack_require__(222),
  275. // ES2015 preset with es2015-modules-commonjs removed
  276. // Plugin list copied from babel-preset-es2015/index.js
  277. 'es2015-no-commonjs': {
  278. plugins: [__webpack_require__(83), __webpack_require__(76), __webpack_require__(75), __webpack_require__(68), __webpack_require__(69), __webpack_require__(71), __webpack_require__(78), __webpack_require__(80), __webpack_require__(72), __webpack_require__(74), __webpack_require__(82), __webpack_require__(85), __webpack_require__(66), __webpack_require__(81), __webpack_require__(79), __webpack_require__(73), __webpack_require__(70), __webpack_require__(84), [__webpack_require__(86), { async: false, asyncGenerators: false }]]
  279. },
  280. // ES2015 preset with plugins set to loose mode.
  281. // Based off https://github.com/bkonkle/babel-preset-es2015-loose/blob/master/index.js
  282. 'es2015-loose': {
  283. plugins: [[__webpack_require__(83), { loose: true }], __webpack_require__(76), __webpack_require__(75), __webpack_require__(68), __webpack_require__(69), [__webpack_require__(71), { loose: true }], __webpack_require__(78), __webpack_require__(80), __webpack_require__(130), [__webpack_require__(72), { loose: true }], [__webpack_require__(74), { loose: true }], __webpack_require__(82), __webpack_require__(85), __webpack_require__(66), [__webpack_require__(81), { loose: true }], __webpack_require__(79), [__webpack_require__(73), { loose: true }], __webpack_require__(70), __webpack_require__(84), [__webpack_require__(77), { loose: true }], [__webpack_require__(86), { async: false, asyncGenerators: false }]]
  284. }
  285. });
  286. var version = exports.version = ("6.26.0");
  287. // Listen for load event if we're in a browser and then kick off finding and
  288. // running of scripts with "text/babel" type.
  289. if (typeof window !== 'undefined' && window && window.addEventListener) {
  290. window.addEventListener('DOMContentLoaded', function () {
  291. return transformScriptTags();
  292. }, false);
  293. }
  294. /**
  295. * Transform <script> tags with "text/babel" type.
  296. * @param {Array} scriptTags specify script tags to transform, transform all in the <head> if not given
  297. */
  298. function transformScriptTags(scriptTags) {
  299. (0, _transformScriptTags.runScripts)(transform, scriptTags);
  300. }
  301. /**
  302. * Disables automatic transformation of <script> tags with "text/babel" type.
  303. */
  304. function disableScriptTags() {
  305. window.removeEventListener('DOMContentLoaded', transformScriptTags);
  306. }
  307. /***/ }),
  308. /* 1 */
  309. /***/ (function(module, exports, __webpack_require__) {
  310. "use strict";
  311. exports.__esModule = true;
  312. exports.createTypeAnnotationBasedOnTypeof = exports.removeTypeDuplicates = exports.createUnionTypeAnnotation = exports.valueToNode = exports.toBlock = exports.toExpression = exports.toStatement = exports.toBindingIdentifierName = exports.toIdentifier = exports.toKeyAlias = exports.toSequenceExpression = exports.toComputedKey = exports.isNodesEquivalent = exports.isImmutable = exports.isScope = exports.isSpecifierDefault = exports.isVar = exports.isBlockScoped = exports.isLet = exports.isValidIdentifier = exports.isReferenced = exports.isBinding = exports.getOuterBindingIdentifiers = exports.getBindingIdentifiers = exports.TYPES = exports.react = exports.DEPRECATED_KEYS = exports.BUILDER_KEYS = exports.NODE_FIELDS = exports.ALIAS_KEYS = exports.VISITOR_KEYS = exports.NOT_LOCAL_BINDING = exports.BLOCK_SCOPED_SYMBOL = exports.INHERIT_KEYS = exports.UNARY_OPERATORS = exports.STRING_UNARY_OPERATORS = exports.NUMBER_UNARY_OPERATORS = exports.BOOLEAN_UNARY_OPERATORS = exports.BINARY_OPERATORS = exports.NUMBER_BINARY_OPERATORS = exports.BOOLEAN_BINARY_OPERATORS = exports.COMPARISON_BINARY_OPERATORS = exports.EQUALITY_BINARY_OPERATORS = exports.BOOLEAN_NUMBER_BINARY_OPERATORS = exports.UPDATE_OPERATORS = exports.LOGICAL_OPERATORS = exports.COMMENT_KEYS = exports.FOR_INIT_KEYS = exports.FLATTENABLE_KEYS = exports.STATEMENT_OR_BLOCK_KEYS = undefined;
  313. var _getOwnPropertySymbols = __webpack_require__(360);
  314. var _getOwnPropertySymbols2 = _interopRequireDefault(_getOwnPropertySymbols);
  315. var _getIterator2 = __webpack_require__(2);
  316. var _getIterator3 = _interopRequireDefault(_getIterator2);
  317. var _keys = __webpack_require__(14);
  318. var _keys2 = _interopRequireDefault(_keys);
  319. var _stringify = __webpack_require__(35);
  320. var _stringify2 = _interopRequireDefault(_stringify);
  321. var _constants = __webpack_require__(135);
  322. Object.defineProperty(exports, "STATEMENT_OR_BLOCK_KEYS", {
  323. enumerable: true,
  324. get: function get() {
  325. return _constants.STATEMENT_OR_BLOCK_KEYS;
  326. }
  327. });
  328. Object.defineProperty(exports, "FLATTENABLE_KEYS", {
  329. enumerable: true,
  330. get: function get() {
  331. return _constants.FLATTENABLE_KEYS;
  332. }
  333. });
  334. Object.defineProperty(exports, "FOR_INIT_KEYS", {
  335. enumerable: true,
  336. get: function get() {
  337. return _constants.FOR_INIT_KEYS;
  338. }
  339. });
  340. Object.defineProperty(exports, "COMMENT_KEYS", {
  341. enumerable: true,
  342. get: function get() {
  343. return _constants.COMMENT_KEYS;
  344. }
  345. });
  346. Object.defineProperty(exports, "LOGICAL_OPERATORS", {
  347. enumerable: true,
  348. get: function get() {
  349. return _constants.LOGICAL_OPERATORS;
  350. }
  351. });
  352. Object.defineProperty(exports, "UPDATE_OPERATORS", {
  353. enumerable: true,
  354. get: function get() {
  355. return _constants.UPDATE_OPERATORS;
  356. }
  357. });
  358. Object.defineProperty(exports, "BOOLEAN_NUMBER_BINARY_OPERATORS", {
  359. enumerable: true,
  360. get: function get() {
  361. return _constants.BOOLEAN_NUMBER_BINARY_OPERATORS;
  362. }
  363. });
  364. Object.defineProperty(exports, "EQUALITY_BINARY_OPERATORS", {
  365. enumerable: true,
  366. get: function get() {
  367. return _constants.EQUALITY_BINARY_OPERATORS;
  368. }
  369. });
  370. Object.defineProperty(exports, "COMPARISON_BINARY_OPERATORS", {
  371. enumerable: true,
  372. get: function get() {
  373. return _constants.COMPARISON_BINARY_OPERATORS;
  374. }
  375. });
  376. Object.defineProperty(exports, "BOOLEAN_BINARY_OPERATORS", {
  377. enumerable: true,
  378. get: function get() {
  379. return _constants.BOOLEAN_BINARY_OPERATORS;
  380. }
  381. });
  382. Object.defineProperty(exports, "NUMBER_BINARY_OPERATORS", {
  383. enumerable: true,
  384. get: function get() {
  385. return _constants.NUMBER_BINARY_OPERATORS;
  386. }
  387. });
  388. Object.defineProperty(exports, "BINARY_OPERATORS", {
  389. enumerable: true,
  390. get: function get() {
  391. return _constants.BINARY_OPERATORS;
  392. }
  393. });
  394. Object.defineProperty(exports, "BOOLEAN_UNARY_OPERATORS", {
  395. enumerable: true,
  396. get: function get() {
  397. return _constants.BOOLEAN_UNARY_OPERATORS;
  398. }
  399. });
  400. Object.defineProperty(exports, "NUMBER_UNARY_OPERATORS", {
  401. enumerable: true,
  402. get: function get() {
  403. return _constants.NUMBER_UNARY_OPERATORS;
  404. }
  405. });
  406. Object.defineProperty(exports, "STRING_UNARY_OPERATORS", {
  407. enumerable: true,
  408. get: function get() {
  409. return _constants.STRING_UNARY_OPERATORS;
  410. }
  411. });
  412. Object.defineProperty(exports, "UNARY_OPERATORS", {
  413. enumerable: true,
  414. get: function get() {
  415. return _constants.UNARY_OPERATORS;
  416. }
  417. });
  418. Object.defineProperty(exports, "INHERIT_KEYS", {
  419. enumerable: true,
  420. get: function get() {
  421. return _constants.INHERIT_KEYS;
  422. }
  423. });
  424. Object.defineProperty(exports, "BLOCK_SCOPED_SYMBOL", {
  425. enumerable: true,
  426. get: function get() {
  427. return _constants.BLOCK_SCOPED_SYMBOL;
  428. }
  429. });
  430. Object.defineProperty(exports, "NOT_LOCAL_BINDING", {
  431. enumerable: true,
  432. get: function get() {
  433. return _constants.NOT_LOCAL_BINDING;
  434. }
  435. });
  436. exports.is = is;
  437. exports.isType = isType;
  438. exports.validate = validate;
  439. exports.shallowEqual = shallowEqual;
  440. exports.appendToMemberExpression = appendToMemberExpression;
  441. exports.prependToMemberExpression = prependToMemberExpression;
  442. exports.ensureBlock = ensureBlock;
  443. exports.clone = clone;
  444. exports.cloneWithoutLoc = cloneWithoutLoc;
  445. exports.cloneDeep = cloneDeep;
  446. exports.buildMatchMemberExpression = buildMatchMemberExpression;
  447. exports.removeComments = removeComments;
  448. exports.inheritsComments = inheritsComments;
  449. exports.inheritTrailingComments = inheritTrailingComments;
  450. exports.inheritLeadingComments = inheritLeadingComments;
  451. exports.inheritInnerComments = inheritInnerComments;
  452. exports.inherits = inherits;
  453. exports.assertNode = assertNode;
  454. exports.isNode = isNode;
  455. exports.traverseFast = traverseFast;
  456. exports.removeProperties = removeProperties;
  457. exports.removePropertiesDeep = removePropertiesDeep;
  458. var _retrievers = __webpack_require__(226);
  459. Object.defineProperty(exports, "getBindingIdentifiers", {
  460. enumerable: true,
  461. get: function get() {
  462. return _retrievers.getBindingIdentifiers;
  463. }
  464. });
  465. Object.defineProperty(exports, "getOuterBindingIdentifiers", {
  466. enumerable: true,
  467. get: function get() {
  468. return _retrievers.getOuterBindingIdentifiers;
  469. }
  470. });
  471. var _validators = __webpack_require__(395);
  472. Object.defineProperty(exports, "isBinding", {
  473. enumerable: true,
  474. get: function get() {
  475. return _validators.isBinding;
  476. }
  477. });
  478. Object.defineProperty(exports, "isReferenced", {
  479. enumerable: true,
  480. get: function get() {
  481. return _validators.isReferenced;
  482. }
  483. });
  484. Object.defineProperty(exports, "isValidIdentifier", {
  485. enumerable: true,
  486. get: function get() {
  487. return _validators.isValidIdentifier;
  488. }
  489. });
  490. Object.defineProperty(exports, "isLet", {
  491. enumerable: true,
  492. get: function get() {
  493. return _validators.isLet;
  494. }
  495. });
  496. Object.defineProperty(exports, "isBlockScoped", {
  497. enumerable: true,
  498. get: function get() {
  499. return _validators.isBlockScoped;
  500. }
  501. });
  502. Object.defineProperty(exports, "isVar", {
  503. enumerable: true,
  504. get: function get() {
  505. return _validators.isVar;
  506. }
  507. });
  508. Object.defineProperty(exports, "isSpecifierDefault", {
  509. enumerable: true,
  510. get: function get() {
  511. return _validators.isSpecifierDefault;
  512. }
  513. });
  514. Object.defineProperty(exports, "isScope", {
  515. enumerable: true,
  516. get: function get() {
  517. return _validators.isScope;
  518. }
  519. });
  520. Object.defineProperty(exports, "isImmutable", {
  521. enumerable: true,
  522. get: function get() {
  523. return _validators.isImmutable;
  524. }
  525. });
  526. Object.defineProperty(exports, "isNodesEquivalent", {
  527. enumerable: true,
  528. get: function get() {
  529. return _validators.isNodesEquivalent;
  530. }
  531. });
  532. var _converters = __webpack_require__(385);
  533. Object.defineProperty(exports, "toComputedKey", {
  534. enumerable: true,
  535. get: function get() {
  536. return _converters.toComputedKey;
  537. }
  538. });
  539. Object.defineProperty(exports, "toSequenceExpression", {
  540. enumerable: true,
  541. get: function get() {
  542. return _converters.toSequenceExpression;
  543. }
  544. });
  545. Object.defineProperty(exports, "toKeyAlias", {
  546. enumerable: true,
  547. get: function get() {
  548. return _converters.toKeyAlias;
  549. }
  550. });
  551. Object.defineProperty(exports, "toIdentifier", {
  552. enumerable: true,
  553. get: function get() {
  554. return _converters.toIdentifier;
  555. }
  556. });
  557. Object.defineProperty(exports, "toBindingIdentifierName", {
  558. enumerable: true,
  559. get: function get() {
  560. return _converters.toBindingIdentifierName;
  561. }
  562. });
  563. Object.defineProperty(exports, "toStatement", {
  564. enumerable: true,
  565. get: function get() {
  566. return _converters.toStatement;
  567. }
  568. });
  569. Object.defineProperty(exports, "toExpression", {
  570. enumerable: true,
  571. get: function get() {
  572. return _converters.toExpression;
  573. }
  574. });
  575. Object.defineProperty(exports, "toBlock", {
  576. enumerable: true,
  577. get: function get() {
  578. return _converters.toBlock;
  579. }
  580. });
  581. Object.defineProperty(exports, "valueToNode", {
  582. enumerable: true,
  583. get: function get() {
  584. return _converters.valueToNode;
  585. }
  586. });
  587. var _flow = __webpack_require__(393);
  588. Object.defineProperty(exports, "createUnionTypeAnnotation", {
  589. enumerable: true,
  590. get: function get() {
  591. return _flow.createUnionTypeAnnotation;
  592. }
  593. });
  594. Object.defineProperty(exports, "removeTypeDuplicates", {
  595. enumerable: true,
  596. get: function get() {
  597. return _flow.removeTypeDuplicates;
  598. }
  599. });
  600. Object.defineProperty(exports, "createTypeAnnotationBasedOnTypeof", {
  601. enumerable: true,
  602. get: function get() {
  603. return _flow.createTypeAnnotationBasedOnTypeof;
  604. }
  605. });
  606. var _toFastProperties = __webpack_require__(624);
  607. var _toFastProperties2 = _interopRequireDefault(_toFastProperties);
  608. var _clone = __webpack_require__(109);
  609. var _clone2 = _interopRequireDefault(_clone);
  610. var _uniq = __webpack_require__(600);
  611. var _uniq2 = _interopRequireDefault(_uniq);
  612. __webpack_require__(390);
  613. var _definitions = __webpack_require__(26);
  614. var _react2 = __webpack_require__(394);
  615. var _react = _interopRequireWildcard(_react2);
  616. function _interopRequireWildcard(obj) {
  617. if (obj && obj.__esModule) {
  618. return obj;
  619. } else {
  620. var newObj = {};if (obj != null) {
  621. for (var key in obj) {
  622. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  623. }
  624. }newObj.default = obj;return newObj;
  625. }
  626. }
  627. function _interopRequireDefault(obj) {
  628. return obj && obj.__esModule ? obj : { default: obj };
  629. }
  630. var t = exports;
  631. function registerType(type) {
  632. var is = t["is" + type];
  633. if (!is) {
  634. is = t["is" + type] = function (node, opts) {
  635. return t.is(type, node, opts);
  636. };
  637. }
  638. t["assert" + type] = function (node, opts) {
  639. opts = opts || {};
  640. if (!is(node, opts)) {
  641. throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts));
  642. }
  643. };
  644. }
  645. exports.VISITOR_KEYS = _definitions.VISITOR_KEYS;
  646. exports.ALIAS_KEYS = _definitions.ALIAS_KEYS;
  647. exports.NODE_FIELDS = _definitions.NODE_FIELDS;
  648. exports.BUILDER_KEYS = _definitions.BUILDER_KEYS;
  649. exports.DEPRECATED_KEYS = _definitions.DEPRECATED_KEYS;
  650. exports.react = _react;
  651. for (var type in t.VISITOR_KEYS) {
  652. registerType(type);
  653. }
  654. t.FLIPPED_ALIAS_KEYS = {};
  655. (0, _keys2.default)(t.ALIAS_KEYS).forEach(function (type) {
  656. t.ALIAS_KEYS[type].forEach(function (alias) {
  657. var types = t.FLIPPED_ALIAS_KEYS[alias] = t.FLIPPED_ALIAS_KEYS[alias] || [];
  658. types.push(type);
  659. });
  660. });
  661. (0, _keys2.default)(t.FLIPPED_ALIAS_KEYS).forEach(function (type) {
  662. t[type.toUpperCase() + "_TYPES"] = t.FLIPPED_ALIAS_KEYS[type];
  663. registerType(type);
  664. });
  665. var TYPES = exports.TYPES = (0, _keys2.default)(t.VISITOR_KEYS).concat((0, _keys2.default)(t.FLIPPED_ALIAS_KEYS)).concat((0, _keys2.default)(t.DEPRECATED_KEYS));
  666. function is(type, node, opts) {
  667. if (!node) return false;
  668. var matches = isType(node.type, type);
  669. if (!matches) return false;
  670. if (typeof opts === "undefined") {
  671. return true;
  672. } else {
  673. return t.shallowEqual(node, opts);
  674. }
  675. }
  676. function isType(nodeType, targetType) {
  677. if (nodeType === targetType) return true;
  678. if (t.ALIAS_KEYS[targetType]) return false;
  679. var aliases = t.FLIPPED_ALIAS_KEYS[targetType];
  680. if (aliases) {
  681. if (aliases[0] === nodeType) return true;
  682. for (var _iterator = aliases, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
  683. var _ref;
  684. if (_isArray) {
  685. if (_i >= _iterator.length) break;
  686. _ref = _iterator[_i++];
  687. } else {
  688. _i = _iterator.next();
  689. if (_i.done) break;
  690. _ref = _i.value;
  691. }
  692. var alias = _ref;
  693. if (nodeType === alias) return true;
  694. }
  695. }
  696. return false;
  697. }
  698. (0, _keys2.default)(t.BUILDER_KEYS).forEach(function (type) {
  699. var keys = t.BUILDER_KEYS[type];
  700. function builder() {
  701. if (arguments.length > keys.length) {
  702. throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length));
  703. }
  704. var node = {};
  705. node.type = type;
  706. var i = 0;
  707. for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) {
  708. var _ref2;
  709. if (_isArray2) {
  710. if (_i2 >= _iterator2.length) break;
  711. _ref2 = _iterator2[_i2++];
  712. } else {
  713. _i2 = _iterator2.next();
  714. if (_i2.done) break;
  715. _ref2 = _i2.value;
  716. }
  717. var _key = _ref2;
  718. var field = t.NODE_FIELDS[type][_key];
  719. var arg = arguments[i++];
  720. if (arg === undefined) arg = (0, _clone2.default)(field.default);
  721. node[_key] = arg;
  722. }
  723. for (var key in node) {
  724. validate(node, key, node[key]);
  725. }
  726. return node;
  727. }
  728. t[type] = builder;
  729. t[type[0].toLowerCase() + type.slice(1)] = builder;
  730. });
  731. var _loop = function _loop(_type) {
  732. var newType = t.DEPRECATED_KEYS[_type];
  733. function proxy(fn) {
  734. return function () {
  735. console.trace("The node type " + _type + " has been renamed to " + newType);
  736. return fn.apply(this, arguments);
  737. };
  738. }
  739. t[_type] = t[_type[0].toLowerCase() + _type.slice(1)] = proxy(t[newType]);
  740. t["is" + _type] = proxy(t["is" + newType]);
  741. t["assert" + _type] = proxy(t["assert" + newType]);
  742. };
  743. for (var _type in t.DEPRECATED_KEYS) {
  744. _loop(_type);
  745. }
  746. function validate(node, key, val) {
  747. if (!node) return;
  748. var fields = t.NODE_FIELDS[node.type];
  749. if (!fields) return;
  750. var field = fields[key];
  751. if (!field || !field.validate) return;
  752. if (field.optional && val == null) return;
  753. field.validate(node, key, val);
  754. }
  755. function shallowEqual(actual, expected) {
  756. var keys = (0, _keys2.default)(expected);
  757. for (var _iterator3 = keys, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) {
  758. var _ref3;
  759. if (_isArray3) {
  760. if (_i3 >= _iterator3.length) break;
  761. _ref3 = _iterator3[_i3++];
  762. } else {
  763. _i3 = _iterator3.next();
  764. if (_i3.done) break;
  765. _ref3 = _i3.value;
  766. }
  767. var key = _ref3;
  768. if (actual[key] !== expected[key]) {
  769. return false;
  770. }
  771. }
  772. return true;
  773. }
  774. function appendToMemberExpression(member, append, computed) {
  775. member.object = t.memberExpression(member.object, member.property, member.computed);
  776. member.property = append;
  777. member.computed = !!computed;
  778. return member;
  779. }
  780. function prependToMemberExpression(member, prepend) {
  781. member.object = t.memberExpression(prepend, member.object);
  782. return member;
  783. }
  784. function ensureBlock(node) {
  785. var key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "body";
  786. return node[key] = t.toBlock(node[key], node);
  787. }
  788. function clone(node) {
  789. if (!node) return node;
  790. var newNode = {};
  791. for (var key in node) {
  792. if (key[0] === "_") continue;
  793. newNode[key] = node[key];
  794. }
  795. return newNode;
  796. }
  797. function cloneWithoutLoc(node) {
  798. var newNode = clone(node);
  799. delete newNode.loc;
  800. return newNode;
  801. }
  802. function cloneDeep(node) {
  803. if (!node) return node;
  804. var newNode = {};
  805. for (var key in node) {
  806. if (key[0] === "_") continue;
  807. var val = node[key];
  808. if (val) {
  809. if (val.type) {
  810. val = t.cloneDeep(val);
  811. } else if (Array.isArray(val)) {
  812. val = val.map(t.cloneDeep);
  813. }
  814. }
  815. newNode[key] = val;
  816. }
  817. return newNode;
  818. }
  819. function buildMatchMemberExpression(match, allowPartial) {
  820. var parts = match.split(".");
  821. return function (member) {
  822. if (!t.isMemberExpression(member)) return false;
  823. var search = [member];
  824. var i = 0;
  825. while (search.length) {
  826. var node = search.shift();
  827. if (allowPartial && i === parts.length) {
  828. return true;
  829. }
  830. if (t.isIdentifier(node)) {
  831. if (parts[i] !== node.name) return false;
  832. } else if (t.isStringLiteral(node)) {
  833. if (parts[i] !== node.value) return false;
  834. } else if (t.isMemberExpression(node)) {
  835. if (node.computed && !t.isStringLiteral(node.property)) {
  836. return false;
  837. } else {
  838. search.push(node.object);
  839. search.push(node.property);
  840. continue;
  841. }
  842. } else {
  843. return false;
  844. }
  845. if (++i > parts.length) {
  846. return false;
  847. }
  848. }
  849. return true;
  850. };
  851. }
  852. function removeComments(node) {
  853. for (var _iterator4 = t.COMMENT_KEYS, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, _getIterator3.default)(_iterator4);;) {
  854. var _ref4;
  855. if (_isArray4) {
  856. if (_i4 >= _iterator4.length) break;
  857. _ref4 = _iterator4[_i4++];
  858. } else {
  859. _i4 = _iterator4.next();
  860. if (_i4.done) break;
  861. _ref4 = _i4.value;
  862. }
  863. var key = _ref4;
  864. delete node[key];
  865. }
  866. return node;
  867. }
  868. function inheritsComments(child, parent) {
  869. inheritTrailingComments(child, parent);
  870. inheritLeadingComments(child, parent);
  871. inheritInnerComments(child, parent);
  872. return child;
  873. }
  874. function inheritTrailingComments(child, parent) {
  875. _inheritComments("trailingComments", child, parent);
  876. }
  877. function inheritLeadingComments(child, parent) {
  878. _inheritComments("leadingComments", child, parent);
  879. }
  880. function inheritInnerComments(child, parent) {
  881. _inheritComments("innerComments", child, parent);
  882. }
  883. function _inheritComments(key, child, parent) {
  884. if (child && parent) {
  885. child[key] = (0, _uniq2.default)([].concat(child[key], parent[key]).filter(Boolean));
  886. }
  887. }
  888. function inherits(child, parent) {
  889. if (!child || !parent) return child;
  890. for (var _iterator5 = t.INHERIT_KEYS.optional, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, _getIterator3.default)(_iterator5);;) {
  891. var _ref5;
  892. if (_isArray5) {
  893. if (_i5 >= _iterator5.length) break;
  894. _ref5 = _iterator5[_i5++];
  895. } else {
  896. _i5 = _iterator5.next();
  897. if (_i5.done) break;
  898. _ref5 = _i5.value;
  899. }
  900. var _key2 = _ref5;
  901. if (child[_key2] == null) {
  902. child[_key2] = parent[_key2];
  903. }
  904. }
  905. for (var key in parent) {
  906. if (key[0] === "_") child[key] = parent[key];
  907. }
  908. for (var _iterator6 = t.INHERIT_KEYS.force, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, _getIterator3.default)(_iterator6);;) {
  909. var _ref6;
  910. if (_isArray6) {
  911. if (_i6 >= _iterator6.length) break;
  912. _ref6 = _iterator6[_i6++];
  913. } else {
  914. _i6 = _iterator6.next();
  915. if (_i6.done) break;
  916. _ref6 = _i6.value;
  917. }
  918. var _key3 = _ref6;
  919. child[_key3] = parent[_key3];
  920. }
  921. t.inheritsComments(child, parent);
  922. return child;
  923. }
  924. function assertNode(node) {
  925. if (!isNode(node)) {
  926. throw new TypeError("Not a valid node " + (node && node.type));
  927. }
  928. }
  929. function isNode(node) {
  930. return !!(node && _definitions.VISITOR_KEYS[node.type]);
  931. }
  932. (0, _toFastProperties2.default)(t);
  933. (0, _toFastProperties2.default)(t.VISITOR_KEYS);
  934. function traverseFast(node, enter, opts) {
  935. if (!node) return;
  936. var keys = t.VISITOR_KEYS[node.type];
  937. if (!keys) return;
  938. opts = opts || {};
  939. enter(node, opts);
  940. for (var _iterator7 = keys, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : (0, _getIterator3.default)(_iterator7);;) {
  941. var _ref7;
  942. if (_isArray7) {
  943. if (_i7 >= _iterator7.length) break;
  944. _ref7 = _iterator7[_i7++];
  945. } else {
  946. _i7 = _iterator7.next();
  947. if (_i7.done) break;
  948. _ref7 = _i7.value;
  949. }
  950. var key = _ref7;
  951. var subNode = node[key];
  952. if (Array.isArray(subNode)) {
  953. for (var _iterator8 = subNode, _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : (0, _getIterator3.default)(_iterator8);;) {
  954. var _ref8;
  955. if (_isArray8) {
  956. if (_i8 >= _iterator8.length) break;
  957. _ref8 = _iterator8[_i8++];
  958. } else {
  959. _i8 = _iterator8.next();
  960. if (_i8.done) break;
  961. _ref8 = _i8.value;
  962. }
  963. var _node = _ref8;
  964. traverseFast(_node, enter, opts);
  965. }
  966. } else {
  967. traverseFast(subNode, enter, opts);
  968. }
  969. }
  970. }
  971. var CLEAR_KEYS = ["tokens", "start", "end", "loc", "raw", "rawValue"];
  972. var CLEAR_KEYS_PLUS_COMMENTS = t.COMMENT_KEYS.concat(["comments"]).concat(CLEAR_KEYS);
  973. function removeProperties(node, opts) {
  974. opts = opts || {};
  975. var map = opts.preserveComments ? CLEAR_KEYS : CLEAR_KEYS_PLUS_COMMENTS;
  976. for (var _iterator9 = map, _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : (0, _getIterator3.default)(_iterator9);;) {
  977. var _ref9;
  978. if (_isArray9) {
  979. if (_i9 >= _iterator9.length) break;
  980. _ref9 = _iterator9[_i9++];
  981. } else {
  982. _i9 = _iterator9.next();
  983. if (_i9.done) break;
  984. _ref9 = _i9.value;
  985. }
  986. var _key4 = _ref9;
  987. if (node[_key4] != null) node[_key4] = undefined;
  988. }
  989. for (var key in node) {
  990. if (key[0] === "_" && node[key] != null) node[key] = undefined;
  991. }
  992. var syms = (0, _getOwnPropertySymbols2.default)(node);
  993. for (var _iterator10 = syms, _isArray10 = Array.isArray(_iterator10), _i10 = 0, _iterator10 = _isArray10 ? _iterator10 : (0, _getIterator3.default)(_iterator10);;) {
  994. var _ref10;
  995. if (_isArray10) {
  996. if (_i10 >= _iterator10.length) break;
  997. _ref10 = _iterator10[_i10++];
  998. } else {
  999. _i10 = _iterator10.next();
  1000. if (_i10.done) break;
  1001. _ref10 = _i10.value;
  1002. }
  1003. var sym = _ref10;
  1004. node[sym] = null;
  1005. }
  1006. }
  1007. function removePropertiesDeep(tree, opts) {
  1008. traverseFast(tree, removeProperties, opts);
  1009. return tree;
  1010. }
  1011. /***/ }),
  1012. /* 2 */
  1013. /***/ (function(module, exports, __webpack_require__) {
  1014. "use strict";
  1015. module.exports = { "default": __webpack_require__(404), __esModule: true };
  1016. /***/ }),
  1017. /* 3 */
  1018. /***/ (function(module, exports) {
  1019. "use strict";
  1020. exports.__esModule = true;
  1021. exports.default = function (instance, Constructor) {
  1022. if (!(instance instanceof Constructor)) {
  1023. throw new TypeError("Cannot call a class as a function");
  1024. }
  1025. };
  1026. /***/ }),
  1027. /* 4 */
  1028. /***/ (function(module, exports, __webpack_require__) {
  1029. "use strict";
  1030. exports.__esModule = true;
  1031. var _symbol = __webpack_require__(10);
  1032. var _symbol2 = _interopRequireDefault(_symbol);
  1033. exports.default = function (code, opts) {
  1034. var stack = void 0;
  1035. try {
  1036. throw new Error();
  1037. } catch (error) {
  1038. if (error.stack) {
  1039. stack = error.stack.split("\n").slice(1).join("\n");
  1040. }
  1041. }
  1042. opts = (0, _assign2.default)({
  1043. allowReturnOutsideFunction: true,
  1044. allowSuperOutsideMethod: true,
  1045. preserveComments: false
  1046. }, opts);
  1047. var _getAst = function getAst() {
  1048. var ast = void 0;
  1049. try {
  1050. ast = babylon.parse(code, opts);
  1051. ast = _babelTraverse2.default.removeProperties(ast, { preserveComments: opts.preserveComments });
  1052. _babelTraverse2.default.cheap(ast, function (node) {
  1053. node[FROM_TEMPLATE] = true;
  1054. });
  1055. } catch (err) {
  1056. err.stack = err.stack + "from\n" + stack;
  1057. throw err;
  1058. }
  1059. _getAst = function getAst() {
  1060. return ast;
  1061. };
  1062. return ast;
  1063. };
  1064. return function () {
  1065. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  1066. args[_key] = arguments[_key];
  1067. }
  1068. return useTemplate(_getAst(), args);
  1069. };
  1070. };
  1071. var _cloneDeep = __webpack_require__(574);
  1072. var _cloneDeep2 = _interopRequireDefault(_cloneDeep);
  1073. var _assign = __webpack_require__(174);
  1074. var _assign2 = _interopRequireDefault(_assign);
  1075. var _has = __webpack_require__(274);
  1076. var _has2 = _interopRequireDefault(_has);
  1077. var _babelTraverse = __webpack_require__(7);
  1078. var _babelTraverse2 = _interopRequireDefault(_babelTraverse);
  1079. var _babylon = __webpack_require__(89);
  1080. var babylon = _interopRequireWildcard(_babylon);
  1081. var _babelTypes = __webpack_require__(1);
  1082. var t = _interopRequireWildcard(_babelTypes);
  1083. function _interopRequireWildcard(obj) {
  1084. if (obj && obj.__esModule) {
  1085. return obj;
  1086. } else {
  1087. var newObj = {};if (obj != null) {
  1088. for (var key in obj) {
  1089. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  1090. }
  1091. }newObj.default = obj;return newObj;
  1092. }
  1093. }
  1094. function _interopRequireDefault(obj) {
  1095. return obj && obj.__esModule ? obj : { default: obj };
  1096. }
  1097. var FROM_TEMPLATE = "_fromTemplate";
  1098. var TEMPLATE_SKIP = (0, _symbol2.default)();
  1099. function useTemplate(ast, nodes) {
  1100. ast = (0, _cloneDeep2.default)(ast);
  1101. var _ast = ast,
  1102. program = _ast.program;
  1103. if (nodes.length) {
  1104. (0, _babelTraverse2.default)(ast, templateVisitor, null, nodes);
  1105. }
  1106. if (program.body.length > 1) {
  1107. return program.body;
  1108. } else {
  1109. return program.body[0];
  1110. }
  1111. }
  1112. var templateVisitor = {
  1113. noScope: true,
  1114. enter: function enter(path, args) {
  1115. var node = path.node;
  1116. if (node[TEMPLATE_SKIP]) return path.skip();
  1117. if (t.isExpressionStatement(node)) {
  1118. node = node.expression;
  1119. }
  1120. var replacement = void 0;
  1121. if (t.isIdentifier(node) && node[FROM_TEMPLATE]) {
  1122. if ((0, _has2.default)(args[0], node.name)) {
  1123. replacement = args[0][node.name];
  1124. } else if (node.name[0] === "$") {
  1125. var i = +node.name.slice(1);
  1126. if (args[i]) replacement = args[i];
  1127. }
  1128. }
  1129. if (replacement === null) {
  1130. path.remove();
  1131. }
  1132. if (replacement) {
  1133. replacement[TEMPLATE_SKIP] = true;
  1134. path.replaceInline(replacement);
  1135. }
  1136. },
  1137. exit: function exit(_ref) {
  1138. var node = _ref.node;
  1139. if (!node.loc) _babelTraverse2.default.clearNode(node);
  1140. }
  1141. };
  1142. module.exports = exports["default"];
  1143. /***/ }),
  1144. /* 5 */
  1145. /***/ (function(module, exports) {
  1146. 'use strict';
  1147. var core = module.exports = { version: '2.5.0' };
  1148. if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef
  1149. /***/ }),
  1150. /* 6 */
  1151. /***/ (function(module, exports) {
  1152. "use strict";
  1153. /**
  1154. * Checks if `value` is classified as an `Array` object.
  1155. *
  1156. * @static
  1157. * @memberOf _
  1158. * @since 0.1.0
  1159. * @category Lang
  1160. * @param {*} value The value to check.
  1161. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  1162. * @example
  1163. *
  1164. * _.isArray([1, 2, 3]);
  1165. * // => true
  1166. *
  1167. * _.isArray(document.body.children);
  1168. * // => false
  1169. *
  1170. * _.isArray('abc');
  1171. * // => false
  1172. *
  1173. * _.isArray(_.noop);
  1174. * // => false
  1175. */
  1176. var isArray = Array.isArray;
  1177. module.exports = isArray;
  1178. /***/ }),
  1179. /* 7 */
  1180. /***/ (function(module, exports, __webpack_require__) {
  1181. "use strict";
  1182. exports.__esModule = true;
  1183. exports.visitors = exports.Hub = exports.Scope = exports.NodePath = undefined;
  1184. var _getIterator2 = __webpack_require__(2);
  1185. var _getIterator3 = _interopRequireDefault(_getIterator2);
  1186. var _path = __webpack_require__(36);
  1187. Object.defineProperty(exports, "NodePath", {
  1188. enumerable: true,
  1189. get: function get() {
  1190. return _interopRequireDefault(_path).default;
  1191. }
  1192. });
  1193. var _scope = __webpack_require__(134);
  1194. Object.defineProperty(exports, "Scope", {
  1195. enumerable: true,
  1196. get: function get() {
  1197. return _interopRequireDefault(_scope).default;
  1198. }
  1199. });
  1200. var _hub = __webpack_require__(223);
  1201. Object.defineProperty(exports, "Hub", {
  1202. enumerable: true,
  1203. get: function get() {
  1204. return _interopRequireDefault(_hub).default;
  1205. }
  1206. });
  1207. exports.default = traverse;
  1208. var _context = __webpack_require__(367);
  1209. var _context2 = _interopRequireDefault(_context);
  1210. var _visitors = __webpack_require__(384);
  1211. var visitors = _interopRequireWildcard(_visitors);
  1212. var _babelMessages = __webpack_require__(20);
  1213. var messages = _interopRequireWildcard(_babelMessages);
  1214. var _includes = __webpack_require__(111);
  1215. var _includes2 = _interopRequireDefault(_includes);
  1216. var _babelTypes = __webpack_require__(1);
  1217. var t = _interopRequireWildcard(_babelTypes);
  1218. var _cache = __webpack_require__(88);
  1219. var cache = _interopRequireWildcard(_cache);
  1220. function _interopRequireWildcard(obj) {
  1221. if (obj && obj.__esModule) {
  1222. return obj;
  1223. } else {
  1224. var newObj = {};if (obj != null) {
  1225. for (var key in obj) {
  1226. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  1227. }
  1228. }newObj.default = obj;return newObj;
  1229. }
  1230. }
  1231. function _interopRequireDefault(obj) {
  1232. return obj && obj.__esModule ? obj : { default: obj };
  1233. }
  1234. exports.visitors = visitors;
  1235. function traverse(parent, opts, scope, state, parentPath) {
  1236. if (!parent) return;
  1237. if (!opts) opts = {};
  1238. if (!opts.noScope && !scope) {
  1239. if (parent.type !== "Program" && parent.type !== "File") {
  1240. throw new Error(messages.get("traverseNeedsParent", parent.type));
  1241. }
  1242. }
  1243. visitors.explode(opts);
  1244. traverse.node(parent, opts, scope, state, parentPath);
  1245. }
  1246. traverse.visitors = visitors;
  1247. traverse.verify = visitors.verify;
  1248. traverse.explode = visitors.explode;
  1249. traverse.NodePath = __webpack_require__(36);
  1250. traverse.Scope = __webpack_require__(134);
  1251. traverse.Hub = __webpack_require__(223);
  1252. traverse.cheap = function (node, enter) {
  1253. return t.traverseFast(node, enter);
  1254. };
  1255. traverse.node = function (node, opts, scope, state, parentPath, skipKeys) {
  1256. var keys = t.VISITOR_KEYS[node.type];
  1257. if (!keys) return;
  1258. var context = new _context2.default(scope, opts, state, parentPath);
  1259. for (var _iterator = keys, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
  1260. var _ref;
  1261. if (_isArray) {
  1262. if (_i >= _iterator.length) break;
  1263. _ref = _iterator[_i++];
  1264. } else {
  1265. _i = _iterator.next();
  1266. if (_i.done) break;
  1267. _ref = _i.value;
  1268. }
  1269. var key = _ref;
  1270. if (skipKeys && skipKeys[key]) continue;
  1271. if (context.visit(node, key)) return;
  1272. }
  1273. };
  1274. traverse.clearNode = function (node, opts) {
  1275. t.removeProperties(node, opts);
  1276. cache.path.delete(node);
  1277. };
  1278. traverse.removeProperties = function (tree, opts) {
  1279. t.traverseFast(tree, traverse.clearNode, opts);
  1280. return tree;
  1281. };
  1282. function hasBlacklistedType(path, state) {
  1283. if (path.node.type === state.type) {
  1284. state.has = true;
  1285. path.stop();
  1286. }
  1287. }
  1288. traverse.hasType = function (tree, scope, type, blacklistTypes) {
  1289. if ((0, _includes2.default)(blacklistTypes, tree.type)) return false;
  1290. if (tree.type === type) return true;
  1291. var state = {
  1292. has: false,
  1293. type: type
  1294. };
  1295. traverse(tree, {
  1296. blacklist: blacklistTypes,
  1297. enter: hasBlacklistedType
  1298. }, scope, state);
  1299. return state.has;
  1300. };
  1301. traverse.clearCache = function () {
  1302. cache.clear();
  1303. };
  1304. traverse.clearCache.clearPath = cache.clearPath;
  1305. traverse.clearCache.clearScope = cache.clearScope;
  1306. traverse.copyCache = function (source, destination) {
  1307. if (cache.path.has(source)) {
  1308. cache.path.set(destination, cache.path.get(source));
  1309. }
  1310. };
  1311. /***/ }),
  1312. /* 8 */
  1313. /***/ (function(module, exports) {
  1314. 'use strict';
  1315. // shim for using process in browser
  1316. var process = module.exports = {};
  1317. // cached from whatever global is present so that test runners that stub it
  1318. // don't break things. But we need to wrap it in a try catch in case it is
  1319. // wrapped in strict mode code which doesn't define any globals. It's inside a
  1320. // function because try/catches deoptimize in certain engines.
  1321. var cachedSetTimeout;
  1322. var cachedClearTimeout;
  1323. function defaultSetTimout() {
  1324. throw new Error('setTimeout has not been defined');
  1325. }
  1326. function defaultClearTimeout() {
  1327. throw new Error('clearTimeout has not been defined');
  1328. }
  1329. (function () {
  1330. try {
  1331. if (typeof setTimeout === 'function') {
  1332. cachedSetTimeout = setTimeout;
  1333. } else {
  1334. cachedSetTimeout = defaultSetTimout;
  1335. }
  1336. } catch (e) {
  1337. cachedSetTimeout = defaultSetTimout;
  1338. }
  1339. try {
  1340. if (typeof clearTimeout === 'function') {
  1341. cachedClearTimeout = clearTimeout;
  1342. } else {
  1343. cachedClearTimeout = defaultClearTimeout;
  1344. }
  1345. } catch (e) {
  1346. cachedClearTimeout = defaultClearTimeout;
  1347. }
  1348. })();
  1349. function runTimeout(fun) {
  1350. if (cachedSetTimeout === setTimeout) {
  1351. //normal enviroments in sane situations
  1352. return setTimeout(fun, 0);
  1353. }
  1354. // if setTimeout wasn't available but was latter defined
  1355. if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
  1356. cachedSetTimeout = setTimeout;
  1357. return setTimeout(fun, 0);
  1358. }
  1359. try {
  1360. // when when somebody has screwed with setTimeout but no I.E. maddness
  1361. return cachedSetTimeout(fun, 0);
  1362. } catch (e) {
  1363. try {
  1364. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  1365. return cachedSetTimeout.call(null, fun, 0);
  1366. } catch (e) {
  1367. // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
  1368. return cachedSetTimeout.call(this, fun, 0);
  1369. }
  1370. }
  1371. }
  1372. function runClearTimeout(marker) {
  1373. if (cachedClearTimeout === clearTimeout) {
  1374. //normal enviroments in sane situations
  1375. return clearTimeout(marker);
  1376. }
  1377. // if clearTimeout wasn't available but was latter defined
  1378. if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
  1379. cachedClearTimeout = clearTimeout;
  1380. return clearTimeout(marker);
  1381. }
  1382. try {
  1383. // when when somebody has screwed with setTimeout but no I.E. maddness
  1384. return cachedClearTimeout(marker);
  1385. } catch (e) {
  1386. try {
  1387. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  1388. return cachedClearTimeout.call(null, marker);
  1389. } catch (e) {
  1390. // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
  1391. // Some versions of I.E. have different rules for clearTimeout vs setTimeout
  1392. return cachedClearTimeout.call(this, marker);
  1393. }
  1394. }
  1395. }
  1396. var queue = [];
  1397. var draining = false;
  1398. var currentQueue;
  1399. var queueIndex = -1;
  1400. function cleanUpNextTick() {
  1401. if (!draining || !currentQueue) {
  1402. return;
  1403. }
  1404. draining = false;
  1405. if (currentQueue.length) {
  1406. queue = currentQueue.concat(queue);
  1407. } else {
  1408. queueIndex = -1;
  1409. }
  1410. if (queue.length) {
  1411. drainQueue();
  1412. }
  1413. }
  1414. function drainQueue() {
  1415. if (draining) {
  1416. return;
  1417. }
  1418. var timeout = runTimeout(cleanUpNextTick);
  1419. draining = true;
  1420. var len = queue.length;
  1421. while (len) {
  1422. currentQueue = queue;
  1423. queue = [];
  1424. while (++queueIndex < len) {
  1425. if (currentQueue) {
  1426. currentQueue[queueIndex].run();
  1427. }
  1428. }
  1429. queueIndex = -1;
  1430. len = queue.length;
  1431. }
  1432. currentQueue = null;
  1433. draining = false;
  1434. runClearTimeout(timeout);
  1435. }
  1436. process.nextTick = function (fun) {
  1437. var args = new Array(arguments.length - 1);
  1438. if (arguments.length > 1) {
  1439. for (var i = 1; i < arguments.length; i++) {
  1440. args[i - 1] = arguments[i];
  1441. }
  1442. }
  1443. queue.push(new Item(fun, args));
  1444. if (queue.length === 1 && !draining) {
  1445. runTimeout(drainQueue);
  1446. }
  1447. };
  1448. // v8 likes predictible objects
  1449. function Item(fun, array) {
  1450. this.fun = fun;
  1451. this.array = array;
  1452. }
  1453. Item.prototype.run = function () {
  1454. this.fun.apply(null, this.array);
  1455. };
  1456. process.title = 'browser';
  1457. process.browser = true;
  1458. process.env = {};
  1459. process.argv = [];
  1460. process.version = ''; // empty string to avoid regexp issues
  1461. process.versions = {};
  1462. function noop() {}
  1463. process.on = noop;
  1464. process.addListener = noop;
  1465. process.once = noop;
  1466. process.off = noop;
  1467. process.removeListener = noop;
  1468. process.removeAllListeners = noop;
  1469. process.emit = noop;
  1470. process.prependListener = noop;
  1471. process.prependOnceListener = noop;
  1472. process.listeners = function (name) {
  1473. return [];
  1474. };
  1475. process.binding = function (name) {
  1476. throw new Error('process.binding is not supported');
  1477. };
  1478. process.cwd = function () {
  1479. return '/';
  1480. };
  1481. process.chdir = function (dir) {
  1482. throw new Error('process.chdir is not supported');
  1483. };
  1484. process.umask = function () {
  1485. return 0;
  1486. };
  1487. /***/ }),
  1488. /* 9 */
  1489. /***/ (function(module, exports, __webpack_require__) {
  1490. "use strict";
  1491. module.exports = { "default": __webpack_require__(409), __esModule: true };
  1492. /***/ }),
  1493. /* 10 */
  1494. /***/ (function(module, exports, __webpack_require__) {
  1495. "use strict";
  1496. module.exports = { "default": __webpack_require__(414), __esModule: true };
  1497. /***/ }),
  1498. /* 11 */
  1499. /***/ (function(module, exports, __webpack_require__) {
  1500. "use strict";
  1501. var _typeof2 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  1502. exports.__esModule = true;
  1503. var _iterator = __webpack_require__(363);
  1504. var _iterator2 = _interopRequireDefault(_iterator);
  1505. var _symbol = __webpack_require__(10);
  1506. var _symbol2 = _interopRequireDefault(_symbol);
  1507. var _typeof = typeof _symbol2.default === "function" && _typeof2(_iterator2.default) === "symbol" ? function (obj) {
  1508. return typeof obj === "undefined" ? "undefined" : _typeof2(obj);
  1509. } : function (obj) {
  1510. return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof2(obj);
  1511. };
  1512. function _interopRequireDefault(obj) {
  1513. return obj && obj.__esModule ? obj : { default: obj };
  1514. }
  1515. exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.default) === "symbol" ? function (obj) {
  1516. return typeof obj === "undefined" ? "undefined" : _typeof(obj);
  1517. } : function (obj) {
  1518. return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof(obj);
  1519. };
  1520. /***/ }),
  1521. /* 12 */
  1522. /***/ (function(module, exports, __webpack_require__) {
  1523. 'use strict';
  1524. var global = __webpack_require__(15);
  1525. var core = __webpack_require__(5);
  1526. var ctx = __webpack_require__(43);
  1527. var hide = __webpack_require__(29);
  1528. var PROTOTYPE = 'prototype';
  1529. var $export = function $export(type, name, source) {
  1530. var IS_FORCED = type & $export.F;
  1531. var IS_GLOBAL = type & $export.G;
  1532. var IS_STATIC = type & $export.S;
  1533. var IS_PROTO = type & $export.P;
  1534. var IS_BIND = type & $export.B;
  1535. var IS_WRAP = type & $export.W;
  1536. var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});
  1537. var expProto = exports[PROTOTYPE];
  1538. var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE];
  1539. var key, own, out;
  1540. if (IS_GLOBAL) source = name;
  1541. for (key in source) {
  1542. // contains in native
  1543. own = !IS_FORCED && target && target[key] !== undefined;
  1544. if (own && key in exports) continue;
  1545. // export native or passed
  1546. out = own ? target[key] : source[key];
  1547. // prevent global pollution for namespaces
  1548. exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]
  1549. // bind timers to global for call from export context
  1550. : IS_BIND && own ? ctx(out, global)
  1551. // wrap global constructors for prevent change them in library
  1552. : IS_WRAP && target[key] == out ? function (C) {
  1553. var F = function F(a, b, c) {
  1554. if (this instanceof C) {
  1555. switch (arguments.length) {
  1556. case 0:
  1557. return new C();
  1558. case 1:
  1559. return new C(a);
  1560. case 2:
  1561. return new C(a, b);
  1562. }return new C(a, b, c);
  1563. }return C.apply(this, arguments);
  1564. };
  1565. F[PROTOTYPE] = C[PROTOTYPE];
  1566. return F;
  1567. // make static versions for prototype methods
  1568. }(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
  1569. // export proto methods to core.%CONSTRUCTOR%.methods.%NAME%
  1570. if (IS_PROTO) {
  1571. (exports.virtual || (exports.virtual = {}))[key] = out;
  1572. // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%
  1573. if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out);
  1574. }
  1575. }
  1576. };
  1577. // type bitmap
  1578. $export.F = 1; // forced
  1579. $export.G = 2; // global
  1580. $export.S = 4; // static
  1581. $export.P = 8; // proto
  1582. $export.B = 16; // bind
  1583. $export.W = 32; // wrap
  1584. $export.U = 64; // safe
  1585. $export.R = 128; // real proto method for `library`
  1586. module.exports = $export;
  1587. /***/ }),
  1588. /* 13 */
  1589. /***/ (function(module, exports, __webpack_require__) {
  1590. 'use strict';
  1591. var store = __webpack_require__(151)('wks');
  1592. var uid = __webpack_require__(95);
  1593. var _Symbol = __webpack_require__(15).Symbol;
  1594. var USE_SYMBOL = typeof _Symbol == 'function';
  1595. var $exports = module.exports = function (name) {
  1596. return store[name] || (store[name] = USE_SYMBOL && _Symbol[name] || (USE_SYMBOL ? _Symbol : uid)('Symbol.' + name));
  1597. };
  1598. $exports.store = store;
  1599. /***/ }),
  1600. /* 14 */
  1601. /***/ (function(module, exports, __webpack_require__) {
  1602. "use strict";
  1603. module.exports = { "default": __webpack_require__(411), __esModule: true };
  1604. /***/ }),
  1605. /* 15 */
  1606. /***/ (function(module, exports) {
  1607. 'use strict';
  1608. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  1609. var global = module.exports = typeof window != 'undefined' && window.Math == Math ? window : typeof self != 'undefined' && self.Math == Math ? self
  1610. // eslint-disable-next-line no-new-func
  1611. : Function('return this')();
  1612. if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef
  1613. /***/ }),
  1614. /* 16 */
  1615. /***/ (function(module, exports) {
  1616. 'use strict';
  1617. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  1618. module.exports = function (it) {
  1619. return (typeof it === 'undefined' ? 'undefined' : _typeof(it)) === 'object' ? it !== null : typeof it === 'function';
  1620. };
  1621. /***/ }),
  1622. /* 17 */
  1623. /***/ (function(module, exports, __webpack_require__) {
  1624. 'use strict';
  1625. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  1626. var freeGlobal = __webpack_require__(261);
  1627. /** Detect free variable `self`. */
  1628. var freeSelf = (typeof self === 'undefined' ? 'undefined' : _typeof(self)) == 'object' && self && self.Object === Object && self;
  1629. /** Used as a reference to the global object. */
  1630. var root = freeGlobal || freeSelf || Function('return this')();
  1631. module.exports = root;
  1632. /***/ }),
  1633. /* 18 */
  1634. /***/ (function(module, exports) {
  1635. 'use strict';
  1636. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  1637. /**
  1638. * Checks if `value` is the
  1639. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  1640. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  1641. *
  1642. * @static
  1643. * @memberOf _
  1644. * @since 0.1.0
  1645. * @category Lang
  1646. * @param {*} value The value to check.
  1647. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  1648. * @example
  1649. *
  1650. * _.isObject({});
  1651. * // => true
  1652. *
  1653. * _.isObject([1, 2, 3]);
  1654. * // => true
  1655. *
  1656. * _.isObject(_.noop);
  1657. * // => true
  1658. *
  1659. * _.isObject(null);
  1660. * // => false
  1661. */
  1662. function isObject(value) {
  1663. var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);
  1664. return value != null && (type == 'object' || type == 'function');
  1665. }
  1666. module.exports = isObject;
  1667. /***/ }),
  1668. /* 19 */
  1669. /***/ (function(module, exports, __webpack_require__) {
  1670. /* WEBPACK VAR INJECTION */(function(process) {'use strict';
  1671. // Copyright Joyent, Inc. and other Node contributors.
  1672. //
  1673. // Permission is hereby granted, free of charge, to any person obtaining a
  1674. // copy of this software and associated documentation files (the
  1675. // "Software"), to deal in the Software without restriction, including
  1676. // without limitation the rights to use, copy, modify, merge, publish,
  1677. // distribute, sublicense, and/or sell copies of the Software, and to permit
  1678. // persons to whom the Software is furnished to do so, subject to the
  1679. // following conditions:
  1680. //
  1681. // The above copyright notice and this permission notice shall be included
  1682. // in all copies or substantial portions of the Software.
  1683. //
  1684. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  1685. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  1686. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  1687. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  1688. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  1689. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  1690. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  1691. // resolves . and .. elements in a path array with directory names there
  1692. // must be no slashes, empty elements, or device names (c:\) in the array
  1693. // (so also no leading and trailing slashes - it does not distinguish
  1694. // relative and absolute paths)
  1695. function normalizeArray(parts, allowAboveRoot) {
  1696. // if the path tries to go above the root, `up` ends up > 0
  1697. var up = 0;
  1698. for (var i = parts.length - 1; i >= 0; i--) {
  1699. var last = parts[i];
  1700. if (last === '.') {
  1701. parts.splice(i, 1);
  1702. } else if (last === '..') {
  1703. parts.splice(i, 1);
  1704. up++;
  1705. } else if (up) {
  1706. parts.splice(i, 1);
  1707. up--;
  1708. }
  1709. }
  1710. // if the path is allowed to go above the root, restore leading ..s
  1711. if (allowAboveRoot) {
  1712. for (; up--; up) {
  1713. parts.unshift('..');
  1714. }
  1715. }
  1716. return parts;
  1717. }
  1718. // Split a filename into [root, dir, basename, ext], unix version
  1719. // 'root' is just a slash, or nothing.
  1720. var splitPathRe = /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;
  1721. var splitPath = function splitPath(filename) {
  1722. return splitPathRe.exec(filename).slice(1);
  1723. };
  1724. // path.resolve([from ...], to)
  1725. // posix version
  1726. exports.resolve = function () {
  1727. var resolvedPath = '',
  1728. resolvedAbsolute = false;
  1729. for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
  1730. var path = i >= 0 ? arguments[i] : process.cwd();
  1731. // Skip empty and invalid entries
  1732. if (typeof path !== 'string') {
  1733. throw new TypeError('Arguments to path.resolve must be strings');
  1734. } else if (!path) {
  1735. continue;
  1736. }
  1737. resolvedPath = path + '/' + resolvedPath;
  1738. resolvedAbsolute = path.charAt(0) === '/';
  1739. }
  1740. // At this point the path should be resolved to a full absolute path, but
  1741. // handle relative paths to be safe (might happen when process.cwd() fails)
  1742. // Normalize the path
  1743. resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function (p) {
  1744. return !!p;
  1745. }), !resolvedAbsolute).join('/');
  1746. return (resolvedAbsolute ? '/' : '') + resolvedPath || '.';
  1747. };
  1748. // path.normalize(path)
  1749. // posix version
  1750. exports.normalize = function (path) {
  1751. var isAbsolute = exports.isAbsolute(path),
  1752. trailingSlash = substr(path, -1) === '/';
  1753. // Normalize the path
  1754. path = normalizeArray(filter(path.split('/'), function (p) {
  1755. return !!p;
  1756. }), !isAbsolute).join('/');
  1757. if (!path && !isAbsolute) {
  1758. path = '.';
  1759. }
  1760. if (path && trailingSlash) {
  1761. path += '/';
  1762. }
  1763. return (isAbsolute ? '/' : '') + path;
  1764. };
  1765. // posix version
  1766. exports.isAbsolute = function (path) {
  1767. return path.charAt(0) === '/';
  1768. };
  1769. // posix version
  1770. exports.join = function () {
  1771. var paths = Array.prototype.slice.call(arguments, 0);
  1772. return exports.normalize(filter(paths, function (p, index) {
  1773. if (typeof p !== 'string') {
  1774. throw new TypeError('Arguments to path.join must be strings');
  1775. }
  1776. return p;
  1777. }).join('/'));
  1778. };
  1779. // path.relative(from, to)
  1780. // posix version
  1781. exports.relative = function (from, to) {
  1782. from = exports.resolve(from).substr(1);
  1783. to = exports.resolve(to).substr(1);
  1784. function trim(arr) {
  1785. var start = 0;
  1786. for (; start < arr.length; start++) {
  1787. if (arr[start] !== '') break;
  1788. }
  1789. var end = arr.length - 1;
  1790. for (; end >= 0; end--) {
  1791. if (arr[end] !== '') break;
  1792. }
  1793. if (start > end) return [];
  1794. return arr.slice(start, end - start + 1);
  1795. }
  1796. var fromParts = trim(from.split('/'));
  1797. var toParts = trim(to.split('/'));
  1798. var length = Math.min(fromParts.length, toParts.length);
  1799. var samePartsLength = length;
  1800. for (var i = 0; i < length; i++) {
  1801. if (fromParts[i] !== toParts[i]) {
  1802. samePartsLength = i;
  1803. break;
  1804. }
  1805. }
  1806. var outputParts = [];
  1807. for (var i = samePartsLength; i < fromParts.length; i++) {
  1808. outputParts.push('..');
  1809. }
  1810. outputParts = outputParts.concat(toParts.slice(samePartsLength));
  1811. return outputParts.join('/');
  1812. };
  1813. exports.sep = '/';
  1814. exports.delimiter = ':';
  1815. exports.dirname = function (path) {
  1816. var result = splitPath(path),
  1817. root = result[0],
  1818. dir = result[1];
  1819. if (!root && !dir) {
  1820. // No dirname whatsoever
  1821. return '.';
  1822. }
  1823. if (dir) {
  1824. // It has a dirname, strip trailing slash
  1825. dir = dir.substr(0, dir.length - 1);
  1826. }
  1827. return root + dir;
  1828. };
  1829. exports.basename = function (path, ext) {
  1830. var f = splitPath(path)[2];
  1831. // TODO: make this comparison case-insensitive on windows?
  1832. if (ext && f.substr(-1 * ext.length) === ext) {
  1833. f = f.substr(0, f.length - ext.length);
  1834. }
  1835. return f;
  1836. };
  1837. exports.extname = function (path) {
  1838. return splitPath(path)[3];
  1839. };
  1840. function filter(xs, f) {
  1841. if (xs.filter) return xs.filter(f);
  1842. var res = [];
  1843. for (var i = 0; i < xs.length; i++) {
  1844. if (f(xs[i], i, xs)) res.push(xs[i]);
  1845. }
  1846. return res;
  1847. }
  1848. // String.prototype.substr - negative index don't work in IE8
  1849. var substr = 'ab'.substr(-1) === 'b' ? function (str, start, len) {
  1850. return str.substr(start, len);
  1851. } : function (str, start, len) {
  1852. if (start < 0) start = str.length + start;
  1853. return str.substr(start, len);
  1854. };
  1855. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(8)))
  1856. /***/ }),
  1857. /* 20 */
  1858. /***/ (function(module, exports, __webpack_require__) {
  1859. "use strict";
  1860. exports.__esModule = true;
  1861. exports.MESSAGES = undefined;
  1862. var _stringify = __webpack_require__(35);
  1863. var _stringify2 = _interopRequireDefault(_stringify);
  1864. exports.get = get;
  1865. exports.parseArgs = parseArgs;
  1866. var _util = __webpack_require__(117);
  1867. var util = _interopRequireWildcard(_util);
  1868. function _interopRequireWildcard(obj) {
  1869. if (obj && obj.__esModule) {
  1870. return obj;
  1871. } else {
  1872. var newObj = {};if (obj != null) {
  1873. for (var key in obj) {
  1874. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  1875. }
  1876. }newObj.default = obj;return newObj;
  1877. }
  1878. }
  1879. function _interopRequireDefault(obj) {
  1880. return obj && obj.__esModule ? obj : { default: obj };
  1881. }
  1882. var MESSAGES = exports.MESSAGES = {
  1883. tailCallReassignmentDeopt: "Function reference has been reassigned, so it will probably be dereferenced, therefore we can't optimise this with confidence",
  1884. classesIllegalBareSuper: "Illegal use of bare super",
  1885. classesIllegalSuperCall: "Direct super call is illegal in non-constructor, use super.$1() instead",
  1886. scopeDuplicateDeclaration: "Duplicate declaration $1",
  1887. settersNoRest: "Setters aren't allowed to have a rest",
  1888. noAssignmentsInForHead: "No assignments allowed in for-in/of head",
  1889. expectedMemberExpressionOrIdentifier: "Expected type MemberExpression or Identifier",
  1890. invalidParentForThisNode: "We don't know how to handle this node within the current parent - please open an issue",
  1891. readOnly: "$1 is read-only",
  1892. unknownForHead: "Unknown node type $1 in ForStatement",
  1893. didYouMean: "Did you mean $1?",
  1894. codeGeneratorDeopt: "Note: The code generator has deoptimised the styling of $1 as it exceeds the max of $2.",
  1895. missingTemplatesDirectory: "no templates directory - this is most likely the result of a broken `npm publish`. Please report to https://github.com/babel/babel/issues",
  1896. unsupportedOutputType: "Unsupported output type $1",
  1897. illegalMethodName: "Illegal method name $1",
  1898. lostTrackNodePath: "We lost track of this node's position, likely because the AST was directly manipulated",
  1899. modulesIllegalExportName: "Illegal export $1",
  1900. modulesDuplicateDeclarations: "Duplicate module declarations with the same source but in different scopes",
  1901. undeclaredVariable: "Reference to undeclared variable $1",
  1902. undeclaredVariableType: "Referencing a type alias outside of a type annotation",
  1903. undeclaredVariableSuggestion: "Reference to undeclared variable $1 - did you mean $2?",
  1904. traverseNeedsParent: "You must pass a scope and parentPath unless traversing a Program/File. Instead of that you tried to traverse a $1 node without passing scope and parentPath.",
  1905. traverseVerifyRootFunction: "You passed `traverse()` a function when it expected a visitor object, are you sure you didn't mean `{ enter: Function }`?",
  1906. traverseVerifyVisitorProperty: "You passed `traverse()` a visitor object with the property $1 that has the invalid property $2",
  1907. traverseVerifyNodeType: "You gave us a visitor for the node type $1 but it's not a valid type",
  1908. pluginNotObject: "Plugin $2 specified in $1 was expected to return an object when invoked but returned $3",
  1909. pluginNotFunction: "Plugin $2 specified in $1 was expected to return a function but returned $3",
  1910. pluginUnknown: "Unknown plugin $1 specified in $2 at $3, attempted to resolve relative to $4",
  1911. pluginInvalidProperty: "Plugin $2 specified in $1 provided an invalid property of $3"
  1912. };
  1913. function get(key) {
  1914. for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  1915. args[_key - 1] = arguments[_key];
  1916. }
  1917. var msg = MESSAGES[key];
  1918. if (!msg) throw new ReferenceError("Unknown message " + (0, _stringify2.default)(key));
  1919. args = parseArgs(args);
  1920. return msg.replace(/\$(\d+)/g, function (str, i) {
  1921. return args[i - 1];
  1922. });
  1923. }
  1924. function parseArgs(args) {
  1925. return args.map(function (val) {
  1926. if (val != null && val.inspect) {
  1927. return val.inspect();
  1928. } else {
  1929. try {
  1930. return (0, _stringify2.default)(val) || val + "";
  1931. } catch (e) {
  1932. return util.inspect(val);
  1933. }
  1934. }
  1935. });
  1936. }
  1937. /***/ }),
  1938. /* 21 */
  1939. /***/ (function(module, exports, __webpack_require__) {
  1940. 'use strict';
  1941. var isObject = __webpack_require__(16);
  1942. module.exports = function (it) {
  1943. if (!isObject(it)) throw TypeError(it + ' is not an object!');
  1944. return it;
  1945. };
  1946. /***/ }),
  1947. /* 22 */
  1948. /***/ (function(module, exports, __webpack_require__) {
  1949. 'use strict';
  1950. // Thank's IE8 for his funny defineProperty
  1951. module.exports = !__webpack_require__(27)(function () {
  1952. return Object.defineProperty({}, 'a', { get: function get() {
  1953. return 7;
  1954. } }).a != 7;
  1955. });
  1956. /***/ }),
  1957. /* 23 */
  1958. /***/ (function(module, exports, __webpack_require__) {
  1959. 'use strict';
  1960. var anObject = __webpack_require__(21);
  1961. var IE8_DOM_DEFINE = __webpack_require__(231);
  1962. var toPrimitive = __webpack_require__(154);
  1963. var dP = Object.defineProperty;
  1964. exports.f = __webpack_require__(22) ? Object.defineProperty : function defineProperty(O, P, Attributes) {
  1965. anObject(O);
  1966. P = toPrimitive(P, true);
  1967. anObject(Attributes);
  1968. if (IE8_DOM_DEFINE) try {
  1969. return dP(O, P, Attributes);
  1970. } catch (e) {/* empty */}
  1971. if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
  1972. if ('value' in Attributes) O[P] = Attributes.value;
  1973. return O;
  1974. };
  1975. /***/ }),
  1976. /* 24 */
  1977. /***/ (function(module, exports, __webpack_require__) {
  1978. 'use strict';
  1979. var isFunction = __webpack_require__(175),
  1980. isLength = __webpack_require__(176);
  1981. /**
  1982. * Checks if `value` is array-like. A value is considered array-like if it's
  1983. * not a function and has a `value.length` that's an integer greater than or
  1984. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  1985. *
  1986. * @static
  1987. * @memberOf _
  1988. * @since 4.0.0
  1989. * @category Lang
  1990. * @param {*} value The value to check.
  1991. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  1992. * @example
  1993. *
  1994. * _.isArrayLike([1, 2, 3]);
  1995. * // => true
  1996. *
  1997. * _.isArrayLike(document.body.children);
  1998. * // => true
  1999. *
  2000. * _.isArrayLike('abc');
  2001. * // => true
  2002. *
  2003. * _.isArrayLike(_.noop);
  2004. * // => false
  2005. */
  2006. function isArrayLike(value) {
  2007. return value != null && isLength(value.length) && !isFunction(value);
  2008. }
  2009. module.exports = isArrayLike;
  2010. /***/ }),
  2011. /* 25 */
  2012. /***/ (function(module, exports) {
  2013. 'use strict';
  2014. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  2015. /**
  2016. * Checks if `value` is object-like. A value is object-like if it's not `null`
  2017. * and has a `typeof` result of "object".
  2018. *
  2019. * @static
  2020. * @memberOf _
  2021. * @since 4.0.0
  2022. * @category Lang
  2023. * @param {*} value The value to check.
  2024. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  2025. * @example
  2026. *
  2027. * _.isObjectLike({});
  2028. * // => true
  2029. *
  2030. * _.isObjectLike([1, 2, 3]);
  2031. * // => true
  2032. *
  2033. * _.isObjectLike(_.noop);
  2034. * // => false
  2035. *
  2036. * _.isObjectLike(null);
  2037. * // => false
  2038. */
  2039. function isObjectLike(value) {
  2040. return value != null && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) == 'object';
  2041. }
  2042. module.exports = isObjectLike;
  2043. /***/ }),
  2044. /* 26 */
  2045. /***/ (function(module, exports, __webpack_require__) {
  2046. "use strict";
  2047. exports.__esModule = true;
  2048. exports.DEPRECATED_KEYS = exports.BUILDER_KEYS = exports.NODE_FIELDS = exports.ALIAS_KEYS = exports.VISITOR_KEYS = undefined;
  2049. var _getIterator2 = __webpack_require__(2);
  2050. var _getIterator3 = _interopRequireDefault(_getIterator2);
  2051. var _stringify = __webpack_require__(35);
  2052. var _stringify2 = _interopRequireDefault(_stringify);
  2053. var _typeof2 = __webpack_require__(11);
  2054. var _typeof3 = _interopRequireDefault(_typeof2);
  2055. exports.assertEach = assertEach;
  2056. exports.assertOneOf = assertOneOf;
  2057. exports.assertNodeType = assertNodeType;
  2058. exports.assertNodeOrValueType = assertNodeOrValueType;
  2059. exports.assertValueType = assertValueType;
  2060. exports.chain = chain;
  2061. exports.default = defineType;
  2062. var _index = __webpack_require__(1);
  2063. var t = _interopRequireWildcard(_index);
  2064. function _interopRequireWildcard(obj) {
  2065. if (obj && obj.__esModule) {
  2066. return obj;
  2067. } else {
  2068. var newObj = {};if (obj != null) {
  2069. for (var key in obj) {
  2070. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  2071. }
  2072. }newObj.default = obj;return newObj;
  2073. }
  2074. }
  2075. function _interopRequireDefault(obj) {
  2076. return obj && obj.__esModule ? obj : { default: obj };
  2077. }
  2078. var VISITOR_KEYS = exports.VISITOR_KEYS = {};
  2079. var ALIAS_KEYS = exports.ALIAS_KEYS = {};
  2080. var NODE_FIELDS = exports.NODE_FIELDS = {};
  2081. var BUILDER_KEYS = exports.BUILDER_KEYS = {};
  2082. var DEPRECATED_KEYS = exports.DEPRECATED_KEYS = {};
  2083. function getType(val) {
  2084. if (Array.isArray(val)) {
  2085. return "array";
  2086. } else if (val === null) {
  2087. return "null";
  2088. } else if (val === undefined) {
  2089. return "undefined";
  2090. } else {
  2091. return typeof val === "undefined" ? "undefined" : (0, _typeof3.default)(val);
  2092. }
  2093. }
  2094. function assertEach(callback) {
  2095. function validator(node, key, val) {
  2096. if (!Array.isArray(val)) return;
  2097. for (var i = 0; i < val.length; i++) {
  2098. callback(node, key + "[" + i + "]", val[i]);
  2099. }
  2100. }
  2101. validator.each = callback;
  2102. return validator;
  2103. }
  2104. function assertOneOf() {
  2105. for (var _len = arguments.length, vals = Array(_len), _key = 0; _key < _len; _key++) {
  2106. vals[_key] = arguments[_key];
  2107. }
  2108. function validate(node, key, val) {
  2109. if (vals.indexOf(val) < 0) {
  2110. throw new TypeError("Property " + key + " expected value to be one of " + (0, _stringify2.default)(vals) + " but got " + (0, _stringify2.default)(val));
  2111. }
  2112. }
  2113. validate.oneOf = vals;
  2114. return validate;
  2115. }
  2116. function assertNodeType() {
  2117. for (var _len2 = arguments.length, types = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  2118. types[_key2] = arguments[_key2];
  2119. }
  2120. function validate(node, key, val) {
  2121. var valid = false;
  2122. for (var _iterator = types, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
  2123. var _ref;
  2124. if (_isArray) {
  2125. if (_i >= _iterator.length) break;
  2126. _ref = _iterator[_i++];
  2127. } else {
  2128. _i = _iterator.next();
  2129. if (_i.done) break;
  2130. _ref = _i.value;
  2131. }
  2132. var type = _ref;
  2133. if (t.is(type, val)) {
  2134. valid = true;
  2135. break;
  2136. }
  2137. }
  2138. if (!valid) {
  2139. throw new TypeError("Property " + key + " of " + node.type + " expected node to be of a type " + (0, _stringify2.default)(types) + " " + ("but instead got " + (0, _stringify2.default)(val && val.type)));
  2140. }
  2141. }
  2142. validate.oneOfNodeTypes = types;
  2143. return validate;
  2144. }
  2145. function assertNodeOrValueType() {
  2146. for (var _len3 = arguments.length, types = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
  2147. types[_key3] = arguments[_key3];
  2148. }
  2149. function validate(node, key, val) {
  2150. var valid = false;
  2151. for (var _iterator2 = types, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) {
  2152. var _ref2;
  2153. if (_isArray2) {
  2154. if (_i2 >= _iterator2.length) break;
  2155. _ref2 = _iterator2[_i2++];
  2156. } else {
  2157. _i2 = _iterator2.next();
  2158. if (_i2.done) break;
  2159. _ref2 = _i2.value;
  2160. }
  2161. var type = _ref2;
  2162. if (getType(val) === type || t.is(type, val)) {
  2163. valid = true;
  2164. break;
  2165. }
  2166. }
  2167. if (!valid) {
  2168. throw new TypeError("Property " + key + " of " + node.type + " expected node to be of a type " + (0, _stringify2.default)(types) + " " + ("but instead got " + (0, _stringify2.default)(val && val.type)));
  2169. }
  2170. }
  2171. validate.oneOfNodeOrValueTypes = types;
  2172. return validate;
  2173. }
  2174. function assertValueType(type) {
  2175. function validate(node, key, val) {
  2176. var valid = getType(val) === type;
  2177. if (!valid) {
  2178. throw new TypeError("Property " + key + " expected type of " + type + " but got " + getType(val));
  2179. }
  2180. }
  2181. validate.type = type;
  2182. return validate;
  2183. }
  2184. function chain() {
  2185. for (var _len4 = arguments.length, fns = Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
  2186. fns[_key4] = arguments[_key4];
  2187. }
  2188. function validate() {
  2189. for (var _iterator3 = fns, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) {
  2190. var _ref3;
  2191. if (_isArray3) {
  2192. if (_i3 >= _iterator3.length) break;
  2193. _ref3 = _iterator3[_i3++];
  2194. } else {
  2195. _i3 = _iterator3.next();
  2196. if (_i3.done) break;
  2197. _ref3 = _i3.value;
  2198. }
  2199. var fn = _ref3;
  2200. fn.apply(undefined, arguments);
  2201. }
  2202. }
  2203. validate.chainOf = fns;
  2204. return validate;
  2205. }
  2206. function defineType(type) {
  2207. var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  2208. var inherits = opts.inherits && store[opts.inherits] || {};
  2209. opts.fields = opts.fields || inherits.fields || {};
  2210. opts.visitor = opts.visitor || inherits.visitor || [];
  2211. opts.aliases = opts.aliases || inherits.aliases || [];
  2212. opts.builder = opts.builder || inherits.builder || opts.visitor || [];
  2213. if (opts.deprecatedAlias) {
  2214. DEPRECATED_KEYS[opts.deprecatedAlias] = type;
  2215. }
  2216. for (var _iterator4 = opts.visitor.concat(opts.builder), _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, _getIterator3.default)(_iterator4);;) {
  2217. var _ref4;
  2218. if (_isArray4) {
  2219. if (_i4 >= _iterator4.length) break;
  2220. _ref4 = _iterator4[_i4++];
  2221. } else {
  2222. _i4 = _iterator4.next();
  2223. if (_i4.done) break;
  2224. _ref4 = _i4.value;
  2225. }
  2226. var _key5 = _ref4;
  2227. opts.fields[_key5] = opts.fields[_key5] || {};
  2228. }
  2229. for (var key in opts.fields) {
  2230. var field = opts.fields[key];
  2231. if (opts.builder.indexOf(key) === -1) {
  2232. field.optional = true;
  2233. }
  2234. if (field.default === undefined) {
  2235. field.default = null;
  2236. } else if (!field.validate) {
  2237. field.validate = assertValueType(getType(field.default));
  2238. }
  2239. }
  2240. VISITOR_KEYS[type] = opts.visitor;
  2241. BUILDER_KEYS[type] = opts.builder;
  2242. NODE_FIELDS[type] = opts.fields;
  2243. ALIAS_KEYS[type] = opts.aliases;
  2244. store[type] = opts;
  2245. }
  2246. var store = {};
  2247. /***/ }),
  2248. /* 27 */
  2249. /***/ (function(module, exports) {
  2250. "use strict";
  2251. module.exports = function (exec) {
  2252. try {
  2253. return !!exec();
  2254. } catch (e) {
  2255. return true;
  2256. }
  2257. };
  2258. /***/ }),
  2259. /* 28 */
  2260. /***/ (function(module, exports) {
  2261. "use strict";
  2262. var hasOwnProperty = {}.hasOwnProperty;
  2263. module.exports = function (it, key) {
  2264. return hasOwnProperty.call(it, key);
  2265. };
  2266. /***/ }),
  2267. /* 29 */
  2268. /***/ (function(module, exports, __webpack_require__) {
  2269. 'use strict';
  2270. var dP = __webpack_require__(23);
  2271. var createDesc = __webpack_require__(92);
  2272. module.exports = __webpack_require__(22) ? function (object, key, value) {
  2273. return dP.f(object, key, createDesc(1, value));
  2274. } : function (object, key, value) {
  2275. object[key] = value;
  2276. return object;
  2277. };
  2278. /***/ }),
  2279. /* 30 */
  2280. /***/ (function(module, exports, __webpack_require__) {
  2281. 'use strict';
  2282. var _Symbol = __webpack_require__(45),
  2283. getRawTag = __webpack_require__(534),
  2284. objectToString = __webpack_require__(559);
  2285. /** `Object#toString` result references. */
  2286. var nullTag = '[object Null]',
  2287. undefinedTag = '[object Undefined]';
  2288. /** Built-in value references. */
  2289. var symToStringTag = _Symbol ? _Symbol.toStringTag : undefined;
  2290. /**
  2291. * The base implementation of `getTag` without fallbacks for buggy environments.
  2292. *
  2293. * @private
  2294. * @param {*} value The value to query.
  2295. * @returns {string} Returns the `toStringTag`.
  2296. */
  2297. function baseGetTag(value) {
  2298. if (value == null) {
  2299. return value === undefined ? undefinedTag : nullTag;
  2300. }
  2301. return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
  2302. }
  2303. module.exports = baseGetTag;
  2304. /***/ }),
  2305. /* 31 */
  2306. /***/ (function(module, exports, __webpack_require__) {
  2307. 'use strict';
  2308. var assignValue = __webpack_require__(162),
  2309. baseAssignValue = __webpack_require__(163);
  2310. /**
  2311. * Copies properties of `source` to `object`.
  2312. *
  2313. * @private
  2314. * @param {Object} source The object to copy properties from.
  2315. * @param {Array} props The property identifiers to copy.
  2316. * @param {Object} [object={}] The object to copy properties to.
  2317. * @param {Function} [customizer] The function to customize copied values.
  2318. * @returns {Object} Returns `object`.
  2319. */
  2320. function copyObject(source, props, object, customizer) {
  2321. var isNew = !object;
  2322. object || (object = {});
  2323. var index = -1,
  2324. length = props.length;
  2325. while (++index < length) {
  2326. var key = props[index];
  2327. var newValue = customizer ? customizer(object[key], source[key], key, object, source) : undefined;
  2328. if (newValue === undefined) {
  2329. newValue = source[key];
  2330. }
  2331. if (isNew) {
  2332. baseAssignValue(object, key, newValue);
  2333. } else {
  2334. assignValue(object, key, newValue);
  2335. }
  2336. }
  2337. return object;
  2338. }
  2339. module.exports = copyObject;
  2340. /***/ }),
  2341. /* 32 */
  2342. /***/ (function(module, exports, __webpack_require__) {
  2343. 'use strict';
  2344. var arrayLikeKeys = __webpack_require__(245),
  2345. baseKeys = __webpack_require__(500),
  2346. isArrayLike = __webpack_require__(24);
  2347. /**
  2348. * Creates an array of the own enumerable property names of `object`.
  2349. *
  2350. * **Note:** Non-object values are coerced to objects. See the
  2351. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  2352. * for more details.
  2353. *
  2354. * @static
  2355. * @since 0.1.0
  2356. * @memberOf _
  2357. * @category Object
  2358. * @param {Object} object The object to query.
  2359. * @returns {Array} Returns the array of property names.
  2360. * @example
  2361. *
  2362. * function Foo() {
  2363. * this.a = 1;
  2364. * this.b = 2;
  2365. * }
  2366. *
  2367. * Foo.prototype.c = 3;
  2368. *
  2369. * _.keys(new Foo);
  2370. * // => ['a', 'b'] (iteration order is not guaranteed)
  2371. *
  2372. * _.keys('hi');
  2373. * // => ['0', '1']
  2374. */
  2375. function keys(object) {
  2376. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  2377. }
  2378. module.exports = keys;
  2379. /***/ }),
  2380. /* 33 */
  2381. /***/ (function(module, exports) {
  2382. "use strict";
  2383. module.exports = {
  2384. filename: {
  2385. type: "filename",
  2386. description: "filename to use when reading from stdin - this will be used in source-maps, errors etc",
  2387. default: "unknown",
  2388. shorthand: "f"
  2389. },
  2390. filenameRelative: {
  2391. hidden: true,
  2392. type: "string"
  2393. },
  2394. inputSourceMap: {
  2395. hidden: true
  2396. },
  2397. env: {
  2398. hidden: true,
  2399. default: {}
  2400. },
  2401. mode: {
  2402. description: "",
  2403. hidden: true
  2404. },
  2405. retainLines: {
  2406. type: "boolean",
  2407. default: false,
  2408. description: "retain line numbers - will result in really ugly code"
  2409. },
  2410. highlightCode: {
  2411. description: "enable/disable ANSI syntax highlighting of code frames (on by default)",
  2412. type: "boolean",
  2413. default: true
  2414. },
  2415. suppressDeprecationMessages: {
  2416. type: "boolean",
  2417. default: false,
  2418. hidden: true
  2419. },
  2420. presets: {
  2421. type: "list",
  2422. description: "",
  2423. default: []
  2424. },
  2425. plugins: {
  2426. type: "list",
  2427. default: [],
  2428. description: ""
  2429. },
  2430. ignore: {
  2431. type: "list",
  2432. description: "list of glob paths to **not** compile",
  2433. default: []
  2434. },
  2435. only: {
  2436. type: "list",
  2437. description: "list of glob paths to **only** compile"
  2438. },
  2439. code: {
  2440. hidden: true,
  2441. default: true,
  2442. type: "boolean"
  2443. },
  2444. metadata: {
  2445. hidden: true,
  2446. default: true,
  2447. type: "boolean"
  2448. },
  2449. ast: {
  2450. hidden: true,
  2451. default: true,
  2452. type: "boolean"
  2453. },
  2454. extends: {
  2455. type: "string",
  2456. hidden: true
  2457. },
  2458. comments: {
  2459. type: "boolean",
  2460. default: true,
  2461. description: "write comments to generated output (true by default)"
  2462. },
  2463. shouldPrintComment: {
  2464. hidden: true,
  2465. description: "optional callback to control whether a comment should be inserted, when this is used the comments option is ignored"
  2466. },
  2467. wrapPluginVisitorMethod: {
  2468. hidden: true,
  2469. description: "optional callback to wrap all visitor methods"
  2470. },
  2471. compact: {
  2472. type: "booleanString",
  2473. default: "auto",
  2474. description: "do not include superfluous whitespace characters and line terminators [true|false|auto]"
  2475. },
  2476. minified: {
  2477. type: "boolean",
  2478. default: false,
  2479. description: "save as much bytes when printing [true|false]"
  2480. },
  2481. sourceMap: {
  2482. alias: "sourceMaps",
  2483. hidden: true
  2484. },
  2485. sourceMaps: {
  2486. type: "booleanString",
  2487. description: "[true|false|inline]",
  2488. default: false,
  2489. shorthand: "s"
  2490. },
  2491. sourceMapTarget: {
  2492. type: "string",
  2493. description: "set `file` on returned source map"
  2494. },
  2495. sourceFileName: {
  2496. type: "string",
  2497. description: "set `sources[0]` on returned source map"
  2498. },
  2499. sourceRoot: {
  2500. type: "filename",
  2501. description: "the root from which all sources are relative"
  2502. },
  2503. babelrc: {
  2504. description: "Whether or not to look up .babelrc and .babelignore files",
  2505. type: "boolean",
  2506. default: true
  2507. },
  2508. sourceType: {
  2509. description: "",
  2510. default: "module"
  2511. },
  2512. auxiliaryCommentBefore: {
  2513. type: "string",
  2514. description: "print a comment before any injected non-user code"
  2515. },
  2516. auxiliaryCommentAfter: {
  2517. type: "string",
  2518. description: "print a comment after any injected non-user code"
  2519. },
  2520. resolveModuleSource: {
  2521. hidden: true
  2522. },
  2523. getModuleId: {
  2524. hidden: true
  2525. },
  2526. moduleRoot: {
  2527. type: "filename",
  2528. description: "optional prefix for the AMD module formatter that will be prepend to the filename on module definitions"
  2529. },
  2530. moduleIds: {
  2531. type: "boolean",
  2532. default: false,
  2533. shorthand: "M",
  2534. description: "insert an explicit id for modules"
  2535. },
  2536. moduleId: {
  2537. description: "specify a custom name for module ids",
  2538. type: "string"
  2539. },
  2540. passPerPreset: {
  2541. description: "Whether to spawn a traversal pass per a preset. By default all presets are merged.",
  2542. type: "boolean",
  2543. default: false,
  2544. hidden: true
  2545. },
  2546. parserOpts: {
  2547. description: "Options to pass into the parser, or to change parsers (parserOpts.parser)",
  2548. default: false
  2549. },
  2550. generatorOpts: {
  2551. description: "Options to pass into the generator, or to change generators (generatorOpts.generator)",
  2552. default: false
  2553. }
  2554. };
  2555. /***/ }),
  2556. /* 34 */
  2557. /***/ (function(module, exports, __webpack_require__) {
  2558. /* WEBPACK VAR INJECTION */(function(process) {"use strict";
  2559. exports.__esModule = true;
  2560. var _objectWithoutProperties2 = __webpack_require__(366);
  2561. var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);
  2562. var _stringify = __webpack_require__(35);
  2563. var _stringify2 = _interopRequireDefault(_stringify);
  2564. var _assign = __webpack_require__(87);
  2565. var _assign2 = _interopRequireDefault(_assign);
  2566. var _getIterator2 = __webpack_require__(2);
  2567. var _getIterator3 = _interopRequireDefault(_getIterator2);
  2568. var _typeof2 = __webpack_require__(11);
  2569. var _typeof3 = _interopRequireDefault(_typeof2);
  2570. var _classCallCheck2 = __webpack_require__(3);
  2571. var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
  2572. var _node = __webpack_require__(182);
  2573. var context = _interopRequireWildcard(_node);
  2574. var _plugin2 = __webpack_require__(65);
  2575. var _plugin3 = _interopRequireDefault(_plugin2);
  2576. var _babelMessages = __webpack_require__(20);
  2577. var messages = _interopRequireWildcard(_babelMessages);
  2578. var _index = __webpack_require__(52);
  2579. var _resolvePlugin = __webpack_require__(184);
  2580. var _resolvePlugin2 = _interopRequireDefault(_resolvePlugin);
  2581. var _resolvePreset = __webpack_require__(185);
  2582. var _resolvePreset2 = _interopRequireDefault(_resolvePreset);
  2583. var _cloneDeepWith = __webpack_require__(575);
  2584. var _cloneDeepWith2 = _interopRequireDefault(_cloneDeepWith);
  2585. var _clone = __webpack_require__(109);
  2586. var _clone2 = _interopRequireDefault(_clone);
  2587. var _merge = __webpack_require__(293);
  2588. var _merge2 = _interopRequireDefault(_merge);
  2589. var _config2 = __webpack_require__(33);
  2590. var _config3 = _interopRequireDefault(_config2);
  2591. var _removed = __webpack_require__(54);
  2592. var _removed2 = _interopRequireDefault(_removed);
  2593. var _buildConfigChain = __webpack_require__(51);
  2594. var _buildConfigChain2 = _interopRequireDefault(_buildConfigChain);
  2595. var _path = __webpack_require__(19);
  2596. var _path2 = _interopRequireDefault(_path);
  2597. function _interopRequireWildcard(obj) {
  2598. if (obj && obj.__esModule) {
  2599. return obj;
  2600. } else {
  2601. var newObj = {};if (obj != null) {
  2602. for (var key in obj) {
  2603. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  2604. }
  2605. }newObj.default = obj;return newObj;
  2606. }
  2607. }
  2608. function _interopRequireDefault(obj) {
  2609. return obj && obj.__esModule ? obj : { default: obj };
  2610. }
  2611. var OptionManager = function () {
  2612. function OptionManager(log) {
  2613. (0, _classCallCheck3.default)(this, OptionManager);
  2614. this.resolvedConfigs = [];
  2615. this.options = OptionManager.createBareOptions();
  2616. this.log = log;
  2617. }
  2618. OptionManager.memoisePluginContainer = function memoisePluginContainer(fn, loc, i, alias) {
  2619. for (var _iterator = OptionManager.memoisedPlugins, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
  2620. var _ref;
  2621. if (_isArray) {
  2622. if (_i >= _iterator.length) break;
  2623. _ref = _iterator[_i++];
  2624. } else {
  2625. _i = _iterator.next();
  2626. if (_i.done) break;
  2627. _ref = _i.value;
  2628. }
  2629. var cache = _ref;
  2630. if (cache.container === fn) return cache.plugin;
  2631. }
  2632. var obj = void 0;
  2633. if (typeof fn === "function") {
  2634. obj = fn(context);
  2635. } else {
  2636. obj = fn;
  2637. }
  2638. if ((typeof obj === "undefined" ? "undefined" : (0, _typeof3.default)(obj)) === "object") {
  2639. var _plugin = new _plugin3.default(obj, alias);
  2640. OptionManager.memoisedPlugins.push({
  2641. container: fn,
  2642. plugin: _plugin
  2643. });
  2644. return _plugin;
  2645. } else {
  2646. throw new TypeError(messages.get("pluginNotObject", loc, i, typeof obj === "undefined" ? "undefined" : (0, _typeof3.default)(obj)) + loc + i);
  2647. }
  2648. };
  2649. OptionManager.createBareOptions = function createBareOptions() {
  2650. var opts = {};
  2651. for (var _key in _config3.default) {
  2652. var opt = _config3.default[_key];
  2653. opts[_key] = (0, _clone2.default)(opt.default);
  2654. }
  2655. return opts;
  2656. };
  2657. OptionManager.normalisePlugin = function normalisePlugin(plugin, loc, i, alias) {
  2658. plugin = plugin.__esModule ? plugin.default : plugin;
  2659. if (!(plugin instanceof _plugin3.default)) {
  2660. if (typeof plugin === "function" || (typeof plugin === "undefined" ? "undefined" : (0, _typeof3.default)(plugin)) === "object") {
  2661. plugin = OptionManager.memoisePluginContainer(plugin, loc, i, alias);
  2662. } else {
  2663. throw new TypeError(messages.get("pluginNotFunction", loc, i, typeof plugin === "undefined" ? "undefined" : (0, _typeof3.default)(plugin)));
  2664. }
  2665. }
  2666. plugin.init(loc, i);
  2667. return plugin;
  2668. };
  2669. OptionManager.normalisePlugins = function normalisePlugins(loc, dirname, plugins) {
  2670. return plugins.map(function (val, i) {
  2671. var plugin = void 0,
  2672. options = void 0;
  2673. if (!val) {
  2674. throw new TypeError("Falsy value found in plugins");
  2675. }
  2676. if (Array.isArray(val)) {
  2677. plugin = val[0];
  2678. options = val[1];
  2679. } else {
  2680. plugin = val;
  2681. }
  2682. var alias = typeof plugin === "string" ? plugin : loc + "$" + i;
  2683. if (typeof plugin === "string") {
  2684. var pluginLoc = (0, _resolvePlugin2.default)(plugin, dirname);
  2685. if (pluginLoc) {
  2686. plugin = __webpack_require__(179)(pluginLoc);
  2687. } else {
  2688. throw new ReferenceError(messages.get("pluginUnknown", plugin, loc, i, dirname));
  2689. }
  2690. }
  2691. plugin = OptionManager.normalisePlugin(plugin, loc, i, alias);
  2692. return [plugin, options];
  2693. });
  2694. };
  2695. OptionManager.prototype.mergeOptions = function mergeOptions(_ref2) {
  2696. var _this = this;
  2697. var rawOpts = _ref2.options,
  2698. extendingOpts = _ref2.extending,
  2699. alias = _ref2.alias,
  2700. loc = _ref2.loc,
  2701. dirname = _ref2.dirname;
  2702. alias = alias || "foreign";
  2703. if (!rawOpts) return;
  2704. if ((typeof rawOpts === "undefined" ? "undefined" : (0, _typeof3.default)(rawOpts)) !== "object" || Array.isArray(rawOpts)) {
  2705. this.log.error("Invalid options type for " + alias, TypeError);
  2706. }
  2707. var opts = (0, _cloneDeepWith2.default)(rawOpts, function (val) {
  2708. if (val instanceof _plugin3.default) {
  2709. return val;
  2710. }
  2711. });
  2712. dirname = dirname || process.cwd();
  2713. loc = loc || alias;
  2714. for (var _key2 in opts) {
  2715. var option = _config3.default[_key2];
  2716. if (!option && this.log) {
  2717. if (_removed2.default[_key2]) {
  2718. this.log.error("Using removed Babel 5 option: " + alias + "." + _key2 + " - " + _removed2.default[_key2].message, ReferenceError);
  2719. } else {
  2720. var unknownOptErr = "Unknown option: " + alias + "." + _key2 + ". Check out http://babeljs.io/docs/usage/options/ for more information about options.";
  2721. var presetConfigErr = "A common cause of this error is the presence of a configuration options object without the corresponding preset name. Example:\n\nInvalid:\n `{ presets: [{option: value}] }`\nValid:\n `{ presets: [['presetName', {option: value}]] }`\n\nFor more detailed information on preset configuration, please see http://babeljs.io/docs/plugins/#pluginpresets-options.";
  2722. this.log.error(unknownOptErr + "\n\n" + presetConfigErr, ReferenceError);
  2723. }
  2724. }
  2725. }
  2726. (0, _index.normaliseOptions)(opts);
  2727. if (opts.plugins) {
  2728. opts.plugins = OptionManager.normalisePlugins(loc, dirname, opts.plugins);
  2729. }
  2730. if (opts.presets) {
  2731. if (opts.passPerPreset) {
  2732. opts.presets = this.resolvePresets(opts.presets, dirname, function (preset, presetLoc) {
  2733. _this.mergeOptions({
  2734. options: preset,
  2735. extending: preset,
  2736. alias: presetLoc,
  2737. loc: presetLoc,
  2738. dirname: dirname
  2739. });
  2740. });
  2741. } else {
  2742. this.mergePresets(opts.presets, dirname);
  2743. delete opts.presets;
  2744. }
  2745. }
  2746. if (rawOpts === extendingOpts) {
  2747. (0, _assign2.default)(extendingOpts, opts);
  2748. } else {
  2749. (0, _merge2.default)(extendingOpts || this.options, opts);
  2750. }
  2751. };
  2752. OptionManager.prototype.mergePresets = function mergePresets(presets, dirname) {
  2753. var _this2 = this;
  2754. this.resolvePresets(presets, dirname, function (presetOpts, presetLoc) {
  2755. _this2.mergeOptions({
  2756. options: presetOpts,
  2757. alias: presetLoc,
  2758. loc: presetLoc,
  2759. dirname: _path2.default.dirname(presetLoc || "")
  2760. });
  2761. });
  2762. };
  2763. OptionManager.prototype.resolvePresets = function resolvePresets(presets, dirname, onResolve) {
  2764. return presets.map(function (val) {
  2765. var options = void 0;
  2766. if (Array.isArray(val)) {
  2767. if (val.length > 2) {
  2768. throw new Error("Unexpected extra options " + (0, _stringify2.default)(val.slice(2)) + " passed to preset.");
  2769. }
  2770. var _val = val;
  2771. val = _val[0];
  2772. options = _val[1];
  2773. }
  2774. var presetLoc = void 0;
  2775. try {
  2776. if (typeof val === "string") {
  2777. presetLoc = (0, _resolvePreset2.default)(val, dirname);
  2778. if (!presetLoc) {
  2779. throw new Error("Couldn't find preset " + (0, _stringify2.default)(val) + " relative to directory " + (0, _stringify2.default)(dirname));
  2780. }
  2781. val = __webpack_require__(179)(presetLoc);
  2782. }
  2783. if ((typeof val === "undefined" ? "undefined" : (0, _typeof3.default)(val)) === "object" && val.__esModule) {
  2784. if (val.default) {
  2785. val = val.default;
  2786. } else {
  2787. var _val2 = val,
  2788. __esModule = _val2.__esModule,
  2789. rest = (0, _objectWithoutProperties3.default)(_val2, ["__esModule"]);
  2790. val = rest;
  2791. }
  2792. }
  2793. if ((typeof val === "undefined" ? "undefined" : (0, _typeof3.default)(val)) === "object" && val.buildPreset) val = val.buildPreset;
  2794. if (typeof val !== "function" && options !== undefined) {
  2795. throw new Error("Options " + (0, _stringify2.default)(options) + " passed to " + (presetLoc || "a preset") + " which does not accept options.");
  2796. }
  2797. if (typeof val === "function") val = val(context, options, { dirname: dirname });
  2798. if ((typeof val === "undefined" ? "undefined" : (0, _typeof3.default)(val)) !== "object") {
  2799. throw new Error("Unsupported preset format: " + val + ".");
  2800. }
  2801. onResolve && onResolve(val, presetLoc);
  2802. } catch (e) {
  2803. if (presetLoc) {
  2804. e.message += " (While processing preset: " + (0, _stringify2.default)(presetLoc) + ")";
  2805. }
  2806. throw e;
  2807. }
  2808. return val;
  2809. });
  2810. };
  2811. OptionManager.prototype.normaliseOptions = function normaliseOptions() {
  2812. var opts = this.options;
  2813. for (var _key3 in _config3.default) {
  2814. var option = _config3.default[_key3];
  2815. var val = opts[_key3];
  2816. if (!val && option.optional) continue;
  2817. if (option.alias) {
  2818. opts[option.alias] = opts[option.alias] || val;
  2819. } else {
  2820. opts[_key3] = val;
  2821. }
  2822. }
  2823. };
  2824. OptionManager.prototype.init = function init() {
  2825. var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  2826. for (var _iterator2 = (0, _buildConfigChain2.default)(opts, this.log), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) {
  2827. var _ref3;
  2828. if (_isArray2) {
  2829. if (_i2 >= _iterator2.length) break;
  2830. _ref3 = _iterator2[_i2++];
  2831. } else {
  2832. _i2 = _iterator2.next();
  2833. if (_i2.done) break;
  2834. _ref3 = _i2.value;
  2835. }
  2836. var _config = _ref3;
  2837. this.mergeOptions(_config);
  2838. }
  2839. this.normaliseOptions(opts);
  2840. return this.options;
  2841. };
  2842. return OptionManager;
  2843. }();
  2844. exports.default = OptionManager;
  2845. OptionManager.memoisedPlugins = [];
  2846. module.exports = exports["default"];
  2847. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(8)))
  2848. /***/ }),
  2849. /* 35 */
  2850. /***/ (function(module, exports, __webpack_require__) {
  2851. "use strict";
  2852. module.exports = { "default": __webpack_require__(405), __esModule: true };
  2853. /***/ }),
  2854. /* 36 */
  2855. /***/ (function(module, exports, __webpack_require__) {
  2856. "use strict";
  2857. exports.__esModule = true;
  2858. var _getIterator2 = __webpack_require__(2);
  2859. var _getIterator3 = _interopRequireDefault(_getIterator2);
  2860. var _classCallCheck2 = __webpack_require__(3);
  2861. var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
  2862. var _virtualTypes = __webpack_require__(224);
  2863. var virtualTypes = _interopRequireWildcard(_virtualTypes);
  2864. var _debug2 = __webpack_require__(239);
  2865. var _debug3 = _interopRequireDefault(_debug2);
  2866. var _invariant = __webpack_require__(466);
  2867. var _invariant2 = _interopRequireDefault(_invariant);
  2868. var _index = __webpack_require__(7);
  2869. var _index2 = _interopRequireDefault(_index);
  2870. var _assign = __webpack_require__(174);
  2871. var _assign2 = _interopRequireDefault(_assign);
  2872. var _scope = __webpack_require__(134);
  2873. var _scope2 = _interopRequireDefault(_scope);
  2874. var _babelTypes = __webpack_require__(1);
  2875. var t = _interopRequireWildcard(_babelTypes);
  2876. var _cache = __webpack_require__(88);
  2877. function _interopRequireWildcard(obj) {
  2878. if (obj && obj.__esModule) {
  2879. return obj;
  2880. } else {
  2881. var newObj = {};if (obj != null) {
  2882. for (var key in obj) {
  2883. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  2884. }
  2885. }newObj.default = obj;return newObj;
  2886. }
  2887. }
  2888. function _interopRequireDefault(obj) {
  2889. return obj && obj.__esModule ? obj : { default: obj };
  2890. }
  2891. var _debug = (0, _debug3.default)("babel");
  2892. var NodePath = function () {
  2893. function NodePath(hub, parent) {
  2894. (0, _classCallCheck3.default)(this, NodePath);
  2895. this.parent = parent;
  2896. this.hub = hub;
  2897. this.contexts = [];
  2898. this.data = {};
  2899. this.shouldSkip = false;
  2900. this.shouldStop = false;
  2901. this.removed = false;
  2902. this.state = null;
  2903. this.opts = null;
  2904. this.skipKeys = null;
  2905. this.parentPath = null;
  2906. this.context = null;
  2907. this.container = null;
  2908. this.listKey = null;
  2909. this.inList = false;
  2910. this.parentKey = null;
  2911. this.key = null;
  2912. this.node = null;
  2913. this.scope = null;
  2914. this.type = null;
  2915. this.typeAnnotation = null;
  2916. }
  2917. NodePath.get = function get(_ref) {
  2918. var hub = _ref.hub,
  2919. parentPath = _ref.parentPath,
  2920. parent = _ref.parent,
  2921. container = _ref.container,
  2922. listKey = _ref.listKey,
  2923. key = _ref.key;
  2924. if (!hub && parentPath) {
  2925. hub = parentPath.hub;
  2926. }
  2927. (0, _invariant2.default)(parent, "To get a node path the parent needs to exist");
  2928. var targetNode = container[key];
  2929. var paths = _cache.path.get(parent) || [];
  2930. if (!_cache.path.has(parent)) {
  2931. _cache.path.set(parent, paths);
  2932. }
  2933. var path = void 0;
  2934. for (var i = 0; i < paths.length; i++) {
  2935. var pathCheck = paths[i];
  2936. if (pathCheck.node === targetNode) {
  2937. path = pathCheck;
  2938. break;
  2939. }
  2940. }
  2941. if (!path) {
  2942. path = new NodePath(hub, parent);
  2943. paths.push(path);
  2944. }
  2945. path.setup(parentPath, container, listKey, key);
  2946. return path;
  2947. };
  2948. NodePath.prototype.getScope = function getScope(scope) {
  2949. var ourScope = scope;
  2950. if (this.isScope()) {
  2951. ourScope = new _scope2.default(this, scope);
  2952. }
  2953. return ourScope;
  2954. };
  2955. NodePath.prototype.setData = function setData(key, val) {
  2956. return this.data[key] = val;
  2957. };
  2958. NodePath.prototype.getData = function getData(key, def) {
  2959. var val = this.data[key];
  2960. if (!val && def) val = this.data[key] = def;
  2961. return val;
  2962. };
  2963. NodePath.prototype.buildCodeFrameError = function buildCodeFrameError(msg) {
  2964. var Error = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : SyntaxError;
  2965. return this.hub.file.buildCodeFrameError(this.node, msg, Error);
  2966. };
  2967. NodePath.prototype.traverse = function traverse(visitor, state) {
  2968. (0, _index2.default)(this.node, visitor, this.scope, state, this);
  2969. };
  2970. NodePath.prototype.mark = function mark(type, message) {
  2971. this.hub.file.metadata.marked.push({
  2972. type: type,
  2973. message: message,
  2974. loc: this.node.loc
  2975. });
  2976. };
  2977. NodePath.prototype.set = function set(key, node) {
  2978. t.validate(this.node, key, node);
  2979. this.node[key] = node;
  2980. };
  2981. NodePath.prototype.getPathLocation = function getPathLocation() {
  2982. var parts = [];
  2983. var path = this;
  2984. do {
  2985. var key = path.key;
  2986. if (path.inList) key = path.listKey + "[" + key + "]";
  2987. parts.unshift(key);
  2988. } while (path = path.parentPath);
  2989. return parts.join(".");
  2990. };
  2991. NodePath.prototype.debug = function debug(buildMessage) {
  2992. if (!_debug.enabled) return;
  2993. _debug(this.getPathLocation() + " " + this.type + ": " + buildMessage());
  2994. };
  2995. return NodePath;
  2996. }();
  2997. exports.default = NodePath;
  2998. (0, _assign2.default)(NodePath.prototype, __webpack_require__(368));
  2999. (0, _assign2.default)(NodePath.prototype, __webpack_require__(374));
  3000. (0, _assign2.default)(NodePath.prototype, __webpack_require__(382));
  3001. (0, _assign2.default)(NodePath.prototype, __webpack_require__(372));
  3002. (0, _assign2.default)(NodePath.prototype, __webpack_require__(371));
  3003. (0, _assign2.default)(NodePath.prototype, __webpack_require__(377));
  3004. (0, _assign2.default)(NodePath.prototype, __webpack_require__(370));
  3005. (0, _assign2.default)(NodePath.prototype, __webpack_require__(381));
  3006. (0, _assign2.default)(NodePath.prototype, __webpack_require__(380));
  3007. (0, _assign2.default)(NodePath.prototype, __webpack_require__(373));
  3008. (0, _assign2.default)(NodePath.prototype, __webpack_require__(369));
  3009. var _loop2 = function _loop2() {
  3010. if (_isArray) {
  3011. if (_i >= _iterator.length) return "break";
  3012. _ref2 = _iterator[_i++];
  3013. } else {
  3014. _i = _iterator.next();
  3015. if (_i.done) return "break";
  3016. _ref2 = _i.value;
  3017. }
  3018. var type = _ref2;
  3019. var typeKey = "is" + type;
  3020. NodePath.prototype[typeKey] = function (opts) {
  3021. return t[typeKey](this.node, opts);
  3022. };
  3023. NodePath.prototype["assert" + type] = function (opts) {
  3024. if (!this[typeKey](opts)) {
  3025. throw new TypeError("Expected node path of type " + type);
  3026. }
  3027. };
  3028. };
  3029. for (var _iterator = t.TYPES, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
  3030. var _ref2;
  3031. var _ret2 = _loop2();
  3032. if (_ret2 === "break") break;
  3033. }
  3034. var _loop = function _loop(type) {
  3035. if (type[0] === "_") return "continue";
  3036. if (t.TYPES.indexOf(type) < 0) t.TYPES.push(type);
  3037. var virtualType = virtualTypes[type];
  3038. NodePath.prototype["is" + type] = function (opts) {
  3039. return virtualType.checkPath(this, opts);
  3040. };
  3041. };
  3042. for (var type in virtualTypes) {
  3043. var _ret = _loop(type);
  3044. if (_ret === "continue") continue;
  3045. }
  3046. module.exports = exports["default"];
  3047. /***/ }),
  3048. /* 37 */
  3049. /***/ (function(module, exports, __webpack_require__) {
  3050. 'use strict';
  3051. // to indexed object, toObject with fallback for non-array-like ES3 strings
  3052. var IObject = __webpack_require__(142);
  3053. var defined = __webpack_require__(140);
  3054. module.exports = function (it) {
  3055. return IObject(defined(it));
  3056. };
  3057. /***/ }),
  3058. /* 38 */
  3059. /***/ (function(module, exports, __webpack_require__) {
  3060. 'use strict';
  3061. var baseIsNative = __webpack_require__(497),
  3062. getValue = __webpack_require__(535);
  3063. /**
  3064. * Gets the native function at `key` of `object`.
  3065. *
  3066. * @private
  3067. * @param {Object} object The object to query.
  3068. * @param {string} key The key of the method to get.
  3069. * @returns {*} Returns the function if it's native, else `undefined`.
  3070. */
  3071. function getNative(object, key) {
  3072. var value = getValue(object, key);
  3073. return baseIsNative(value) ? value : undefined;
  3074. }
  3075. module.exports = getNative;
  3076. /***/ }),
  3077. /* 39 */
  3078. /***/ (function(module, exports) {
  3079. "use strict";
  3080. module.exports = function (module) {
  3081. if (!module.webpackPolyfill) {
  3082. module.deprecate = function () {};
  3083. module.paths = [];
  3084. // module.parent = undefined by default
  3085. module.children = [];
  3086. module.webpackPolyfill = 1;
  3087. }
  3088. return module;
  3089. };
  3090. /***/ }),
  3091. /* 40 */
  3092. /***/ (function(module, exports, __webpack_require__) {
  3093. "use strict";
  3094. exports.__esModule = true;
  3095. exports.default = function (_ref) {
  3096. var node = _ref.node,
  3097. parent = _ref.parent,
  3098. scope = _ref.scope,
  3099. id = _ref.id;
  3100. if (node.id) return;
  3101. if ((t.isObjectProperty(parent) || t.isObjectMethod(parent, { kind: "method" })) && (!parent.computed || t.isLiteral(parent.key))) {
  3102. id = parent.key;
  3103. } else if (t.isVariableDeclarator(parent)) {
  3104. id = parent.id;
  3105. if (t.isIdentifier(id)) {
  3106. var binding = scope.parent.getBinding(id.name);
  3107. if (binding && binding.constant && scope.getBinding(id.name) === binding) {
  3108. node.id = id;
  3109. node.id[t.NOT_LOCAL_BINDING] = true;
  3110. return;
  3111. }
  3112. }
  3113. } else if (t.isAssignmentExpression(parent)) {
  3114. id = parent.left;
  3115. } else if (!id) {
  3116. return;
  3117. }
  3118. var name = void 0;
  3119. if (id && t.isLiteral(id)) {
  3120. name = id.value;
  3121. } else if (id && t.isIdentifier(id)) {
  3122. name = id.name;
  3123. } else {
  3124. return;
  3125. }
  3126. name = t.toBindingIdentifierName(name);
  3127. id = t.identifier(name);
  3128. id[t.NOT_LOCAL_BINDING] = true;
  3129. var state = visit(node, name, scope);
  3130. return wrap(state, node, id, scope) || node;
  3131. };
  3132. var _babelHelperGetFunctionArity = __webpack_require__(189);
  3133. var _babelHelperGetFunctionArity2 = _interopRequireDefault(_babelHelperGetFunctionArity);
  3134. var _babelTemplate = __webpack_require__(4);
  3135. var _babelTemplate2 = _interopRequireDefault(_babelTemplate);
  3136. var _babelTypes = __webpack_require__(1);
  3137. var t = _interopRequireWildcard(_babelTypes);
  3138. function _interopRequireWildcard(obj) {
  3139. if (obj && obj.__esModule) {
  3140. return obj;
  3141. } else {
  3142. var newObj = {};if (obj != null) {
  3143. for (var key in obj) {
  3144. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  3145. }
  3146. }newObj.default = obj;return newObj;
  3147. }
  3148. }
  3149. function _interopRequireDefault(obj) {
  3150. return obj && obj.__esModule ? obj : { default: obj };
  3151. }
  3152. var buildPropertyMethodAssignmentWrapper = (0, _babelTemplate2.default)("\n (function (FUNCTION_KEY) {\n function FUNCTION_ID() {\n return FUNCTION_KEY.apply(this, arguments);\n }\n\n FUNCTION_ID.toString = function () {\n return FUNCTION_KEY.toString();\n }\n\n return FUNCTION_ID;\n })(FUNCTION)\n");
  3153. var buildGeneratorPropertyMethodAssignmentWrapper = (0, _babelTemplate2.default)("\n (function (FUNCTION_KEY) {\n function* FUNCTION_ID() {\n return yield* FUNCTION_KEY.apply(this, arguments);\n }\n\n FUNCTION_ID.toString = function () {\n return FUNCTION_KEY.toString();\n };\n\n return FUNCTION_ID;\n })(FUNCTION)\n");
  3154. var visitor = {
  3155. "ReferencedIdentifier|BindingIdentifier": function ReferencedIdentifierBindingIdentifier(path, state) {
  3156. if (path.node.name !== state.name) return;
  3157. var localDeclar = path.scope.getBindingIdentifier(state.name);
  3158. if (localDeclar !== state.outerDeclar) return;
  3159. state.selfReference = true;
  3160. path.stop();
  3161. }
  3162. };
  3163. function wrap(state, method, id, scope) {
  3164. if (state.selfReference) {
  3165. if (scope.hasBinding(id.name) && !scope.hasGlobal(id.name)) {
  3166. scope.rename(id.name);
  3167. } else {
  3168. if (!t.isFunction(method)) return;
  3169. var build = buildPropertyMethodAssignmentWrapper;
  3170. if (method.generator) build = buildGeneratorPropertyMethodAssignmentWrapper;
  3171. var _template = build({
  3172. FUNCTION: method,
  3173. FUNCTION_ID: id,
  3174. FUNCTION_KEY: scope.generateUidIdentifier(id.name)
  3175. }).expression;
  3176. _template.callee._skipModulesRemap = true;
  3177. var params = _template.callee.body.body[0].params;
  3178. for (var i = 0, len = (0, _babelHelperGetFunctionArity2.default)(method); i < len; i++) {
  3179. params.push(scope.generateUidIdentifier("x"));
  3180. }
  3181. return _template;
  3182. }
  3183. }
  3184. method.id = id;
  3185. scope.getProgramParent().references[id.name] = true;
  3186. }
  3187. function visit(node, name, scope) {
  3188. var state = {
  3189. selfAssignment: false,
  3190. selfReference: false,
  3191. outerDeclar: scope.getBindingIdentifier(name),
  3192. references: [],
  3193. name: name
  3194. };
  3195. var binding = scope.getOwnBinding(name);
  3196. if (binding) {
  3197. if (binding.kind === "param") {
  3198. state.selfReference = true;
  3199. } else {}
  3200. } else if (state.outerDeclar || scope.hasGlobal(name)) {
  3201. scope.traverse(node, visitor, state);
  3202. }
  3203. return state;
  3204. }
  3205. module.exports = exports["default"];
  3206. /***/ }),
  3207. /* 41 */
  3208. /***/ (function(module, exports, __webpack_require__) {
  3209. "use strict";
  3210. exports.__esModule = true;
  3211. var _setPrototypeOf = __webpack_require__(361);
  3212. var _setPrototypeOf2 = _interopRequireDefault(_setPrototypeOf);
  3213. var _create = __webpack_require__(9);
  3214. var _create2 = _interopRequireDefault(_create);
  3215. var _typeof2 = __webpack_require__(11);
  3216. var _typeof3 = _interopRequireDefault(_typeof2);
  3217. function _interopRequireDefault(obj) {
  3218. return obj && obj.__esModule ? obj : { default: obj };
  3219. }
  3220. exports.default = function (subClass, superClass) {
  3221. if (typeof superClass !== "function" && superClass !== null) {
  3222. throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === "undefined" ? "undefined" : (0, _typeof3.default)(superClass)));
  3223. }
  3224. subClass.prototype = (0, _create2.default)(superClass && superClass.prototype, {
  3225. constructor: {
  3226. value: subClass,
  3227. enumerable: false,
  3228. writable: true,
  3229. configurable: true
  3230. }
  3231. });
  3232. if (superClass) _setPrototypeOf2.default ? (0, _setPrototypeOf2.default)(subClass, superClass) : subClass.__proto__ = superClass;
  3233. };
  3234. /***/ }),
  3235. /* 42 */
  3236. /***/ (function(module, exports, __webpack_require__) {
  3237. "use strict";
  3238. exports.__esModule = true;
  3239. var _typeof2 = __webpack_require__(11);
  3240. var _typeof3 = _interopRequireDefault(_typeof2);
  3241. function _interopRequireDefault(obj) {
  3242. return obj && obj.__esModule ? obj : { default: obj };
  3243. }
  3244. exports.default = function (self, call) {
  3245. if (!self) {
  3246. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  3247. }
  3248. return call && ((typeof call === "undefined" ? "undefined" : (0, _typeof3.default)(call)) === "object" || typeof call === "function") ? call : self;
  3249. };
  3250. /***/ }),
  3251. /* 43 */
  3252. /***/ (function(module, exports, __webpack_require__) {
  3253. 'use strict';
  3254. // optional / simple context binding
  3255. var aFunction = __webpack_require__(227);
  3256. module.exports = function (fn, that, length) {
  3257. aFunction(fn);
  3258. if (that === undefined) return fn;
  3259. switch (length) {
  3260. case 1:
  3261. return function (a) {
  3262. return fn.call(that, a);
  3263. };
  3264. case 2:
  3265. return function (a, b) {
  3266. return fn.call(that, a, b);
  3267. };
  3268. case 3:
  3269. return function (a, b, c) {
  3270. return fn.call(that, a, b, c);
  3271. };
  3272. }
  3273. return function () /* ...args */{
  3274. return fn.apply(that, arguments);
  3275. };
  3276. };
  3277. /***/ }),
  3278. /* 44 */
  3279. /***/ (function(module, exports, __webpack_require__) {
  3280. 'use strict';
  3281. // 19.1.2.14 / 15.2.3.14 Object.keys(O)
  3282. var $keys = __webpack_require__(237);
  3283. var enumBugKeys = __webpack_require__(141);
  3284. module.exports = Object.keys || function keys(O) {
  3285. return $keys(O, enumBugKeys);
  3286. };
  3287. /***/ }),
  3288. /* 45 */
  3289. /***/ (function(module, exports, __webpack_require__) {
  3290. 'use strict';
  3291. var root = __webpack_require__(17);
  3292. /** Built-in value references. */
  3293. var _Symbol = root.Symbol;
  3294. module.exports = _Symbol;
  3295. /***/ }),
  3296. /* 46 */
  3297. /***/ (function(module, exports) {
  3298. "use strict";
  3299. /**
  3300. * Performs a
  3301. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  3302. * comparison between two values to determine if they are equivalent.
  3303. *
  3304. * @static
  3305. * @memberOf _
  3306. * @since 4.0.0
  3307. * @category Lang
  3308. * @param {*} value The value to compare.
  3309. * @param {*} other The other value to compare.
  3310. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  3311. * @example
  3312. *
  3313. * var object = { 'a': 1 };
  3314. * var other = { 'a': 1 };
  3315. *
  3316. * _.eq(object, object);
  3317. * // => true
  3318. *
  3319. * _.eq(object, other);
  3320. * // => false
  3321. *
  3322. * _.eq('a', 'a');
  3323. * // => true
  3324. *
  3325. * _.eq('a', Object('a'));
  3326. * // => false
  3327. *
  3328. * _.eq(NaN, NaN);
  3329. * // => true
  3330. */
  3331. function eq(value, other) {
  3332. return value === other || value !== value && other !== other;
  3333. }
  3334. module.exports = eq;
  3335. /***/ }),
  3336. /* 47 */
  3337. /***/ (function(module, exports, __webpack_require__) {
  3338. 'use strict';
  3339. var arrayLikeKeys = __webpack_require__(245),
  3340. baseKeysIn = __webpack_require__(501),
  3341. isArrayLike = __webpack_require__(24);
  3342. /**
  3343. * Creates an array of the own and inherited enumerable property names of `object`.
  3344. *
  3345. * **Note:** Non-object values are coerced to objects.
  3346. *
  3347. * @static
  3348. * @memberOf _
  3349. * @since 3.0.0
  3350. * @category Object
  3351. * @param {Object} object The object to query.
  3352. * @returns {Array} Returns the array of property names.
  3353. * @example
  3354. *
  3355. * function Foo() {
  3356. * this.a = 1;
  3357. * this.b = 2;
  3358. * }
  3359. *
  3360. * Foo.prototype.c = 3;
  3361. *
  3362. * _.keysIn(new Foo);
  3363. * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
  3364. */
  3365. function keysIn(object) {
  3366. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  3367. }
  3368. module.exports = keysIn;
  3369. /***/ }),
  3370. /* 48 */
  3371. /***/ (function(module, exports, __webpack_require__) {
  3372. 'use strict';
  3373. var toFinite = __webpack_require__(597);
  3374. /**
  3375. * Converts `value` to an integer.
  3376. *
  3377. * **Note:** This method is loosely based on
  3378. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  3379. *
  3380. * @static
  3381. * @memberOf _
  3382. * @since 4.0.0
  3383. * @category Lang
  3384. * @param {*} value The value to convert.
  3385. * @returns {number} Returns the converted integer.
  3386. * @example
  3387. *
  3388. * _.toInteger(3.2);
  3389. * // => 3
  3390. *
  3391. * _.toInteger(Number.MIN_VALUE);
  3392. * // => 0
  3393. *
  3394. * _.toInteger(Infinity);
  3395. * // => 1.7976931348623157e+308
  3396. *
  3397. * _.toInteger('3.2');
  3398. * // => 3
  3399. */
  3400. function toInteger(value) {
  3401. var result = toFinite(value),
  3402. remainder = result % 1;
  3403. return result === result ? remainder ? result - remainder : result : 0;
  3404. }
  3405. module.exports = toInteger;
  3406. /***/ }),
  3407. /* 49 */
  3408. /***/ (function(module, exports) {
  3409. /* WEBPACK VAR INJECTION */(function(__webpack_amd_options__) {module.exports = __webpack_amd_options__;
  3410. /* WEBPACK VAR INJECTION */}.call(exports, {}))
  3411. /***/ }),
  3412. /* 50 */
  3413. /***/ (function(module, exports, __webpack_require__) {
  3414. /* WEBPACK VAR INJECTION */(function(process) {"use strict";
  3415. exports.__esModule = true;
  3416. exports.File = undefined;
  3417. var _getIterator2 = __webpack_require__(2);
  3418. var _getIterator3 = _interopRequireDefault(_getIterator2);
  3419. var _create = __webpack_require__(9);
  3420. var _create2 = _interopRequireDefault(_create);
  3421. var _assign = __webpack_require__(87);
  3422. var _assign2 = _interopRequireDefault(_assign);
  3423. var _classCallCheck2 = __webpack_require__(3);
  3424. var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
  3425. var _possibleConstructorReturn2 = __webpack_require__(42);
  3426. var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
  3427. var _inherits2 = __webpack_require__(41);
  3428. var _inherits3 = _interopRequireDefault(_inherits2);
  3429. var _babelHelpers = __webpack_require__(194);
  3430. var _babelHelpers2 = _interopRequireDefault(_babelHelpers);
  3431. var _metadata = __webpack_require__(121);
  3432. var metadataVisitor = _interopRequireWildcard(_metadata);
  3433. var _convertSourceMap = __webpack_require__(403);
  3434. var _convertSourceMap2 = _interopRequireDefault(_convertSourceMap);
  3435. var _optionManager = __webpack_require__(34);
  3436. var _optionManager2 = _interopRequireDefault(_optionManager);
  3437. var _pluginPass = __webpack_require__(299);
  3438. var _pluginPass2 = _interopRequireDefault(_pluginPass);
  3439. var _babelTraverse = __webpack_require__(7);
  3440. var _babelTraverse2 = _interopRequireDefault(_babelTraverse);
  3441. var _sourceMap = __webpack_require__(288);
  3442. var _sourceMap2 = _interopRequireDefault(_sourceMap);
  3443. var _babelGenerator = __webpack_require__(186);
  3444. var _babelGenerator2 = _interopRequireDefault(_babelGenerator);
  3445. var _babelCodeFrame = __webpack_require__(181);
  3446. var _babelCodeFrame2 = _interopRequireDefault(_babelCodeFrame);
  3447. var _defaults = __webpack_require__(273);
  3448. var _defaults2 = _interopRequireDefault(_defaults);
  3449. var _logger = __webpack_require__(120);
  3450. var _logger2 = _interopRequireDefault(_logger);
  3451. var _store = __webpack_require__(119);
  3452. var _store2 = _interopRequireDefault(_store);
  3453. var _babylon = __webpack_require__(89);
  3454. var _util = __webpack_require__(122);
  3455. var util = _interopRequireWildcard(_util);
  3456. var _path = __webpack_require__(19);
  3457. var _path2 = _interopRequireDefault(_path);
  3458. var _babelTypes = __webpack_require__(1);
  3459. var t = _interopRequireWildcard(_babelTypes);
  3460. var _resolve = __webpack_require__(118);
  3461. var _resolve2 = _interopRequireDefault(_resolve);
  3462. var _blockHoist = __webpack_require__(296);
  3463. var _blockHoist2 = _interopRequireDefault(_blockHoist);
  3464. var _shadowFunctions = __webpack_require__(297);
  3465. var _shadowFunctions2 = _interopRequireDefault(_shadowFunctions);
  3466. function _interopRequireWildcard(obj) {
  3467. if (obj && obj.__esModule) {
  3468. return obj;
  3469. } else {
  3470. var newObj = {};if (obj != null) {
  3471. for (var key in obj) {
  3472. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  3473. }
  3474. }newObj.default = obj;return newObj;
  3475. }
  3476. }
  3477. function _interopRequireDefault(obj) {
  3478. return obj && obj.__esModule ? obj : { default: obj };
  3479. }
  3480. var shebangRegex = /^#!.*/;
  3481. var INTERNAL_PLUGINS = [[_blockHoist2.default], [_shadowFunctions2.default]];
  3482. var errorVisitor = {
  3483. enter: function enter(path, state) {
  3484. var loc = path.node.loc;
  3485. if (loc) {
  3486. state.loc = loc;
  3487. path.stop();
  3488. }
  3489. }
  3490. };
  3491. var File = function (_Store) {
  3492. (0, _inherits3.default)(File, _Store);
  3493. function File() {
  3494. var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  3495. var pipeline = arguments[1];
  3496. (0, _classCallCheck3.default)(this, File);
  3497. var _this = (0, _possibleConstructorReturn3.default)(this, _Store.call(this));
  3498. _this.pipeline = pipeline;
  3499. _this.log = new _logger2.default(_this, opts.filename || "unknown");
  3500. _this.opts = _this.initOptions(opts);
  3501. _this.parserOpts = {
  3502. sourceType: _this.opts.sourceType,
  3503. sourceFileName: _this.opts.filename,
  3504. plugins: []
  3505. };
  3506. _this.pluginVisitors = [];
  3507. _this.pluginPasses = [];
  3508. _this.buildPluginsForOptions(_this.opts);
  3509. if (_this.opts.passPerPreset) {
  3510. _this.perPresetOpts = [];
  3511. _this.opts.presets.forEach(function (presetOpts) {
  3512. var perPresetOpts = (0, _assign2.default)((0, _create2.default)(_this.opts), presetOpts);
  3513. _this.perPresetOpts.push(perPresetOpts);
  3514. _this.buildPluginsForOptions(perPresetOpts);
  3515. });
  3516. }
  3517. _this.metadata = {
  3518. usedHelpers: [],
  3519. marked: [],
  3520. modules: {
  3521. imports: [],
  3522. exports: {
  3523. exported: [],
  3524. specifiers: []
  3525. }
  3526. }
  3527. };
  3528. _this.dynamicImportTypes = {};
  3529. _this.dynamicImportIds = {};
  3530. _this.dynamicImports = [];
  3531. _this.declarations = {};
  3532. _this.usedHelpers = {};
  3533. _this.path = null;
  3534. _this.ast = {};
  3535. _this.code = "";
  3536. _this.shebang = "";
  3537. _this.hub = new _babelTraverse.Hub(_this);
  3538. return _this;
  3539. }
  3540. File.prototype.getMetadata = function getMetadata() {
  3541. var has = false;
  3542. for (var _iterator = this.ast.program.body, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
  3543. var _ref;
  3544. if (_isArray) {
  3545. if (_i >= _iterator.length) break;
  3546. _ref = _iterator[_i++];
  3547. } else {
  3548. _i = _iterator.next();
  3549. if (_i.done) break;
  3550. _ref = _i.value;
  3551. }
  3552. var node = _ref;
  3553. if (t.isModuleDeclaration(node)) {
  3554. has = true;
  3555. break;
  3556. }
  3557. }
  3558. if (has) {
  3559. this.path.traverse(metadataVisitor, this);
  3560. }
  3561. };
  3562. File.prototype.initOptions = function initOptions(opts) {
  3563. opts = new _optionManager2.default(this.log, this.pipeline).init(opts);
  3564. if (opts.inputSourceMap) {
  3565. opts.sourceMaps = true;
  3566. }
  3567. if (opts.moduleId) {
  3568. opts.moduleIds = true;
  3569. }
  3570. opts.basename = _path2.default.basename(opts.filename, _path2.default.extname(opts.filename));
  3571. opts.ignore = util.arrayify(opts.ignore, util.regexify);
  3572. if (opts.only) opts.only = util.arrayify(opts.only, util.regexify);
  3573. (0, _defaults2.default)(opts, {
  3574. moduleRoot: opts.sourceRoot
  3575. });
  3576. (0, _defaults2.default)(opts, {
  3577. sourceRoot: opts.moduleRoot
  3578. });
  3579. (0, _defaults2.default)(opts, {
  3580. filenameRelative: opts.filename
  3581. });
  3582. var basenameRelative = _path2.default.basename(opts.filenameRelative);
  3583. (0, _defaults2.default)(opts, {
  3584. sourceFileName: basenameRelative,
  3585. sourceMapTarget: basenameRelative
  3586. });
  3587. return opts;
  3588. };
  3589. File.prototype.buildPluginsForOptions = function buildPluginsForOptions(opts) {
  3590. if (!Array.isArray(opts.plugins)) {
  3591. return;
  3592. }
  3593. var plugins = opts.plugins.concat(INTERNAL_PLUGINS);
  3594. var currentPluginVisitors = [];
  3595. var currentPluginPasses = [];
  3596. for (var _iterator2 = plugins, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) {
  3597. var _ref2;
  3598. if (_isArray2) {
  3599. if (_i2 >= _iterator2.length) break;
  3600. _ref2 = _iterator2[_i2++];
  3601. } else {
  3602. _i2 = _iterator2.next();
  3603. if (_i2.done) break;
  3604. _ref2 = _i2.value;
  3605. }
  3606. var ref = _ref2;
  3607. var plugin = ref[0],
  3608. pluginOpts = ref[1];
  3609. currentPluginVisitors.push(plugin.visitor);
  3610. currentPluginPasses.push(new _pluginPass2.default(this, plugin, pluginOpts));
  3611. if (plugin.manipulateOptions) {
  3612. plugin.manipulateOptions(opts, this.parserOpts, this);
  3613. }
  3614. }
  3615. this.pluginVisitors.push(currentPluginVisitors);
  3616. this.pluginPasses.push(currentPluginPasses);
  3617. };
  3618. File.prototype.getModuleName = function getModuleName() {
  3619. var opts = this.opts;
  3620. if (!opts.moduleIds) {
  3621. return null;
  3622. }
  3623. if (opts.moduleId != null && !opts.getModuleId) {
  3624. return opts.moduleId;
  3625. }
  3626. var filenameRelative = opts.filenameRelative;
  3627. var moduleName = "";
  3628. if (opts.moduleRoot != null) {
  3629. moduleName = opts.moduleRoot + "/";
  3630. }
  3631. if (!opts.filenameRelative) {
  3632. return moduleName + opts.filename.replace(/^\//, "");
  3633. }
  3634. if (opts.sourceRoot != null) {
  3635. var sourceRootRegEx = new RegExp("^" + opts.sourceRoot + "\/?");
  3636. filenameRelative = filenameRelative.replace(sourceRootRegEx, "");
  3637. }
  3638. filenameRelative = filenameRelative.replace(/\.(\w*?)$/, "");
  3639. moduleName += filenameRelative;
  3640. moduleName = moduleName.replace(/\\/g, "/");
  3641. if (opts.getModuleId) {
  3642. return opts.getModuleId(moduleName) || moduleName;
  3643. } else {
  3644. return moduleName;
  3645. }
  3646. };
  3647. File.prototype.resolveModuleSource = function resolveModuleSource(source) {
  3648. var resolveModuleSource = this.opts.resolveModuleSource;
  3649. if (resolveModuleSource) source = resolveModuleSource(source, this.opts.filename);
  3650. return source;
  3651. };
  3652. File.prototype.addImport = function addImport(source, imported) {
  3653. var name = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : imported;
  3654. var alias = source + ":" + imported;
  3655. var id = this.dynamicImportIds[alias];
  3656. if (!id) {
  3657. source = this.resolveModuleSource(source);
  3658. id = this.dynamicImportIds[alias] = this.scope.generateUidIdentifier(name);
  3659. var specifiers = [];
  3660. if (imported === "*") {
  3661. specifiers.push(t.importNamespaceSpecifier(id));
  3662. } else if (imported === "default") {
  3663. specifiers.push(t.importDefaultSpecifier(id));
  3664. } else {
  3665. specifiers.push(t.importSpecifier(id, t.identifier(imported)));
  3666. }
  3667. var declar = t.importDeclaration(specifiers, t.stringLiteral(source));
  3668. declar._blockHoist = 3;
  3669. this.path.unshiftContainer("body", declar);
  3670. }
  3671. return id;
  3672. };
  3673. File.prototype.addHelper = function addHelper(name) {
  3674. var declar = this.declarations[name];
  3675. if (declar) return declar;
  3676. if (!this.usedHelpers[name]) {
  3677. this.metadata.usedHelpers.push(name);
  3678. this.usedHelpers[name] = true;
  3679. }
  3680. var generator = this.get("helperGenerator");
  3681. var runtime = this.get("helpersNamespace");
  3682. if (generator) {
  3683. var res = generator(name);
  3684. if (res) return res;
  3685. } else if (runtime) {
  3686. return t.memberExpression(runtime, t.identifier(name));
  3687. }
  3688. var ref = (0, _babelHelpers2.default)(name);
  3689. var uid = this.declarations[name] = this.scope.generateUidIdentifier(name);
  3690. if (t.isFunctionExpression(ref) && !ref.id) {
  3691. ref.body._compact = true;
  3692. ref._generated = true;
  3693. ref.id = uid;
  3694. ref.type = "FunctionDeclaration";
  3695. this.path.unshiftContainer("body", ref);
  3696. } else {
  3697. ref._compact = true;
  3698. this.scope.push({
  3699. id: uid,
  3700. init: ref,
  3701. unique: true
  3702. });
  3703. }
  3704. return uid;
  3705. };
  3706. File.prototype.addTemplateObject = function addTemplateObject(helperName, strings, raw) {
  3707. var stringIds = raw.elements.map(function (string) {
  3708. return string.value;
  3709. });
  3710. var name = helperName + "_" + raw.elements.length + "_" + stringIds.join(",");
  3711. var declar = this.declarations[name];
  3712. if (declar) return declar;
  3713. var uid = this.declarations[name] = this.scope.generateUidIdentifier("templateObject");
  3714. var helperId = this.addHelper(helperName);
  3715. var init = t.callExpression(helperId, [strings, raw]);
  3716. init._compact = true;
  3717. this.scope.push({
  3718. id: uid,
  3719. init: init,
  3720. _blockHoist: 1.9 });
  3721. return uid;
  3722. };
  3723. File.prototype.buildCodeFrameError = function buildCodeFrameError(node, msg) {
  3724. var Error = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : SyntaxError;
  3725. var loc = node && (node.loc || node._loc);
  3726. var err = new Error(msg);
  3727. if (loc) {
  3728. err.loc = loc.start;
  3729. } else {
  3730. (0, _babelTraverse2.default)(node, errorVisitor, this.scope, err);
  3731. err.message += " (This is an error on an internal node. Probably an internal error";
  3732. if (err.loc) {
  3733. err.message += ". Location has been estimated.";
  3734. }
  3735. err.message += ")";
  3736. }
  3737. return err;
  3738. };
  3739. File.prototype.mergeSourceMap = function mergeSourceMap(map) {
  3740. var inputMap = this.opts.inputSourceMap;
  3741. if (inputMap) {
  3742. var inputMapConsumer = new _sourceMap2.default.SourceMapConsumer(inputMap);
  3743. var outputMapConsumer = new _sourceMap2.default.SourceMapConsumer(map);
  3744. var mergedGenerator = new _sourceMap2.default.SourceMapGenerator({
  3745. file: inputMapConsumer.file,
  3746. sourceRoot: inputMapConsumer.sourceRoot
  3747. });
  3748. var source = outputMapConsumer.sources[0];
  3749. inputMapConsumer.eachMapping(function (mapping) {
  3750. var generatedPosition = outputMapConsumer.generatedPositionFor({
  3751. line: mapping.generatedLine,
  3752. column: mapping.generatedColumn,
  3753. source: source
  3754. });
  3755. if (generatedPosition.column != null) {
  3756. mergedGenerator.addMapping({
  3757. source: mapping.source,
  3758. original: mapping.source == null ? null : {
  3759. line: mapping.originalLine,
  3760. column: mapping.originalColumn
  3761. },
  3762. generated: generatedPosition
  3763. });
  3764. }
  3765. });
  3766. var mergedMap = mergedGenerator.toJSON();
  3767. inputMap.mappings = mergedMap.mappings;
  3768. return inputMap;
  3769. } else {
  3770. return map;
  3771. }
  3772. };
  3773. File.prototype.parse = function parse(code) {
  3774. var parseCode = _babylon.parse;
  3775. var parserOpts = this.opts.parserOpts;
  3776. if (parserOpts) {
  3777. parserOpts = (0, _assign2.default)({}, this.parserOpts, parserOpts);
  3778. if (parserOpts.parser) {
  3779. if (typeof parserOpts.parser === "string") {
  3780. var dirname = _path2.default.dirname(this.opts.filename) || process.cwd();
  3781. var parser = (0, _resolve2.default)(parserOpts.parser, dirname);
  3782. if (parser) {
  3783. parseCode = __webpack_require__(178)(parser).parse;
  3784. } else {
  3785. throw new Error("Couldn't find parser " + parserOpts.parser + " with \"parse\" method " + ("relative to directory " + dirname));
  3786. }
  3787. } else {
  3788. parseCode = parserOpts.parser;
  3789. }
  3790. parserOpts.parser = {
  3791. parse: function parse(source) {
  3792. return (0, _babylon.parse)(source, parserOpts);
  3793. }
  3794. };
  3795. }
  3796. }
  3797. this.log.debug("Parse start");
  3798. var ast = parseCode(code, parserOpts || this.parserOpts);
  3799. this.log.debug("Parse stop");
  3800. return ast;
  3801. };
  3802. File.prototype._addAst = function _addAst(ast) {
  3803. this.path = _babelTraverse.NodePath.get({
  3804. hub: this.hub,
  3805. parentPath: null,
  3806. parent: ast,
  3807. container: ast,
  3808. key: "program"
  3809. }).setContext();
  3810. this.scope = this.path.scope;
  3811. this.ast = ast;
  3812. this.getMetadata();
  3813. };
  3814. File.prototype.addAst = function addAst(ast) {
  3815. this.log.debug("Start set AST");
  3816. this._addAst(ast);
  3817. this.log.debug("End set AST");
  3818. };
  3819. File.prototype.transform = function transform() {
  3820. for (var i = 0; i < this.pluginPasses.length; i++) {
  3821. var pluginPasses = this.pluginPasses[i];
  3822. this.call("pre", pluginPasses);
  3823. this.log.debug("Start transform traverse");
  3824. var visitor = _babelTraverse2.default.visitors.merge(this.pluginVisitors[i], pluginPasses, this.opts.wrapPluginVisitorMethod);
  3825. (0, _babelTraverse2.default)(this.ast, visitor, this.scope);
  3826. this.log.debug("End transform traverse");
  3827. this.call("post", pluginPasses);
  3828. }
  3829. return this.generate();
  3830. };
  3831. File.prototype.wrap = function wrap(code, callback) {
  3832. code = code + "";
  3833. try {
  3834. if (this.shouldIgnore()) {
  3835. return this.makeResult({ code: code, ignored: true });
  3836. } else {
  3837. return callback();
  3838. }
  3839. } catch (err) {
  3840. if (err._babel) {
  3841. throw err;
  3842. } else {
  3843. err._babel = true;
  3844. }
  3845. var message = err.message = this.opts.filename + ": " + err.message;
  3846. var loc = err.loc;
  3847. if (loc) {
  3848. err.codeFrame = (0, _babelCodeFrame2.default)(code, loc.line, loc.column + 1, this.opts);
  3849. message += "\n" + err.codeFrame;
  3850. }
  3851. if (process.browser) {
  3852. err.message = message;
  3853. }
  3854. if (err.stack) {
  3855. var newStack = err.stack.replace(err.message, message);
  3856. err.stack = newStack;
  3857. }
  3858. throw err;
  3859. }
  3860. };
  3861. File.prototype.addCode = function addCode(code) {
  3862. code = (code || "") + "";
  3863. code = this.parseInputSourceMap(code);
  3864. this.code = code;
  3865. };
  3866. File.prototype.parseCode = function parseCode() {
  3867. this.parseShebang();
  3868. var ast = this.parse(this.code);
  3869. this.addAst(ast);
  3870. };
  3871. File.prototype.shouldIgnore = function shouldIgnore() {
  3872. var opts = this.opts;
  3873. return util.shouldIgnore(opts.filename, opts.ignore, opts.only);
  3874. };
  3875. File.prototype.call = function call(key, pluginPasses) {
  3876. for (var _iterator3 = pluginPasses, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) {
  3877. var _ref3;
  3878. if (_isArray3) {
  3879. if (_i3 >= _iterator3.length) break;
  3880. _ref3 = _iterator3[_i3++];
  3881. } else {
  3882. _i3 = _iterator3.next();
  3883. if (_i3.done) break;
  3884. _ref3 = _i3.value;
  3885. }
  3886. var pass = _ref3;
  3887. var plugin = pass.plugin;
  3888. var fn = plugin[key];
  3889. if (fn) fn.call(pass, this);
  3890. }
  3891. };
  3892. File.prototype.parseInputSourceMap = function parseInputSourceMap(code) {
  3893. var opts = this.opts;
  3894. if (opts.inputSourceMap !== false) {
  3895. var inputMap = _convertSourceMap2.default.fromSource(code);
  3896. if (inputMap) {
  3897. opts.inputSourceMap = inputMap.toObject();
  3898. code = _convertSourceMap2.default.removeComments(code);
  3899. }
  3900. }
  3901. return code;
  3902. };
  3903. File.prototype.parseShebang = function parseShebang() {
  3904. var shebangMatch = shebangRegex.exec(this.code);
  3905. if (shebangMatch) {
  3906. this.shebang = shebangMatch[0];
  3907. this.code = this.code.replace(shebangRegex, "");
  3908. }
  3909. };
  3910. File.prototype.makeResult = function makeResult(_ref4) {
  3911. var code = _ref4.code,
  3912. map = _ref4.map,
  3913. ast = _ref4.ast,
  3914. ignored = _ref4.ignored;
  3915. var result = {
  3916. metadata: null,
  3917. options: this.opts,
  3918. ignored: !!ignored,
  3919. code: null,
  3920. ast: null,
  3921. map: map || null
  3922. };
  3923. if (this.opts.code) {
  3924. result.code = code;
  3925. }
  3926. if (this.opts.ast) {
  3927. result.ast = ast;
  3928. }
  3929. if (this.opts.metadata) {
  3930. result.metadata = this.metadata;
  3931. }
  3932. return result;
  3933. };
  3934. File.prototype.generate = function generate() {
  3935. var opts = this.opts;
  3936. var ast = this.ast;
  3937. var result = { ast: ast };
  3938. if (!opts.code) return this.makeResult(result);
  3939. var gen = _babelGenerator2.default;
  3940. if (opts.generatorOpts.generator) {
  3941. gen = opts.generatorOpts.generator;
  3942. if (typeof gen === "string") {
  3943. var dirname = _path2.default.dirname(this.opts.filename) || process.cwd();
  3944. var generator = (0, _resolve2.default)(gen, dirname);
  3945. if (generator) {
  3946. gen = __webpack_require__(178)(generator).print;
  3947. } else {
  3948. throw new Error("Couldn't find generator " + gen + " with \"print\" method relative " + ("to directory " + dirname));
  3949. }
  3950. }
  3951. }
  3952. this.log.debug("Generation start");
  3953. var _result = gen(ast, opts.generatorOpts ? (0, _assign2.default)(opts, opts.generatorOpts) : opts, this.code);
  3954. result.code = _result.code;
  3955. result.map = _result.map;
  3956. this.log.debug("Generation end");
  3957. if (this.shebang) {
  3958. result.code = this.shebang + "\n" + result.code;
  3959. }
  3960. if (result.map) {
  3961. result.map = this.mergeSourceMap(result.map);
  3962. }
  3963. if (opts.sourceMaps === "inline" || opts.sourceMaps === "both") {
  3964. result.code += "\n" + _convertSourceMap2.default.fromObject(result.map).toComment();
  3965. }
  3966. if (opts.sourceMaps === "inline") {
  3967. result.map = null;
  3968. }
  3969. return this.makeResult(result);
  3970. };
  3971. return File;
  3972. }(_store2.default);
  3973. exports.default = File;
  3974. exports.File = File;
  3975. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(8)))
  3976. /***/ }),
  3977. /* 51 */
  3978. /***/ (function(module, exports, __webpack_require__) {
  3979. /* WEBPACK VAR INJECTION */(function(process) {"use strict";
  3980. exports.__esModule = true;
  3981. var _assign = __webpack_require__(87);
  3982. var _assign2 = _interopRequireDefault(_assign);
  3983. var _classCallCheck2 = __webpack_require__(3);
  3984. var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
  3985. exports.default = buildConfigChain;
  3986. var _resolve = __webpack_require__(118);
  3987. var _resolve2 = _interopRequireDefault(_resolve);
  3988. var _json = __webpack_require__(470);
  3989. var _json2 = _interopRequireDefault(_json);
  3990. var _pathIsAbsolute = __webpack_require__(604);
  3991. var _pathIsAbsolute2 = _interopRequireDefault(_pathIsAbsolute);
  3992. var _path = __webpack_require__(19);
  3993. var _path2 = _interopRequireDefault(_path);
  3994. var _fs = __webpack_require__(115);
  3995. var _fs2 = _interopRequireDefault(_fs);
  3996. function _interopRequireDefault(obj) {
  3997. return obj && obj.__esModule ? obj : { default: obj };
  3998. }
  3999. var existsCache = {};
  4000. var jsonCache = {};
  4001. var BABELIGNORE_FILENAME = ".babelignore";
  4002. var BABELRC_FILENAME = ".babelrc";
  4003. var PACKAGE_FILENAME = "package.json";
  4004. function exists(filename) {
  4005. var cached = existsCache[filename];
  4006. if (cached == null) {
  4007. return existsCache[filename] = _fs2.default.existsSync(filename);
  4008. } else {
  4009. return cached;
  4010. }
  4011. }
  4012. function buildConfigChain() {
  4013. var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  4014. var log = arguments[1];
  4015. var filename = opts.filename;
  4016. var builder = new ConfigChainBuilder(log);
  4017. if (opts.babelrc !== false) {
  4018. builder.findConfigs(filename);
  4019. }
  4020. builder.mergeConfig({
  4021. options: opts,
  4022. alias: "base",
  4023. dirname: filename && _path2.default.dirname(filename)
  4024. });
  4025. return builder.configs;
  4026. }
  4027. var ConfigChainBuilder = function () {
  4028. function ConfigChainBuilder(log) {
  4029. (0, _classCallCheck3.default)(this, ConfigChainBuilder);
  4030. this.resolvedConfigs = [];
  4031. this.configs = [];
  4032. this.log = log;
  4033. }
  4034. ConfigChainBuilder.prototype.findConfigs = function findConfigs(loc) {
  4035. if (!loc) return;
  4036. if (!(0, _pathIsAbsolute2.default)(loc)) {
  4037. loc = _path2.default.join(process.cwd(), loc);
  4038. }
  4039. var foundConfig = false;
  4040. var foundIgnore = false;
  4041. while (loc !== (loc = _path2.default.dirname(loc))) {
  4042. if (!foundConfig) {
  4043. var configLoc = _path2.default.join(loc, BABELRC_FILENAME);
  4044. if (exists(configLoc)) {
  4045. this.addConfig(configLoc);
  4046. foundConfig = true;
  4047. }
  4048. var pkgLoc = _path2.default.join(loc, PACKAGE_FILENAME);
  4049. if (!foundConfig && exists(pkgLoc)) {
  4050. foundConfig = this.addConfig(pkgLoc, "babel", JSON);
  4051. }
  4052. }
  4053. if (!foundIgnore) {
  4054. var ignoreLoc = _path2.default.join(loc, BABELIGNORE_FILENAME);
  4055. if (exists(ignoreLoc)) {
  4056. this.addIgnoreConfig(ignoreLoc);
  4057. foundIgnore = true;
  4058. }
  4059. }
  4060. if (foundIgnore && foundConfig) return;
  4061. }
  4062. };
  4063. ConfigChainBuilder.prototype.addIgnoreConfig = function addIgnoreConfig(loc) {
  4064. var file = _fs2.default.readFileSync(loc, "utf8");
  4065. var lines = file.split("\n");
  4066. lines = lines.map(function (line) {
  4067. return line.replace(/#(.*?)$/, "").trim();
  4068. }).filter(function (line) {
  4069. return !!line;
  4070. });
  4071. if (lines.length) {
  4072. this.mergeConfig({
  4073. options: { ignore: lines },
  4074. alias: loc,
  4075. dirname: _path2.default.dirname(loc)
  4076. });
  4077. }
  4078. };
  4079. ConfigChainBuilder.prototype.addConfig = function addConfig(loc, key) {
  4080. var json = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _json2.default;
  4081. if (this.resolvedConfigs.indexOf(loc) >= 0) {
  4082. return false;
  4083. }
  4084. this.resolvedConfigs.push(loc);
  4085. var content = _fs2.default.readFileSync(loc, "utf8");
  4086. var options = void 0;
  4087. try {
  4088. options = jsonCache[content] = jsonCache[content] || json.parse(content);
  4089. if (key) options = options[key];
  4090. } catch (err) {
  4091. err.message = loc + ": Error while parsing JSON - " + err.message;
  4092. throw err;
  4093. }
  4094. this.mergeConfig({
  4095. options: options,
  4096. alias: loc,
  4097. dirname: _path2.default.dirname(loc)
  4098. });
  4099. return !!options;
  4100. };
  4101. ConfigChainBuilder.prototype.mergeConfig = function mergeConfig(_ref) {
  4102. var options = _ref.options,
  4103. alias = _ref.alias,
  4104. loc = _ref.loc,
  4105. dirname = _ref.dirname;
  4106. if (!options) {
  4107. return false;
  4108. }
  4109. options = (0, _assign2.default)({}, options);
  4110. dirname = dirname || process.cwd();
  4111. loc = loc || alias;
  4112. if (options.extends) {
  4113. var extendsLoc = (0, _resolve2.default)(options.extends, dirname);
  4114. if (extendsLoc) {
  4115. this.addConfig(extendsLoc);
  4116. } else {
  4117. if (this.log) this.log.error("Couldn't resolve extends clause of " + options.extends + " in " + alias);
  4118. }
  4119. delete options.extends;
  4120. }
  4121. this.configs.push({
  4122. options: options,
  4123. alias: alias,
  4124. loc: loc,
  4125. dirname: dirname
  4126. });
  4127. var envOpts = void 0;
  4128. var envKey = process.env.BABEL_ENV || ("production") || "development";
  4129. if (options.env) {
  4130. envOpts = options.env[envKey];
  4131. delete options.env;
  4132. }
  4133. this.mergeConfig({
  4134. options: envOpts,
  4135. alias: alias + ".env." + envKey,
  4136. dirname: dirname
  4137. });
  4138. };
  4139. return ConfigChainBuilder;
  4140. }();
  4141. module.exports = exports["default"];
  4142. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(8)))
  4143. /***/ }),
  4144. /* 52 */
  4145. /***/ (function(module, exports, __webpack_require__) {
  4146. "use strict";
  4147. exports.__esModule = true;
  4148. exports.config = undefined;
  4149. exports.normaliseOptions = normaliseOptions;
  4150. var _parsers = __webpack_require__(53);
  4151. var parsers = _interopRequireWildcard(_parsers);
  4152. var _config = __webpack_require__(33);
  4153. var _config2 = _interopRequireDefault(_config);
  4154. function _interopRequireDefault(obj) {
  4155. return obj && obj.__esModule ? obj : { default: obj };
  4156. }
  4157. function _interopRequireWildcard(obj) {
  4158. if (obj && obj.__esModule) {
  4159. return obj;
  4160. } else {
  4161. var newObj = {};if (obj != null) {
  4162. for (var key in obj) {
  4163. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  4164. }
  4165. }newObj.default = obj;return newObj;
  4166. }
  4167. }
  4168. exports.config = _config2.default;
  4169. function normaliseOptions() {
  4170. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  4171. for (var key in options) {
  4172. var val = options[key];
  4173. if (val == null) continue;
  4174. var opt = _config2.default[key];
  4175. if (opt && opt.alias) opt = _config2.default[opt.alias];
  4176. if (!opt) continue;
  4177. var parser = parsers[opt.type];
  4178. if (parser) val = parser(val);
  4179. options[key] = val;
  4180. }
  4181. return options;
  4182. }
  4183. /***/ }),
  4184. /* 53 */
  4185. /***/ (function(module, exports, __webpack_require__) {
  4186. "use strict";
  4187. exports.__esModule = true;
  4188. exports.filename = undefined;
  4189. exports.boolean = boolean;
  4190. exports.booleanString = booleanString;
  4191. exports.list = list;
  4192. var _slash = __webpack_require__(284);
  4193. var _slash2 = _interopRequireDefault(_slash);
  4194. var _util = __webpack_require__(122);
  4195. var util = _interopRequireWildcard(_util);
  4196. function _interopRequireWildcard(obj) {
  4197. if (obj && obj.__esModule) {
  4198. return obj;
  4199. } else {
  4200. var newObj = {};if (obj != null) {
  4201. for (var key in obj) {
  4202. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  4203. }
  4204. }newObj.default = obj;return newObj;
  4205. }
  4206. }
  4207. function _interopRequireDefault(obj) {
  4208. return obj && obj.__esModule ? obj : { default: obj };
  4209. }
  4210. var filename = exports.filename = _slash2.default;
  4211. function boolean(val) {
  4212. return !!val;
  4213. }
  4214. function booleanString(val) {
  4215. return util.booleanify(val);
  4216. }
  4217. function list(val) {
  4218. return util.list(val);
  4219. }
  4220. /***/ }),
  4221. /* 54 */
  4222. /***/ (function(module, exports) {
  4223. "use strict";
  4224. module.exports = {
  4225. "auxiliaryComment": {
  4226. "message": "Use `auxiliaryCommentBefore` or `auxiliaryCommentAfter`"
  4227. },
  4228. "blacklist": {
  4229. "message": "Put the specific transforms you want in the `plugins` option"
  4230. },
  4231. "breakConfig": {
  4232. "message": "This is not a necessary option in Babel 6"
  4233. },
  4234. "experimental": {
  4235. "message": "Put the specific transforms you want in the `plugins` option"
  4236. },
  4237. "externalHelpers": {
  4238. "message": "Use the `external-helpers` plugin instead. Check out http://babeljs.io/docs/plugins/external-helpers/"
  4239. },
  4240. "extra": {
  4241. "message": ""
  4242. },
  4243. "jsxPragma": {
  4244. "message": "use the `pragma` option in the `react-jsx` plugin . Check out http://babeljs.io/docs/plugins/transform-react-jsx/"
  4245. },
  4246. "loose": {
  4247. "message": "Specify the `loose` option for the relevant plugin you are using or use a preset that sets the option."
  4248. },
  4249. "metadataUsedHelpers": {
  4250. "message": "Not required anymore as this is enabled by default"
  4251. },
  4252. "modules": {
  4253. "message": "Use the corresponding module transform plugin in the `plugins` option. Check out http://babeljs.io/docs/plugins/#modules"
  4254. },
  4255. "nonStandard": {
  4256. "message": "Use the `react-jsx` and `flow-strip-types` plugins to support JSX and Flow. Also check out the react preset http://babeljs.io/docs/plugins/preset-react/"
  4257. },
  4258. "optional": {
  4259. "message": "Put the specific transforms you want in the `plugins` option"
  4260. },
  4261. "sourceMapName": {
  4262. "message": "Use the `sourceMapTarget` option"
  4263. },
  4264. "stage": {
  4265. "message": "Check out the corresponding stage-x presets http://babeljs.io/docs/plugins/#presets"
  4266. },
  4267. "whitelist": {
  4268. "message": "Put the specific transforms you want in the `plugins` option"
  4269. }
  4270. };
  4271. /***/ }),
  4272. /* 55 */
  4273. /***/ (function(module, exports, __webpack_require__) {
  4274. 'use strict';
  4275. var ctx = __webpack_require__(43);
  4276. var call = __webpack_require__(428);
  4277. var isArrayIter = __webpack_require__(427);
  4278. var anObject = __webpack_require__(21);
  4279. var toLength = __webpack_require__(153);
  4280. var getIterFn = __webpack_require__(238);
  4281. var BREAK = {};
  4282. var RETURN = {};
  4283. var _exports = module.exports = function (iterable, entries, fn, that, ITERATOR) {
  4284. var iterFn = ITERATOR ? function () {
  4285. return iterable;
  4286. } : getIterFn(iterable);
  4287. var f = ctx(fn, that, entries ? 2 : 1);
  4288. var index = 0;
  4289. var length, step, iterator, result;
  4290. if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!');
  4291. // fast case for arrays with default iterator
  4292. if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) {
  4293. result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);
  4294. if (result === BREAK || result === RETURN) return result;
  4295. } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) {
  4296. result = call(iterator, f, step.value, entries);
  4297. if (result === BREAK || result === RETURN) return result;
  4298. }
  4299. };
  4300. _exports.BREAK = BREAK;
  4301. _exports.RETURN = RETURN;
  4302. /***/ }),
  4303. /* 56 */
  4304. /***/ (function(module, exports) {
  4305. "use strict";
  4306. module.exports = {};
  4307. /***/ }),
  4308. /* 57 */
  4309. /***/ (function(module, exports, __webpack_require__) {
  4310. 'use strict';
  4311. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  4312. var META = __webpack_require__(95)('meta');
  4313. var isObject = __webpack_require__(16);
  4314. var has = __webpack_require__(28);
  4315. var setDesc = __webpack_require__(23).f;
  4316. var id = 0;
  4317. var isExtensible = Object.isExtensible || function () {
  4318. return true;
  4319. };
  4320. var FREEZE = !__webpack_require__(27)(function () {
  4321. return isExtensible(Object.preventExtensions({}));
  4322. });
  4323. var setMeta = function setMeta(it) {
  4324. setDesc(it, META, { value: {
  4325. i: 'O' + ++id, // object ID
  4326. w: {} // weak collections IDs
  4327. } });
  4328. };
  4329. var fastKey = function fastKey(it, create) {
  4330. // return primitive with prefix
  4331. if (!isObject(it)) return (typeof it === 'undefined' ? 'undefined' : _typeof(it)) == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
  4332. if (!has(it, META)) {
  4333. // can't set metadata to uncaught frozen object
  4334. if (!isExtensible(it)) return 'F';
  4335. // not necessary to add metadata
  4336. if (!create) return 'E';
  4337. // add missing metadata
  4338. setMeta(it);
  4339. // return object ID
  4340. }return it[META].i;
  4341. };
  4342. var getWeak = function getWeak(it, create) {
  4343. if (!has(it, META)) {
  4344. // can't set metadata to uncaught frozen object
  4345. if (!isExtensible(it)) return true;
  4346. // not necessary to add metadata
  4347. if (!create) return false;
  4348. // add missing metadata
  4349. setMeta(it);
  4350. // return hash weak collections IDs
  4351. }return it[META].w;
  4352. };
  4353. // add metadata on freeze-family methods calling
  4354. var onFreeze = function onFreeze(it) {
  4355. if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it);
  4356. return it;
  4357. };
  4358. var meta = module.exports = {
  4359. KEY: META,
  4360. NEED: false,
  4361. fastKey: fastKey,
  4362. getWeak: getWeak,
  4363. onFreeze: onFreeze
  4364. };
  4365. /***/ }),
  4366. /* 58 */
  4367. /***/ (function(module, exports, __webpack_require__) {
  4368. 'use strict';
  4369. var isObject = __webpack_require__(16);
  4370. module.exports = function (it, TYPE) {
  4371. if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!');
  4372. return it;
  4373. };
  4374. /***/ }),
  4375. /* 59 */
  4376. /***/ (function(module, exports, __webpack_require__) {
  4377. 'use strict';
  4378. __webpack_require__(440);
  4379. var global = __webpack_require__(15);
  4380. var hide = __webpack_require__(29);
  4381. var Iterators = __webpack_require__(56);
  4382. var TO_STRING_TAG = __webpack_require__(13)('toStringTag');
  4383. var DOMIterables = ('CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,' + 'DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,' + 'MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,' + 'SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,' + 'TextTrackList,TouchList').split(',');
  4384. for (var i = 0; i < DOMIterables.length; i++) {
  4385. var NAME = DOMIterables[i];
  4386. var Collection = global[NAME];
  4387. var proto = Collection && Collection.prototype;
  4388. if (proto && !proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME);
  4389. Iterators[NAME] = Iterators.Array;
  4390. }
  4391. /***/ }),
  4392. /* 60 */
  4393. /***/ (function(module, exports) {
  4394. "use strict";
  4395. /**
  4396. * A specialized version of `_.map` for arrays without support for iteratee
  4397. * shorthands.
  4398. *
  4399. * @private
  4400. * @param {Array} [array] The array to iterate over.
  4401. * @param {Function} iteratee The function invoked per iteration.
  4402. * @returns {Array} Returns the new mapped array.
  4403. */
  4404. function arrayMap(array, iteratee) {
  4405. var index = -1,
  4406. length = array == null ? 0 : array.length,
  4407. result = Array(length);
  4408. while (++index < length) {
  4409. result[index] = iteratee(array[index], index, array);
  4410. }
  4411. return result;
  4412. }
  4413. module.exports = arrayMap;
  4414. /***/ }),
  4415. /* 61 */
  4416. /***/ (function(module, exports, __webpack_require__) {
  4417. 'use strict';
  4418. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  4419. var baseMatches = __webpack_require__(502),
  4420. baseMatchesProperty = __webpack_require__(503),
  4421. identity = __webpack_require__(110),
  4422. isArray = __webpack_require__(6),
  4423. property = __webpack_require__(592);
  4424. /**
  4425. * The base implementation of `_.iteratee`.
  4426. *
  4427. * @private
  4428. * @param {*} [value=_.identity] The value to convert to an iteratee.
  4429. * @returns {Function} Returns the iteratee.
  4430. */
  4431. function baseIteratee(value) {
  4432. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  4433. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  4434. if (typeof value == 'function') {
  4435. return value;
  4436. }
  4437. if (value == null) {
  4438. return identity;
  4439. }
  4440. if ((typeof value === 'undefined' ? 'undefined' : _typeof(value)) == 'object') {
  4441. return isArray(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value);
  4442. }
  4443. return property(value);
  4444. }
  4445. module.exports = baseIteratee;
  4446. /***/ }),
  4447. /* 62 */
  4448. /***/ (function(module, exports, __webpack_require__) {
  4449. 'use strict';
  4450. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  4451. var baseGetTag = __webpack_require__(30),
  4452. isObjectLike = __webpack_require__(25);
  4453. /** `Object#toString` result references. */
  4454. var symbolTag = '[object Symbol]';
  4455. /**
  4456. * Checks if `value` is classified as a `Symbol` primitive or object.
  4457. *
  4458. * @static
  4459. * @memberOf _
  4460. * @since 4.0.0
  4461. * @category Lang
  4462. * @param {*} value The value to check.
  4463. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  4464. * @example
  4465. *
  4466. * _.isSymbol(Symbol.iterator);
  4467. * // => true
  4468. *
  4469. * _.isSymbol('abc');
  4470. * // => false
  4471. */
  4472. function isSymbol(value) {
  4473. return (typeof value === 'undefined' ? 'undefined' : _typeof(value)) == 'symbol' || isObjectLike(value) && baseGetTag(value) == symbolTag;
  4474. }
  4475. module.exports = isSymbol;
  4476. /***/ }),
  4477. /* 63 */
  4478. /***/ (function(module, exports) {
  4479. 'use strict';
  4480. /* -*- Mode: js; js-indent-level: 2; -*- */
  4481. /*
  4482. * Copyright 2011 Mozilla Foundation and contributors
  4483. * Licensed under the New BSD license. See LICENSE or:
  4484. * http://opensource.org/licenses/BSD-3-Clause
  4485. */
  4486. /**
  4487. * This is a helper function for getting values from parameter/options
  4488. * objects.
  4489. *
  4490. * @param args The object we are extracting values from
  4491. * @param name The name of the property we are getting.
  4492. * @param defaultValue An optional value to return if the property is missing
  4493. * from the object. If this is not specified and the property is missing, an
  4494. * error will be thrown.
  4495. */
  4496. function getArg(aArgs, aName, aDefaultValue) {
  4497. if (aName in aArgs) {
  4498. return aArgs[aName];
  4499. } else if (arguments.length === 3) {
  4500. return aDefaultValue;
  4501. } else {
  4502. throw new Error('"' + aName + '" is a required argument.');
  4503. }
  4504. }
  4505. exports.getArg = getArg;
  4506. var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/;
  4507. var dataUrlRegexp = /^data:.+\,.+$/;
  4508. function urlParse(aUrl) {
  4509. var match = aUrl.match(urlRegexp);
  4510. if (!match) {
  4511. return null;
  4512. }
  4513. return {
  4514. scheme: match[1],
  4515. auth: match[2],
  4516. host: match[3],
  4517. port: match[4],
  4518. path: match[5]
  4519. };
  4520. }
  4521. exports.urlParse = urlParse;
  4522. function urlGenerate(aParsedUrl) {
  4523. var url = '';
  4524. if (aParsedUrl.scheme) {
  4525. url += aParsedUrl.scheme + ':';
  4526. }
  4527. url += '//';
  4528. if (aParsedUrl.auth) {
  4529. url += aParsedUrl.auth + '@';
  4530. }
  4531. if (aParsedUrl.host) {
  4532. url += aParsedUrl.host;
  4533. }
  4534. if (aParsedUrl.port) {
  4535. url += ":" + aParsedUrl.port;
  4536. }
  4537. if (aParsedUrl.path) {
  4538. url += aParsedUrl.path;
  4539. }
  4540. return url;
  4541. }
  4542. exports.urlGenerate = urlGenerate;
  4543. /**
  4544. * Normalizes a path, or the path portion of a URL:
  4545. *
  4546. * - Replaces consecutive slashes with one slash.
  4547. * - Removes unnecessary '.' parts.
  4548. * - Removes unnecessary '<dir>/..' parts.
  4549. *
  4550. * Based on code in the Node.js 'path' core module.
  4551. *
  4552. * @param aPath The path or url to normalize.
  4553. */
  4554. function normalize(aPath) {
  4555. var path = aPath;
  4556. var url = urlParse(aPath);
  4557. if (url) {
  4558. if (!url.path) {
  4559. return aPath;
  4560. }
  4561. path = url.path;
  4562. }
  4563. var isAbsolute = exports.isAbsolute(path);
  4564. var parts = path.split(/\/+/);
  4565. for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {
  4566. part = parts[i];
  4567. if (part === '.') {
  4568. parts.splice(i, 1);
  4569. } else if (part === '..') {
  4570. up++;
  4571. } else if (up > 0) {
  4572. if (part === '') {
  4573. // The first part is blank if the path is absolute. Trying to go
  4574. // above the root is a no-op. Therefore we can remove all '..' parts
  4575. // directly after the root.
  4576. parts.splice(i + 1, up);
  4577. up = 0;
  4578. } else {
  4579. parts.splice(i, 2);
  4580. up--;
  4581. }
  4582. }
  4583. }
  4584. path = parts.join('/');
  4585. if (path === '') {
  4586. path = isAbsolute ? '/' : '.';
  4587. }
  4588. if (url) {
  4589. url.path = path;
  4590. return urlGenerate(url);
  4591. }
  4592. return path;
  4593. }
  4594. exports.normalize = normalize;
  4595. /**
  4596. * Joins two paths/URLs.
  4597. *
  4598. * @param aRoot The root path or URL.
  4599. * @param aPath The path or URL to be joined with the root.
  4600. *
  4601. * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a
  4602. * scheme-relative URL: Then the scheme of aRoot, if any, is prepended
  4603. * first.
  4604. * - Otherwise aPath is a path. If aRoot is a URL, then its path portion
  4605. * is updated with the result and aRoot is returned. Otherwise the result
  4606. * is returned.
  4607. * - If aPath is absolute, the result is aPath.
  4608. * - Otherwise the two paths are joined with a slash.
  4609. * - Joining for example 'http://' and 'www.example.com' is also supported.
  4610. */
  4611. function join(aRoot, aPath) {
  4612. if (aRoot === "") {
  4613. aRoot = ".";
  4614. }
  4615. if (aPath === "") {
  4616. aPath = ".";
  4617. }
  4618. var aPathUrl = urlParse(aPath);
  4619. var aRootUrl = urlParse(aRoot);
  4620. if (aRootUrl) {
  4621. aRoot = aRootUrl.path || '/';
  4622. }
  4623. // `join(foo, '//www.example.org')`
  4624. if (aPathUrl && !aPathUrl.scheme) {
  4625. if (aRootUrl) {
  4626. aPathUrl.scheme = aRootUrl.scheme;
  4627. }
  4628. return urlGenerate(aPathUrl);
  4629. }
  4630. if (aPathUrl || aPath.match(dataUrlRegexp)) {
  4631. return aPath;
  4632. }
  4633. // `join('http://', 'www.example.com')`
  4634. if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {
  4635. aRootUrl.host = aPath;
  4636. return urlGenerate(aRootUrl);
  4637. }
  4638. var joined = aPath.charAt(0) === '/' ? aPath : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath);
  4639. if (aRootUrl) {
  4640. aRootUrl.path = joined;
  4641. return urlGenerate(aRootUrl);
  4642. }
  4643. return joined;
  4644. }
  4645. exports.join = join;
  4646. exports.isAbsolute = function (aPath) {
  4647. return aPath.charAt(0) === '/' || !!aPath.match(urlRegexp);
  4648. };
  4649. /**
  4650. * Make a path relative to a URL or another path.
  4651. *
  4652. * @param aRoot The root path or URL.
  4653. * @param aPath The path or URL to be made relative to aRoot.
  4654. */
  4655. function relative(aRoot, aPath) {
  4656. if (aRoot === "") {
  4657. aRoot = ".";
  4658. }
  4659. aRoot = aRoot.replace(/\/$/, '');
  4660. // It is possible for the path to be above the root. In this case, simply
  4661. // checking whether the root is a prefix of the path won't work. Instead, we
  4662. // need to remove components from the root one by one, until either we find
  4663. // a prefix that fits, or we run out of components to remove.
  4664. var level = 0;
  4665. while (aPath.indexOf(aRoot + '/') !== 0) {
  4666. var index = aRoot.lastIndexOf("/");
  4667. if (index < 0) {
  4668. return aPath;
  4669. }
  4670. // If the only part of the root that is left is the scheme (i.e. http://,
  4671. // file:///, etc.), one or more slashes (/), or simply nothing at all, we
  4672. // have exhausted all components, so the path is not relative to the root.
  4673. aRoot = aRoot.slice(0, index);
  4674. if (aRoot.match(/^([^\/]+:\/)?\/*$/)) {
  4675. return aPath;
  4676. }
  4677. ++level;
  4678. }
  4679. // Make sure we add a "../" for each component we removed from the root.
  4680. return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1);
  4681. }
  4682. exports.relative = relative;
  4683. var supportsNullProto = function () {
  4684. var obj = Object.create(null);
  4685. return !('__proto__' in obj);
  4686. }();
  4687. function identity(s) {
  4688. return s;
  4689. }
  4690. /**
  4691. * Because behavior goes wacky when you set `__proto__` on objects, we
  4692. * have to prefix all the strings in our set with an arbitrary character.
  4693. *
  4694. * See https://github.com/mozilla/source-map/pull/31 and
  4695. * https://github.com/mozilla/source-map/issues/30
  4696. *
  4697. * @param String aStr
  4698. */
  4699. function toSetString(aStr) {
  4700. if (isProtoString(aStr)) {
  4701. return '$' + aStr;
  4702. }
  4703. return aStr;
  4704. }
  4705. exports.toSetString = supportsNullProto ? identity : toSetString;
  4706. function fromSetString(aStr) {
  4707. if (isProtoString(aStr)) {
  4708. return aStr.slice(1);
  4709. }
  4710. return aStr;
  4711. }
  4712. exports.fromSetString = supportsNullProto ? identity : fromSetString;
  4713. function isProtoString(s) {
  4714. if (!s) {
  4715. return false;
  4716. }
  4717. var length = s.length;
  4718. if (length < 9 /* "__proto__".length */) {
  4719. return false;
  4720. }
  4721. if (s.charCodeAt(length - 1) !== 95 /* '_' */ || s.charCodeAt(length - 2) !== 95 /* '_' */ || s.charCodeAt(length - 3) !== 111 /* 'o' */ || s.charCodeAt(length - 4) !== 116 /* 't' */ || s.charCodeAt(length - 5) !== 111 /* 'o' */ || s.charCodeAt(length - 6) !== 114 /* 'r' */ || s.charCodeAt(length - 7) !== 112 /* 'p' */ || s.charCodeAt(length - 8) !== 95 /* '_' */ || s.charCodeAt(length - 9) !== 95 /* '_' */) {
  4722. return false;
  4723. }
  4724. for (var i = length - 10; i >= 0; i--) {
  4725. if (s.charCodeAt(i) !== 36 /* '$' */) {
  4726. return false;
  4727. }
  4728. }
  4729. return true;
  4730. }
  4731. /**
  4732. * Comparator between two mappings where the original positions are compared.
  4733. *
  4734. * Optionally pass in `true` as `onlyCompareGenerated` to consider two
  4735. * mappings with the same original source/line/column, but different generated
  4736. * line and column the same. Useful when searching for a mapping with a
  4737. * stubbed out mapping.
  4738. */
  4739. function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {
  4740. var cmp = mappingA.source - mappingB.source;
  4741. if (cmp !== 0) {
  4742. return cmp;
  4743. }
  4744. cmp = mappingA.originalLine - mappingB.originalLine;
  4745. if (cmp !== 0) {
  4746. return cmp;
  4747. }
  4748. cmp = mappingA.originalColumn - mappingB.originalColumn;
  4749. if (cmp !== 0 || onlyCompareOriginal) {
  4750. return cmp;
  4751. }
  4752. cmp = mappingA.generatedColumn - mappingB.generatedColumn;
  4753. if (cmp !== 0) {
  4754. return cmp;
  4755. }
  4756. cmp = mappingA.generatedLine - mappingB.generatedLine;
  4757. if (cmp !== 0) {
  4758. return cmp;
  4759. }
  4760. return mappingA.name - mappingB.name;
  4761. }
  4762. exports.compareByOriginalPositions = compareByOriginalPositions;
  4763. /**
  4764. * Comparator between two mappings with deflated source and name indices where
  4765. * the generated positions are compared.
  4766. *
  4767. * Optionally pass in `true` as `onlyCompareGenerated` to consider two
  4768. * mappings with the same generated line and column, but different
  4769. * source/name/original line and column the same. Useful when searching for a
  4770. * mapping with a stubbed out mapping.
  4771. */
  4772. function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {
  4773. var cmp = mappingA.generatedLine - mappingB.generatedLine;
  4774. if (cmp !== 0) {
  4775. return cmp;
  4776. }
  4777. cmp = mappingA.generatedColumn - mappingB.generatedColumn;
  4778. if (cmp !== 0 || onlyCompareGenerated) {
  4779. return cmp;
  4780. }
  4781. cmp = mappingA.source - mappingB.source;
  4782. if (cmp !== 0) {
  4783. return cmp;
  4784. }
  4785. cmp = mappingA.originalLine - mappingB.originalLine;
  4786. if (cmp !== 0) {
  4787. return cmp;
  4788. }
  4789. cmp = mappingA.originalColumn - mappingB.originalColumn;
  4790. if (cmp !== 0) {
  4791. return cmp;
  4792. }
  4793. return mappingA.name - mappingB.name;
  4794. }
  4795. exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;
  4796. function strcmp(aStr1, aStr2) {
  4797. if (aStr1 === aStr2) {
  4798. return 0;
  4799. }
  4800. if (aStr1 > aStr2) {
  4801. return 1;
  4802. }
  4803. return -1;
  4804. }
  4805. /**
  4806. * Comparator between two mappings with inflated source and name strings where
  4807. * the generated positions are compared.
  4808. */
  4809. function compareByGeneratedPositionsInflated(mappingA, mappingB) {
  4810. var cmp = mappingA.generatedLine - mappingB.generatedLine;
  4811. if (cmp !== 0) {
  4812. return cmp;
  4813. }
  4814. cmp = mappingA.generatedColumn - mappingB.generatedColumn;
  4815. if (cmp !== 0) {
  4816. return cmp;
  4817. }
  4818. cmp = strcmp(mappingA.source, mappingB.source);
  4819. if (cmp !== 0) {
  4820. return cmp;
  4821. }
  4822. cmp = mappingA.originalLine - mappingB.originalLine;
  4823. if (cmp !== 0) {
  4824. return cmp;
  4825. }
  4826. cmp = mappingA.originalColumn - mappingB.originalColumn;
  4827. if (cmp !== 0) {
  4828. return cmp;
  4829. }
  4830. return strcmp(mappingA.name, mappingB.name);
  4831. }
  4832. exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;
  4833. /***/ }),
  4834. /* 64 */
  4835. /***/ (function(module, exports, __webpack_require__) {
  4836. /* WEBPACK VAR INJECTION */(function(global) {'use strict';
  4837. // compare and isBuffer taken from https://github.com/feross/buffer/blob/680e9e5e488f22aac27599a57dc844a6315928dd/index.js
  4838. // original notice:
  4839. /*!
  4840. * The buffer module from node.js, for the browser.
  4841. *
  4842. * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
  4843. * @license MIT
  4844. */
  4845. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  4846. function compare(a, b) {
  4847. if (a === b) {
  4848. return 0;
  4849. }
  4850. var x = a.length;
  4851. var y = b.length;
  4852. for (var i = 0, len = Math.min(x, y); i < len; ++i) {
  4853. if (a[i] !== b[i]) {
  4854. x = a[i];
  4855. y = b[i];
  4856. break;
  4857. }
  4858. }
  4859. if (x < y) {
  4860. return -1;
  4861. }
  4862. if (y < x) {
  4863. return 1;
  4864. }
  4865. return 0;
  4866. }
  4867. function isBuffer(b) {
  4868. if (global.Buffer && typeof global.Buffer.isBuffer === 'function') {
  4869. return global.Buffer.isBuffer(b);
  4870. }
  4871. return !!(b != null && b._isBuffer);
  4872. }
  4873. // based on node assert, original notice:
  4874. // http://wiki.commonjs.org/wiki/Unit_Testing/1.0
  4875. //
  4876. // THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8!
  4877. //
  4878. // Originally from narwhal.js (http://narwhaljs.org)
  4879. // Copyright (c) 2009 Thomas Robinson <280north.com>
  4880. //
  4881. // Permission is hereby granted, free of charge, to any person obtaining a copy
  4882. // of this software and associated documentation files (the 'Software'), to
  4883. // deal in the Software without restriction, including without limitation the
  4884. // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  4885. // sell copies of the Software, and to permit persons to whom the Software is
  4886. // furnished to do so, subject to the following conditions:
  4887. //
  4888. // The above copyright notice and this permission notice shall be included in
  4889. // all copies or substantial portions of the Software.
  4890. //
  4891. // THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  4892. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  4893. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  4894. // AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
  4895. // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  4896. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  4897. var util = __webpack_require__(117);
  4898. var hasOwn = Object.prototype.hasOwnProperty;
  4899. var pSlice = Array.prototype.slice;
  4900. var functionsHaveNames = function () {
  4901. return function foo() {}.name === 'foo';
  4902. }();
  4903. function pToString(obj) {
  4904. return Object.prototype.toString.call(obj);
  4905. }
  4906. function isView(arrbuf) {
  4907. if (isBuffer(arrbuf)) {
  4908. return false;
  4909. }
  4910. if (typeof global.ArrayBuffer !== 'function') {
  4911. return false;
  4912. }
  4913. if (typeof ArrayBuffer.isView === 'function') {
  4914. return ArrayBuffer.isView(arrbuf);
  4915. }
  4916. if (!arrbuf) {
  4917. return false;
  4918. }
  4919. if (arrbuf instanceof DataView) {
  4920. return true;
  4921. }
  4922. if (arrbuf.buffer && arrbuf.buffer instanceof ArrayBuffer) {
  4923. return true;
  4924. }
  4925. return false;
  4926. }
  4927. // 1. The assert module provides functions that throw
  4928. // AssertionError's when particular conditions are not met. The
  4929. // assert module must conform to the following interface.
  4930. var assert = module.exports = ok;
  4931. // 2. The AssertionError is defined in assert.
  4932. // new assert.AssertionError({ message: message,
  4933. // actual: actual,
  4934. // expected: expected })
  4935. var regex = /\s*function\s+([^\(\s]*)\s*/;
  4936. // based on https://github.com/ljharb/function.prototype.name/blob/adeeeec8bfcc6068b187d7d9fb3d5bb1d3a30899/implementation.js
  4937. function getName(func) {
  4938. if (!util.isFunction(func)) {
  4939. return;
  4940. }
  4941. if (functionsHaveNames) {
  4942. return func.name;
  4943. }
  4944. var str = func.toString();
  4945. var match = str.match(regex);
  4946. return match && match[1];
  4947. }
  4948. assert.AssertionError = function AssertionError(options) {
  4949. this.name = 'AssertionError';
  4950. this.actual = options.actual;
  4951. this.expected = options.expected;
  4952. this.operator = options.operator;
  4953. if (options.message) {
  4954. this.message = options.message;
  4955. this.generatedMessage = false;
  4956. } else {
  4957. this.message = getMessage(this);
  4958. this.generatedMessage = true;
  4959. }
  4960. var stackStartFunction = options.stackStartFunction || fail;
  4961. if (Error.captureStackTrace) {
  4962. Error.captureStackTrace(this, stackStartFunction);
  4963. } else {
  4964. // non v8 browsers so we can have a stacktrace
  4965. var err = new Error();
  4966. if (err.stack) {
  4967. var out = err.stack;
  4968. // try to strip useless frames
  4969. var fn_name = getName(stackStartFunction);
  4970. var idx = out.indexOf('\n' + fn_name);
  4971. if (idx >= 0) {
  4972. // once we have located the function frame
  4973. // we need to strip out everything before it (and its line)
  4974. var next_line = out.indexOf('\n', idx + 1);
  4975. out = out.substring(next_line + 1);
  4976. }
  4977. this.stack = out;
  4978. }
  4979. }
  4980. };
  4981. // assert.AssertionError instanceof Error
  4982. util.inherits(assert.AssertionError, Error);
  4983. function truncate(s, n) {
  4984. if (typeof s === 'string') {
  4985. return s.length < n ? s : s.slice(0, n);
  4986. } else {
  4987. return s;
  4988. }
  4989. }
  4990. function inspect(something) {
  4991. if (functionsHaveNames || !util.isFunction(something)) {
  4992. return util.inspect(something);
  4993. }
  4994. var rawname = getName(something);
  4995. var name = rawname ? ': ' + rawname : '';
  4996. return '[Function' + name + ']';
  4997. }
  4998. function getMessage(self) {
  4999. return truncate(inspect(self.actual), 128) + ' ' + self.operator + ' ' + truncate(inspect(self.expected), 128);
  5000. }
  5001. // At present only the three keys mentioned above are used and
  5002. // understood by the spec. Implementations or sub modules can pass
  5003. // other keys to the AssertionError's constructor - they will be
  5004. // ignored.
  5005. // 3. All of the following functions must throw an AssertionError
  5006. // when a corresponding condition is not met, with a message that
  5007. // may be undefined if not provided. All assertion methods provide
  5008. // both the actual and expected values to the assertion error for
  5009. // display purposes.
  5010. function fail(actual, expected, message, operator, stackStartFunction) {
  5011. throw new assert.AssertionError({
  5012. message: message,
  5013. actual: actual,
  5014. expected: expected,
  5015. operator: operator,
  5016. stackStartFunction: stackStartFunction
  5017. });
  5018. }
  5019. // EXTENSION! allows for well behaved errors defined elsewhere.
  5020. assert.fail = fail;
  5021. // 4. Pure assertion tests whether a value is truthy, as determined
  5022. // by !!guard.
  5023. // assert.ok(guard, message_opt);
  5024. // This statement is equivalent to assert.equal(true, !!guard,
  5025. // message_opt);. To test strictly for the value true, use
  5026. // assert.strictEqual(true, guard, message_opt);.
  5027. function ok(value, message) {
  5028. if (!value) fail(value, true, message, '==', assert.ok);
  5029. }
  5030. assert.ok = ok;
  5031. // 5. The equality assertion tests shallow, coercive equality with
  5032. // ==.
  5033. // assert.equal(actual, expected, message_opt);
  5034. assert.equal = function equal(actual, expected, message) {
  5035. if (actual != expected) fail(actual, expected, message, '==', assert.equal);
  5036. };
  5037. // 6. The non-equality assertion tests for whether two objects are not equal
  5038. // with != assert.notEqual(actual, expected, message_opt);
  5039. assert.notEqual = function notEqual(actual, expected, message) {
  5040. if (actual == expected) {
  5041. fail(actual, expected, message, '!=', assert.notEqual);
  5042. }
  5043. };
  5044. // 7. The equivalence assertion tests a deep equality relation.
  5045. // assert.deepEqual(actual, expected, message_opt);
  5046. assert.deepEqual = function deepEqual(actual, expected, message) {
  5047. if (!_deepEqual(actual, expected, false)) {
  5048. fail(actual, expected, message, 'deepEqual', assert.deepEqual);
  5049. }
  5050. };
  5051. assert.deepStrictEqual = function deepStrictEqual(actual, expected, message) {
  5052. if (!_deepEqual(actual, expected, true)) {
  5053. fail(actual, expected, message, 'deepStrictEqual', assert.deepStrictEqual);
  5054. }
  5055. };
  5056. function _deepEqual(actual, expected, strict, memos) {
  5057. // 7.1. All identical values are equivalent, as determined by ===.
  5058. if (actual === expected) {
  5059. return true;
  5060. } else if (isBuffer(actual) && isBuffer(expected)) {
  5061. return compare(actual, expected) === 0;
  5062. // 7.2. If the expected value is a Date object, the actual value is
  5063. // equivalent if it is also a Date object that refers to the same time.
  5064. } else if (util.isDate(actual) && util.isDate(expected)) {
  5065. return actual.getTime() === expected.getTime();
  5066. // 7.3 If the expected value is a RegExp object, the actual value is
  5067. // equivalent if it is also a RegExp object with the same source and
  5068. // properties (`global`, `multiline`, `lastIndex`, `ignoreCase`).
  5069. } else if (util.isRegExp(actual) && util.isRegExp(expected)) {
  5070. return actual.source === expected.source && actual.global === expected.global && actual.multiline === expected.multiline && actual.lastIndex === expected.lastIndex && actual.ignoreCase === expected.ignoreCase;
  5071. // 7.4. Other pairs that do not both pass typeof value == 'object',
  5072. // equivalence is determined by ==.
  5073. } else if ((actual === null || (typeof actual === 'undefined' ? 'undefined' : _typeof(actual)) !== 'object') && (expected === null || (typeof expected === 'undefined' ? 'undefined' : _typeof(expected)) !== 'object')) {
  5074. return strict ? actual === expected : actual == expected;
  5075. // If both values are instances of typed arrays, wrap their underlying
  5076. // ArrayBuffers in a Buffer each to increase performance
  5077. // This optimization requires the arrays to have the same type as checked by
  5078. // Object.prototype.toString (aka pToString). Never perform binary
  5079. // comparisons for Float*Arrays, though, since e.g. +0 === -0 but their
  5080. // bit patterns are not identical.
  5081. } else if (isView(actual) && isView(expected) && pToString(actual) === pToString(expected) && !(actual instanceof Float32Array || actual instanceof Float64Array)) {
  5082. return compare(new Uint8Array(actual.buffer), new Uint8Array(expected.buffer)) === 0;
  5083. // 7.5 For all other Object pairs, including Array objects, equivalence is
  5084. // determined by having the same number of owned properties (as verified
  5085. // with Object.prototype.hasOwnProperty.call), the same set of keys
  5086. // (although not necessarily the same order), equivalent values for every
  5087. // corresponding key, and an identical 'prototype' property. Note: this
  5088. // accounts for both named and indexed properties on Arrays.
  5089. } else if (isBuffer(actual) !== isBuffer(expected)) {
  5090. return false;
  5091. } else {
  5092. memos = memos || { actual: [], expected: [] };
  5093. var actualIndex = memos.actual.indexOf(actual);
  5094. if (actualIndex !== -1) {
  5095. if (actualIndex === memos.expected.indexOf(expected)) {
  5096. return true;
  5097. }
  5098. }
  5099. memos.actual.push(actual);
  5100. memos.expected.push(expected);
  5101. return objEquiv(actual, expected, strict, memos);
  5102. }
  5103. }
  5104. function isArguments(object) {
  5105. return Object.prototype.toString.call(object) == '[object Arguments]';
  5106. }
  5107. function objEquiv(a, b, strict, actualVisitedObjects) {
  5108. if (a === null || a === undefined || b === null || b === undefined) return false;
  5109. // if one is a primitive, the other must be same
  5110. if (util.isPrimitive(a) || util.isPrimitive(b)) return a === b;
  5111. if (strict && Object.getPrototypeOf(a) !== Object.getPrototypeOf(b)) return false;
  5112. var aIsArgs = isArguments(a);
  5113. var bIsArgs = isArguments(b);
  5114. if (aIsArgs && !bIsArgs || !aIsArgs && bIsArgs) return false;
  5115. if (aIsArgs) {
  5116. a = pSlice.call(a);
  5117. b = pSlice.call(b);
  5118. return _deepEqual(a, b, strict);
  5119. }
  5120. var ka = objectKeys(a);
  5121. var kb = objectKeys(b);
  5122. var key, i;
  5123. // having the same number of owned properties (keys incorporates
  5124. // hasOwnProperty)
  5125. if (ka.length !== kb.length) return false;
  5126. //the same set of keys (although not necessarily the same order),
  5127. ka.sort();
  5128. kb.sort();
  5129. //~~~cheap key test
  5130. for (i = ka.length - 1; i >= 0; i--) {
  5131. if (ka[i] !== kb[i]) return false;
  5132. }
  5133. //equivalent values for every corresponding key, and
  5134. //~~~possibly expensive deep test
  5135. for (i = ka.length - 1; i >= 0; i--) {
  5136. key = ka[i];
  5137. if (!_deepEqual(a[key], b[key], strict, actualVisitedObjects)) return false;
  5138. }
  5139. return true;
  5140. }
  5141. // 8. The non-equivalence assertion tests for any deep inequality.
  5142. // assert.notDeepEqual(actual, expected, message_opt);
  5143. assert.notDeepEqual = function notDeepEqual(actual, expected, message) {
  5144. if (_deepEqual(actual, expected, false)) {
  5145. fail(actual, expected, message, 'notDeepEqual', assert.notDeepEqual);
  5146. }
  5147. };
  5148. assert.notDeepStrictEqual = notDeepStrictEqual;
  5149. function notDeepStrictEqual(actual, expected, message) {
  5150. if (_deepEqual(actual, expected, true)) {
  5151. fail(actual, expected, message, 'notDeepStrictEqual', notDeepStrictEqual);
  5152. }
  5153. }
  5154. // 9. The strict equality assertion tests strict equality, as determined by ===.
  5155. // assert.strictEqual(actual, expected, message_opt);
  5156. assert.strictEqual = function strictEqual(actual, expected, message) {
  5157. if (actual !== expected) {
  5158. fail(actual, expected, message, '===', assert.strictEqual);
  5159. }
  5160. };
  5161. // 10. The strict non-equality assertion tests for strict inequality, as
  5162. // determined by !==. assert.notStrictEqual(actual, expected, message_opt);
  5163. assert.notStrictEqual = function notStrictEqual(actual, expected, message) {
  5164. if (actual === expected) {
  5165. fail(actual, expected, message, '!==', assert.notStrictEqual);
  5166. }
  5167. };
  5168. function expectedException(actual, expected) {
  5169. if (!actual || !expected) {
  5170. return false;
  5171. }
  5172. if (Object.prototype.toString.call(expected) == '[object RegExp]') {
  5173. return expected.test(actual);
  5174. }
  5175. try {
  5176. if (actual instanceof expected) {
  5177. return true;
  5178. }
  5179. } catch (e) {
  5180. // Ignore. The instanceof check doesn't work for arrow functions.
  5181. }
  5182. if (Error.isPrototypeOf(expected)) {
  5183. return false;
  5184. }
  5185. return expected.call({}, actual) === true;
  5186. }
  5187. function _tryBlock(block) {
  5188. var error;
  5189. try {
  5190. block();
  5191. } catch (e) {
  5192. error = e;
  5193. }
  5194. return error;
  5195. }
  5196. function _throws(shouldThrow, block, expected, message) {
  5197. var actual;
  5198. if (typeof block !== 'function') {
  5199. throw new TypeError('"block" argument must be a function');
  5200. }
  5201. if (typeof expected === 'string') {
  5202. message = expected;
  5203. expected = null;
  5204. }
  5205. actual = _tryBlock(block);
  5206. message = (expected && expected.name ? ' (' + expected.name + ').' : '.') + (message ? ' ' + message : '.');
  5207. if (shouldThrow && !actual) {
  5208. fail(actual, expected, 'Missing expected exception' + message);
  5209. }
  5210. var userProvidedMessage = typeof message === 'string';
  5211. var isUnwantedException = !shouldThrow && util.isError(actual);
  5212. var isUnexpectedException = !shouldThrow && actual && !expected;
  5213. if (isUnwantedException && userProvidedMessage && expectedException(actual, expected) || isUnexpectedException) {
  5214. fail(actual, expected, 'Got unwanted exception' + message);
  5215. }
  5216. if (shouldThrow && actual && expected && !expectedException(actual, expected) || !shouldThrow && actual) {
  5217. throw actual;
  5218. }
  5219. }
  5220. // 11. Expected to throw an error:
  5221. // assert.throws(block, Error_opt, message_opt);
  5222. assert.throws = function (block, /*optional*/error, /*optional*/message) {
  5223. _throws(true, block, error, message);
  5224. };
  5225. // EXTENSION! This is annoying to write outside this module.
  5226. assert.doesNotThrow = function (block, /*optional*/error, /*optional*/message) {
  5227. _throws(false, block, error, message);
  5228. };
  5229. assert.ifError = function (err) {
  5230. if (err) throw err;
  5231. };
  5232. var objectKeys = Object.keys || function (obj) {
  5233. var keys = [];
  5234. for (var key in obj) {
  5235. if (hasOwn.call(obj, key)) keys.push(key);
  5236. }
  5237. return keys;
  5238. };
  5239. /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
  5240. /***/ }),
  5241. /* 65 */
  5242. /***/ (function(module, exports, __webpack_require__) {
  5243. "use strict";
  5244. exports.__esModule = true;
  5245. var _getIterator2 = __webpack_require__(2);
  5246. var _getIterator3 = _interopRequireDefault(_getIterator2);
  5247. var _classCallCheck2 = __webpack_require__(3);
  5248. var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
  5249. var _possibleConstructorReturn2 = __webpack_require__(42);
  5250. var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
  5251. var _inherits2 = __webpack_require__(41);
  5252. var _inherits3 = _interopRequireDefault(_inherits2);
  5253. var _optionManager = __webpack_require__(34);
  5254. var _optionManager2 = _interopRequireDefault(_optionManager);
  5255. var _babelMessages = __webpack_require__(20);
  5256. var messages = _interopRequireWildcard(_babelMessages);
  5257. var _store = __webpack_require__(119);
  5258. var _store2 = _interopRequireDefault(_store);
  5259. var _babelTraverse = __webpack_require__(7);
  5260. var _babelTraverse2 = _interopRequireDefault(_babelTraverse);
  5261. var _assign = __webpack_require__(174);
  5262. var _assign2 = _interopRequireDefault(_assign);
  5263. var _clone = __webpack_require__(109);
  5264. var _clone2 = _interopRequireDefault(_clone);
  5265. function _interopRequireWildcard(obj) {
  5266. if (obj && obj.__esModule) {
  5267. return obj;
  5268. } else {
  5269. var newObj = {};if (obj != null) {
  5270. for (var key in obj) {
  5271. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  5272. }
  5273. }newObj.default = obj;return newObj;
  5274. }
  5275. }
  5276. function _interopRequireDefault(obj) {
  5277. return obj && obj.__esModule ? obj : { default: obj };
  5278. }
  5279. var GLOBAL_VISITOR_PROPS = ["enter", "exit"];
  5280. var Plugin = function (_Store) {
  5281. (0, _inherits3.default)(Plugin, _Store);
  5282. function Plugin(plugin, key) {
  5283. (0, _classCallCheck3.default)(this, Plugin);
  5284. var _this = (0, _possibleConstructorReturn3.default)(this, _Store.call(this));
  5285. _this.initialized = false;
  5286. _this.raw = (0, _assign2.default)({}, plugin);
  5287. _this.key = _this.take("name") || key;
  5288. _this.manipulateOptions = _this.take("manipulateOptions");
  5289. _this.post = _this.take("post");
  5290. _this.pre = _this.take("pre");
  5291. _this.visitor = _this.normaliseVisitor((0, _clone2.default)(_this.take("visitor")) || {});
  5292. return _this;
  5293. }
  5294. Plugin.prototype.take = function take(key) {
  5295. var val = this.raw[key];
  5296. delete this.raw[key];
  5297. return val;
  5298. };
  5299. Plugin.prototype.chain = function chain(target, key) {
  5300. if (!target[key]) return this[key];
  5301. if (!this[key]) return target[key];
  5302. var fns = [target[key], this[key]];
  5303. return function () {
  5304. var val = void 0;
  5305. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  5306. args[_key] = arguments[_key];
  5307. }
  5308. for (var _iterator = fns, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
  5309. var _ref;
  5310. if (_isArray) {
  5311. if (_i >= _iterator.length) break;
  5312. _ref = _iterator[_i++];
  5313. } else {
  5314. _i = _iterator.next();
  5315. if (_i.done) break;
  5316. _ref = _i.value;
  5317. }
  5318. var fn = _ref;
  5319. if (fn) {
  5320. var ret = fn.apply(this, args);
  5321. if (ret != null) val = ret;
  5322. }
  5323. }
  5324. return val;
  5325. };
  5326. };
  5327. Plugin.prototype.maybeInherit = function maybeInherit(loc) {
  5328. var inherits = this.take("inherits");
  5329. if (!inherits) return;
  5330. inherits = _optionManager2.default.normalisePlugin(inherits, loc, "inherits");
  5331. this.manipulateOptions = this.chain(inherits, "manipulateOptions");
  5332. this.post = this.chain(inherits, "post");
  5333. this.pre = this.chain(inherits, "pre");
  5334. this.visitor = _babelTraverse2.default.visitors.merge([inherits.visitor, this.visitor]);
  5335. };
  5336. Plugin.prototype.init = function init(loc, i) {
  5337. if (this.initialized) return;
  5338. this.initialized = true;
  5339. this.maybeInherit(loc);
  5340. for (var key in this.raw) {
  5341. throw new Error(messages.get("pluginInvalidProperty", loc, i, key));
  5342. }
  5343. };
  5344. Plugin.prototype.normaliseVisitor = function normaliseVisitor(visitor) {
  5345. for (var _iterator2 = GLOBAL_VISITOR_PROPS, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) {
  5346. var _ref2;
  5347. if (_isArray2) {
  5348. if (_i2 >= _iterator2.length) break;
  5349. _ref2 = _iterator2[_i2++];
  5350. } else {
  5351. _i2 = _iterator2.next();
  5352. if (_i2.done) break;
  5353. _ref2 = _i2.value;
  5354. }
  5355. var key = _ref2;
  5356. if (visitor[key]) {
  5357. throw new Error("Plugins aren't allowed to specify catch-all enter/exit handlers. " + "Please target individual nodes.");
  5358. }
  5359. }
  5360. _babelTraverse2.default.explode(visitor);
  5361. return visitor;
  5362. };
  5363. return Plugin;
  5364. }(_store2.default);
  5365. exports.default = Plugin;
  5366. module.exports = exports["default"];
  5367. /***/ }),
  5368. /* 66 */
  5369. /***/ (function(module, exports, __webpack_require__) {
  5370. "use strict";
  5371. exports.__esModule = true;
  5372. var _getIterator2 = __webpack_require__(2);
  5373. var _getIterator3 = _interopRequireDefault(_getIterator2);
  5374. exports.default = function (_ref) {
  5375. var messages = _ref.messages;
  5376. return {
  5377. visitor: {
  5378. Scope: function Scope(_ref2) {
  5379. var scope = _ref2.scope;
  5380. for (var name in scope.bindings) {
  5381. var binding = scope.bindings[name];
  5382. if (binding.kind !== "const" && binding.kind !== "module") continue;
  5383. for (var _iterator = binding.constantViolations, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
  5384. var _ref3;
  5385. if (_isArray) {
  5386. if (_i >= _iterator.length) break;
  5387. _ref3 = _iterator[_i++];
  5388. } else {
  5389. _i = _iterator.next();
  5390. if (_i.done) break;
  5391. _ref3 = _i.value;
  5392. }
  5393. var violation = _ref3;
  5394. throw violation.buildCodeFrameError(messages.get("readOnly", name));
  5395. }
  5396. }
  5397. }
  5398. }
  5399. };
  5400. };
  5401. function _interopRequireDefault(obj) {
  5402. return obj && obj.__esModule ? obj : { default: obj };
  5403. }
  5404. module.exports = exports["default"];
  5405. /***/ }),
  5406. /* 67 */
  5407. /***/ (function(module, exports) {
  5408. "use strict";
  5409. exports.__esModule = true;
  5410. exports.default = function () {
  5411. return {
  5412. manipulateOptions: function manipulateOptions(opts, parserOpts) {
  5413. parserOpts.plugins.push("asyncFunctions");
  5414. }
  5415. };
  5416. };
  5417. module.exports = exports["default"];
  5418. /***/ }),
  5419. /* 68 */
  5420. /***/ (function(module, exports) {
  5421. "use strict";
  5422. exports.__esModule = true;
  5423. exports.default = function (_ref) {
  5424. var t = _ref.types;
  5425. return {
  5426. visitor: {
  5427. ArrowFunctionExpression: function ArrowFunctionExpression(path, state) {
  5428. if (state.opts.spec) {
  5429. var node = path.node;
  5430. if (node.shadow) return;
  5431. node.shadow = { this: false };
  5432. node.type = "FunctionExpression";
  5433. var boundThis = t.thisExpression();
  5434. boundThis._forceShadow = path;
  5435. path.ensureBlock();
  5436. path.get("body").unshiftContainer("body", t.expressionStatement(t.callExpression(state.addHelper("newArrowCheck"), [t.thisExpression(), boundThis])));
  5437. path.replaceWith(t.callExpression(t.memberExpression(node, t.identifier("bind")), [t.thisExpression()]));
  5438. } else {
  5439. path.arrowFunctionToShadowed();
  5440. }
  5441. }
  5442. }
  5443. };
  5444. };
  5445. module.exports = exports["default"];
  5446. /***/ }),
  5447. /* 69 */
  5448. /***/ (function(module, exports, __webpack_require__) {
  5449. "use strict";
  5450. exports.__esModule = true;
  5451. var _getIterator2 = __webpack_require__(2);
  5452. var _getIterator3 = _interopRequireDefault(_getIterator2);
  5453. exports.default = function (_ref) {
  5454. var t = _ref.types;
  5455. function statementList(key, path) {
  5456. var paths = path.get(key);
  5457. for (var _iterator = paths, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
  5458. var _ref2;
  5459. if (_isArray) {
  5460. if (_i >= _iterator.length) break;
  5461. _ref2 = _iterator[_i++];
  5462. } else {
  5463. _i = _iterator.next();
  5464. if (_i.done) break;
  5465. _ref2 = _i.value;
  5466. }
  5467. var _path = _ref2;
  5468. var func = _path.node;
  5469. if (!_path.isFunctionDeclaration()) continue;
  5470. var declar = t.variableDeclaration("let", [t.variableDeclarator(func.id, t.toExpression(func))]);
  5471. declar._blockHoist = 2;
  5472. func.id = null;
  5473. _path.replaceWith(declar);
  5474. }
  5475. }
  5476. return {
  5477. visitor: {
  5478. BlockStatement: function BlockStatement(path) {
  5479. var node = path.node,
  5480. parent = path.parent;
  5481. if (t.isFunction(parent, { body: node }) || t.isExportDeclaration(parent)) {
  5482. return;
  5483. }
  5484. statementList("body", path);
  5485. },
  5486. SwitchCase: function SwitchCase(path) {
  5487. statementList("consequent", path);
  5488. }
  5489. }
  5490. };
  5491. };
  5492. function _interopRequireDefault(obj) {
  5493. return obj && obj.__esModule ? obj : { default: obj };
  5494. }
  5495. module.exports = exports["default"];
  5496. /***/ }),
  5497. /* 70 */
  5498. /***/ (function(module, exports, __webpack_require__) {
  5499. "use strict";
  5500. exports.__esModule = true;
  5501. var _symbol = __webpack_require__(10);
  5502. var _symbol2 = _interopRequireDefault(_symbol);
  5503. var _create = __webpack_require__(9);
  5504. var _create2 = _interopRequireDefault(_create);
  5505. var _classCallCheck2 = __webpack_require__(3);
  5506. var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
  5507. exports.default = function () {
  5508. return {
  5509. visitor: {
  5510. VariableDeclaration: function VariableDeclaration(path, file) {
  5511. var node = path.node,
  5512. parent = path.parent,
  5513. scope = path.scope;
  5514. if (!isBlockScoped(node)) return;
  5515. convertBlockScopedToVar(path, null, parent, scope, true);
  5516. if (node._tdzThis) {
  5517. var nodes = [node];
  5518. for (var i = 0; i < node.declarations.length; i++) {
  5519. var decl = node.declarations[i];
  5520. if (decl.init) {
  5521. var assign = t.assignmentExpression("=", decl.id, decl.init);
  5522. assign._ignoreBlockScopingTDZ = true;
  5523. nodes.push(t.expressionStatement(assign));
  5524. }
  5525. decl.init = file.addHelper("temporalUndefined");
  5526. }
  5527. node._blockHoist = 2;
  5528. if (path.isCompletionRecord()) {
  5529. nodes.push(t.expressionStatement(scope.buildUndefinedNode()));
  5530. }
  5531. path.replaceWithMultiple(nodes);
  5532. }
  5533. },
  5534. Loop: function Loop(path, file) {
  5535. var node = path.node,
  5536. parent = path.parent,
  5537. scope = path.scope;
  5538. t.ensureBlock(node);
  5539. var blockScoping = new BlockScoping(path, path.get("body"), parent, scope, file);
  5540. var replace = blockScoping.run();
  5541. if (replace) path.replaceWith(replace);
  5542. },
  5543. CatchClause: function CatchClause(path, file) {
  5544. var parent = path.parent,
  5545. scope = path.scope;
  5546. var blockScoping = new BlockScoping(null, path.get("body"), parent, scope, file);
  5547. blockScoping.run();
  5548. },
  5549. "BlockStatement|SwitchStatement|Program": function BlockStatementSwitchStatementProgram(path, file) {
  5550. if (!ignoreBlock(path)) {
  5551. var blockScoping = new BlockScoping(null, path, path.parent, path.scope, file);
  5552. blockScoping.run();
  5553. }
  5554. }
  5555. }
  5556. };
  5557. };
  5558. var _babelTraverse = __webpack_require__(7);
  5559. var _babelTraverse2 = _interopRequireDefault(_babelTraverse);
  5560. var _tdz = __webpack_require__(330);
  5561. var _babelTypes = __webpack_require__(1);
  5562. var t = _interopRequireWildcard(_babelTypes);
  5563. var _values = __webpack_require__(280);
  5564. var _values2 = _interopRequireDefault(_values);
  5565. var _extend = __webpack_require__(578);
  5566. var _extend2 = _interopRequireDefault(_extend);
  5567. var _babelTemplate = __webpack_require__(4);
  5568. var _babelTemplate2 = _interopRequireDefault(_babelTemplate);
  5569. function _interopRequireWildcard(obj) {
  5570. if (obj && obj.__esModule) {
  5571. return obj;
  5572. } else {
  5573. var newObj = {};if (obj != null) {
  5574. for (var key in obj) {
  5575. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  5576. }
  5577. }newObj.default = obj;return newObj;
  5578. }
  5579. }
  5580. function _interopRequireDefault(obj) {
  5581. return obj && obj.__esModule ? obj : { default: obj };
  5582. }
  5583. function ignoreBlock(path) {
  5584. return t.isLoop(path.parent) || t.isCatchClause(path.parent);
  5585. }
  5586. var buildRetCheck = (0, _babelTemplate2.default)("\n if (typeof RETURN === \"object\") return RETURN.v;\n");
  5587. function isBlockScoped(node) {
  5588. if (!t.isVariableDeclaration(node)) return false;
  5589. if (node[t.BLOCK_SCOPED_SYMBOL]) return true;
  5590. if (node.kind !== "let" && node.kind !== "const") return false;
  5591. return true;
  5592. }
  5593. function convertBlockScopedToVar(path, node, parent, scope) {
  5594. var moveBindingsToParent = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  5595. if (!node) {
  5596. node = path.node;
  5597. }
  5598. if (!t.isFor(parent)) {
  5599. for (var i = 0; i < node.declarations.length; i++) {
  5600. var declar = node.declarations[i];
  5601. declar.init = declar.init || scope.buildUndefinedNode();
  5602. }
  5603. }
  5604. node[t.BLOCK_SCOPED_SYMBOL] = true;
  5605. node.kind = "var";
  5606. if (moveBindingsToParent) {
  5607. var parentScope = scope.getFunctionParent();
  5608. var ids = path.getBindingIdentifiers();
  5609. for (var name in ids) {
  5610. var binding = scope.getOwnBinding(name);
  5611. if (binding) binding.kind = "var";
  5612. scope.moveBindingTo(name, parentScope);
  5613. }
  5614. }
  5615. }
  5616. function isVar(node) {
  5617. return t.isVariableDeclaration(node, { kind: "var" }) && !isBlockScoped(node);
  5618. }
  5619. var letReferenceBlockVisitor = _babelTraverse2.default.visitors.merge([{
  5620. Loop: {
  5621. enter: function enter(path, state) {
  5622. state.loopDepth++;
  5623. },
  5624. exit: function exit(path, state) {
  5625. state.loopDepth--;
  5626. }
  5627. },
  5628. Function: function Function(path, state) {
  5629. if (state.loopDepth > 0) {
  5630. path.traverse(letReferenceFunctionVisitor, state);
  5631. }
  5632. return path.skip();
  5633. }
  5634. }, _tdz.visitor]);
  5635. var letReferenceFunctionVisitor = _babelTraverse2.default.visitors.merge([{
  5636. ReferencedIdentifier: function ReferencedIdentifier(path, state) {
  5637. var ref = state.letReferences[path.node.name];
  5638. if (!ref) return;
  5639. var localBinding = path.scope.getBindingIdentifier(path.node.name);
  5640. if (localBinding && localBinding !== ref) return;
  5641. state.closurify = true;
  5642. }
  5643. }, _tdz.visitor]);
  5644. var hoistVarDeclarationsVisitor = {
  5645. enter: function enter(path, self) {
  5646. var node = path.node,
  5647. parent = path.parent;
  5648. if (path.isForStatement()) {
  5649. if (isVar(node.init, node)) {
  5650. var nodes = self.pushDeclar(node.init);
  5651. if (nodes.length === 1) {
  5652. node.init = nodes[0];
  5653. } else {
  5654. node.init = t.sequenceExpression(nodes);
  5655. }
  5656. }
  5657. } else if (path.isFor()) {
  5658. if (isVar(node.left, node)) {
  5659. self.pushDeclar(node.left);
  5660. node.left = node.left.declarations[0].id;
  5661. }
  5662. } else if (isVar(node, parent)) {
  5663. path.replaceWithMultiple(self.pushDeclar(node).map(function (expr) {
  5664. return t.expressionStatement(expr);
  5665. }));
  5666. } else if (path.isFunction()) {
  5667. return path.skip();
  5668. }
  5669. }
  5670. };
  5671. var loopLabelVisitor = {
  5672. LabeledStatement: function LabeledStatement(_ref, state) {
  5673. var node = _ref.node;
  5674. state.innerLabels.push(node.label.name);
  5675. }
  5676. };
  5677. var continuationVisitor = {
  5678. enter: function enter(path, state) {
  5679. if (path.isAssignmentExpression() || path.isUpdateExpression()) {
  5680. var bindings = path.getBindingIdentifiers();
  5681. for (var name in bindings) {
  5682. if (state.outsideReferences[name] !== path.scope.getBindingIdentifier(name)) continue;
  5683. state.reassignments[name] = true;
  5684. }
  5685. }
  5686. }
  5687. };
  5688. function loopNodeTo(node) {
  5689. if (t.isBreakStatement(node)) {
  5690. return "break";
  5691. } else if (t.isContinueStatement(node)) {
  5692. return "continue";
  5693. }
  5694. }
  5695. var loopVisitor = {
  5696. Loop: function Loop(path, state) {
  5697. var oldIgnoreLabeless = state.ignoreLabeless;
  5698. state.ignoreLabeless = true;
  5699. path.traverse(loopVisitor, state);
  5700. state.ignoreLabeless = oldIgnoreLabeless;
  5701. path.skip();
  5702. },
  5703. Function: function Function(path) {
  5704. path.skip();
  5705. },
  5706. SwitchCase: function SwitchCase(path, state) {
  5707. var oldInSwitchCase = state.inSwitchCase;
  5708. state.inSwitchCase = true;
  5709. path.traverse(loopVisitor, state);
  5710. state.inSwitchCase = oldInSwitchCase;
  5711. path.skip();
  5712. },
  5713. "BreakStatement|ContinueStatement|ReturnStatement": function BreakStatementContinueStatementReturnStatement(path, state) {
  5714. var node = path.node,
  5715. parent = path.parent,
  5716. scope = path.scope;
  5717. if (node[this.LOOP_IGNORE]) return;
  5718. var replace = void 0;
  5719. var loopText = loopNodeTo(node);
  5720. if (loopText) {
  5721. if (node.label) {
  5722. if (state.innerLabels.indexOf(node.label.name) >= 0) {
  5723. return;
  5724. }
  5725. loopText = loopText + "|" + node.label.name;
  5726. } else {
  5727. if (state.ignoreLabeless) return;
  5728. if (state.inSwitchCase) return;
  5729. if (t.isBreakStatement(node) && t.isSwitchCase(parent)) return;
  5730. }
  5731. state.hasBreakContinue = true;
  5732. state.map[loopText] = node;
  5733. replace = t.stringLiteral(loopText);
  5734. }
  5735. if (path.isReturnStatement()) {
  5736. state.hasReturn = true;
  5737. replace = t.objectExpression([t.objectProperty(t.identifier("v"), node.argument || scope.buildUndefinedNode())]);
  5738. }
  5739. if (replace) {
  5740. replace = t.returnStatement(replace);
  5741. replace[this.LOOP_IGNORE] = true;
  5742. path.skip();
  5743. path.replaceWith(t.inherits(replace, node));
  5744. }
  5745. }
  5746. };
  5747. var BlockScoping = function () {
  5748. function BlockScoping(loopPath, blockPath, parent, scope, file) {
  5749. (0, _classCallCheck3.default)(this, BlockScoping);
  5750. this.parent = parent;
  5751. this.scope = scope;
  5752. this.file = file;
  5753. this.blockPath = blockPath;
  5754. this.block = blockPath.node;
  5755. this.outsideLetReferences = (0, _create2.default)(null);
  5756. this.hasLetReferences = false;
  5757. this.letReferences = (0, _create2.default)(null);
  5758. this.body = [];
  5759. if (loopPath) {
  5760. this.loopParent = loopPath.parent;
  5761. this.loopLabel = t.isLabeledStatement(this.loopParent) && this.loopParent.label;
  5762. this.loopPath = loopPath;
  5763. this.loop = loopPath.node;
  5764. }
  5765. }
  5766. BlockScoping.prototype.run = function run() {
  5767. var block = this.block;
  5768. if (block._letDone) return;
  5769. block._letDone = true;
  5770. var needsClosure = this.getLetReferences();
  5771. if (t.isFunction(this.parent) || t.isProgram(this.block)) {
  5772. this.updateScopeInfo();
  5773. return;
  5774. }
  5775. if (!this.hasLetReferences) return;
  5776. if (needsClosure) {
  5777. this.wrapClosure();
  5778. } else {
  5779. this.remap();
  5780. }
  5781. this.updateScopeInfo(needsClosure);
  5782. if (this.loopLabel && !t.isLabeledStatement(this.loopParent)) {
  5783. return t.labeledStatement(this.loopLabel, this.loop);
  5784. }
  5785. };
  5786. BlockScoping.prototype.updateScopeInfo = function updateScopeInfo(wrappedInClosure) {
  5787. var scope = this.scope;
  5788. var parentScope = scope.getFunctionParent();
  5789. var letRefs = this.letReferences;
  5790. for (var key in letRefs) {
  5791. var ref = letRefs[key];
  5792. var binding = scope.getBinding(ref.name);
  5793. if (!binding) continue;
  5794. if (binding.kind === "let" || binding.kind === "const") {
  5795. binding.kind = "var";
  5796. if (wrappedInClosure) {
  5797. scope.removeBinding(ref.name);
  5798. } else {
  5799. scope.moveBindingTo(ref.name, parentScope);
  5800. }
  5801. }
  5802. }
  5803. };
  5804. BlockScoping.prototype.remap = function remap() {
  5805. var letRefs = this.letReferences;
  5806. var scope = this.scope;
  5807. for (var key in letRefs) {
  5808. var ref = letRefs[key];
  5809. if (scope.parentHasBinding(key) || scope.hasGlobal(key)) {
  5810. if (scope.hasOwnBinding(key)) scope.rename(ref.name);
  5811. if (this.blockPath.scope.hasOwnBinding(key)) this.blockPath.scope.rename(ref.name);
  5812. }
  5813. }
  5814. };
  5815. BlockScoping.prototype.wrapClosure = function wrapClosure() {
  5816. if (this.file.opts.throwIfClosureRequired) {
  5817. throw this.blockPath.buildCodeFrameError("Compiling let/const in this block would add a closure " + "(throwIfClosureRequired).");
  5818. }
  5819. var block = this.block;
  5820. var outsideRefs = this.outsideLetReferences;
  5821. if (this.loop) {
  5822. for (var name in outsideRefs) {
  5823. var id = outsideRefs[name];
  5824. if (this.scope.hasGlobal(id.name) || this.scope.parentHasBinding(id.name)) {
  5825. delete outsideRefs[id.name];
  5826. delete this.letReferences[id.name];
  5827. this.scope.rename(id.name);
  5828. this.letReferences[id.name] = id;
  5829. outsideRefs[id.name] = id;
  5830. }
  5831. }
  5832. }
  5833. this.has = this.checkLoop();
  5834. this.hoistVarDeclarations();
  5835. var params = (0, _values2.default)(outsideRefs);
  5836. var args = (0, _values2.default)(outsideRefs);
  5837. var isSwitch = this.blockPath.isSwitchStatement();
  5838. var fn = t.functionExpression(null, params, t.blockStatement(isSwitch ? [block] : block.body));
  5839. fn.shadow = true;
  5840. this.addContinuations(fn);
  5841. var ref = fn;
  5842. if (this.loop) {
  5843. ref = this.scope.generateUidIdentifier("loop");
  5844. this.loopPath.insertBefore(t.variableDeclaration("var", [t.variableDeclarator(ref, fn)]));
  5845. }
  5846. var call = t.callExpression(ref, args);
  5847. var ret = this.scope.generateUidIdentifier("ret");
  5848. var hasYield = _babelTraverse2.default.hasType(fn.body, this.scope, "YieldExpression", t.FUNCTION_TYPES);
  5849. if (hasYield) {
  5850. fn.generator = true;
  5851. call = t.yieldExpression(call, true);
  5852. }
  5853. var hasAsync = _babelTraverse2.default.hasType(fn.body, this.scope, "AwaitExpression", t.FUNCTION_TYPES);
  5854. if (hasAsync) {
  5855. fn.async = true;
  5856. call = t.awaitExpression(call);
  5857. }
  5858. this.buildClosure(ret, call);
  5859. if (isSwitch) this.blockPath.replaceWithMultiple(this.body);else block.body = this.body;
  5860. };
  5861. BlockScoping.prototype.buildClosure = function buildClosure(ret, call) {
  5862. var has = this.has;
  5863. if (has.hasReturn || has.hasBreakContinue) {
  5864. this.buildHas(ret, call);
  5865. } else {
  5866. this.body.push(t.expressionStatement(call));
  5867. }
  5868. };
  5869. BlockScoping.prototype.addContinuations = function addContinuations(fn) {
  5870. var state = {
  5871. reassignments: {},
  5872. outsideReferences: this.outsideLetReferences
  5873. };
  5874. this.scope.traverse(fn, continuationVisitor, state);
  5875. for (var i = 0; i < fn.params.length; i++) {
  5876. var param = fn.params[i];
  5877. if (!state.reassignments[param.name]) continue;
  5878. var newParam = this.scope.generateUidIdentifier(param.name);
  5879. fn.params[i] = newParam;
  5880. this.scope.rename(param.name, newParam.name, fn);
  5881. fn.body.body.push(t.expressionStatement(t.assignmentExpression("=", param, newParam)));
  5882. }
  5883. };
  5884. BlockScoping.prototype.getLetReferences = function getLetReferences() {
  5885. var _this = this;
  5886. var block = this.block;
  5887. var declarators = [];
  5888. if (this.loop) {
  5889. var init = this.loop.left || this.loop.init;
  5890. if (isBlockScoped(init)) {
  5891. declarators.push(init);
  5892. (0, _extend2.default)(this.outsideLetReferences, t.getBindingIdentifiers(init));
  5893. }
  5894. }
  5895. var addDeclarationsFromChild = function addDeclarationsFromChild(path, node) {
  5896. node = node || path.node;
  5897. if (t.isClassDeclaration(node) || t.isFunctionDeclaration(node) || isBlockScoped(node)) {
  5898. if (isBlockScoped(node)) {
  5899. convertBlockScopedToVar(path, node, block, _this.scope);
  5900. }
  5901. declarators = declarators.concat(node.declarations || node);
  5902. }
  5903. if (t.isLabeledStatement(node)) {
  5904. addDeclarationsFromChild(path.get("body"), node.body);
  5905. }
  5906. };
  5907. if (block.body) {
  5908. for (var i = 0; i < block.body.length; i++) {
  5909. var declarPath = this.blockPath.get("body")[i];
  5910. addDeclarationsFromChild(declarPath);
  5911. }
  5912. }
  5913. if (block.cases) {
  5914. for (var _i = 0; _i < block.cases.length; _i++) {
  5915. var consequents = block.cases[_i].consequent;
  5916. for (var j = 0; j < consequents.length; j++) {
  5917. var _declarPath = this.blockPath.get("cases")[_i];
  5918. var declar = consequents[j];
  5919. addDeclarationsFromChild(_declarPath, declar);
  5920. }
  5921. }
  5922. }
  5923. for (var _i2 = 0; _i2 < declarators.length; _i2++) {
  5924. var _declar = declarators[_i2];
  5925. var keys = t.getBindingIdentifiers(_declar, false, true);
  5926. (0, _extend2.default)(this.letReferences, keys);
  5927. this.hasLetReferences = true;
  5928. }
  5929. if (!this.hasLetReferences) return;
  5930. var state = {
  5931. letReferences: this.letReferences,
  5932. closurify: false,
  5933. file: this.file,
  5934. loopDepth: 0
  5935. };
  5936. var loopOrFunctionParent = this.blockPath.find(function (path) {
  5937. return path.isLoop() || path.isFunction();
  5938. });
  5939. if (loopOrFunctionParent && loopOrFunctionParent.isLoop()) {
  5940. state.loopDepth++;
  5941. }
  5942. this.blockPath.traverse(letReferenceBlockVisitor, state);
  5943. return state.closurify;
  5944. };
  5945. BlockScoping.prototype.checkLoop = function checkLoop() {
  5946. var state = {
  5947. hasBreakContinue: false,
  5948. ignoreLabeless: false,
  5949. inSwitchCase: false,
  5950. innerLabels: [],
  5951. hasReturn: false,
  5952. isLoop: !!this.loop,
  5953. map: {},
  5954. LOOP_IGNORE: (0, _symbol2.default)()
  5955. };
  5956. this.blockPath.traverse(loopLabelVisitor, state);
  5957. this.blockPath.traverse(loopVisitor, state);
  5958. return state;
  5959. };
  5960. BlockScoping.prototype.hoistVarDeclarations = function hoistVarDeclarations() {
  5961. this.blockPath.traverse(hoistVarDeclarationsVisitor, this);
  5962. };
  5963. BlockScoping.prototype.pushDeclar = function pushDeclar(node) {
  5964. var declars = [];
  5965. var names = t.getBindingIdentifiers(node);
  5966. for (var name in names) {
  5967. declars.push(t.variableDeclarator(names[name]));
  5968. }
  5969. this.body.push(t.variableDeclaration(node.kind, declars));
  5970. var replace = [];
  5971. for (var i = 0; i < node.declarations.length; i++) {
  5972. var declar = node.declarations[i];
  5973. if (!declar.init) continue;
  5974. var expr = t.assignmentExpression("=", declar.id, declar.init);
  5975. replace.push(t.inherits(expr, declar));
  5976. }
  5977. return replace;
  5978. };
  5979. BlockScoping.prototype.buildHas = function buildHas(ret, call) {
  5980. var body = this.body;
  5981. body.push(t.variableDeclaration("var", [t.variableDeclarator(ret, call)]));
  5982. var retCheck = void 0;
  5983. var has = this.has;
  5984. var cases = [];
  5985. if (has.hasReturn) {
  5986. retCheck = buildRetCheck({
  5987. RETURN: ret
  5988. });
  5989. }
  5990. if (has.hasBreakContinue) {
  5991. for (var key in has.map) {
  5992. cases.push(t.switchCase(t.stringLiteral(key), [has.map[key]]));
  5993. }
  5994. if (has.hasReturn) {
  5995. cases.push(t.switchCase(null, [retCheck]));
  5996. }
  5997. if (cases.length === 1) {
  5998. var single = cases[0];
  5999. body.push(t.ifStatement(t.binaryExpression("===", ret, single.test), single.consequent[0]));
  6000. } else {
  6001. if (this.loop) {
  6002. for (var i = 0; i < cases.length; i++) {
  6003. var caseConsequent = cases[i].consequent[0];
  6004. if (t.isBreakStatement(caseConsequent) && !caseConsequent.label) {
  6005. caseConsequent.label = this.loopLabel = this.loopLabel || this.scope.generateUidIdentifier("loop");
  6006. }
  6007. }
  6008. }
  6009. body.push(t.switchStatement(ret, cases));
  6010. }
  6011. } else {
  6012. if (has.hasReturn) {
  6013. body.push(retCheck);
  6014. }
  6015. }
  6016. };
  6017. return BlockScoping;
  6018. }();
  6019. module.exports = exports["default"];
  6020. /***/ }),
  6021. /* 71 */
  6022. /***/ (function(module, exports, __webpack_require__) {
  6023. "use strict";
  6024. exports.__esModule = true;
  6025. var _symbol = __webpack_require__(10);
  6026. var _symbol2 = _interopRequireDefault(_symbol);
  6027. exports.default = function (_ref) {
  6028. var t = _ref.types;
  6029. var VISITED = (0, _symbol2.default)();
  6030. return {
  6031. visitor: {
  6032. ExportDefaultDeclaration: function ExportDefaultDeclaration(path) {
  6033. if (!path.get("declaration").isClassDeclaration()) return;
  6034. var node = path.node;
  6035. var ref = node.declaration.id || path.scope.generateUidIdentifier("class");
  6036. node.declaration.id = ref;
  6037. path.replaceWith(node.declaration);
  6038. path.insertAfter(t.exportDefaultDeclaration(ref));
  6039. },
  6040. ClassDeclaration: function ClassDeclaration(path) {
  6041. var node = path.node;
  6042. var ref = node.id || path.scope.generateUidIdentifier("class");
  6043. path.replaceWith(t.variableDeclaration("let", [t.variableDeclarator(ref, t.toExpression(node))]));
  6044. },
  6045. ClassExpression: function ClassExpression(path, state) {
  6046. var node = path.node;
  6047. if (node[VISITED]) return;
  6048. var inferred = (0, _babelHelperFunctionName2.default)(path);
  6049. if (inferred && inferred !== node) return path.replaceWith(inferred);
  6050. node[VISITED] = true;
  6051. var Constructor = _vanilla2.default;
  6052. if (state.opts.loose) Constructor = _loose2.default;
  6053. path.replaceWith(new Constructor(path, state.file).run());
  6054. }
  6055. }
  6056. };
  6057. };
  6058. var _loose = __webpack_require__(331);
  6059. var _loose2 = _interopRequireDefault(_loose);
  6060. var _vanilla = __webpack_require__(207);
  6061. var _vanilla2 = _interopRequireDefault(_vanilla);
  6062. var _babelHelperFunctionName = __webpack_require__(40);
  6063. var _babelHelperFunctionName2 = _interopRequireDefault(_babelHelperFunctionName);
  6064. function _interopRequireDefault(obj) {
  6065. return obj && obj.__esModule ? obj : { default: obj };
  6066. }
  6067. module.exports = exports["default"];
  6068. /***/ }),
  6069. /* 72 */
  6070. /***/ (function(module, exports, __webpack_require__) {
  6071. "use strict";
  6072. exports.__esModule = true;
  6073. var _getIterator2 = __webpack_require__(2);
  6074. var _getIterator3 = _interopRequireDefault(_getIterator2);
  6075. exports.default = function (_ref) {
  6076. var t = _ref.types,
  6077. template = _ref.template;
  6078. var buildMutatorMapAssign = template("\n MUTATOR_MAP_REF[KEY] = MUTATOR_MAP_REF[KEY] || {};\n MUTATOR_MAP_REF[KEY].KIND = VALUE;\n ");
  6079. function getValue(prop) {
  6080. if (t.isObjectProperty(prop)) {
  6081. return prop.value;
  6082. } else if (t.isObjectMethod(prop)) {
  6083. return t.functionExpression(null, prop.params, prop.body, prop.generator, prop.async);
  6084. }
  6085. }
  6086. function pushAssign(objId, prop, body) {
  6087. if (prop.kind === "get" && prop.kind === "set") {
  6088. pushMutatorDefine(objId, prop, body);
  6089. } else {
  6090. body.push(t.expressionStatement(t.assignmentExpression("=", t.memberExpression(objId, prop.key, prop.computed || t.isLiteral(prop.key)), getValue(prop))));
  6091. }
  6092. }
  6093. function pushMutatorDefine(_ref2, prop) {
  6094. var objId = _ref2.objId,
  6095. body = _ref2.body,
  6096. getMutatorId = _ref2.getMutatorId,
  6097. scope = _ref2.scope;
  6098. var key = !prop.computed && t.isIdentifier(prop.key) ? t.stringLiteral(prop.key.name) : prop.key;
  6099. var maybeMemoise = scope.maybeGenerateMemoised(key);
  6100. if (maybeMemoise) {
  6101. body.push(t.expressionStatement(t.assignmentExpression("=", maybeMemoise, key)));
  6102. key = maybeMemoise;
  6103. }
  6104. body.push.apply(body, buildMutatorMapAssign({
  6105. MUTATOR_MAP_REF: getMutatorId(),
  6106. KEY: key,
  6107. VALUE: getValue(prop),
  6108. KIND: t.identifier(prop.kind)
  6109. }));
  6110. }
  6111. function loose(info) {
  6112. for (var _iterator = info.computedProps, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
  6113. var _ref3;
  6114. if (_isArray) {
  6115. if (_i >= _iterator.length) break;
  6116. _ref3 = _iterator[_i++];
  6117. } else {
  6118. _i = _iterator.next();
  6119. if (_i.done) break;
  6120. _ref3 = _i.value;
  6121. }
  6122. var prop = _ref3;
  6123. if (prop.kind === "get" || prop.kind === "set") {
  6124. pushMutatorDefine(info, prop);
  6125. } else {
  6126. pushAssign(info.objId, prop, info.body);
  6127. }
  6128. }
  6129. }
  6130. function spec(info) {
  6131. var objId = info.objId,
  6132. body = info.body,
  6133. computedProps = info.computedProps,
  6134. state = info.state;
  6135. for (var _iterator2 = computedProps, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) {
  6136. var _ref4;
  6137. if (_isArray2) {
  6138. if (_i2 >= _iterator2.length) break;
  6139. _ref4 = _iterator2[_i2++];
  6140. } else {
  6141. _i2 = _iterator2.next();
  6142. if (_i2.done) break;
  6143. _ref4 = _i2.value;
  6144. }
  6145. var prop = _ref4;
  6146. var key = t.toComputedKey(prop);
  6147. if (prop.kind === "get" || prop.kind === "set") {
  6148. pushMutatorDefine(info, prop);
  6149. } else if (t.isStringLiteral(key, { value: "__proto__" })) {
  6150. pushAssign(objId, prop, body);
  6151. } else {
  6152. if (computedProps.length === 1) {
  6153. return t.callExpression(state.addHelper("defineProperty"), [info.initPropExpression, key, getValue(prop)]);
  6154. } else {
  6155. body.push(t.expressionStatement(t.callExpression(state.addHelper("defineProperty"), [objId, key, getValue(prop)])));
  6156. }
  6157. }
  6158. }
  6159. }
  6160. return {
  6161. visitor: {
  6162. ObjectExpression: {
  6163. exit: function exit(path, state) {
  6164. var node = path.node,
  6165. parent = path.parent,
  6166. scope = path.scope;
  6167. var hasComputed = false;
  6168. for (var _iterator3 = node.properties, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) {
  6169. var _ref5;
  6170. if (_isArray3) {
  6171. if (_i3 >= _iterator3.length) break;
  6172. _ref5 = _iterator3[_i3++];
  6173. } else {
  6174. _i3 = _iterator3.next();
  6175. if (_i3.done) break;
  6176. _ref5 = _i3.value;
  6177. }
  6178. var prop = _ref5;
  6179. hasComputed = prop.computed === true;
  6180. if (hasComputed) break;
  6181. }
  6182. if (!hasComputed) return;
  6183. var initProps = [];
  6184. var computedProps = [];
  6185. var foundComputed = false;
  6186. for (var _iterator4 = node.properties, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, _getIterator3.default)(_iterator4);;) {
  6187. var _ref6;
  6188. if (_isArray4) {
  6189. if (_i4 >= _iterator4.length) break;
  6190. _ref6 = _iterator4[_i4++];
  6191. } else {
  6192. _i4 = _iterator4.next();
  6193. if (_i4.done) break;
  6194. _ref6 = _i4.value;
  6195. }
  6196. var _prop = _ref6;
  6197. if (_prop.computed) {
  6198. foundComputed = true;
  6199. }
  6200. if (foundComputed) {
  6201. computedProps.push(_prop);
  6202. } else {
  6203. initProps.push(_prop);
  6204. }
  6205. }
  6206. var objId = scope.generateUidIdentifierBasedOnNode(parent);
  6207. var initPropExpression = t.objectExpression(initProps);
  6208. var body = [];
  6209. body.push(t.variableDeclaration("var", [t.variableDeclarator(objId, initPropExpression)]));
  6210. var callback = spec;
  6211. if (state.opts.loose) callback = loose;
  6212. var mutatorRef = void 0;
  6213. var getMutatorId = function getMutatorId() {
  6214. if (!mutatorRef) {
  6215. mutatorRef = scope.generateUidIdentifier("mutatorMap");
  6216. body.push(t.variableDeclaration("var", [t.variableDeclarator(mutatorRef, t.objectExpression([]))]));
  6217. }
  6218. return mutatorRef;
  6219. };
  6220. var single = callback({
  6221. scope: scope,
  6222. objId: objId,
  6223. body: body,
  6224. computedProps: computedProps,
  6225. initPropExpression: initPropExpression,
  6226. getMutatorId: getMutatorId,
  6227. state: state
  6228. });
  6229. if (mutatorRef) {
  6230. body.push(t.expressionStatement(t.callExpression(state.addHelper("defineEnumerableProperties"), [objId, mutatorRef])));
  6231. }
  6232. if (single) {
  6233. path.replaceWith(single);
  6234. } else {
  6235. body.push(t.expressionStatement(objId));
  6236. path.replaceWithMultiple(body);
  6237. }
  6238. }
  6239. }
  6240. }
  6241. };
  6242. };
  6243. function _interopRequireDefault(obj) {
  6244. return obj && obj.__esModule ? obj : { default: obj };
  6245. }
  6246. module.exports = exports["default"];
  6247. /***/ }),
  6248. /* 73 */
  6249. /***/ (function(module, exports, __webpack_require__) {
  6250. "use strict";
  6251. exports.__esModule = true;
  6252. var _classCallCheck2 = __webpack_require__(3);
  6253. var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
  6254. var _getIterator2 = __webpack_require__(2);
  6255. var _getIterator3 = _interopRequireDefault(_getIterator2);
  6256. exports.default = function (_ref) {
  6257. var t = _ref.types;
  6258. function variableDeclarationHasPattern(node) {
  6259. for (var _iterator = node.declarations, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
  6260. var _ref2;
  6261. if (_isArray) {
  6262. if (_i >= _iterator.length) break;
  6263. _ref2 = _iterator[_i++];
  6264. } else {
  6265. _i = _iterator.next();
  6266. if (_i.done) break;
  6267. _ref2 = _i.value;
  6268. }
  6269. var declar = _ref2;
  6270. if (t.isPattern(declar.id)) {
  6271. return true;
  6272. }
  6273. }
  6274. return false;
  6275. }
  6276. function hasRest(pattern) {
  6277. for (var _iterator2 = pattern.elements, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) {
  6278. var _ref3;
  6279. if (_isArray2) {
  6280. if (_i2 >= _iterator2.length) break;
  6281. _ref3 = _iterator2[_i2++];
  6282. } else {
  6283. _i2 = _iterator2.next();
  6284. if (_i2.done) break;
  6285. _ref3 = _i2.value;
  6286. }
  6287. var elem = _ref3;
  6288. if (t.isRestElement(elem)) {
  6289. return true;
  6290. }
  6291. }
  6292. return false;
  6293. }
  6294. var arrayUnpackVisitor = {
  6295. ReferencedIdentifier: function ReferencedIdentifier(path, state) {
  6296. if (state.bindings[path.node.name]) {
  6297. state.deopt = true;
  6298. path.stop();
  6299. }
  6300. }
  6301. };
  6302. var DestructuringTransformer = function () {
  6303. function DestructuringTransformer(opts) {
  6304. (0, _classCallCheck3.default)(this, DestructuringTransformer);
  6305. this.blockHoist = opts.blockHoist;
  6306. this.operator = opts.operator;
  6307. this.arrays = {};
  6308. this.nodes = opts.nodes || [];
  6309. this.scope = opts.scope;
  6310. this.file = opts.file;
  6311. this.kind = opts.kind;
  6312. }
  6313. DestructuringTransformer.prototype.buildVariableAssignment = function buildVariableAssignment(id, init) {
  6314. var op = this.operator;
  6315. if (t.isMemberExpression(id)) op = "=";
  6316. var node = void 0;
  6317. if (op) {
  6318. node = t.expressionStatement(t.assignmentExpression(op, id, init));
  6319. } else {
  6320. node = t.variableDeclaration(this.kind, [t.variableDeclarator(id, init)]);
  6321. }
  6322. node._blockHoist = this.blockHoist;
  6323. return node;
  6324. };
  6325. DestructuringTransformer.prototype.buildVariableDeclaration = function buildVariableDeclaration(id, init) {
  6326. var declar = t.variableDeclaration("var", [t.variableDeclarator(id, init)]);
  6327. declar._blockHoist = this.blockHoist;
  6328. return declar;
  6329. };
  6330. DestructuringTransformer.prototype.push = function push(id, init) {
  6331. if (t.isObjectPattern(id)) {
  6332. this.pushObjectPattern(id, init);
  6333. } else if (t.isArrayPattern(id)) {
  6334. this.pushArrayPattern(id, init);
  6335. } else if (t.isAssignmentPattern(id)) {
  6336. this.pushAssignmentPattern(id, init);
  6337. } else {
  6338. this.nodes.push(this.buildVariableAssignment(id, init));
  6339. }
  6340. };
  6341. DestructuringTransformer.prototype.toArray = function toArray(node, count) {
  6342. if (this.file.opts.loose || t.isIdentifier(node) && this.arrays[node.name]) {
  6343. return node;
  6344. } else {
  6345. return this.scope.toArray(node, count);
  6346. }
  6347. };
  6348. DestructuringTransformer.prototype.pushAssignmentPattern = function pushAssignmentPattern(pattern, valueRef) {
  6349. var tempValueRef = this.scope.generateUidIdentifierBasedOnNode(valueRef);
  6350. var declar = t.variableDeclaration("var", [t.variableDeclarator(tempValueRef, valueRef)]);
  6351. declar._blockHoist = this.blockHoist;
  6352. this.nodes.push(declar);
  6353. var tempConditional = t.conditionalExpression(t.binaryExpression("===", tempValueRef, t.identifier("undefined")), pattern.right, tempValueRef);
  6354. var left = pattern.left;
  6355. if (t.isPattern(left)) {
  6356. var tempValueDefault = t.expressionStatement(t.assignmentExpression("=", tempValueRef, tempConditional));
  6357. tempValueDefault._blockHoist = this.blockHoist;
  6358. this.nodes.push(tempValueDefault);
  6359. this.push(left, tempValueRef);
  6360. } else {
  6361. this.nodes.push(this.buildVariableAssignment(left, tempConditional));
  6362. }
  6363. };
  6364. DestructuringTransformer.prototype.pushObjectRest = function pushObjectRest(pattern, objRef, spreadProp, spreadPropIndex) {
  6365. var keys = [];
  6366. for (var i = 0; i < pattern.properties.length; i++) {
  6367. var prop = pattern.properties[i];
  6368. if (i >= spreadPropIndex) break;
  6369. if (t.isRestProperty(prop)) continue;
  6370. var key = prop.key;
  6371. if (t.isIdentifier(key) && !prop.computed) key = t.stringLiteral(prop.key.name);
  6372. keys.push(key);
  6373. }
  6374. keys = t.arrayExpression(keys);
  6375. var value = t.callExpression(this.file.addHelper("objectWithoutProperties"), [objRef, keys]);
  6376. this.nodes.push(this.buildVariableAssignment(spreadProp.argument, value));
  6377. };
  6378. DestructuringTransformer.prototype.pushObjectProperty = function pushObjectProperty(prop, propRef) {
  6379. if (t.isLiteral(prop.key)) prop.computed = true;
  6380. var pattern = prop.value;
  6381. var objRef = t.memberExpression(propRef, prop.key, prop.computed);
  6382. if (t.isPattern(pattern)) {
  6383. this.push(pattern, objRef);
  6384. } else {
  6385. this.nodes.push(this.buildVariableAssignment(pattern, objRef));
  6386. }
  6387. };
  6388. DestructuringTransformer.prototype.pushObjectPattern = function pushObjectPattern(pattern, objRef) {
  6389. if (!pattern.properties.length) {
  6390. this.nodes.push(t.expressionStatement(t.callExpression(this.file.addHelper("objectDestructuringEmpty"), [objRef])));
  6391. }
  6392. if (pattern.properties.length > 1 && !this.scope.isStatic(objRef)) {
  6393. var temp = this.scope.generateUidIdentifierBasedOnNode(objRef);
  6394. this.nodes.push(this.buildVariableDeclaration(temp, objRef));
  6395. objRef = temp;
  6396. }
  6397. for (var i = 0; i < pattern.properties.length; i++) {
  6398. var prop = pattern.properties[i];
  6399. if (t.isRestProperty(prop)) {
  6400. this.pushObjectRest(pattern, objRef, prop, i);
  6401. } else {
  6402. this.pushObjectProperty(prop, objRef);
  6403. }
  6404. }
  6405. };
  6406. DestructuringTransformer.prototype.canUnpackArrayPattern = function canUnpackArrayPattern(pattern, arr) {
  6407. if (!t.isArrayExpression(arr)) return false;
  6408. if (pattern.elements.length > arr.elements.length) return;
  6409. if (pattern.elements.length < arr.elements.length && !hasRest(pattern)) return false;
  6410. for (var _iterator3 = pattern.elements, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) {
  6411. var _ref4;
  6412. if (_isArray3) {
  6413. if (_i3 >= _iterator3.length) break;
  6414. _ref4 = _iterator3[_i3++];
  6415. } else {
  6416. _i3 = _iterator3.next();
  6417. if (_i3.done) break;
  6418. _ref4 = _i3.value;
  6419. }
  6420. var elem = _ref4;
  6421. if (!elem) return false;
  6422. if (t.isMemberExpression(elem)) return false;
  6423. }
  6424. for (var _iterator4 = arr.elements, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, _getIterator3.default)(_iterator4);;) {
  6425. var _ref5;
  6426. if (_isArray4) {
  6427. if (_i4 >= _iterator4.length) break;
  6428. _ref5 = _iterator4[_i4++];
  6429. } else {
  6430. _i4 = _iterator4.next();
  6431. if (_i4.done) break;
  6432. _ref5 = _i4.value;
  6433. }
  6434. var _elem = _ref5;
  6435. if (t.isSpreadElement(_elem)) return false;
  6436. if (t.isCallExpression(_elem)) return false;
  6437. if (t.isMemberExpression(_elem)) return false;
  6438. }
  6439. var bindings = t.getBindingIdentifiers(pattern);
  6440. var state = { deopt: false, bindings: bindings };
  6441. this.scope.traverse(arr, arrayUnpackVisitor, state);
  6442. return !state.deopt;
  6443. };
  6444. DestructuringTransformer.prototype.pushUnpackedArrayPattern = function pushUnpackedArrayPattern(pattern, arr) {
  6445. for (var i = 0; i < pattern.elements.length; i++) {
  6446. var elem = pattern.elements[i];
  6447. if (t.isRestElement(elem)) {
  6448. this.push(elem.argument, t.arrayExpression(arr.elements.slice(i)));
  6449. } else {
  6450. this.push(elem, arr.elements[i]);
  6451. }
  6452. }
  6453. };
  6454. DestructuringTransformer.prototype.pushArrayPattern = function pushArrayPattern(pattern, arrayRef) {
  6455. if (!pattern.elements) return;
  6456. if (this.canUnpackArrayPattern(pattern, arrayRef)) {
  6457. return this.pushUnpackedArrayPattern(pattern, arrayRef);
  6458. }
  6459. var count = !hasRest(pattern) && pattern.elements.length;
  6460. var toArray = this.toArray(arrayRef, count);
  6461. if (t.isIdentifier(toArray)) {
  6462. arrayRef = toArray;
  6463. } else {
  6464. arrayRef = this.scope.generateUidIdentifierBasedOnNode(arrayRef);
  6465. this.arrays[arrayRef.name] = true;
  6466. this.nodes.push(this.buildVariableDeclaration(arrayRef, toArray));
  6467. }
  6468. for (var i = 0; i < pattern.elements.length; i++) {
  6469. var elem = pattern.elements[i];
  6470. if (!elem) continue;
  6471. var elemRef = void 0;
  6472. if (t.isRestElement(elem)) {
  6473. elemRef = this.toArray(arrayRef);
  6474. elemRef = t.callExpression(t.memberExpression(elemRef, t.identifier("slice")), [t.numericLiteral(i)]);
  6475. elem = elem.argument;
  6476. } else {
  6477. elemRef = t.memberExpression(arrayRef, t.numericLiteral(i), true);
  6478. }
  6479. this.push(elem, elemRef);
  6480. }
  6481. };
  6482. DestructuringTransformer.prototype.init = function init(pattern, ref) {
  6483. if (!t.isArrayExpression(ref) && !t.isMemberExpression(ref)) {
  6484. var memo = this.scope.maybeGenerateMemoised(ref, true);
  6485. if (memo) {
  6486. this.nodes.push(this.buildVariableDeclaration(memo, ref));
  6487. ref = memo;
  6488. }
  6489. }
  6490. this.push(pattern, ref);
  6491. return this.nodes;
  6492. };
  6493. return DestructuringTransformer;
  6494. }();
  6495. return {
  6496. visitor: {
  6497. ExportNamedDeclaration: function ExportNamedDeclaration(path) {
  6498. var declaration = path.get("declaration");
  6499. if (!declaration.isVariableDeclaration()) return;
  6500. if (!variableDeclarationHasPattern(declaration.node)) return;
  6501. var specifiers = [];
  6502. for (var name in path.getOuterBindingIdentifiers(path)) {
  6503. var id = t.identifier(name);
  6504. specifiers.push(t.exportSpecifier(id, id));
  6505. }
  6506. path.replaceWith(declaration.node);
  6507. path.insertAfter(t.exportNamedDeclaration(null, specifiers));
  6508. },
  6509. ForXStatement: function ForXStatement(path, file) {
  6510. var node = path.node,
  6511. scope = path.scope;
  6512. var left = node.left;
  6513. if (t.isPattern(left)) {
  6514. var temp = scope.generateUidIdentifier("ref");
  6515. node.left = t.variableDeclaration("var", [t.variableDeclarator(temp)]);
  6516. path.ensureBlock();
  6517. node.body.body.unshift(t.variableDeclaration("var", [t.variableDeclarator(left, temp)]));
  6518. return;
  6519. }
  6520. if (!t.isVariableDeclaration(left)) return;
  6521. var pattern = left.declarations[0].id;
  6522. if (!t.isPattern(pattern)) return;
  6523. var key = scope.generateUidIdentifier("ref");
  6524. node.left = t.variableDeclaration(left.kind, [t.variableDeclarator(key, null)]);
  6525. var nodes = [];
  6526. var destructuring = new DestructuringTransformer({
  6527. kind: left.kind,
  6528. file: file,
  6529. scope: scope,
  6530. nodes: nodes
  6531. });
  6532. destructuring.init(pattern, key);
  6533. path.ensureBlock();
  6534. var block = node.body;
  6535. block.body = nodes.concat(block.body);
  6536. },
  6537. CatchClause: function CatchClause(_ref6, file) {
  6538. var node = _ref6.node,
  6539. scope = _ref6.scope;
  6540. var pattern = node.param;
  6541. if (!t.isPattern(pattern)) return;
  6542. var ref = scope.generateUidIdentifier("ref");
  6543. node.param = ref;
  6544. var nodes = [];
  6545. var destructuring = new DestructuringTransformer({
  6546. kind: "let",
  6547. file: file,
  6548. scope: scope,
  6549. nodes: nodes
  6550. });
  6551. destructuring.init(pattern, ref);
  6552. node.body.body = nodes.concat(node.body.body);
  6553. },
  6554. AssignmentExpression: function AssignmentExpression(path, file) {
  6555. var node = path.node,
  6556. scope = path.scope;
  6557. if (!t.isPattern(node.left)) return;
  6558. var nodes = [];
  6559. var destructuring = new DestructuringTransformer({
  6560. operator: node.operator,
  6561. file: file,
  6562. scope: scope,
  6563. nodes: nodes
  6564. });
  6565. var ref = void 0;
  6566. if (path.isCompletionRecord() || !path.parentPath.isExpressionStatement()) {
  6567. ref = scope.generateUidIdentifierBasedOnNode(node.right, "ref");
  6568. nodes.push(t.variableDeclaration("var", [t.variableDeclarator(ref, node.right)]));
  6569. if (t.isArrayExpression(node.right)) {
  6570. destructuring.arrays[ref.name] = true;
  6571. }
  6572. }
  6573. destructuring.init(node.left, ref || node.right);
  6574. if (ref) {
  6575. nodes.push(t.expressionStatement(ref));
  6576. }
  6577. path.replaceWithMultiple(nodes);
  6578. },
  6579. VariableDeclaration: function VariableDeclaration(path, file) {
  6580. var node = path.node,
  6581. scope = path.scope,
  6582. parent = path.parent;
  6583. if (t.isForXStatement(parent)) return;
  6584. if (!parent || !path.container) return;
  6585. if (!variableDeclarationHasPattern(node)) return;
  6586. var nodes = [];
  6587. var declar = void 0;
  6588. for (var i = 0; i < node.declarations.length; i++) {
  6589. declar = node.declarations[i];
  6590. var patternId = declar.init;
  6591. var pattern = declar.id;
  6592. var destructuring = new DestructuringTransformer({
  6593. blockHoist: node._blockHoist,
  6594. nodes: nodes,
  6595. scope: scope,
  6596. kind: node.kind,
  6597. file: file
  6598. });
  6599. if (t.isPattern(pattern)) {
  6600. destructuring.init(pattern, patternId);
  6601. if (+i !== node.declarations.length - 1) {
  6602. t.inherits(nodes[nodes.length - 1], declar);
  6603. }
  6604. } else {
  6605. nodes.push(t.inherits(destructuring.buildVariableAssignment(declar.id, declar.init), declar));
  6606. }
  6607. }
  6608. var nodesOut = [];
  6609. for (var _iterator5 = nodes, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, _getIterator3.default)(_iterator5);;) {
  6610. var _ref7;
  6611. if (_isArray5) {
  6612. if (_i5 >= _iterator5.length) break;
  6613. _ref7 = _iterator5[_i5++];
  6614. } else {
  6615. _i5 = _iterator5.next();
  6616. if (_i5.done) break;
  6617. _ref7 = _i5.value;
  6618. }
  6619. var _node = _ref7;
  6620. var tail = nodesOut[nodesOut.length - 1];
  6621. if (tail && t.isVariableDeclaration(tail) && t.isVariableDeclaration(_node) && tail.kind === _node.kind) {
  6622. var _tail$declarations;
  6623. (_tail$declarations = tail.declarations).push.apply(_tail$declarations, _node.declarations);
  6624. } else {
  6625. nodesOut.push(_node);
  6626. }
  6627. }
  6628. for (var _iterator6 = nodesOut, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, _getIterator3.default)(_iterator6);;) {
  6629. var _ref8;
  6630. if (_isArray6) {
  6631. if (_i6 >= _iterator6.length) break;
  6632. _ref8 = _iterator6[_i6++];
  6633. } else {
  6634. _i6 = _iterator6.next();
  6635. if (_i6.done) break;
  6636. _ref8 = _i6.value;
  6637. }
  6638. var nodeOut = _ref8;
  6639. if (!nodeOut.declarations) continue;
  6640. for (var _iterator7 = nodeOut.declarations, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : (0, _getIterator3.default)(_iterator7);;) {
  6641. var _ref9;
  6642. if (_isArray7) {
  6643. if (_i7 >= _iterator7.length) break;
  6644. _ref9 = _iterator7[_i7++];
  6645. } else {
  6646. _i7 = _iterator7.next();
  6647. if (_i7.done) break;
  6648. _ref9 = _i7.value;
  6649. }
  6650. var declaration = _ref9;
  6651. var name = declaration.id.name;
  6652. if (scope.bindings[name]) {
  6653. scope.bindings[name].kind = nodeOut.kind;
  6654. }
  6655. }
  6656. }
  6657. if (nodesOut.length === 1) {
  6658. path.replaceWith(nodesOut[0]);
  6659. } else {
  6660. path.replaceWithMultiple(nodesOut);
  6661. }
  6662. }
  6663. }
  6664. };
  6665. };
  6666. function _interopRequireDefault(obj) {
  6667. return obj && obj.__esModule ? obj : { default: obj };
  6668. }
  6669. module.exports = exports["default"];
  6670. /***/ }),
  6671. /* 74 */
  6672. /***/ (function(module, exports) {
  6673. "use strict";
  6674. exports.__esModule = true;
  6675. exports.default = function (_ref) {
  6676. var messages = _ref.messages,
  6677. template = _ref.template,
  6678. t = _ref.types;
  6679. var buildForOfArray = template("\n for (var KEY = 0; KEY < ARR.length; KEY++) BODY;\n ");
  6680. var buildForOfLoose = template("\n for (var LOOP_OBJECT = OBJECT,\n IS_ARRAY = Array.isArray(LOOP_OBJECT),\n INDEX = 0,\n LOOP_OBJECT = IS_ARRAY ? LOOP_OBJECT : LOOP_OBJECT[Symbol.iterator]();;) {\n var ID;\n if (IS_ARRAY) {\n if (INDEX >= LOOP_OBJECT.length) break;\n ID = LOOP_OBJECT[INDEX++];\n } else {\n INDEX = LOOP_OBJECT.next();\n if (INDEX.done) break;\n ID = INDEX.value;\n }\n }\n ");
  6681. var buildForOf = template("\n var ITERATOR_COMPLETION = true;\n var ITERATOR_HAD_ERROR_KEY = false;\n var ITERATOR_ERROR_KEY = undefined;\n try {\n for (var ITERATOR_KEY = OBJECT[Symbol.iterator](), STEP_KEY; !(ITERATOR_COMPLETION = (STEP_KEY = ITERATOR_KEY.next()).done); ITERATOR_COMPLETION = true) {\n }\n } catch (err) {\n ITERATOR_HAD_ERROR_KEY = true;\n ITERATOR_ERROR_KEY = err;\n } finally {\n try {\n if (!ITERATOR_COMPLETION && ITERATOR_KEY.return) {\n ITERATOR_KEY.return();\n }\n } finally {\n if (ITERATOR_HAD_ERROR_KEY) {\n throw ITERATOR_ERROR_KEY;\n }\n }\n }\n ");
  6682. function _ForOfStatementArray(path) {
  6683. var node = path.node,
  6684. scope = path.scope;
  6685. var nodes = [];
  6686. var right = node.right;
  6687. if (!t.isIdentifier(right) || !scope.hasBinding(right.name)) {
  6688. var uid = scope.generateUidIdentifier("arr");
  6689. nodes.push(t.variableDeclaration("var", [t.variableDeclarator(uid, right)]));
  6690. right = uid;
  6691. }
  6692. var iterationKey = scope.generateUidIdentifier("i");
  6693. var loop = buildForOfArray({
  6694. BODY: node.body,
  6695. KEY: iterationKey,
  6696. ARR: right
  6697. });
  6698. t.inherits(loop, node);
  6699. t.ensureBlock(loop);
  6700. var iterationValue = t.memberExpression(right, iterationKey, true);
  6701. var left = node.left;
  6702. if (t.isVariableDeclaration(left)) {
  6703. left.declarations[0].init = iterationValue;
  6704. loop.body.body.unshift(left);
  6705. } else {
  6706. loop.body.body.unshift(t.expressionStatement(t.assignmentExpression("=", left, iterationValue)));
  6707. }
  6708. if (path.parentPath.isLabeledStatement()) {
  6709. loop = t.labeledStatement(path.parentPath.node.label, loop);
  6710. }
  6711. nodes.push(loop);
  6712. return nodes;
  6713. }
  6714. return {
  6715. visitor: {
  6716. ForOfStatement: function ForOfStatement(path, state) {
  6717. if (path.get("right").isArrayExpression()) {
  6718. if (path.parentPath.isLabeledStatement()) {
  6719. return path.parentPath.replaceWithMultiple(_ForOfStatementArray(path));
  6720. } else {
  6721. return path.replaceWithMultiple(_ForOfStatementArray(path));
  6722. }
  6723. }
  6724. var callback = spec;
  6725. if (state.opts.loose) callback = loose;
  6726. var node = path.node;
  6727. var build = callback(path, state);
  6728. var declar = build.declar;
  6729. var loop = build.loop;
  6730. var block = loop.body;
  6731. path.ensureBlock();
  6732. if (declar) {
  6733. block.body.push(declar);
  6734. }
  6735. block.body = block.body.concat(node.body.body);
  6736. t.inherits(loop, node);
  6737. t.inherits(loop.body, node.body);
  6738. if (build.replaceParent) {
  6739. path.parentPath.replaceWithMultiple(build.node);
  6740. path.remove();
  6741. } else {
  6742. path.replaceWithMultiple(build.node);
  6743. }
  6744. }
  6745. }
  6746. };
  6747. function loose(path, file) {
  6748. var node = path.node,
  6749. scope = path.scope,
  6750. parent = path.parent;
  6751. var left = node.left;
  6752. var declar = void 0,
  6753. id = void 0;
  6754. if (t.isIdentifier(left) || t.isPattern(left) || t.isMemberExpression(left)) {
  6755. id = left;
  6756. } else if (t.isVariableDeclaration(left)) {
  6757. id = scope.generateUidIdentifier("ref");
  6758. declar = t.variableDeclaration(left.kind, [t.variableDeclarator(left.declarations[0].id, id)]);
  6759. } else {
  6760. throw file.buildCodeFrameError(left, messages.get("unknownForHead", left.type));
  6761. }
  6762. var iteratorKey = scope.generateUidIdentifier("iterator");
  6763. var isArrayKey = scope.generateUidIdentifier("isArray");
  6764. var loop = buildForOfLoose({
  6765. LOOP_OBJECT: iteratorKey,
  6766. IS_ARRAY: isArrayKey,
  6767. OBJECT: node.right,
  6768. INDEX: scope.generateUidIdentifier("i"),
  6769. ID: id
  6770. });
  6771. if (!declar) {
  6772. loop.body.body.shift();
  6773. }
  6774. var isLabeledParent = t.isLabeledStatement(parent);
  6775. var labeled = void 0;
  6776. if (isLabeledParent) {
  6777. labeled = t.labeledStatement(parent.label, loop);
  6778. }
  6779. return {
  6780. replaceParent: isLabeledParent,
  6781. declar: declar,
  6782. node: labeled || loop,
  6783. loop: loop
  6784. };
  6785. }
  6786. function spec(path, file) {
  6787. var node = path.node,
  6788. scope = path.scope,
  6789. parent = path.parent;
  6790. var left = node.left;
  6791. var declar = void 0;
  6792. var stepKey = scope.generateUidIdentifier("step");
  6793. var stepValue = t.memberExpression(stepKey, t.identifier("value"));
  6794. if (t.isIdentifier(left) || t.isPattern(left) || t.isMemberExpression(left)) {
  6795. declar = t.expressionStatement(t.assignmentExpression("=", left, stepValue));
  6796. } else if (t.isVariableDeclaration(left)) {
  6797. declar = t.variableDeclaration(left.kind, [t.variableDeclarator(left.declarations[0].id, stepValue)]);
  6798. } else {
  6799. throw file.buildCodeFrameError(left, messages.get("unknownForHead", left.type));
  6800. }
  6801. var iteratorKey = scope.generateUidIdentifier("iterator");
  6802. var template = buildForOf({
  6803. ITERATOR_HAD_ERROR_KEY: scope.generateUidIdentifier("didIteratorError"),
  6804. ITERATOR_COMPLETION: scope.generateUidIdentifier("iteratorNormalCompletion"),
  6805. ITERATOR_ERROR_KEY: scope.generateUidIdentifier("iteratorError"),
  6806. ITERATOR_KEY: iteratorKey,
  6807. STEP_KEY: stepKey,
  6808. OBJECT: node.right,
  6809. BODY: null
  6810. });
  6811. var isLabeledParent = t.isLabeledStatement(parent);
  6812. var tryBody = template[3].block.body;
  6813. var loop = tryBody[0];
  6814. if (isLabeledParent) {
  6815. tryBody[0] = t.labeledStatement(parent.label, loop);
  6816. }
  6817. return {
  6818. replaceParent: isLabeledParent,
  6819. declar: declar,
  6820. loop: loop,
  6821. node: template
  6822. };
  6823. }
  6824. };
  6825. module.exports = exports["default"];
  6826. /***/ }),
  6827. /* 75 */
  6828. /***/ (function(module, exports, __webpack_require__) {
  6829. "use strict";
  6830. exports.__esModule = true;
  6831. exports.default = function () {
  6832. return {
  6833. visitor: {
  6834. FunctionExpression: {
  6835. exit: function exit(path) {
  6836. if (path.key !== "value" && !path.parentPath.isObjectProperty()) {
  6837. var replacement = (0, _babelHelperFunctionName2.default)(path);
  6838. if (replacement) path.replaceWith(replacement);
  6839. }
  6840. }
  6841. },
  6842. ObjectProperty: function ObjectProperty(path) {
  6843. var value = path.get("value");
  6844. if (value.isFunction()) {
  6845. var newNode = (0, _babelHelperFunctionName2.default)(value);
  6846. if (newNode) value.replaceWith(newNode);
  6847. }
  6848. }
  6849. }
  6850. };
  6851. };
  6852. var _babelHelperFunctionName = __webpack_require__(40);
  6853. var _babelHelperFunctionName2 = _interopRequireDefault(_babelHelperFunctionName);
  6854. function _interopRequireDefault(obj) {
  6855. return obj && obj.__esModule ? obj : { default: obj };
  6856. }
  6857. module.exports = exports["default"];
  6858. /***/ }),
  6859. /* 76 */
  6860. /***/ (function(module, exports) {
  6861. "use strict";
  6862. exports.__esModule = true;
  6863. exports.default = function () {
  6864. return {
  6865. visitor: {
  6866. NumericLiteral: function NumericLiteral(_ref) {
  6867. var node = _ref.node;
  6868. if (node.extra && /^0[ob]/i.test(node.extra.raw)) {
  6869. node.extra = undefined;
  6870. }
  6871. },
  6872. StringLiteral: function StringLiteral(_ref2) {
  6873. var node = _ref2.node;
  6874. if (node.extra && /\\[u]/gi.test(node.extra.raw)) {
  6875. node.extra = undefined;
  6876. }
  6877. }
  6878. }
  6879. };
  6880. };
  6881. module.exports = exports["default"];
  6882. /***/ }),
  6883. /* 77 */
  6884. /***/ (function(module, exports, __webpack_require__) {
  6885. "use strict";
  6886. exports.__esModule = true;
  6887. var _keys = __webpack_require__(14);
  6888. var _keys2 = _interopRequireDefault(_keys);
  6889. var _create = __webpack_require__(9);
  6890. var _create2 = _interopRequireDefault(_create);
  6891. var _getIterator2 = __webpack_require__(2);
  6892. var _getIterator3 = _interopRequireDefault(_getIterator2);
  6893. var _symbol = __webpack_require__(10);
  6894. var _symbol2 = _interopRequireDefault(_symbol);
  6895. exports.default = function () {
  6896. var REASSIGN_REMAP_SKIP = (0, _symbol2.default)();
  6897. var reassignmentVisitor = {
  6898. ReferencedIdentifier: function ReferencedIdentifier(path) {
  6899. var name = path.node.name;
  6900. var remap = this.remaps[name];
  6901. if (!remap) return;
  6902. if (this.scope.getBinding(name) !== path.scope.getBinding(name)) return;
  6903. if (path.parentPath.isCallExpression({ callee: path.node })) {
  6904. path.replaceWith(t.sequenceExpression([t.numericLiteral(0), remap]));
  6905. } else if (path.isJSXIdentifier() && t.isMemberExpression(remap)) {
  6906. var object = remap.object,
  6907. property = remap.property;
  6908. path.replaceWith(t.JSXMemberExpression(t.JSXIdentifier(object.name), t.JSXIdentifier(property.name)));
  6909. } else {
  6910. path.replaceWith(remap);
  6911. }
  6912. this.requeueInParent(path);
  6913. },
  6914. AssignmentExpression: function AssignmentExpression(path) {
  6915. var node = path.node;
  6916. if (node[REASSIGN_REMAP_SKIP]) return;
  6917. var left = path.get("left");
  6918. if (left.isIdentifier()) {
  6919. var name = left.node.name;
  6920. var exports = this.exports[name];
  6921. if (!exports) return;
  6922. if (this.scope.getBinding(name) !== path.scope.getBinding(name)) return;
  6923. node[REASSIGN_REMAP_SKIP] = true;
  6924. for (var _iterator = exports, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
  6925. var _ref;
  6926. if (_isArray) {
  6927. if (_i >= _iterator.length) break;
  6928. _ref = _iterator[_i++];
  6929. } else {
  6930. _i = _iterator.next();
  6931. if (_i.done) break;
  6932. _ref = _i.value;
  6933. }
  6934. var reid = _ref;
  6935. node = buildExportsAssignment(reid, node).expression;
  6936. }
  6937. path.replaceWith(node);
  6938. this.requeueInParent(path);
  6939. } else if (left.isObjectPattern()) {
  6940. for (var _iterator2 = left.node.properties, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) {
  6941. var _ref2;
  6942. if (_isArray2) {
  6943. if (_i2 >= _iterator2.length) break;
  6944. _ref2 = _iterator2[_i2++];
  6945. } else {
  6946. _i2 = _iterator2.next();
  6947. if (_i2.done) break;
  6948. _ref2 = _i2.value;
  6949. }
  6950. var property = _ref2;
  6951. var _name = property.value.name;
  6952. var _exports = this.exports[_name];
  6953. if (!_exports) continue;
  6954. if (this.scope.getBinding(_name) !== path.scope.getBinding(_name)) return;
  6955. node[REASSIGN_REMAP_SKIP] = true;
  6956. path.insertAfter(buildExportsAssignment(t.identifier(_name), t.identifier(_name)));
  6957. }
  6958. } else if (left.isArrayPattern()) {
  6959. for (var _iterator3 = left.node.elements, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) {
  6960. var _ref3;
  6961. if (_isArray3) {
  6962. if (_i3 >= _iterator3.length) break;
  6963. _ref3 = _iterator3[_i3++];
  6964. } else {
  6965. _i3 = _iterator3.next();
  6966. if (_i3.done) break;
  6967. _ref3 = _i3.value;
  6968. }
  6969. var element = _ref3;
  6970. if (!element) continue;
  6971. var _name2 = element.name;
  6972. var _exports2 = this.exports[_name2];
  6973. if (!_exports2) continue;
  6974. if (this.scope.getBinding(_name2) !== path.scope.getBinding(_name2)) return;
  6975. node[REASSIGN_REMAP_SKIP] = true;
  6976. path.insertAfter(buildExportsAssignment(t.identifier(_name2), t.identifier(_name2)));
  6977. }
  6978. }
  6979. },
  6980. UpdateExpression: function UpdateExpression(path) {
  6981. var arg = path.get("argument");
  6982. if (!arg.isIdentifier()) return;
  6983. var name = arg.node.name;
  6984. var exports = this.exports[name];
  6985. if (!exports) return;
  6986. if (this.scope.getBinding(name) !== path.scope.getBinding(name)) return;
  6987. var node = t.assignmentExpression(path.node.operator[0] + "=", arg.node, t.numericLiteral(1));
  6988. if (path.parentPath.isExpressionStatement() && !path.isCompletionRecord() || path.node.prefix) {
  6989. path.replaceWith(node);
  6990. this.requeueInParent(path);
  6991. return;
  6992. }
  6993. var nodes = [];
  6994. nodes.push(node);
  6995. var operator = void 0;
  6996. if (path.node.operator === "--") {
  6997. operator = "+";
  6998. } else {
  6999. operator = "-";
  7000. }
  7001. nodes.push(t.binaryExpression(operator, arg.node, t.numericLiteral(1)));
  7002. path.replaceWithMultiple(t.sequenceExpression(nodes));
  7003. }
  7004. };
  7005. return {
  7006. inherits: _babelPluginTransformStrictMode2.default,
  7007. visitor: {
  7008. ThisExpression: function ThisExpression(path, state) {
  7009. if (this.ranCommonJS) return;
  7010. if (state.opts.allowTopLevelThis !== true && !path.findParent(function (path) {
  7011. return !path.is("shadow") && THIS_BREAK_KEYS.indexOf(path.type) >= 0;
  7012. })) {
  7013. path.replaceWith(t.identifier("undefined"));
  7014. }
  7015. },
  7016. Program: {
  7017. exit: function exit(path) {
  7018. this.ranCommonJS = true;
  7019. var strict = !!this.opts.strict;
  7020. var noInterop = !!this.opts.noInterop;
  7021. var scope = path.scope;
  7022. scope.rename("module");
  7023. scope.rename("exports");
  7024. scope.rename("require");
  7025. var hasExports = false;
  7026. var hasImports = false;
  7027. var body = path.get("body");
  7028. var imports = (0, _create2.default)(null);
  7029. var exports = (0, _create2.default)(null);
  7030. var nonHoistedExportNames = (0, _create2.default)(null);
  7031. var topNodes = [];
  7032. var remaps = (0, _create2.default)(null);
  7033. var requires = (0, _create2.default)(null);
  7034. function addRequire(source, blockHoist) {
  7035. var cached = requires[source];
  7036. if (cached) return cached;
  7037. var ref = path.scope.generateUidIdentifier((0, _path2.basename)(source, (0, _path2.extname)(source)));
  7038. var varDecl = t.variableDeclaration("var", [t.variableDeclarator(ref, buildRequire(t.stringLiteral(source)).expression)]);
  7039. if (imports[source]) {
  7040. varDecl.loc = imports[source].loc;
  7041. }
  7042. if (typeof blockHoist === "number" && blockHoist > 0) {
  7043. varDecl._blockHoist = blockHoist;
  7044. }
  7045. topNodes.push(varDecl);
  7046. return requires[source] = ref;
  7047. }
  7048. function addTo(obj, key, arr) {
  7049. var existing = obj[key] || [];
  7050. obj[key] = existing.concat(arr);
  7051. }
  7052. for (var _iterator4 = body, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, _getIterator3.default)(_iterator4);;) {
  7053. var _ref4;
  7054. if (_isArray4) {
  7055. if (_i4 >= _iterator4.length) break;
  7056. _ref4 = _iterator4[_i4++];
  7057. } else {
  7058. _i4 = _iterator4.next();
  7059. if (_i4.done) break;
  7060. _ref4 = _i4.value;
  7061. }
  7062. var _path = _ref4;
  7063. if (_path.isExportDeclaration()) {
  7064. hasExports = true;
  7065. var specifiers = [].concat(_path.get("declaration"), _path.get("specifiers"));
  7066. for (var _iterator6 = specifiers, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, _getIterator3.default)(_iterator6);;) {
  7067. var _ref6;
  7068. if (_isArray6) {
  7069. if (_i6 >= _iterator6.length) break;
  7070. _ref6 = _iterator6[_i6++];
  7071. } else {
  7072. _i6 = _iterator6.next();
  7073. if (_i6.done) break;
  7074. _ref6 = _i6.value;
  7075. }
  7076. var _specifier2 = _ref6;
  7077. var ids = _specifier2.getBindingIdentifiers();
  7078. if (ids.__esModule) {
  7079. throw _specifier2.buildCodeFrameError("Illegal export \"__esModule\"");
  7080. }
  7081. }
  7082. }
  7083. if (_path.isImportDeclaration()) {
  7084. var _importsEntry$specifi;
  7085. hasImports = true;
  7086. var key = _path.node.source.value;
  7087. var importsEntry = imports[key] || {
  7088. specifiers: [],
  7089. maxBlockHoist: 0,
  7090. loc: _path.node.loc
  7091. };
  7092. (_importsEntry$specifi = importsEntry.specifiers).push.apply(_importsEntry$specifi, _path.node.specifiers);
  7093. if (typeof _path.node._blockHoist === "number") {
  7094. importsEntry.maxBlockHoist = Math.max(_path.node._blockHoist, importsEntry.maxBlockHoist);
  7095. }
  7096. imports[key] = importsEntry;
  7097. _path.remove();
  7098. } else if (_path.isExportDefaultDeclaration()) {
  7099. var declaration = _path.get("declaration");
  7100. if (declaration.isFunctionDeclaration()) {
  7101. var id = declaration.node.id;
  7102. var defNode = t.identifier("default");
  7103. if (id) {
  7104. addTo(exports, id.name, defNode);
  7105. topNodes.push(buildExportsAssignment(defNode, id));
  7106. _path.replaceWith(declaration.node);
  7107. } else {
  7108. topNodes.push(buildExportsAssignment(defNode, t.toExpression(declaration.node)));
  7109. _path.remove();
  7110. }
  7111. } else if (declaration.isClassDeclaration()) {
  7112. var _id = declaration.node.id;
  7113. var _defNode = t.identifier("default");
  7114. if (_id) {
  7115. addTo(exports, _id.name, _defNode);
  7116. _path.replaceWithMultiple([declaration.node, buildExportsAssignment(_defNode, _id)]);
  7117. } else {
  7118. _path.replaceWith(buildExportsAssignment(_defNode, t.toExpression(declaration.node)));
  7119. _path.parentPath.requeue(_path.get("expression.left"));
  7120. }
  7121. } else {
  7122. _path.replaceWith(buildExportsAssignment(t.identifier("default"), declaration.node));
  7123. _path.parentPath.requeue(_path.get("expression.left"));
  7124. }
  7125. } else if (_path.isExportNamedDeclaration()) {
  7126. var _declaration = _path.get("declaration");
  7127. if (_declaration.node) {
  7128. if (_declaration.isFunctionDeclaration()) {
  7129. var _id2 = _declaration.node.id;
  7130. addTo(exports, _id2.name, _id2);
  7131. topNodes.push(buildExportsAssignment(_id2, _id2));
  7132. _path.replaceWith(_declaration.node);
  7133. } else if (_declaration.isClassDeclaration()) {
  7134. var _id3 = _declaration.node.id;
  7135. addTo(exports, _id3.name, _id3);
  7136. _path.replaceWithMultiple([_declaration.node, buildExportsAssignment(_id3, _id3)]);
  7137. nonHoistedExportNames[_id3.name] = true;
  7138. } else if (_declaration.isVariableDeclaration()) {
  7139. var declarators = _declaration.get("declarations");
  7140. for (var _iterator7 = declarators, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : (0, _getIterator3.default)(_iterator7);;) {
  7141. var _ref7;
  7142. if (_isArray7) {
  7143. if (_i7 >= _iterator7.length) break;
  7144. _ref7 = _iterator7[_i7++];
  7145. } else {
  7146. _i7 = _iterator7.next();
  7147. if (_i7.done) break;
  7148. _ref7 = _i7.value;
  7149. }
  7150. var decl = _ref7;
  7151. var _id4 = decl.get("id");
  7152. var init = decl.get("init");
  7153. var exportsToInsert = [];
  7154. if (!init.node) init.replaceWith(t.identifier("undefined"));
  7155. if (_id4.isIdentifier()) {
  7156. addTo(exports, _id4.node.name, _id4.node);
  7157. init.replaceWith(buildExportsAssignment(_id4.node, init.node).expression);
  7158. nonHoistedExportNames[_id4.node.name] = true;
  7159. } else if (_id4.isObjectPattern()) {
  7160. for (var _i8 = 0; _i8 < _id4.node.properties.length; _i8++) {
  7161. var prop = _id4.node.properties[_i8];
  7162. var propValue = prop.value;
  7163. if (t.isAssignmentPattern(propValue)) {
  7164. propValue = propValue.left;
  7165. } else if (t.isRestProperty(prop)) {
  7166. propValue = prop.argument;
  7167. }
  7168. addTo(exports, propValue.name, propValue);
  7169. exportsToInsert.push(buildExportsAssignment(propValue, propValue));
  7170. nonHoistedExportNames[propValue.name] = true;
  7171. }
  7172. } else if (_id4.isArrayPattern() && _id4.node.elements) {
  7173. for (var _i9 = 0; _i9 < _id4.node.elements.length; _i9++) {
  7174. var elem = _id4.node.elements[_i9];
  7175. if (!elem) continue;
  7176. if (t.isAssignmentPattern(elem)) {
  7177. elem = elem.left;
  7178. } else if (t.isRestElement(elem)) {
  7179. elem = elem.argument;
  7180. }
  7181. var name = elem.name;
  7182. addTo(exports, name, elem);
  7183. exportsToInsert.push(buildExportsAssignment(elem, elem));
  7184. nonHoistedExportNames[name] = true;
  7185. }
  7186. }
  7187. _path.insertAfter(exportsToInsert);
  7188. }
  7189. _path.replaceWith(_declaration.node);
  7190. }
  7191. continue;
  7192. }
  7193. var _specifiers = _path.get("specifiers");
  7194. var nodes = [];
  7195. var _source = _path.node.source;
  7196. if (_source) {
  7197. var ref = addRequire(_source.value, _path.node._blockHoist);
  7198. for (var _iterator8 = _specifiers, _isArray8 = Array.isArray(_iterator8), _i10 = 0, _iterator8 = _isArray8 ? _iterator8 : (0, _getIterator3.default)(_iterator8);;) {
  7199. var _ref8;
  7200. if (_isArray8) {
  7201. if (_i10 >= _iterator8.length) break;
  7202. _ref8 = _iterator8[_i10++];
  7203. } else {
  7204. _i10 = _iterator8.next();
  7205. if (_i10.done) break;
  7206. _ref8 = _i10.value;
  7207. }
  7208. var _specifier3 = _ref8;
  7209. if (_specifier3.isExportNamespaceSpecifier()) {} else if (_specifier3.isExportDefaultSpecifier()) {} else if (_specifier3.isExportSpecifier()) {
  7210. if (!noInterop && _specifier3.node.local.name === "default") {
  7211. topNodes.push(buildExportsFrom(t.stringLiteral(_specifier3.node.exported.name), t.memberExpression(t.callExpression(this.addHelper("interopRequireDefault"), [ref]), _specifier3.node.local)));
  7212. } else {
  7213. topNodes.push(buildExportsFrom(t.stringLiteral(_specifier3.node.exported.name), t.memberExpression(ref, _specifier3.node.local)));
  7214. }
  7215. nonHoistedExportNames[_specifier3.node.exported.name] = true;
  7216. }
  7217. }
  7218. } else {
  7219. for (var _iterator9 = _specifiers, _isArray9 = Array.isArray(_iterator9), _i11 = 0, _iterator9 = _isArray9 ? _iterator9 : (0, _getIterator3.default)(_iterator9);;) {
  7220. var _ref9;
  7221. if (_isArray9) {
  7222. if (_i11 >= _iterator9.length) break;
  7223. _ref9 = _iterator9[_i11++];
  7224. } else {
  7225. _i11 = _iterator9.next();
  7226. if (_i11.done) break;
  7227. _ref9 = _i11.value;
  7228. }
  7229. var _specifier4 = _ref9;
  7230. if (_specifier4.isExportSpecifier()) {
  7231. addTo(exports, _specifier4.node.local.name, _specifier4.node.exported);
  7232. nonHoistedExportNames[_specifier4.node.exported.name] = true;
  7233. nodes.push(buildExportsAssignment(_specifier4.node.exported, _specifier4.node.local));
  7234. }
  7235. }
  7236. }
  7237. _path.replaceWithMultiple(nodes);
  7238. } else if (_path.isExportAllDeclaration()) {
  7239. var exportNode = buildExportAll({
  7240. OBJECT: addRequire(_path.node.source.value, _path.node._blockHoist)
  7241. });
  7242. exportNode.loc = _path.node.loc;
  7243. topNodes.push(exportNode);
  7244. _path.remove();
  7245. }
  7246. }
  7247. for (var source in imports) {
  7248. var _imports$source = imports[source],
  7249. specifiers = _imports$source.specifiers,
  7250. maxBlockHoist = _imports$source.maxBlockHoist;
  7251. if (specifiers.length) {
  7252. var uid = addRequire(source, maxBlockHoist);
  7253. var wildcard = void 0;
  7254. for (var i = 0; i < specifiers.length; i++) {
  7255. var specifier = specifiers[i];
  7256. if (t.isImportNamespaceSpecifier(specifier)) {
  7257. if (strict || noInterop) {
  7258. remaps[specifier.local.name] = uid;
  7259. } else {
  7260. var varDecl = t.variableDeclaration("var", [t.variableDeclarator(specifier.local, t.callExpression(this.addHelper("interopRequireWildcard"), [uid]))]);
  7261. if (maxBlockHoist > 0) {
  7262. varDecl._blockHoist = maxBlockHoist;
  7263. }
  7264. topNodes.push(varDecl);
  7265. }
  7266. wildcard = specifier.local;
  7267. } else if (t.isImportDefaultSpecifier(specifier)) {
  7268. specifiers[i] = t.importSpecifier(specifier.local, t.identifier("default"));
  7269. }
  7270. }
  7271. for (var _iterator5 = specifiers, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, _getIterator3.default)(_iterator5);;) {
  7272. var _ref5;
  7273. if (_isArray5) {
  7274. if (_i5 >= _iterator5.length) break;
  7275. _ref5 = _iterator5[_i5++];
  7276. } else {
  7277. _i5 = _iterator5.next();
  7278. if (_i5.done) break;
  7279. _ref5 = _i5.value;
  7280. }
  7281. var _specifier = _ref5;
  7282. if (t.isImportSpecifier(_specifier)) {
  7283. var target = uid;
  7284. if (_specifier.imported.name === "default") {
  7285. if (wildcard) {
  7286. target = wildcard;
  7287. } else if (!noInterop) {
  7288. target = wildcard = path.scope.generateUidIdentifier(uid.name);
  7289. var _varDecl = t.variableDeclaration("var", [t.variableDeclarator(target, t.callExpression(this.addHelper("interopRequireDefault"), [uid]))]);
  7290. if (maxBlockHoist > 0) {
  7291. _varDecl._blockHoist = maxBlockHoist;
  7292. }
  7293. topNodes.push(_varDecl);
  7294. }
  7295. }
  7296. remaps[_specifier.local.name] = t.memberExpression(target, t.cloneWithoutLoc(_specifier.imported));
  7297. }
  7298. }
  7299. } else {
  7300. var requireNode = buildRequire(t.stringLiteral(source));
  7301. requireNode.loc = imports[source].loc;
  7302. topNodes.push(requireNode);
  7303. }
  7304. }
  7305. if (hasImports && (0, _keys2.default)(nonHoistedExportNames).length) {
  7306. var maxHoistedExportsNodeAssignmentLength = 100;
  7307. var nonHoistedExportNamesArr = (0, _keys2.default)(nonHoistedExportNames);
  7308. var _loop = function _loop(currentExportsNodeAssignmentLength) {
  7309. var nonHoistedExportNamesChunk = nonHoistedExportNamesArr.slice(currentExportsNodeAssignmentLength, currentExportsNodeAssignmentLength + maxHoistedExportsNodeAssignmentLength);
  7310. var hoistedExportsNode = t.identifier("undefined");
  7311. nonHoistedExportNamesChunk.forEach(function (name) {
  7312. hoistedExportsNode = buildExportsAssignment(t.identifier(name), hoistedExportsNode).expression;
  7313. });
  7314. var node = t.expressionStatement(hoistedExportsNode);
  7315. node._blockHoist = 3;
  7316. topNodes.unshift(node);
  7317. };
  7318. for (var currentExportsNodeAssignmentLength = 0; currentExportsNodeAssignmentLength < nonHoistedExportNamesArr.length; currentExportsNodeAssignmentLength += maxHoistedExportsNodeAssignmentLength) {
  7319. _loop(currentExportsNodeAssignmentLength);
  7320. }
  7321. }
  7322. if (hasExports && !strict) {
  7323. var buildTemplate = buildExportsModuleDeclaration;
  7324. if (this.opts.loose) buildTemplate = buildLooseExportsModuleDeclaration;
  7325. var declar = buildTemplate();
  7326. declar._blockHoist = 3;
  7327. topNodes.unshift(declar);
  7328. }
  7329. path.unshiftContainer("body", topNodes);
  7330. path.traverse(reassignmentVisitor, {
  7331. remaps: remaps,
  7332. scope: scope,
  7333. exports: exports,
  7334. requeueInParent: function requeueInParent(newPath) {
  7335. return path.requeue(newPath);
  7336. }
  7337. });
  7338. }
  7339. }
  7340. }
  7341. };
  7342. };
  7343. var _path2 = __webpack_require__(19);
  7344. var _babelTemplate = __webpack_require__(4);
  7345. var _babelTemplate2 = _interopRequireDefault(_babelTemplate);
  7346. var _babelPluginTransformStrictMode = __webpack_require__(216);
  7347. var _babelPluginTransformStrictMode2 = _interopRequireDefault(_babelPluginTransformStrictMode);
  7348. var _babelTypes = __webpack_require__(1);
  7349. var t = _interopRequireWildcard(_babelTypes);
  7350. function _interopRequireWildcard(obj) {
  7351. if (obj && obj.__esModule) {
  7352. return obj;
  7353. } else {
  7354. var newObj = {};if (obj != null) {
  7355. for (var key in obj) {
  7356. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  7357. }
  7358. }newObj.default = obj;return newObj;
  7359. }
  7360. }
  7361. function _interopRequireDefault(obj) {
  7362. return obj && obj.__esModule ? obj : { default: obj };
  7363. }
  7364. var buildRequire = (0, _babelTemplate2.default)("\n require($0);\n");
  7365. var buildExportsModuleDeclaration = (0, _babelTemplate2.default)("\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n");
  7366. var buildExportsFrom = (0, _babelTemplate2.default)("\n Object.defineProperty(exports, $0, {\n enumerable: true,\n get: function () {\n return $1;\n }\n });\n");
  7367. var buildLooseExportsModuleDeclaration = (0, _babelTemplate2.default)("\n exports.__esModule = true;\n");
  7368. var buildExportsAssignment = (0, _babelTemplate2.default)("\n exports.$0 = $1;\n");
  7369. var buildExportAll = (0, _babelTemplate2.default)("\n Object.keys(OBJECT).forEach(function (key) {\n if (key === \"default\" || key === \"__esModule\") return;\n Object.defineProperty(exports, key, {\n enumerable: true,\n get: function () {\n return OBJECT[key];\n }\n });\n });\n");
  7370. var THIS_BREAK_KEYS = ["FunctionExpression", "FunctionDeclaration", "ClassProperty", "ClassMethod", "ObjectMethod"];
  7371. module.exports = exports["default"];
  7372. /***/ }),
  7373. /* 78 */
  7374. /***/ (function(module, exports, __webpack_require__) {
  7375. "use strict";
  7376. exports.__esModule = true;
  7377. var _getIterator2 = __webpack_require__(2);
  7378. var _getIterator3 = _interopRequireDefault(_getIterator2);
  7379. var _symbol = __webpack_require__(10);
  7380. var _symbol2 = _interopRequireDefault(_symbol);
  7381. exports.default = function (_ref) {
  7382. var t = _ref.types;
  7383. function Property(path, node, scope, getObjectRef, file) {
  7384. var replaceSupers = new _babelHelperReplaceSupers2.default({
  7385. getObjectRef: getObjectRef,
  7386. methodNode: node,
  7387. methodPath: path,
  7388. isStatic: true,
  7389. scope: scope,
  7390. file: file
  7391. });
  7392. replaceSupers.replace();
  7393. }
  7394. var CONTAINS_SUPER = (0, _symbol2.default)();
  7395. return {
  7396. visitor: {
  7397. Super: function Super(path) {
  7398. var parentObj = path.findParent(function (path) {
  7399. return path.isObjectExpression();
  7400. });
  7401. if (parentObj) parentObj.node[CONTAINS_SUPER] = true;
  7402. },
  7403. ObjectExpression: {
  7404. exit: function exit(path, file) {
  7405. if (!path.node[CONTAINS_SUPER]) return;
  7406. var objectRef = void 0;
  7407. var getObjectRef = function getObjectRef() {
  7408. return objectRef = objectRef || path.scope.generateUidIdentifier("obj");
  7409. };
  7410. var propPaths = path.get("properties");
  7411. for (var _iterator = propPaths, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
  7412. var _ref2;
  7413. if (_isArray) {
  7414. if (_i >= _iterator.length) break;
  7415. _ref2 = _iterator[_i++];
  7416. } else {
  7417. _i = _iterator.next();
  7418. if (_i.done) break;
  7419. _ref2 = _i.value;
  7420. }
  7421. var propPath = _ref2;
  7422. if (propPath.isObjectProperty()) propPath = propPath.get("value");
  7423. Property(propPath, propPath.node, path.scope, getObjectRef, file);
  7424. }
  7425. if (objectRef) {
  7426. path.scope.push({ id: objectRef });
  7427. path.replaceWith(t.assignmentExpression("=", objectRef, path.node));
  7428. }
  7429. }
  7430. }
  7431. }
  7432. };
  7433. };
  7434. var _babelHelperReplaceSupers = __webpack_require__(193);
  7435. var _babelHelperReplaceSupers2 = _interopRequireDefault(_babelHelperReplaceSupers);
  7436. function _interopRequireDefault(obj) {
  7437. return obj && obj.__esModule ? obj : { default: obj };
  7438. }
  7439. module.exports = exports["default"];
  7440. /***/ }),
  7441. /* 79 */
  7442. /***/ (function(module, exports, __webpack_require__) {
  7443. "use strict";
  7444. exports.__esModule = true;
  7445. var _getIterator2 = __webpack_require__(2);
  7446. var _getIterator3 = _interopRequireDefault(_getIterator2);
  7447. exports.default = function () {
  7448. return {
  7449. visitor: _babelTraverse.visitors.merge([{
  7450. ArrowFunctionExpression: function ArrowFunctionExpression(path) {
  7451. var params = path.get("params");
  7452. for (var _iterator = params, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
  7453. var _ref;
  7454. if (_isArray) {
  7455. if (_i >= _iterator.length) break;
  7456. _ref = _iterator[_i++];
  7457. } else {
  7458. _i = _iterator.next();
  7459. if (_i.done) break;
  7460. _ref = _i.value;
  7461. }
  7462. var param = _ref;
  7463. if (param.isRestElement() || param.isAssignmentPattern()) {
  7464. path.arrowFunctionToShadowed();
  7465. break;
  7466. }
  7467. }
  7468. }
  7469. }, destructuring.visitor, rest.visitor, def.visitor])
  7470. };
  7471. };
  7472. var _babelTraverse = __webpack_require__(7);
  7473. var _destructuring = __webpack_require__(334);
  7474. var destructuring = _interopRequireWildcard(_destructuring);
  7475. var _default = __webpack_require__(333);
  7476. var def = _interopRequireWildcard(_default);
  7477. var _rest = __webpack_require__(335);
  7478. var rest = _interopRequireWildcard(_rest);
  7479. function _interopRequireWildcard(obj) {
  7480. if (obj && obj.__esModule) {
  7481. return obj;
  7482. } else {
  7483. var newObj = {};if (obj != null) {
  7484. for (var key in obj) {
  7485. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  7486. }
  7487. }newObj.default = obj;return newObj;
  7488. }
  7489. }
  7490. function _interopRequireDefault(obj) {
  7491. return obj && obj.__esModule ? obj : { default: obj };
  7492. }
  7493. module.exports = exports["default"];
  7494. /***/ }),
  7495. /* 80 */
  7496. /***/ (function(module, exports, __webpack_require__) {
  7497. "use strict";
  7498. exports.__esModule = true;
  7499. exports.default = function () {
  7500. return {
  7501. visitor: {
  7502. ObjectMethod: function ObjectMethod(path) {
  7503. var node = path.node;
  7504. if (node.kind === "method") {
  7505. var func = t.functionExpression(null, node.params, node.body, node.generator, node.async);
  7506. func.returnType = node.returnType;
  7507. path.replaceWith(t.objectProperty(node.key, func, node.computed));
  7508. }
  7509. },
  7510. ObjectProperty: function ObjectProperty(_ref) {
  7511. var node = _ref.node;
  7512. if (node.shorthand) {
  7513. node.shorthand = false;
  7514. }
  7515. }
  7516. }
  7517. };
  7518. };
  7519. var _babelTypes = __webpack_require__(1);
  7520. var t = _interopRequireWildcard(_babelTypes);
  7521. function _interopRequireWildcard(obj) {
  7522. if (obj && obj.__esModule) {
  7523. return obj;
  7524. } else {
  7525. var newObj = {};if (obj != null) {
  7526. for (var key in obj) {
  7527. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  7528. }
  7529. }newObj.default = obj;return newObj;
  7530. }
  7531. }
  7532. module.exports = exports["default"];
  7533. /***/ }),
  7534. /* 81 */
  7535. /***/ (function(module, exports, __webpack_require__) {
  7536. "use strict";
  7537. exports.__esModule = true;
  7538. var _getIterator2 = __webpack_require__(2);
  7539. var _getIterator3 = _interopRequireDefault(_getIterator2);
  7540. exports.default = function (_ref) {
  7541. var t = _ref.types;
  7542. function getSpreadLiteral(spread, scope, state) {
  7543. if (state.opts.loose && !t.isIdentifier(spread.argument, { name: "arguments" })) {
  7544. return spread.argument;
  7545. } else {
  7546. return scope.toArray(spread.argument, true);
  7547. }
  7548. }
  7549. function hasSpread(nodes) {
  7550. for (var i = 0; i < nodes.length; i++) {
  7551. if (t.isSpreadElement(nodes[i])) {
  7552. return true;
  7553. }
  7554. }
  7555. return false;
  7556. }
  7557. function build(props, scope, state) {
  7558. var nodes = [];
  7559. var _props = [];
  7560. function push() {
  7561. if (!_props.length) return;
  7562. nodes.push(t.arrayExpression(_props));
  7563. _props = [];
  7564. }
  7565. for (var _iterator = props, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
  7566. var _ref2;
  7567. if (_isArray) {
  7568. if (_i >= _iterator.length) break;
  7569. _ref2 = _iterator[_i++];
  7570. } else {
  7571. _i = _iterator.next();
  7572. if (_i.done) break;
  7573. _ref2 = _i.value;
  7574. }
  7575. var prop = _ref2;
  7576. if (t.isSpreadElement(prop)) {
  7577. push();
  7578. nodes.push(getSpreadLiteral(prop, scope, state));
  7579. } else {
  7580. _props.push(prop);
  7581. }
  7582. }
  7583. push();
  7584. return nodes;
  7585. }
  7586. return {
  7587. visitor: {
  7588. ArrayExpression: function ArrayExpression(path, state) {
  7589. var node = path.node,
  7590. scope = path.scope;
  7591. var elements = node.elements;
  7592. if (!hasSpread(elements)) return;
  7593. var nodes = build(elements, scope, state);
  7594. var first = nodes.shift();
  7595. if (!t.isArrayExpression(first)) {
  7596. nodes.unshift(first);
  7597. first = t.arrayExpression([]);
  7598. }
  7599. path.replaceWith(t.callExpression(t.memberExpression(first, t.identifier("concat")), nodes));
  7600. },
  7601. CallExpression: function CallExpression(path, state) {
  7602. var node = path.node,
  7603. scope = path.scope;
  7604. var args = node.arguments;
  7605. if (!hasSpread(args)) return;
  7606. var calleePath = path.get("callee");
  7607. if (calleePath.isSuper()) return;
  7608. var contextLiteral = t.identifier("undefined");
  7609. node.arguments = [];
  7610. var nodes = void 0;
  7611. if (args.length === 1 && args[0].argument.name === "arguments") {
  7612. nodes = [args[0].argument];
  7613. } else {
  7614. nodes = build(args, scope, state);
  7615. }
  7616. var first = nodes.shift();
  7617. if (nodes.length) {
  7618. node.arguments.push(t.callExpression(t.memberExpression(first, t.identifier("concat")), nodes));
  7619. } else {
  7620. node.arguments.push(first);
  7621. }
  7622. var callee = node.callee;
  7623. if (calleePath.isMemberExpression()) {
  7624. var temp = scope.maybeGenerateMemoised(callee.object);
  7625. if (temp) {
  7626. callee.object = t.assignmentExpression("=", temp, callee.object);
  7627. contextLiteral = temp;
  7628. } else {
  7629. contextLiteral = callee.object;
  7630. }
  7631. t.appendToMemberExpression(callee, t.identifier("apply"));
  7632. } else {
  7633. node.callee = t.memberExpression(node.callee, t.identifier("apply"));
  7634. }
  7635. if (t.isSuper(contextLiteral)) {
  7636. contextLiteral = t.thisExpression();
  7637. }
  7638. node.arguments.unshift(contextLiteral);
  7639. },
  7640. NewExpression: function NewExpression(path, state) {
  7641. var node = path.node,
  7642. scope = path.scope;
  7643. var args = node.arguments;
  7644. if (!hasSpread(args)) return;
  7645. var nodes = build(args, scope, state);
  7646. var context = t.arrayExpression([t.nullLiteral()]);
  7647. args = t.callExpression(t.memberExpression(context, t.identifier("concat")), nodes);
  7648. path.replaceWith(t.newExpression(t.callExpression(t.memberExpression(t.memberExpression(t.memberExpression(t.identifier("Function"), t.identifier("prototype")), t.identifier("bind")), t.identifier("apply")), [node.callee, args]), []));
  7649. }
  7650. }
  7651. };
  7652. };
  7653. function _interopRequireDefault(obj) {
  7654. return obj && obj.__esModule ? obj : { default: obj };
  7655. }
  7656. module.exports = exports["default"];
  7657. /***/ }),
  7658. /* 82 */
  7659. /***/ (function(module, exports, __webpack_require__) {
  7660. "use strict";
  7661. exports.__esModule = true;
  7662. exports.default = function () {
  7663. return {
  7664. visitor: {
  7665. RegExpLiteral: function RegExpLiteral(path) {
  7666. var node = path.node;
  7667. if (!regex.is(node, "y")) return;
  7668. path.replaceWith(t.newExpression(t.identifier("RegExp"), [t.stringLiteral(node.pattern), t.stringLiteral(node.flags)]));
  7669. }
  7670. }
  7671. };
  7672. };
  7673. var _babelHelperRegex = __webpack_require__(192);
  7674. var regex = _interopRequireWildcard(_babelHelperRegex);
  7675. var _babelTypes = __webpack_require__(1);
  7676. var t = _interopRequireWildcard(_babelTypes);
  7677. function _interopRequireWildcard(obj) {
  7678. if (obj && obj.__esModule) {
  7679. return obj;
  7680. } else {
  7681. var newObj = {};if (obj != null) {
  7682. for (var key in obj) {
  7683. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  7684. }
  7685. }newObj.default = obj;return newObj;
  7686. }
  7687. }
  7688. module.exports = exports["default"];
  7689. /***/ }),
  7690. /* 83 */
  7691. /***/ (function(module, exports, __webpack_require__) {
  7692. "use strict";
  7693. exports.__esModule = true;
  7694. var _getIterator2 = __webpack_require__(2);
  7695. var _getIterator3 = _interopRequireDefault(_getIterator2);
  7696. exports.default = function (_ref) {
  7697. var t = _ref.types;
  7698. function isString(node) {
  7699. return t.isLiteral(node) && typeof node.value === "string";
  7700. }
  7701. function buildBinaryExpression(left, right) {
  7702. return t.binaryExpression("+", left, right);
  7703. }
  7704. return {
  7705. visitor: {
  7706. TaggedTemplateExpression: function TaggedTemplateExpression(path, state) {
  7707. var node = path.node;
  7708. var quasi = node.quasi;
  7709. var args = [];
  7710. var strings = [];
  7711. var raw = [];
  7712. for (var _iterator = quasi.quasis, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
  7713. var _ref2;
  7714. if (_isArray) {
  7715. if (_i >= _iterator.length) break;
  7716. _ref2 = _iterator[_i++];
  7717. } else {
  7718. _i = _iterator.next();
  7719. if (_i.done) break;
  7720. _ref2 = _i.value;
  7721. }
  7722. var elem = _ref2;
  7723. strings.push(t.stringLiteral(elem.value.cooked));
  7724. raw.push(t.stringLiteral(elem.value.raw));
  7725. }
  7726. strings = t.arrayExpression(strings);
  7727. raw = t.arrayExpression(raw);
  7728. var templateName = "taggedTemplateLiteral";
  7729. if (state.opts.loose) templateName += "Loose";
  7730. var templateObject = state.file.addTemplateObject(templateName, strings, raw);
  7731. args.push(templateObject);
  7732. args = args.concat(quasi.expressions);
  7733. path.replaceWith(t.callExpression(node.tag, args));
  7734. },
  7735. TemplateLiteral: function TemplateLiteral(path, state) {
  7736. var nodes = [];
  7737. var expressions = path.get("expressions");
  7738. for (var _iterator2 = path.node.quasis, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) {
  7739. var _ref3;
  7740. if (_isArray2) {
  7741. if (_i2 >= _iterator2.length) break;
  7742. _ref3 = _iterator2[_i2++];
  7743. } else {
  7744. _i2 = _iterator2.next();
  7745. if (_i2.done) break;
  7746. _ref3 = _i2.value;
  7747. }
  7748. var elem = _ref3;
  7749. nodes.push(t.stringLiteral(elem.value.cooked));
  7750. var expr = expressions.shift();
  7751. if (expr) {
  7752. if (state.opts.spec && !expr.isBaseType("string") && !expr.isBaseType("number")) {
  7753. nodes.push(t.callExpression(t.identifier("String"), [expr.node]));
  7754. } else {
  7755. nodes.push(expr.node);
  7756. }
  7757. }
  7758. }
  7759. nodes = nodes.filter(function (n) {
  7760. return !t.isLiteral(n, { value: "" });
  7761. });
  7762. if (!isString(nodes[0]) && !isString(nodes[1])) {
  7763. nodes.unshift(t.stringLiteral(""));
  7764. }
  7765. if (nodes.length > 1) {
  7766. var root = buildBinaryExpression(nodes.shift(), nodes.shift());
  7767. for (var _iterator3 = nodes, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) {
  7768. var _ref4;
  7769. if (_isArray3) {
  7770. if (_i3 >= _iterator3.length) break;
  7771. _ref4 = _iterator3[_i3++];
  7772. } else {
  7773. _i3 = _iterator3.next();
  7774. if (_i3.done) break;
  7775. _ref4 = _i3.value;
  7776. }
  7777. var node = _ref4;
  7778. root = buildBinaryExpression(root, node);
  7779. }
  7780. path.replaceWith(root);
  7781. } else {
  7782. path.replaceWith(nodes[0]);
  7783. }
  7784. }
  7785. }
  7786. };
  7787. };
  7788. function _interopRequireDefault(obj) {
  7789. return obj && obj.__esModule ? obj : { default: obj };
  7790. }
  7791. module.exports = exports["default"];
  7792. /***/ }),
  7793. /* 84 */
  7794. /***/ (function(module, exports, __webpack_require__) {
  7795. "use strict";
  7796. exports.__esModule = true;
  7797. var _symbol = __webpack_require__(10);
  7798. var _symbol2 = _interopRequireDefault(_symbol);
  7799. exports.default = function (_ref) {
  7800. var t = _ref.types;
  7801. var IGNORE = (0, _symbol2.default)();
  7802. return {
  7803. visitor: {
  7804. Scope: function Scope(_ref2) {
  7805. var scope = _ref2.scope;
  7806. if (!scope.getBinding("Symbol")) {
  7807. return;
  7808. }
  7809. scope.rename("Symbol");
  7810. },
  7811. UnaryExpression: function UnaryExpression(path) {
  7812. var node = path.node,
  7813. parent = path.parent;
  7814. if (node[IGNORE]) return;
  7815. if (path.find(function (path) {
  7816. return path.node && !!path.node._generated;
  7817. })) return;
  7818. if (path.parentPath.isBinaryExpression() && t.EQUALITY_BINARY_OPERATORS.indexOf(parent.operator) >= 0) {
  7819. var opposite = path.getOpposite();
  7820. if (opposite.isLiteral() && opposite.node.value !== "symbol" && opposite.node.value !== "object") {
  7821. return;
  7822. }
  7823. }
  7824. if (node.operator === "typeof") {
  7825. var call = t.callExpression(this.addHelper("typeof"), [node.argument]);
  7826. if (path.get("argument").isIdentifier()) {
  7827. var undefLiteral = t.stringLiteral("undefined");
  7828. var unary = t.unaryExpression("typeof", node.argument);
  7829. unary[IGNORE] = true;
  7830. path.replaceWith(t.conditionalExpression(t.binaryExpression("===", unary, undefLiteral), undefLiteral, call));
  7831. } else {
  7832. path.replaceWith(call);
  7833. }
  7834. }
  7835. }
  7836. }
  7837. };
  7838. };
  7839. function _interopRequireDefault(obj) {
  7840. return obj && obj.__esModule ? obj : { default: obj };
  7841. }
  7842. module.exports = exports["default"];
  7843. /***/ }),
  7844. /* 85 */
  7845. /***/ (function(module, exports, __webpack_require__) {
  7846. "use strict";
  7847. exports.__esModule = true;
  7848. exports.default = function () {
  7849. return {
  7850. visitor: {
  7851. RegExpLiteral: function RegExpLiteral(_ref) {
  7852. var node = _ref.node;
  7853. if (!regex.is(node, "u")) return;
  7854. node.pattern = (0, _regexpuCore2.default)(node.pattern, node.flags);
  7855. regex.pullFlag(node, "u");
  7856. }
  7857. }
  7858. };
  7859. };
  7860. var _regexpuCore = __webpack_require__(612);
  7861. var _regexpuCore2 = _interopRequireDefault(_regexpuCore);
  7862. var _babelHelperRegex = __webpack_require__(192);
  7863. var regex = _interopRequireWildcard(_babelHelperRegex);
  7864. function _interopRequireWildcard(obj) {
  7865. if (obj && obj.__esModule) {
  7866. return obj;
  7867. } else {
  7868. var newObj = {};if (obj != null) {
  7869. for (var key in obj) {
  7870. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  7871. }
  7872. }newObj.default = obj;return newObj;
  7873. }
  7874. }
  7875. function _interopRequireDefault(obj) {
  7876. return obj && obj.__esModule ? obj : { default: obj };
  7877. }
  7878. module.exports = exports["default"];
  7879. /***/ }),
  7880. /* 86 */
  7881. /***/ (function(module, exports, __webpack_require__) {
  7882. "use strict";
  7883. module.exports = __webpack_require__(606);
  7884. /***/ }),
  7885. /* 87 */
  7886. /***/ (function(module, exports, __webpack_require__) {
  7887. "use strict";
  7888. module.exports = { "default": __webpack_require__(408), __esModule: true };
  7889. /***/ }),
  7890. /* 88 */
  7891. /***/ (function(module, exports, __webpack_require__) {
  7892. "use strict";
  7893. exports.__esModule = true;
  7894. exports.scope = exports.path = undefined;
  7895. var _weakMap = __webpack_require__(364);
  7896. var _weakMap2 = _interopRequireDefault(_weakMap);
  7897. exports.clear = clear;
  7898. exports.clearPath = clearPath;
  7899. exports.clearScope = clearScope;
  7900. function _interopRequireDefault(obj) {
  7901. return obj && obj.__esModule ? obj : { default: obj };
  7902. }
  7903. var path = exports.path = new _weakMap2.default();
  7904. var scope = exports.scope = new _weakMap2.default();
  7905. function clear() {
  7906. clearPath();
  7907. clearScope();
  7908. }
  7909. function clearPath() {
  7910. exports.path = path = new _weakMap2.default();
  7911. }
  7912. function clearScope() {
  7913. exports.scope = scope = new _weakMap2.default();
  7914. }
  7915. /***/ }),
  7916. /* 89 */
  7917. /***/ (function(module, exports) {
  7918. 'use strict';
  7919. var _typeof2 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  7920. Object.defineProperty(exports, '__esModule', { value: true });
  7921. /* eslint max-len: 0 */
  7922. // This is a trick taken from Esprima. It turns out that, on
  7923. // non-Chrome browsers, to check whether a string is in a set, a
  7924. // predicate containing a big ugly `switch` statement is faster than
  7925. // a regular expression, and on Chrome the two are about on par.
  7926. // This function uses `eval` (non-lexical) to produce such a
  7927. // predicate from a space-separated string of words.
  7928. //
  7929. // It starts by sorting the words by length.
  7930. function makePredicate(words) {
  7931. words = words.split(" ");
  7932. return function (str) {
  7933. return words.indexOf(str) >= 0;
  7934. };
  7935. }
  7936. // Reserved word lists for various dialects of the language
  7937. var reservedWords = {
  7938. 6: makePredicate("enum await"),
  7939. strict: makePredicate("implements interface let package private protected public static yield"),
  7940. strictBind: makePredicate("eval arguments")
  7941. };
  7942. // And the keywords
  7943. var isKeyword = makePredicate("break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this let const class extends export import yield super");
  7944. // ## Character categories
  7945. // Big ugly regular expressions that match characters in the
  7946. // whitespace, identifier, and identifier-start categories. These
  7947. // are only applied when a character is found to actually have a
  7948. // code point above 128.
  7949. // Generated by `bin/generate-identifier-regex.js`.
  7950. var nonASCIIidentifierStartChars = '\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC';
  7951. var nonASCIIidentifierChars = '\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D4-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFB-\u1DFF\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA900-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F';
  7952. var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]");
  7953. var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]");
  7954. nonASCIIidentifierStartChars = nonASCIIidentifierChars = null;
  7955. // These are a run-length and offset encoded representation of the
  7956. // >0xffff code points that are a valid part of identifiers. The
  7957. // offset starts at 0x10000, and each pair of numbers represents an
  7958. // offset to the next range, and then a size of the range. They were
  7959. // generated by `bin/generate-identifier-regex.js`.
  7960. // eslint-disable-next-line comma-spacing
  7961. var astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 17, 26, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 157, 310, 10, 21, 11, 7, 153, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 26, 45, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 785, 52, 76, 44, 33, 24, 27, 35, 42, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 85, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 54, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 86, 25, 391, 63, 32, 0, 449, 56, 264, 8, 2, 36, 18, 0, 50, 29, 881, 921, 103, 110, 18, 195, 2749, 1070, 4050, 582, 8634, 568, 8, 30, 114, 29, 19, 47, 17, 3, 32, 20, 6, 18, 881, 68, 12, 0, 67, 12, 65, 0, 32, 6124, 20, 754, 9486, 1, 3071, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 4149, 196, 60, 67, 1213, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42710, 42, 4148, 12, 221, 3, 5761, 10591, 541];
  7962. // eslint-disable-next-line comma-spacing
  7963. var astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 1306, 2, 54, 14, 32, 9, 16, 3, 46, 10, 54, 9, 7, 2, 37, 13, 2, 9, 52, 0, 13, 2, 49, 13, 10, 2, 4, 9, 83, 11, 7, 0, 161, 11, 6, 9, 7, 3, 57, 0, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 87, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 423, 9, 838, 7, 2, 7, 17, 9, 57, 21, 2, 13, 19882, 9, 135, 4, 60, 6, 26, 9, 1016, 45, 17, 3, 19723, 1, 5319, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 2214, 6, 110, 6, 6, 9, 792487, 239];
  7964. // This has a complexity linear to the value of the code. The
  7965. // assumption is that looking up astral identifier characters is
  7966. // rare.
  7967. function isInAstralSet(code, set) {
  7968. var pos = 0x10000;
  7969. for (var i = 0; i < set.length; i += 2) {
  7970. pos += set[i];
  7971. if (pos > code) return false;
  7972. pos += set[i + 1];
  7973. if (pos >= code) return true;
  7974. }
  7975. }
  7976. // Test whether a given character code starts an identifier.
  7977. function isIdentifierStart(code) {
  7978. if (code < 65) return code === 36;
  7979. if (code < 91) return true;
  7980. if (code < 97) return code === 95;
  7981. if (code < 123) return true;
  7982. if (code <= 0xffff) return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code));
  7983. return isInAstralSet(code, astralIdentifierStartCodes);
  7984. }
  7985. // Test whether a given character is part of an identifier.
  7986. function isIdentifierChar(code) {
  7987. if (code < 48) return code === 36;
  7988. if (code < 58) return true;
  7989. if (code < 65) return false;
  7990. if (code < 91) return true;
  7991. if (code < 97) return code === 95;
  7992. if (code < 123) return true;
  7993. if (code <= 0xffff) return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code));
  7994. return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes);
  7995. }
  7996. // A second optional argument can be given to further configure
  7997. var defaultOptions = {
  7998. // Source type ("script" or "module") for different semantics
  7999. sourceType: "script",
  8000. // Source filename.
  8001. sourceFilename: undefined,
  8002. // Line from which to start counting source. Useful for
  8003. // integration with other tools.
  8004. startLine: 1,
  8005. // When enabled, a return at the top level is not considered an
  8006. // error.
  8007. allowReturnOutsideFunction: false,
  8008. // When enabled, import/export statements are not constrained to
  8009. // appearing at the top of the program.
  8010. allowImportExportEverywhere: false,
  8011. // TODO
  8012. allowSuperOutsideMethod: false,
  8013. // An array of plugins to enable
  8014. plugins: [],
  8015. // TODO
  8016. strictMode: null
  8017. };
  8018. // Interpret and default an options object
  8019. function getOptions(opts) {
  8020. var options = {};
  8021. for (var key in defaultOptions) {
  8022. options[key] = opts && key in opts ? opts[key] : defaultOptions[key];
  8023. }
  8024. return options;
  8025. }
  8026. var _typeof = typeof Symbol === "function" && _typeof2(Symbol.iterator) === "symbol" ? function (obj) {
  8027. return typeof obj === 'undefined' ? 'undefined' : _typeof2(obj);
  8028. } : function (obj) {
  8029. return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj === 'undefined' ? 'undefined' : _typeof2(obj);
  8030. };
  8031. var classCallCheck = function classCallCheck(instance, Constructor) {
  8032. if (!(instance instanceof Constructor)) {
  8033. throw new TypeError("Cannot call a class as a function");
  8034. }
  8035. };
  8036. var inherits = function inherits(subClass, superClass) {
  8037. if (typeof superClass !== "function" && superClass !== null) {
  8038. throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === 'undefined' ? 'undefined' : _typeof2(superClass)));
  8039. }
  8040. subClass.prototype = Object.create(superClass && superClass.prototype, {
  8041. constructor: {
  8042. value: subClass,
  8043. enumerable: false,
  8044. writable: true,
  8045. configurable: true
  8046. }
  8047. });
  8048. if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
  8049. };
  8050. var possibleConstructorReturn = function possibleConstructorReturn(self, call) {
  8051. if (!self) {
  8052. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  8053. }
  8054. return call && ((typeof call === 'undefined' ? 'undefined' : _typeof2(call)) === "object" || typeof call === "function") ? call : self;
  8055. };
  8056. // ## Token types
  8057. // The assignment of fine-grained, information-carrying type objects
  8058. // allows the tokenizer to store the information it has about a
  8059. // token in a way that is very cheap for the parser to look up.
  8060. // All token type variables start with an underscore, to make them
  8061. // easy to recognize.
  8062. // The `beforeExpr` property is used to disambiguate between regular
  8063. // expressions and divisions. It is set on all token types that can
  8064. // be followed by an expression (thus, a slash after them would be a
  8065. // regular expression).
  8066. //
  8067. // `isLoop` marks a keyword as starting a loop, which is important
  8068. // to know when parsing a label, in order to allow or disallow
  8069. // continue jumps to that label.
  8070. var beforeExpr = true;
  8071. var startsExpr = true;
  8072. var isLoop = true;
  8073. var isAssign = true;
  8074. var prefix = true;
  8075. var postfix = true;
  8076. var TokenType = function TokenType(label) {
  8077. var conf = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  8078. classCallCheck(this, TokenType);
  8079. this.label = label;
  8080. this.keyword = conf.keyword;
  8081. this.beforeExpr = !!conf.beforeExpr;
  8082. this.startsExpr = !!conf.startsExpr;
  8083. this.rightAssociative = !!conf.rightAssociative;
  8084. this.isLoop = !!conf.isLoop;
  8085. this.isAssign = !!conf.isAssign;
  8086. this.prefix = !!conf.prefix;
  8087. this.postfix = !!conf.postfix;
  8088. this.binop = conf.binop || null;
  8089. this.updateContext = null;
  8090. };
  8091. var KeywordTokenType = function (_TokenType) {
  8092. inherits(KeywordTokenType, _TokenType);
  8093. function KeywordTokenType(name) {
  8094. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  8095. classCallCheck(this, KeywordTokenType);
  8096. options.keyword = name;
  8097. return possibleConstructorReturn(this, _TokenType.call(this, name, options));
  8098. }
  8099. return KeywordTokenType;
  8100. }(TokenType);
  8101. var BinopTokenType = function (_TokenType2) {
  8102. inherits(BinopTokenType, _TokenType2);
  8103. function BinopTokenType(name, prec) {
  8104. classCallCheck(this, BinopTokenType);
  8105. return possibleConstructorReturn(this, _TokenType2.call(this, name, { beforeExpr: beforeExpr, binop: prec }));
  8106. }
  8107. return BinopTokenType;
  8108. }(TokenType);
  8109. var types = {
  8110. num: new TokenType("num", { startsExpr: startsExpr }),
  8111. regexp: new TokenType("regexp", { startsExpr: startsExpr }),
  8112. string: new TokenType("string", { startsExpr: startsExpr }),
  8113. name: new TokenType("name", { startsExpr: startsExpr }),
  8114. eof: new TokenType("eof"),
  8115. // Punctuation token types.
  8116. bracketL: new TokenType("[", { beforeExpr: beforeExpr, startsExpr: startsExpr }),
  8117. bracketR: new TokenType("]"),
  8118. braceL: new TokenType("{", { beforeExpr: beforeExpr, startsExpr: startsExpr }),
  8119. braceBarL: new TokenType("{|", { beforeExpr: beforeExpr, startsExpr: startsExpr }),
  8120. braceR: new TokenType("}"),
  8121. braceBarR: new TokenType("|}"),
  8122. parenL: new TokenType("(", { beforeExpr: beforeExpr, startsExpr: startsExpr }),
  8123. parenR: new TokenType(")"),
  8124. comma: new TokenType(",", { beforeExpr: beforeExpr }),
  8125. semi: new TokenType(";", { beforeExpr: beforeExpr }),
  8126. colon: new TokenType(":", { beforeExpr: beforeExpr }),
  8127. doubleColon: new TokenType("::", { beforeExpr: beforeExpr }),
  8128. dot: new TokenType("."),
  8129. question: new TokenType("?", { beforeExpr: beforeExpr }),
  8130. arrow: new TokenType("=>", { beforeExpr: beforeExpr }),
  8131. template: new TokenType("template"),
  8132. ellipsis: new TokenType("...", { beforeExpr: beforeExpr }),
  8133. backQuote: new TokenType("`", { startsExpr: startsExpr }),
  8134. dollarBraceL: new TokenType("${", { beforeExpr: beforeExpr, startsExpr: startsExpr }),
  8135. at: new TokenType("@"),
  8136. // Operators. These carry several kinds of properties to help the
  8137. // parser use them properly (the presence of these properties is
  8138. // what categorizes them as operators).
  8139. //
  8140. // `binop`, when present, specifies that this operator is a binary
  8141. // operator, and will refer to its precedence.
  8142. //
  8143. // `prefix` and `postfix` mark the operator as a prefix or postfix
  8144. // unary operator.
  8145. //
  8146. // `isAssign` marks all of `=`, `+=`, `-=` etcetera, which act as
  8147. // binary operators with a very low precedence, that should result
  8148. // in AssignmentExpression nodes.
  8149. eq: new TokenType("=", { beforeExpr: beforeExpr, isAssign: isAssign }),
  8150. assign: new TokenType("_=", { beforeExpr: beforeExpr, isAssign: isAssign }),
  8151. incDec: new TokenType("++/--", { prefix: prefix, postfix: postfix, startsExpr: startsExpr }),
  8152. prefix: new TokenType("prefix", { beforeExpr: beforeExpr, prefix: prefix, startsExpr: startsExpr }),
  8153. logicalOR: new BinopTokenType("||", 1),
  8154. logicalAND: new BinopTokenType("&&", 2),
  8155. bitwiseOR: new BinopTokenType("|", 3),
  8156. bitwiseXOR: new BinopTokenType("^", 4),
  8157. bitwiseAND: new BinopTokenType("&", 5),
  8158. equality: new BinopTokenType("==/!=", 6),
  8159. relational: new BinopTokenType("</>", 7),
  8160. bitShift: new BinopTokenType("<</>>", 8),
  8161. plusMin: new TokenType("+/-", { beforeExpr: beforeExpr, binop: 9, prefix: prefix, startsExpr: startsExpr }),
  8162. modulo: new BinopTokenType("%", 10),
  8163. star: new BinopTokenType("*", 10),
  8164. slash: new BinopTokenType("/", 10),
  8165. exponent: new TokenType("**", { beforeExpr: beforeExpr, binop: 11, rightAssociative: true })
  8166. };
  8167. var keywords = {
  8168. "break": new KeywordTokenType("break"),
  8169. "case": new KeywordTokenType("case", { beforeExpr: beforeExpr }),
  8170. "catch": new KeywordTokenType("catch"),
  8171. "continue": new KeywordTokenType("continue"),
  8172. "debugger": new KeywordTokenType("debugger"),
  8173. "default": new KeywordTokenType("default", { beforeExpr: beforeExpr }),
  8174. "do": new KeywordTokenType("do", { isLoop: isLoop, beforeExpr: beforeExpr }),
  8175. "else": new KeywordTokenType("else", { beforeExpr: beforeExpr }),
  8176. "finally": new KeywordTokenType("finally"),
  8177. "for": new KeywordTokenType("for", { isLoop: isLoop }),
  8178. "function": new KeywordTokenType("function", { startsExpr: startsExpr }),
  8179. "if": new KeywordTokenType("if"),
  8180. "return": new KeywordTokenType("return", { beforeExpr: beforeExpr }),
  8181. "switch": new KeywordTokenType("switch"),
  8182. "throw": new KeywordTokenType("throw", { beforeExpr: beforeExpr }),
  8183. "try": new KeywordTokenType("try"),
  8184. "var": new KeywordTokenType("var"),
  8185. "let": new KeywordTokenType("let"),
  8186. "const": new KeywordTokenType("const"),
  8187. "while": new KeywordTokenType("while", { isLoop: isLoop }),
  8188. "with": new KeywordTokenType("with"),
  8189. "new": new KeywordTokenType("new", { beforeExpr: beforeExpr, startsExpr: startsExpr }),
  8190. "this": new KeywordTokenType("this", { startsExpr: startsExpr }),
  8191. "super": new KeywordTokenType("super", { startsExpr: startsExpr }),
  8192. "class": new KeywordTokenType("class"),
  8193. "extends": new KeywordTokenType("extends", { beforeExpr: beforeExpr }),
  8194. "export": new KeywordTokenType("export"),
  8195. "import": new KeywordTokenType("import", { startsExpr: startsExpr }),
  8196. "yield": new KeywordTokenType("yield", { beforeExpr: beforeExpr, startsExpr: startsExpr }),
  8197. "null": new KeywordTokenType("null", { startsExpr: startsExpr }),
  8198. "true": new KeywordTokenType("true", { startsExpr: startsExpr }),
  8199. "false": new KeywordTokenType("false", { startsExpr: startsExpr }),
  8200. "in": new KeywordTokenType("in", { beforeExpr: beforeExpr, binop: 7 }),
  8201. "instanceof": new KeywordTokenType("instanceof", { beforeExpr: beforeExpr, binop: 7 }),
  8202. "typeof": new KeywordTokenType("typeof", { beforeExpr: beforeExpr, prefix: prefix, startsExpr: startsExpr }),
  8203. "void": new KeywordTokenType("void", { beforeExpr: beforeExpr, prefix: prefix, startsExpr: startsExpr }),
  8204. "delete": new KeywordTokenType("delete", { beforeExpr: beforeExpr, prefix: prefix, startsExpr: startsExpr })
  8205. };
  8206. // Map keyword names to token types.
  8207. Object.keys(keywords).forEach(function (name) {
  8208. types["_" + name] = keywords[name];
  8209. });
  8210. // Matches a whole line break (where CRLF is considered a single
  8211. // line break). Used to count lines.
  8212. var lineBreak = /\r\n?|\n|\u2028|\u2029/;
  8213. var lineBreakG = new RegExp(lineBreak.source, "g");
  8214. function isNewLine(code) {
  8215. return code === 10 || code === 13 || code === 0x2028 || code === 0x2029;
  8216. }
  8217. var nonASCIIwhitespace = /[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;
  8218. // The algorithm used to determine whether a regexp can appear at a
  8219. // given point in the program is loosely based on sweet.js' approach.
  8220. // See https://github.com/mozilla/sweet.js/wiki/design
  8221. var TokContext = function TokContext(token, isExpr, preserveSpace, override) {
  8222. classCallCheck(this, TokContext);
  8223. this.token = token;
  8224. this.isExpr = !!isExpr;
  8225. this.preserveSpace = !!preserveSpace;
  8226. this.override = override;
  8227. };
  8228. var types$1 = {
  8229. braceStatement: new TokContext("{", false),
  8230. braceExpression: new TokContext("{", true),
  8231. templateQuasi: new TokContext("${", true),
  8232. parenStatement: new TokContext("(", false),
  8233. parenExpression: new TokContext("(", true),
  8234. template: new TokContext("`", true, true, function (p) {
  8235. return p.readTmplToken();
  8236. }),
  8237. functionExpression: new TokContext("function", true)
  8238. };
  8239. // Token-specific context update code
  8240. types.parenR.updateContext = types.braceR.updateContext = function () {
  8241. if (this.state.context.length === 1) {
  8242. this.state.exprAllowed = true;
  8243. return;
  8244. }
  8245. var out = this.state.context.pop();
  8246. if (out === types$1.braceStatement && this.curContext() === types$1.functionExpression) {
  8247. this.state.context.pop();
  8248. this.state.exprAllowed = false;
  8249. } else if (out === types$1.templateQuasi) {
  8250. this.state.exprAllowed = true;
  8251. } else {
  8252. this.state.exprAllowed = !out.isExpr;
  8253. }
  8254. };
  8255. types.name.updateContext = function (prevType) {
  8256. this.state.exprAllowed = false;
  8257. if (prevType === types._let || prevType === types._const || prevType === types._var) {
  8258. if (lineBreak.test(this.input.slice(this.state.end))) {
  8259. this.state.exprAllowed = true;
  8260. }
  8261. }
  8262. };
  8263. types.braceL.updateContext = function (prevType) {
  8264. this.state.context.push(this.braceIsBlock(prevType) ? types$1.braceStatement : types$1.braceExpression);
  8265. this.state.exprAllowed = true;
  8266. };
  8267. types.dollarBraceL.updateContext = function () {
  8268. this.state.context.push(types$1.templateQuasi);
  8269. this.state.exprAllowed = true;
  8270. };
  8271. types.parenL.updateContext = function (prevType) {
  8272. var statementParens = prevType === types._if || prevType === types._for || prevType === types._with || prevType === types._while;
  8273. this.state.context.push(statementParens ? types$1.parenStatement : types$1.parenExpression);
  8274. this.state.exprAllowed = true;
  8275. };
  8276. types.incDec.updateContext = function () {
  8277. // tokExprAllowed stays unchanged
  8278. };
  8279. types._function.updateContext = function () {
  8280. if (this.curContext() !== types$1.braceStatement) {
  8281. this.state.context.push(types$1.functionExpression);
  8282. }
  8283. this.state.exprAllowed = false;
  8284. };
  8285. types.backQuote.updateContext = function () {
  8286. if (this.curContext() === types$1.template) {
  8287. this.state.context.pop();
  8288. } else {
  8289. this.state.context.push(types$1.template);
  8290. }
  8291. this.state.exprAllowed = false;
  8292. };
  8293. // These are used when `options.locations` is on, for the
  8294. // `startLoc` and `endLoc` properties.
  8295. var Position = function Position(line, col) {
  8296. classCallCheck(this, Position);
  8297. this.line = line;
  8298. this.column = col;
  8299. };
  8300. var SourceLocation = function SourceLocation(start, end) {
  8301. classCallCheck(this, SourceLocation);
  8302. this.start = start;
  8303. this.end = end;
  8304. };
  8305. // The `getLineInfo` function is mostly useful when the
  8306. // `locations` option is off (for performance reasons) and you
  8307. // want to find the line/column position for a given character
  8308. // offset. `input` should be the code string that the offset refers
  8309. // into.
  8310. function getLineInfo(input, offset) {
  8311. for (var line = 1, cur = 0;;) {
  8312. lineBreakG.lastIndex = cur;
  8313. var match = lineBreakG.exec(input);
  8314. if (match && match.index < offset) {
  8315. ++line;
  8316. cur = match.index + match[0].length;
  8317. } else {
  8318. return new Position(line, offset - cur);
  8319. }
  8320. }
  8321. }
  8322. var State = function () {
  8323. function State() {
  8324. classCallCheck(this, State);
  8325. }
  8326. State.prototype.init = function init(options, input) {
  8327. this.strict = options.strictMode === false ? false : options.sourceType === "module";
  8328. this.input = input;
  8329. this.potentialArrowAt = -1;
  8330. this.inMethod = this.inFunction = this.inGenerator = this.inAsync = this.inPropertyName = this.inType = this.inClassProperty = this.noAnonFunctionType = false;
  8331. this.labels = [];
  8332. this.decorators = [];
  8333. this.tokens = [];
  8334. this.comments = [];
  8335. this.trailingComments = [];
  8336. this.leadingComments = [];
  8337. this.commentStack = [];
  8338. this.pos = this.lineStart = 0;
  8339. this.curLine = options.startLine;
  8340. this.type = types.eof;
  8341. this.value = null;
  8342. this.start = this.end = this.pos;
  8343. this.startLoc = this.endLoc = this.curPosition();
  8344. this.lastTokEndLoc = this.lastTokStartLoc = null;
  8345. this.lastTokStart = this.lastTokEnd = this.pos;
  8346. this.context = [types$1.braceStatement];
  8347. this.exprAllowed = true;
  8348. this.containsEsc = this.containsOctal = false;
  8349. this.octalPosition = null;
  8350. this.invalidTemplateEscapePosition = null;
  8351. this.exportedIdentifiers = [];
  8352. return this;
  8353. };
  8354. // TODO
  8355. // TODO
  8356. // Used to signify the start of a potential arrow function
  8357. // Flags to track whether we are in a function, a generator.
  8358. // Labels in scope.
  8359. // Leading decorators.
  8360. // Token store.
  8361. // Comment store.
  8362. // Comment attachment store
  8363. // The current position of the tokenizer in the input.
  8364. // Properties of the current token:
  8365. // Its type
  8366. // For tokens that include more information than their type, the value
  8367. // Its start and end offset
  8368. // And, if locations are used, the {line, column} object
  8369. // corresponding to those offsets
  8370. // Position information for the previous token
  8371. // The context stack is used to superficially track syntactic
  8372. // context to predict whether a regular expression is allowed in a
  8373. // given position.
  8374. // Used to signal to callers of `readWord1` whether the word
  8375. // contained any escape sequences. This is needed because words with
  8376. // escape sequences must not be interpreted as keywords.
  8377. // TODO
  8378. // Names of exports store. `default` is stored as a name for both
  8379. // `export default foo;` and `export { foo as default };`.
  8380. State.prototype.curPosition = function curPosition() {
  8381. return new Position(this.curLine, this.pos - this.lineStart);
  8382. };
  8383. State.prototype.clone = function clone(skipArrays) {
  8384. var state = new State();
  8385. for (var key in this) {
  8386. var val = this[key];
  8387. if ((!skipArrays || key === "context") && Array.isArray(val)) {
  8388. val = val.slice();
  8389. }
  8390. state[key] = val;
  8391. }
  8392. return state;
  8393. };
  8394. return State;
  8395. }();
  8396. // Object type used to represent tokens. Note that normally, tokens
  8397. // simply exist as properties on the parser object. This is only
  8398. // used for the onToken callback and the external tokenizer.
  8399. var Token = function Token(state) {
  8400. classCallCheck(this, Token);
  8401. this.type = state.type;
  8402. this.value = state.value;
  8403. this.start = state.start;
  8404. this.end = state.end;
  8405. this.loc = new SourceLocation(state.startLoc, state.endLoc);
  8406. };
  8407. // ## Tokenizer
  8408. function codePointToString(code) {
  8409. // UTF-16 Decoding
  8410. if (code <= 0xFFFF) {
  8411. return String.fromCharCode(code);
  8412. } else {
  8413. return String.fromCharCode((code - 0x10000 >> 10) + 0xD800, (code - 0x10000 & 1023) + 0xDC00);
  8414. }
  8415. }
  8416. var Tokenizer = function () {
  8417. function Tokenizer(options, input) {
  8418. classCallCheck(this, Tokenizer);
  8419. this.state = new State();
  8420. this.state.init(options, input);
  8421. }
  8422. // Move to the next token
  8423. Tokenizer.prototype.next = function next() {
  8424. if (!this.isLookahead) {
  8425. this.state.tokens.push(new Token(this.state));
  8426. }
  8427. this.state.lastTokEnd = this.state.end;
  8428. this.state.lastTokStart = this.state.start;
  8429. this.state.lastTokEndLoc = this.state.endLoc;
  8430. this.state.lastTokStartLoc = this.state.startLoc;
  8431. this.nextToken();
  8432. };
  8433. // TODO
  8434. Tokenizer.prototype.eat = function eat(type) {
  8435. if (this.match(type)) {
  8436. this.next();
  8437. return true;
  8438. } else {
  8439. return false;
  8440. }
  8441. };
  8442. // TODO
  8443. Tokenizer.prototype.match = function match(type) {
  8444. return this.state.type === type;
  8445. };
  8446. // TODO
  8447. Tokenizer.prototype.isKeyword = function isKeyword$$1(word) {
  8448. return isKeyword(word);
  8449. };
  8450. // TODO
  8451. Tokenizer.prototype.lookahead = function lookahead() {
  8452. var old = this.state;
  8453. this.state = old.clone(true);
  8454. this.isLookahead = true;
  8455. this.next();
  8456. this.isLookahead = false;
  8457. var curr = this.state.clone(true);
  8458. this.state = old;
  8459. return curr;
  8460. };
  8461. // Toggle strict mode. Re-reads the next number or string to please
  8462. // pedantic tests (`"use strict"; 010;` should fail).
  8463. Tokenizer.prototype.setStrict = function setStrict(strict) {
  8464. this.state.strict = strict;
  8465. if (!this.match(types.num) && !this.match(types.string)) return;
  8466. this.state.pos = this.state.start;
  8467. while (this.state.pos < this.state.lineStart) {
  8468. this.state.lineStart = this.input.lastIndexOf("\n", this.state.lineStart - 2) + 1;
  8469. --this.state.curLine;
  8470. }
  8471. this.nextToken();
  8472. };
  8473. Tokenizer.prototype.curContext = function curContext() {
  8474. return this.state.context[this.state.context.length - 1];
  8475. };
  8476. // Read a single token, updating the parser object's token-related
  8477. // properties.
  8478. Tokenizer.prototype.nextToken = function nextToken() {
  8479. var curContext = this.curContext();
  8480. if (!curContext || !curContext.preserveSpace) this.skipSpace();
  8481. this.state.containsOctal = false;
  8482. this.state.octalPosition = null;
  8483. this.state.start = this.state.pos;
  8484. this.state.startLoc = this.state.curPosition();
  8485. if (this.state.pos >= this.input.length) return this.finishToken(types.eof);
  8486. if (curContext.override) {
  8487. return curContext.override(this);
  8488. } else {
  8489. return this.readToken(this.fullCharCodeAtPos());
  8490. }
  8491. };
  8492. Tokenizer.prototype.readToken = function readToken(code) {
  8493. // Identifier or keyword. '\uXXXX' sequences are allowed in
  8494. // identifiers, so '\' also dispatches to that.
  8495. if (isIdentifierStart(code) || code === 92 /* '\' */) {
  8496. return this.readWord();
  8497. } else {
  8498. return this.getTokenFromCode(code);
  8499. }
  8500. };
  8501. Tokenizer.prototype.fullCharCodeAtPos = function fullCharCodeAtPos() {
  8502. var code = this.input.charCodeAt(this.state.pos);
  8503. if (code <= 0xd7ff || code >= 0xe000) return code;
  8504. var next = this.input.charCodeAt(this.state.pos + 1);
  8505. return (code << 10) + next - 0x35fdc00;
  8506. };
  8507. Tokenizer.prototype.pushComment = function pushComment(block, text, start, end, startLoc, endLoc) {
  8508. var comment = {
  8509. type: block ? "CommentBlock" : "CommentLine",
  8510. value: text,
  8511. start: start,
  8512. end: end,
  8513. loc: new SourceLocation(startLoc, endLoc)
  8514. };
  8515. if (!this.isLookahead) {
  8516. this.state.tokens.push(comment);
  8517. this.state.comments.push(comment);
  8518. this.addComment(comment);
  8519. }
  8520. };
  8521. Tokenizer.prototype.skipBlockComment = function skipBlockComment() {
  8522. var startLoc = this.state.curPosition();
  8523. var start = this.state.pos;
  8524. var end = this.input.indexOf("*/", this.state.pos += 2);
  8525. if (end === -1) this.raise(this.state.pos - 2, "Unterminated comment");
  8526. this.state.pos = end + 2;
  8527. lineBreakG.lastIndex = start;
  8528. var match = void 0;
  8529. while ((match = lineBreakG.exec(this.input)) && match.index < this.state.pos) {
  8530. ++this.state.curLine;
  8531. this.state.lineStart = match.index + match[0].length;
  8532. }
  8533. this.pushComment(true, this.input.slice(start + 2, end), start, this.state.pos, startLoc, this.state.curPosition());
  8534. };
  8535. Tokenizer.prototype.skipLineComment = function skipLineComment(startSkip) {
  8536. var start = this.state.pos;
  8537. var startLoc = this.state.curPosition();
  8538. var ch = this.input.charCodeAt(this.state.pos += startSkip);
  8539. while (this.state.pos < this.input.length && ch !== 10 && ch !== 13 && ch !== 8232 && ch !== 8233) {
  8540. ++this.state.pos;
  8541. ch = this.input.charCodeAt(this.state.pos);
  8542. }
  8543. this.pushComment(false, this.input.slice(start + startSkip, this.state.pos), start, this.state.pos, startLoc, this.state.curPosition());
  8544. };
  8545. // Called at the start of the parse and after every token. Skips
  8546. // whitespace and comments, and.
  8547. Tokenizer.prototype.skipSpace = function skipSpace() {
  8548. loop: while (this.state.pos < this.input.length) {
  8549. var ch = this.input.charCodeAt(this.state.pos);
  8550. switch (ch) {
  8551. case 32:case 160:
  8552. // ' '
  8553. ++this.state.pos;
  8554. break;
  8555. case 13:
  8556. if (this.input.charCodeAt(this.state.pos + 1) === 10) {
  8557. ++this.state.pos;
  8558. }
  8559. case 10:case 8232:case 8233:
  8560. ++this.state.pos;
  8561. ++this.state.curLine;
  8562. this.state.lineStart = this.state.pos;
  8563. break;
  8564. case 47:
  8565. // '/'
  8566. switch (this.input.charCodeAt(this.state.pos + 1)) {
  8567. case 42:
  8568. // '*'
  8569. this.skipBlockComment();
  8570. break;
  8571. case 47:
  8572. this.skipLineComment(2);
  8573. break;
  8574. default:
  8575. break loop;
  8576. }
  8577. break;
  8578. default:
  8579. if (ch > 8 && ch < 14 || ch >= 5760 && nonASCIIwhitespace.test(String.fromCharCode(ch))) {
  8580. ++this.state.pos;
  8581. } else {
  8582. break loop;
  8583. }
  8584. }
  8585. }
  8586. };
  8587. // Called at the end of every token. Sets `end`, `val`, and
  8588. // maintains `context` and `exprAllowed`, and skips the space after
  8589. // the token, so that the next one's `start` will point at the
  8590. // right position.
  8591. Tokenizer.prototype.finishToken = function finishToken(type, val) {
  8592. this.state.end = this.state.pos;
  8593. this.state.endLoc = this.state.curPosition();
  8594. var prevType = this.state.type;
  8595. this.state.type = type;
  8596. this.state.value = val;
  8597. this.updateContext(prevType);
  8598. };
  8599. // ### Token reading
  8600. // This is the function that is called to fetch the next token. It
  8601. // is somewhat obscure, because it works in character codes rather
  8602. // than characters, and because operator parsing has been inlined
  8603. // into it.
  8604. //
  8605. // All in the name of speed.
  8606. //
  8607. Tokenizer.prototype.readToken_dot = function readToken_dot() {
  8608. var next = this.input.charCodeAt(this.state.pos + 1);
  8609. if (next >= 48 && next <= 57) {
  8610. return this.readNumber(true);
  8611. }
  8612. var next2 = this.input.charCodeAt(this.state.pos + 2);
  8613. if (next === 46 && next2 === 46) {
  8614. // 46 = dot '.'
  8615. this.state.pos += 3;
  8616. return this.finishToken(types.ellipsis);
  8617. } else {
  8618. ++this.state.pos;
  8619. return this.finishToken(types.dot);
  8620. }
  8621. };
  8622. Tokenizer.prototype.readToken_slash = function readToken_slash() {
  8623. // '/'
  8624. if (this.state.exprAllowed) {
  8625. ++this.state.pos;
  8626. return this.readRegexp();
  8627. }
  8628. var next = this.input.charCodeAt(this.state.pos + 1);
  8629. if (next === 61) {
  8630. return this.finishOp(types.assign, 2);
  8631. } else {
  8632. return this.finishOp(types.slash, 1);
  8633. }
  8634. };
  8635. Tokenizer.prototype.readToken_mult_modulo = function readToken_mult_modulo(code) {
  8636. // '%*'
  8637. var type = code === 42 ? types.star : types.modulo;
  8638. var width = 1;
  8639. var next = this.input.charCodeAt(this.state.pos + 1);
  8640. if (next === 42) {
  8641. // '*'
  8642. width++;
  8643. next = this.input.charCodeAt(this.state.pos + 2);
  8644. type = types.exponent;
  8645. }
  8646. if (next === 61) {
  8647. width++;
  8648. type = types.assign;
  8649. }
  8650. return this.finishOp(type, width);
  8651. };
  8652. Tokenizer.prototype.readToken_pipe_amp = function readToken_pipe_amp(code) {
  8653. // '|&'
  8654. var next = this.input.charCodeAt(this.state.pos + 1);
  8655. if (next === code) return this.finishOp(code === 124 ? types.logicalOR : types.logicalAND, 2);
  8656. if (next === 61) return this.finishOp(types.assign, 2);
  8657. if (code === 124 && next === 125 && this.hasPlugin("flow")) return this.finishOp(types.braceBarR, 2);
  8658. return this.finishOp(code === 124 ? types.bitwiseOR : types.bitwiseAND, 1);
  8659. };
  8660. Tokenizer.prototype.readToken_caret = function readToken_caret() {
  8661. // '^'
  8662. var next = this.input.charCodeAt(this.state.pos + 1);
  8663. if (next === 61) {
  8664. return this.finishOp(types.assign, 2);
  8665. } else {
  8666. return this.finishOp(types.bitwiseXOR, 1);
  8667. }
  8668. };
  8669. Tokenizer.prototype.readToken_plus_min = function readToken_plus_min(code) {
  8670. // '+-'
  8671. var next = this.input.charCodeAt(this.state.pos + 1);
  8672. if (next === code) {
  8673. if (next === 45 && this.input.charCodeAt(this.state.pos + 2) === 62 && lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.pos))) {
  8674. // A `-->` line comment
  8675. this.skipLineComment(3);
  8676. this.skipSpace();
  8677. return this.nextToken();
  8678. }
  8679. return this.finishOp(types.incDec, 2);
  8680. }
  8681. if (next === 61) {
  8682. return this.finishOp(types.assign, 2);
  8683. } else {
  8684. return this.finishOp(types.plusMin, 1);
  8685. }
  8686. };
  8687. Tokenizer.prototype.readToken_lt_gt = function readToken_lt_gt(code) {
  8688. // '<>'
  8689. var next = this.input.charCodeAt(this.state.pos + 1);
  8690. var size = 1;
  8691. if (next === code) {
  8692. size = code === 62 && this.input.charCodeAt(this.state.pos + 2) === 62 ? 3 : 2;
  8693. if (this.input.charCodeAt(this.state.pos + size) === 61) return this.finishOp(types.assign, size + 1);
  8694. return this.finishOp(types.bitShift, size);
  8695. }
  8696. if (next === 33 && code === 60 && this.input.charCodeAt(this.state.pos + 2) === 45 && this.input.charCodeAt(this.state.pos + 3) === 45) {
  8697. if (this.inModule) this.unexpected();
  8698. // `<!--`, an XML-style comment that should be interpreted as a line comment
  8699. this.skipLineComment(4);
  8700. this.skipSpace();
  8701. return this.nextToken();
  8702. }
  8703. if (next === 61) {
  8704. // <= | >=
  8705. size = 2;
  8706. }
  8707. return this.finishOp(types.relational, size);
  8708. };
  8709. Tokenizer.prototype.readToken_eq_excl = function readToken_eq_excl(code) {
  8710. // '=!'
  8711. var next = this.input.charCodeAt(this.state.pos + 1);
  8712. if (next === 61) return this.finishOp(types.equality, this.input.charCodeAt(this.state.pos + 2) === 61 ? 3 : 2);
  8713. if (code === 61 && next === 62) {
  8714. // '=>'
  8715. this.state.pos += 2;
  8716. return this.finishToken(types.arrow);
  8717. }
  8718. return this.finishOp(code === 61 ? types.eq : types.prefix, 1);
  8719. };
  8720. Tokenizer.prototype.getTokenFromCode = function getTokenFromCode(code) {
  8721. switch (code) {
  8722. // The interpretation of a dot depends on whether it is followed
  8723. // by a digit or another two dots.
  8724. case 46:
  8725. // '.'
  8726. return this.readToken_dot();
  8727. // Punctuation tokens.
  8728. case 40:
  8729. ++this.state.pos;return this.finishToken(types.parenL);
  8730. case 41:
  8731. ++this.state.pos;return this.finishToken(types.parenR);
  8732. case 59:
  8733. ++this.state.pos;return this.finishToken(types.semi);
  8734. case 44:
  8735. ++this.state.pos;return this.finishToken(types.comma);
  8736. case 91:
  8737. ++this.state.pos;return this.finishToken(types.bracketL);
  8738. case 93:
  8739. ++this.state.pos;return this.finishToken(types.bracketR);
  8740. case 123:
  8741. if (this.hasPlugin("flow") && this.input.charCodeAt(this.state.pos + 1) === 124) {
  8742. return this.finishOp(types.braceBarL, 2);
  8743. } else {
  8744. ++this.state.pos;
  8745. return this.finishToken(types.braceL);
  8746. }
  8747. case 125:
  8748. ++this.state.pos;return this.finishToken(types.braceR);
  8749. case 58:
  8750. if (this.hasPlugin("functionBind") && this.input.charCodeAt(this.state.pos + 1) === 58) {
  8751. return this.finishOp(types.doubleColon, 2);
  8752. } else {
  8753. ++this.state.pos;
  8754. return this.finishToken(types.colon);
  8755. }
  8756. case 63:
  8757. ++this.state.pos;return this.finishToken(types.question);
  8758. case 64:
  8759. ++this.state.pos;return this.finishToken(types.at);
  8760. case 96:
  8761. // '`'
  8762. ++this.state.pos;
  8763. return this.finishToken(types.backQuote);
  8764. case 48:
  8765. // '0'
  8766. var next = this.input.charCodeAt(this.state.pos + 1);
  8767. if (next === 120 || next === 88) return this.readRadixNumber(16); // '0x', '0X' - hex number
  8768. if (next === 111 || next === 79) return this.readRadixNumber(8); // '0o', '0O' - octal number
  8769. if (next === 98 || next === 66) return this.readRadixNumber(2); // '0b', '0B' - binary number
  8770. // Anything else beginning with a digit is an integer, octal
  8771. // number, or float.
  8772. case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:
  8773. // 1-9
  8774. return this.readNumber(false);
  8775. // Quotes produce strings.
  8776. case 34:case 39:
  8777. // '"', "'"
  8778. return this.readString(code);
  8779. // Operators are parsed inline in tiny state machines. '=' (61) is
  8780. // often referred to. `finishOp` simply skips the amount of
  8781. // characters it is given as second argument, and returns a token
  8782. // of the type given by its first argument.
  8783. case 47:
  8784. // '/'
  8785. return this.readToken_slash();
  8786. case 37:case 42:
  8787. // '%*'
  8788. return this.readToken_mult_modulo(code);
  8789. case 124:case 38:
  8790. // '|&'
  8791. return this.readToken_pipe_amp(code);
  8792. case 94:
  8793. // '^'
  8794. return this.readToken_caret();
  8795. case 43:case 45:
  8796. // '+-'
  8797. return this.readToken_plus_min(code);
  8798. case 60:case 62:
  8799. // '<>'
  8800. return this.readToken_lt_gt(code);
  8801. case 61:case 33:
  8802. // '=!'
  8803. return this.readToken_eq_excl(code);
  8804. case 126:
  8805. // '~'
  8806. return this.finishOp(types.prefix, 1);
  8807. }
  8808. this.raise(this.state.pos, "Unexpected character '" + codePointToString(code) + "'");
  8809. };
  8810. Tokenizer.prototype.finishOp = function finishOp(type, size) {
  8811. var str = this.input.slice(this.state.pos, this.state.pos + size);
  8812. this.state.pos += size;
  8813. return this.finishToken(type, str);
  8814. };
  8815. Tokenizer.prototype.readRegexp = function readRegexp() {
  8816. var start = this.state.pos;
  8817. var escaped = void 0,
  8818. inClass = void 0;
  8819. for (;;) {
  8820. if (this.state.pos >= this.input.length) this.raise(start, "Unterminated regular expression");
  8821. var ch = this.input.charAt(this.state.pos);
  8822. if (lineBreak.test(ch)) {
  8823. this.raise(start, "Unterminated regular expression");
  8824. }
  8825. if (escaped) {
  8826. escaped = false;
  8827. } else {
  8828. if (ch === "[") {
  8829. inClass = true;
  8830. } else if (ch === "]" && inClass) {
  8831. inClass = false;
  8832. } else if (ch === "/" && !inClass) {
  8833. break;
  8834. }
  8835. escaped = ch === "\\";
  8836. }
  8837. ++this.state.pos;
  8838. }
  8839. var content = this.input.slice(start, this.state.pos);
  8840. ++this.state.pos;
  8841. // Need to use `readWord1` because '\uXXXX' sequences are allowed
  8842. // here (don't ask).
  8843. var mods = this.readWord1();
  8844. if (mods) {
  8845. var validFlags = /^[gmsiyu]*$/;
  8846. if (!validFlags.test(mods)) this.raise(start, "Invalid regular expression flag");
  8847. }
  8848. return this.finishToken(types.regexp, {
  8849. pattern: content,
  8850. flags: mods
  8851. });
  8852. };
  8853. // Read an integer in the given radix. Return null if zero digits
  8854. // were read, the integer value otherwise. When `len` is given, this
  8855. // will return `null` unless the integer has exactly `len` digits.
  8856. Tokenizer.prototype.readInt = function readInt(radix, len) {
  8857. var start = this.state.pos;
  8858. var total = 0;
  8859. for (var i = 0, e = len == null ? Infinity : len; i < e; ++i) {
  8860. var code = this.input.charCodeAt(this.state.pos);
  8861. var val = void 0;
  8862. if (code >= 97) {
  8863. val = code - 97 + 10; // a
  8864. } else if (code >= 65) {
  8865. val = code - 65 + 10; // A
  8866. } else if (code >= 48 && code <= 57) {
  8867. val = code - 48; // 0-9
  8868. } else {
  8869. val = Infinity;
  8870. }
  8871. if (val >= radix) break;
  8872. ++this.state.pos;
  8873. total = total * radix + val;
  8874. }
  8875. if (this.state.pos === start || len != null && this.state.pos - start !== len) return null;
  8876. return total;
  8877. };
  8878. Tokenizer.prototype.readRadixNumber = function readRadixNumber(radix) {
  8879. this.state.pos += 2; // 0x
  8880. var val = this.readInt(radix);
  8881. if (val == null) this.raise(this.state.start + 2, "Expected number in radix " + radix);
  8882. if (isIdentifierStart(this.fullCharCodeAtPos())) this.raise(this.state.pos, "Identifier directly after number");
  8883. return this.finishToken(types.num, val);
  8884. };
  8885. // Read an integer, octal integer, or floating-point number.
  8886. Tokenizer.prototype.readNumber = function readNumber(startsWithDot) {
  8887. var start = this.state.pos;
  8888. var octal = this.input.charCodeAt(start) === 48; // '0'
  8889. var isFloat = false;
  8890. if (!startsWithDot && this.readInt(10) === null) this.raise(start, "Invalid number");
  8891. if (octal && this.state.pos == start + 1) octal = false; // number === 0
  8892. var next = this.input.charCodeAt(this.state.pos);
  8893. if (next === 46 && !octal) {
  8894. // '.'
  8895. ++this.state.pos;
  8896. this.readInt(10);
  8897. isFloat = true;
  8898. next = this.input.charCodeAt(this.state.pos);
  8899. }
  8900. if ((next === 69 || next === 101) && !octal) {
  8901. // 'eE'
  8902. next = this.input.charCodeAt(++this.state.pos);
  8903. if (next === 43 || next === 45) ++this.state.pos; // '+-'
  8904. if (this.readInt(10) === null) this.raise(start, "Invalid number");
  8905. isFloat = true;
  8906. }
  8907. if (isIdentifierStart(this.fullCharCodeAtPos())) this.raise(this.state.pos, "Identifier directly after number");
  8908. var str = this.input.slice(start, this.state.pos);
  8909. var val = void 0;
  8910. if (isFloat) {
  8911. val = parseFloat(str);
  8912. } else if (!octal || str.length === 1) {
  8913. val = parseInt(str, 10);
  8914. } else if (this.state.strict) {
  8915. this.raise(start, "Invalid number");
  8916. } else if (/[89]/.test(str)) {
  8917. val = parseInt(str, 10);
  8918. } else {
  8919. val = parseInt(str, 8);
  8920. }
  8921. return this.finishToken(types.num, val);
  8922. };
  8923. // Read a string value, interpreting backslash-escapes.
  8924. Tokenizer.prototype.readCodePoint = function readCodePoint(throwOnInvalid) {
  8925. var ch = this.input.charCodeAt(this.state.pos);
  8926. var code = void 0;
  8927. if (ch === 123) {
  8928. // '{'
  8929. var codePos = ++this.state.pos;
  8930. code = this.readHexChar(this.input.indexOf("}", this.state.pos) - this.state.pos, throwOnInvalid);
  8931. ++this.state.pos;
  8932. if (code === null) {
  8933. --this.state.invalidTemplateEscapePosition; // to point to the '\'' instead of the 'u'
  8934. } else if (code > 0x10FFFF) {
  8935. if (throwOnInvalid) {
  8936. this.raise(codePos, "Code point out of bounds");
  8937. } else {
  8938. this.state.invalidTemplateEscapePosition = codePos - 2;
  8939. return null;
  8940. }
  8941. }
  8942. } else {
  8943. code = this.readHexChar(4, throwOnInvalid);
  8944. }
  8945. return code;
  8946. };
  8947. Tokenizer.prototype.readString = function readString(quote) {
  8948. var out = "",
  8949. chunkStart = ++this.state.pos;
  8950. for (;;) {
  8951. if (this.state.pos >= this.input.length) this.raise(this.state.start, "Unterminated string constant");
  8952. var ch = this.input.charCodeAt(this.state.pos);
  8953. if (ch === quote) break;
  8954. if (ch === 92) {
  8955. // '\'
  8956. out += this.input.slice(chunkStart, this.state.pos);
  8957. out += this.readEscapedChar(false);
  8958. chunkStart = this.state.pos;
  8959. } else {
  8960. if (isNewLine(ch)) this.raise(this.state.start, "Unterminated string constant");
  8961. ++this.state.pos;
  8962. }
  8963. }
  8964. out += this.input.slice(chunkStart, this.state.pos++);
  8965. return this.finishToken(types.string, out);
  8966. };
  8967. // Reads template string tokens.
  8968. Tokenizer.prototype.readTmplToken = function readTmplToken() {
  8969. var out = "",
  8970. chunkStart = this.state.pos,
  8971. containsInvalid = false;
  8972. for (;;) {
  8973. if (this.state.pos >= this.input.length) this.raise(this.state.start, "Unterminated template");
  8974. var ch = this.input.charCodeAt(this.state.pos);
  8975. if (ch === 96 || ch === 36 && this.input.charCodeAt(this.state.pos + 1) === 123) {
  8976. // '`', '${'
  8977. if (this.state.pos === this.state.start && this.match(types.template)) {
  8978. if (ch === 36) {
  8979. this.state.pos += 2;
  8980. return this.finishToken(types.dollarBraceL);
  8981. } else {
  8982. ++this.state.pos;
  8983. return this.finishToken(types.backQuote);
  8984. }
  8985. }
  8986. out += this.input.slice(chunkStart, this.state.pos);
  8987. return this.finishToken(types.template, containsInvalid ? null : out);
  8988. }
  8989. if (ch === 92) {
  8990. // '\'
  8991. out += this.input.slice(chunkStart, this.state.pos);
  8992. var escaped = this.readEscapedChar(true);
  8993. if (escaped === null) {
  8994. containsInvalid = true;
  8995. } else {
  8996. out += escaped;
  8997. }
  8998. chunkStart = this.state.pos;
  8999. } else if (isNewLine(ch)) {
  9000. out += this.input.slice(chunkStart, this.state.pos);
  9001. ++this.state.pos;
  9002. switch (ch) {
  9003. case 13:
  9004. if (this.input.charCodeAt(this.state.pos) === 10) ++this.state.pos;
  9005. case 10:
  9006. out += "\n";
  9007. break;
  9008. default:
  9009. out += String.fromCharCode(ch);
  9010. break;
  9011. }
  9012. ++this.state.curLine;
  9013. this.state.lineStart = this.state.pos;
  9014. chunkStart = this.state.pos;
  9015. } else {
  9016. ++this.state.pos;
  9017. }
  9018. }
  9019. };
  9020. // Used to read escaped characters
  9021. Tokenizer.prototype.readEscapedChar = function readEscapedChar(inTemplate) {
  9022. var throwOnInvalid = !inTemplate;
  9023. var ch = this.input.charCodeAt(++this.state.pos);
  9024. ++this.state.pos;
  9025. switch (ch) {
  9026. case 110:
  9027. return "\n"; // 'n' -> '\n'
  9028. case 114:
  9029. return "\r"; // 'r' -> '\r'
  9030. case 120:
  9031. {
  9032. // 'x'
  9033. var code = this.readHexChar(2, throwOnInvalid);
  9034. return code === null ? null : String.fromCharCode(code);
  9035. }
  9036. case 117:
  9037. {
  9038. // 'u'
  9039. var _code = this.readCodePoint(throwOnInvalid);
  9040. return _code === null ? null : codePointToString(_code);
  9041. }
  9042. case 116:
  9043. return "\t"; // 't' -> '\t'
  9044. case 98:
  9045. return "\b"; // 'b' -> '\b'
  9046. case 118:
  9047. return "\x0B"; // 'v' -> '\u000b'
  9048. case 102:
  9049. return "\f"; // 'f' -> '\f'
  9050. case 13:
  9051. if (this.input.charCodeAt(this.state.pos) === 10) ++this.state.pos; // '\r\n'
  9052. case 10:
  9053. // ' \n'
  9054. this.state.lineStart = this.state.pos;
  9055. ++this.state.curLine;
  9056. return "";
  9057. default:
  9058. if (ch >= 48 && ch <= 55) {
  9059. var codePos = this.state.pos - 1;
  9060. var octalStr = this.input.substr(this.state.pos - 1, 3).match(/^[0-7]+/)[0];
  9061. var octal = parseInt(octalStr, 8);
  9062. if (octal > 255) {
  9063. octalStr = octalStr.slice(0, -1);
  9064. octal = parseInt(octalStr, 8);
  9065. }
  9066. if (octal > 0) {
  9067. if (inTemplate) {
  9068. this.state.invalidTemplateEscapePosition = codePos;
  9069. return null;
  9070. } else if (this.state.strict) {
  9071. this.raise(codePos, "Octal literal in strict mode");
  9072. } else if (!this.state.containsOctal) {
  9073. // These properties are only used to throw an error for an octal which occurs
  9074. // in a directive which occurs prior to a "use strict" directive.
  9075. this.state.containsOctal = true;
  9076. this.state.octalPosition = codePos;
  9077. }
  9078. }
  9079. this.state.pos += octalStr.length - 1;
  9080. return String.fromCharCode(octal);
  9081. }
  9082. return String.fromCharCode(ch);
  9083. }
  9084. };
  9085. // Used to read character escape sequences ('\x', '\u').
  9086. Tokenizer.prototype.readHexChar = function readHexChar(len, throwOnInvalid) {
  9087. var codePos = this.state.pos;
  9088. var n = this.readInt(16, len);
  9089. if (n === null) {
  9090. if (throwOnInvalid) {
  9091. this.raise(codePos, "Bad character escape sequence");
  9092. } else {
  9093. this.state.pos = codePos - 1;
  9094. this.state.invalidTemplateEscapePosition = codePos - 1;
  9095. }
  9096. }
  9097. return n;
  9098. };
  9099. // Read an identifier, and return it as a string. Sets `this.state.containsEsc`
  9100. // to whether the word contained a '\u' escape.
  9101. //
  9102. // Incrementally adds only escaped chars, adding other chunks as-is
  9103. // as a micro-optimization.
  9104. Tokenizer.prototype.readWord1 = function readWord1() {
  9105. this.state.containsEsc = false;
  9106. var word = "",
  9107. first = true,
  9108. chunkStart = this.state.pos;
  9109. while (this.state.pos < this.input.length) {
  9110. var ch = this.fullCharCodeAtPos();
  9111. if (isIdentifierChar(ch)) {
  9112. this.state.pos += ch <= 0xffff ? 1 : 2;
  9113. } else if (ch === 92) {
  9114. // "\"
  9115. this.state.containsEsc = true;
  9116. word += this.input.slice(chunkStart, this.state.pos);
  9117. var escStart = this.state.pos;
  9118. if (this.input.charCodeAt(++this.state.pos) !== 117) {
  9119. // "u"
  9120. this.raise(this.state.pos, 'Expecting Unicode escape sequence \\uXXXX');
  9121. }
  9122. ++this.state.pos;
  9123. var esc = this.readCodePoint(true);
  9124. if (!(first ? isIdentifierStart : isIdentifierChar)(esc, true)) {
  9125. this.raise(escStart, "Invalid Unicode escape");
  9126. }
  9127. word += codePointToString(esc);
  9128. chunkStart = this.state.pos;
  9129. } else {
  9130. break;
  9131. }
  9132. first = false;
  9133. }
  9134. return word + this.input.slice(chunkStart, this.state.pos);
  9135. };
  9136. // Read an identifier or keyword token. Will check for reserved
  9137. // words when necessary.
  9138. Tokenizer.prototype.readWord = function readWord() {
  9139. var word = this.readWord1();
  9140. var type = types.name;
  9141. if (!this.state.containsEsc && this.isKeyword(word)) {
  9142. type = keywords[word];
  9143. }
  9144. return this.finishToken(type, word);
  9145. };
  9146. Tokenizer.prototype.braceIsBlock = function braceIsBlock(prevType) {
  9147. if (prevType === types.colon) {
  9148. var parent = this.curContext();
  9149. if (parent === types$1.braceStatement || parent === types$1.braceExpression) {
  9150. return !parent.isExpr;
  9151. }
  9152. }
  9153. if (prevType === types._return) {
  9154. return lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.start));
  9155. }
  9156. if (prevType === types._else || prevType === types.semi || prevType === types.eof || prevType === types.parenR) {
  9157. return true;
  9158. }
  9159. if (prevType === types.braceL) {
  9160. return this.curContext() === types$1.braceStatement;
  9161. }
  9162. return !this.state.exprAllowed;
  9163. };
  9164. Tokenizer.prototype.updateContext = function updateContext(prevType) {
  9165. var type = this.state.type;
  9166. var update = void 0;
  9167. if (type.keyword && prevType === types.dot) {
  9168. this.state.exprAllowed = false;
  9169. } else if (update = type.updateContext) {
  9170. update.call(this, prevType);
  9171. } else {
  9172. this.state.exprAllowed = type.beforeExpr;
  9173. }
  9174. };
  9175. return Tokenizer;
  9176. }();
  9177. var plugins = {};
  9178. var frozenDeprecatedWildcardPluginList = ["jsx", "doExpressions", "objectRestSpread", "decorators", "classProperties", "exportExtensions", "asyncGenerators", "functionBind", "functionSent", "dynamicImport", "flow"];
  9179. var Parser = function (_Tokenizer) {
  9180. inherits(Parser, _Tokenizer);
  9181. function Parser(options, input) {
  9182. classCallCheck(this, Parser);
  9183. options = getOptions(options);
  9184. var _this = possibleConstructorReturn(this, _Tokenizer.call(this, options, input));
  9185. _this.options = options;
  9186. _this.inModule = _this.options.sourceType === "module";
  9187. _this.input = input;
  9188. _this.plugins = _this.loadPlugins(_this.options.plugins);
  9189. _this.filename = options.sourceFilename;
  9190. // If enabled, skip leading hashbang line.
  9191. if (_this.state.pos === 0 && _this.input[0] === "#" && _this.input[1] === "!") {
  9192. _this.skipLineComment(2);
  9193. }
  9194. return _this;
  9195. }
  9196. Parser.prototype.isReservedWord = function isReservedWord(word) {
  9197. if (word === "await") {
  9198. return this.inModule;
  9199. } else {
  9200. return reservedWords[6](word);
  9201. }
  9202. };
  9203. Parser.prototype.hasPlugin = function hasPlugin(name) {
  9204. if (this.plugins["*"] && frozenDeprecatedWildcardPluginList.indexOf(name) > -1) {
  9205. return true;
  9206. }
  9207. return !!this.plugins[name];
  9208. };
  9209. Parser.prototype.extend = function extend(name, f) {
  9210. this[name] = f(this[name]);
  9211. };
  9212. Parser.prototype.loadAllPlugins = function loadAllPlugins() {
  9213. var _this2 = this;
  9214. // ensure flow plugin loads last, also ensure estree is not loaded with *
  9215. var pluginNames = Object.keys(plugins).filter(function (name) {
  9216. return name !== "flow" && name !== "estree";
  9217. });
  9218. pluginNames.push("flow");
  9219. pluginNames.forEach(function (name) {
  9220. var plugin = plugins[name];
  9221. if (plugin) plugin(_this2);
  9222. });
  9223. };
  9224. Parser.prototype.loadPlugins = function loadPlugins(pluginList) {
  9225. // TODO: Deprecate "*" option in next major version of Babylon
  9226. if (pluginList.indexOf("*") >= 0) {
  9227. this.loadAllPlugins();
  9228. return { "*": true };
  9229. }
  9230. var pluginMap = {};
  9231. if (pluginList.indexOf("flow") >= 0) {
  9232. // ensure flow plugin loads last
  9233. pluginList = pluginList.filter(function (plugin) {
  9234. return plugin !== "flow";
  9235. });
  9236. pluginList.push("flow");
  9237. }
  9238. if (pluginList.indexOf("estree") >= 0) {
  9239. // ensure estree plugin loads first
  9240. pluginList = pluginList.filter(function (plugin) {
  9241. return plugin !== "estree";
  9242. });
  9243. pluginList.unshift("estree");
  9244. }
  9245. for (var _iterator = pluginList, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
  9246. var _ref;
  9247. if (_isArray) {
  9248. if (_i >= _iterator.length) break;
  9249. _ref = _iterator[_i++];
  9250. } else {
  9251. _i = _iterator.next();
  9252. if (_i.done) break;
  9253. _ref = _i.value;
  9254. }
  9255. var name = _ref;
  9256. if (!pluginMap[name]) {
  9257. pluginMap[name] = true;
  9258. var plugin = plugins[name];
  9259. if (plugin) plugin(this);
  9260. }
  9261. }
  9262. return pluginMap;
  9263. };
  9264. Parser.prototype.parse = function parse() {
  9265. var file = this.startNode();
  9266. var program = this.startNode();
  9267. this.nextToken();
  9268. return this.parseTopLevel(file, program);
  9269. };
  9270. return Parser;
  9271. }(Tokenizer);
  9272. var pp = Parser.prototype;
  9273. // ## Parser utilities
  9274. // TODO
  9275. pp.addExtra = function (node, key, val) {
  9276. if (!node) return;
  9277. var extra = node.extra = node.extra || {};
  9278. extra[key] = val;
  9279. };
  9280. // TODO
  9281. pp.isRelational = function (op) {
  9282. return this.match(types.relational) && this.state.value === op;
  9283. };
  9284. // TODO
  9285. pp.expectRelational = function (op) {
  9286. if (this.isRelational(op)) {
  9287. this.next();
  9288. } else {
  9289. this.unexpected(null, types.relational);
  9290. }
  9291. };
  9292. // Tests whether parsed token is a contextual keyword.
  9293. pp.isContextual = function (name) {
  9294. return this.match(types.name) && this.state.value === name;
  9295. };
  9296. // Consumes contextual keyword if possible.
  9297. pp.eatContextual = function (name) {
  9298. return this.state.value === name && this.eat(types.name);
  9299. };
  9300. // Asserts that following token is given contextual keyword.
  9301. pp.expectContextual = function (name, message) {
  9302. if (!this.eatContextual(name)) this.unexpected(null, message);
  9303. };
  9304. // Test whether a semicolon can be inserted at the current position.
  9305. pp.canInsertSemicolon = function () {
  9306. return this.match(types.eof) || this.match(types.braceR) || lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.start));
  9307. };
  9308. // TODO
  9309. pp.isLineTerminator = function () {
  9310. return this.eat(types.semi) || this.canInsertSemicolon();
  9311. };
  9312. // Consume a semicolon, or, failing that, see if we are allowed to
  9313. // pretend that there is a semicolon at this position.
  9314. pp.semicolon = function () {
  9315. if (!this.isLineTerminator()) this.unexpected(null, types.semi);
  9316. };
  9317. // Expect a token of a given type. If found, consume it, otherwise,
  9318. // raise an unexpected token error at given pos.
  9319. pp.expect = function (type, pos) {
  9320. return this.eat(type) || this.unexpected(pos, type);
  9321. };
  9322. // Raise an unexpected token error. Can take the expected token type
  9323. // instead of a message string.
  9324. pp.unexpected = function (pos) {
  9325. var messageOrType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "Unexpected token";
  9326. if (messageOrType && (typeof messageOrType === "undefined" ? "undefined" : _typeof(messageOrType)) === "object" && messageOrType.label) {
  9327. messageOrType = "Unexpected token, expected " + messageOrType.label;
  9328. }
  9329. this.raise(pos != null ? pos : this.state.start, messageOrType);
  9330. };
  9331. /* eslint max-len: 0 */
  9332. var pp$1 = Parser.prototype;
  9333. // ### Statement parsing
  9334. // Parse a program. Initializes the parser, reads any number of
  9335. // statements, and wraps them in a Program node. Optionally takes a
  9336. // `program` argument. If present, the statements will be appended
  9337. // to its body instead of creating a new node.
  9338. pp$1.parseTopLevel = function (file, program) {
  9339. program.sourceType = this.options.sourceType;
  9340. this.parseBlockBody(program, true, true, types.eof);
  9341. file.program = this.finishNode(program, "Program");
  9342. file.comments = this.state.comments;
  9343. file.tokens = this.state.tokens;
  9344. return this.finishNode(file, "File");
  9345. };
  9346. var loopLabel = { kind: "loop" };
  9347. var switchLabel = { kind: "switch" };
  9348. // TODO
  9349. pp$1.stmtToDirective = function (stmt) {
  9350. var expr = stmt.expression;
  9351. var directiveLiteral = this.startNodeAt(expr.start, expr.loc.start);
  9352. var directive = this.startNodeAt(stmt.start, stmt.loc.start);
  9353. var raw = this.input.slice(expr.start, expr.end);
  9354. var val = directiveLiteral.value = raw.slice(1, -1); // remove quotes
  9355. this.addExtra(directiveLiteral, "raw", raw);
  9356. this.addExtra(directiveLiteral, "rawValue", val);
  9357. directive.value = this.finishNodeAt(directiveLiteral, "DirectiveLiteral", expr.end, expr.loc.end);
  9358. return this.finishNodeAt(directive, "Directive", stmt.end, stmt.loc.end);
  9359. };
  9360. // Parse a single statement.
  9361. //
  9362. // If expecting a statement and finding a slash operator, parse a
  9363. // regular expression literal. This is to handle cases like
  9364. // `if (foo) /blah/.exec(foo)`, where looking at the previous token
  9365. // does not help.
  9366. pp$1.parseStatement = function (declaration, topLevel) {
  9367. if (this.match(types.at)) {
  9368. this.parseDecorators(true);
  9369. }
  9370. var starttype = this.state.type;
  9371. var node = this.startNode();
  9372. // Most types of statements are recognized by the keyword they
  9373. // start with. Many are trivial to parse, some require a bit of
  9374. // complexity.
  9375. switch (starttype) {
  9376. case types._break:case types._continue:
  9377. return this.parseBreakContinueStatement(node, starttype.keyword);
  9378. case types._debugger:
  9379. return this.parseDebuggerStatement(node);
  9380. case types._do:
  9381. return this.parseDoStatement(node);
  9382. case types._for:
  9383. return this.parseForStatement(node);
  9384. case types._function:
  9385. if (!declaration) this.unexpected();
  9386. return this.parseFunctionStatement(node);
  9387. case types._class:
  9388. if (!declaration) this.unexpected();
  9389. return this.parseClass(node, true);
  9390. case types._if:
  9391. return this.parseIfStatement(node);
  9392. case types._return:
  9393. return this.parseReturnStatement(node);
  9394. case types._switch:
  9395. return this.parseSwitchStatement(node);
  9396. case types._throw:
  9397. return this.parseThrowStatement(node);
  9398. case types._try:
  9399. return this.parseTryStatement(node);
  9400. case types._let:
  9401. case types._const:
  9402. if (!declaration) this.unexpected(); // NOTE: falls through to _var
  9403. case types._var:
  9404. return this.parseVarStatement(node, starttype);
  9405. case types._while:
  9406. return this.parseWhileStatement(node);
  9407. case types._with:
  9408. return this.parseWithStatement(node);
  9409. case types.braceL:
  9410. return this.parseBlock();
  9411. case types.semi:
  9412. return this.parseEmptyStatement(node);
  9413. case types._export:
  9414. case types._import:
  9415. if (this.hasPlugin("dynamicImport") && this.lookahead().type === types.parenL) break;
  9416. if (!this.options.allowImportExportEverywhere) {
  9417. if (!topLevel) {
  9418. this.raise(this.state.start, "'import' and 'export' may only appear at the top level");
  9419. }
  9420. if (!this.inModule) {
  9421. this.raise(this.state.start, "'import' and 'export' may appear only with 'sourceType: \"module\"'");
  9422. }
  9423. }
  9424. return starttype === types._import ? this.parseImport(node) : this.parseExport(node);
  9425. case types.name:
  9426. if (this.state.value === "async") {
  9427. // peek ahead and see if next token is a function
  9428. var state = this.state.clone();
  9429. this.next();
  9430. if (this.match(types._function) && !this.canInsertSemicolon()) {
  9431. this.expect(types._function);
  9432. return this.parseFunction(node, true, false, true);
  9433. } else {
  9434. this.state = state;
  9435. }
  9436. }
  9437. }
  9438. // If the statement does not start with a statement keyword or a
  9439. // brace, it's an ExpressionStatement or LabeledStatement. We
  9440. // simply start parsing an expression, and afterwards, if the
  9441. // next token is a colon and the expression was a simple
  9442. // Identifier node, we switch to interpreting it as a label.
  9443. var maybeName = this.state.value;
  9444. var expr = this.parseExpression();
  9445. if (starttype === types.name && expr.type === "Identifier" && this.eat(types.colon)) {
  9446. return this.parseLabeledStatement(node, maybeName, expr);
  9447. } else {
  9448. return this.parseExpressionStatement(node, expr);
  9449. }
  9450. };
  9451. pp$1.takeDecorators = function (node) {
  9452. if (this.state.decorators.length) {
  9453. node.decorators = this.state.decorators;
  9454. this.state.decorators = [];
  9455. }
  9456. };
  9457. pp$1.parseDecorators = function (allowExport) {
  9458. while (this.match(types.at)) {
  9459. var decorator = this.parseDecorator();
  9460. this.state.decorators.push(decorator);
  9461. }
  9462. if (allowExport && this.match(types._export)) {
  9463. return;
  9464. }
  9465. if (!this.match(types._class)) {
  9466. this.raise(this.state.start, "Leading decorators must be attached to a class declaration");
  9467. }
  9468. };
  9469. pp$1.parseDecorator = function () {
  9470. if (!this.hasPlugin("decorators")) {
  9471. this.unexpected();
  9472. }
  9473. var node = this.startNode();
  9474. this.next();
  9475. node.expression = this.parseMaybeAssign();
  9476. return this.finishNode(node, "Decorator");
  9477. };
  9478. pp$1.parseBreakContinueStatement = function (node, keyword) {
  9479. var isBreak = keyword === "break";
  9480. this.next();
  9481. if (this.isLineTerminator()) {
  9482. node.label = null;
  9483. } else if (!this.match(types.name)) {
  9484. this.unexpected();
  9485. } else {
  9486. node.label = this.parseIdentifier();
  9487. this.semicolon();
  9488. }
  9489. // Verify that there is an actual destination to break or
  9490. // continue to.
  9491. var i = void 0;
  9492. for (i = 0; i < this.state.labels.length; ++i) {
  9493. var lab = this.state.labels[i];
  9494. if (node.label == null || lab.name === node.label.name) {
  9495. if (lab.kind != null && (isBreak || lab.kind === "loop")) break;
  9496. if (node.label && isBreak) break;
  9497. }
  9498. }
  9499. if (i === this.state.labels.length) this.raise(node.start, "Unsyntactic " + keyword);
  9500. return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement");
  9501. };
  9502. pp$1.parseDebuggerStatement = function (node) {
  9503. this.next();
  9504. this.semicolon();
  9505. return this.finishNode(node, "DebuggerStatement");
  9506. };
  9507. pp$1.parseDoStatement = function (node) {
  9508. this.next();
  9509. this.state.labels.push(loopLabel);
  9510. node.body = this.parseStatement(false);
  9511. this.state.labels.pop();
  9512. this.expect(types._while);
  9513. node.test = this.parseParenExpression();
  9514. this.eat(types.semi);
  9515. return this.finishNode(node, "DoWhileStatement");
  9516. };
  9517. // Disambiguating between a `for` and a `for`/`in` or `for`/`of`
  9518. // loop is non-trivial. Basically, we have to parse the init `var`
  9519. // statement or expression, disallowing the `in` operator (see
  9520. // the second parameter to `parseExpression`), and then check
  9521. // whether the next token is `in` or `of`. When there is no init
  9522. // part (semicolon immediately after the opening parenthesis), it
  9523. // is a regular `for` loop.
  9524. pp$1.parseForStatement = function (node) {
  9525. this.next();
  9526. this.state.labels.push(loopLabel);
  9527. var forAwait = false;
  9528. if (this.hasPlugin("asyncGenerators") && this.state.inAsync && this.isContextual("await")) {
  9529. forAwait = true;
  9530. this.next();
  9531. }
  9532. this.expect(types.parenL);
  9533. if (this.match(types.semi)) {
  9534. if (forAwait) {
  9535. this.unexpected();
  9536. }
  9537. return this.parseFor(node, null);
  9538. }
  9539. if (this.match(types._var) || this.match(types._let) || this.match(types._const)) {
  9540. var _init = this.startNode();
  9541. var varKind = this.state.type;
  9542. this.next();
  9543. this.parseVar(_init, true, varKind);
  9544. this.finishNode(_init, "VariableDeclaration");
  9545. if (this.match(types._in) || this.isContextual("of")) {
  9546. if (_init.declarations.length === 1 && !_init.declarations[0].init) {
  9547. return this.parseForIn(node, _init, forAwait);
  9548. }
  9549. }
  9550. if (forAwait) {
  9551. this.unexpected();
  9552. }
  9553. return this.parseFor(node, _init);
  9554. }
  9555. var refShorthandDefaultPos = { start: 0 };
  9556. var init = this.parseExpression(true, refShorthandDefaultPos);
  9557. if (this.match(types._in) || this.isContextual("of")) {
  9558. var description = this.isContextual("of") ? "for-of statement" : "for-in statement";
  9559. this.toAssignable(init, undefined, description);
  9560. this.checkLVal(init, undefined, undefined, description);
  9561. return this.parseForIn(node, init, forAwait);
  9562. } else if (refShorthandDefaultPos.start) {
  9563. this.unexpected(refShorthandDefaultPos.start);
  9564. }
  9565. if (forAwait) {
  9566. this.unexpected();
  9567. }
  9568. return this.parseFor(node, init);
  9569. };
  9570. pp$1.parseFunctionStatement = function (node) {
  9571. this.next();
  9572. return this.parseFunction(node, true);
  9573. };
  9574. pp$1.parseIfStatement = function (node) {
  9575. this.next();
  9576. node.test = this.parseParenExpression();
  9577. node.consequent = this.parseStatement(false);
  9578. node.alternate = this.eat(types._else) ? this.parseStatement(false) : null;
  9579. return this.finishNode(node, "IfStatement");
  9580. };
  9581. pp$1.parseReturnStatement = function (node) {
  9582. if (!this.state.inFunction && !this.options.allowReturnOutsideFunction) {
  9583. this.raise(this.state.start, "'return' outside of function");
  9584. }
  9585. this.next();
  9586. // In `return` (and `break`/`continue`), the keywords with
  9587. // optional arguments, we eagerly look for a semicolon or the
  9588. // possibility to insert one.
  9589. if (this.isLineTerminator()) {
  9590. node.argument = null;
  9591. } else {
  9592. node.argument = this.parseExpression();
  9593. this.semicolon();
  9594. }
  9595. return this.finishNode(node, "ReturnStatement");
  9596. };
  9597. pp$1.parseSwitchStatement = function (node) {
  9598. this.next();
  9599. node.discriminant = this.parseParenExpression();
  9600. node.cases = [];
  9601. this.expect(types.braceL);
  9602. this.state.labels.push(switchLabel);
  9603. // Statements under must be grouped (by label) in SwitchCase
  9604. // nodes. `cur` is used to keep the node that we are currently
  9605. // adding statements to.
  9606. var cur = void 0;
  9607. for (var sawDefault; !this.match(types.braceR);) {
  9608. if (this.match(types._case) || this.match(types._default)) {
  9609. var isCase = this.match(types._case);
  9610. if (cur) this.finishNode(cur, "SwitchCase");
  9611. node.cases.push(cur = this.startNode());
  9612. cur.consequent = [];
  9613. this.next();
  9614. if (isCase) {
  9615. cur.test = this.parseExpression();
  9616. } else {
  9617. if (sawDefault) this.raise(this.state.lastTokStart, "Multiple default clauses");
  9618. sawDefault = true;
  9619. cur.test = null;
  9620. }
  9621. this.expect(types.colon);
  9622. } else {
  9623. if (cur) {
  9624. cur.consequent.push(this.parseStatement(true));
  9625. } else {
  9626. this.unexpected();
  9627. }
  9628. }
  9629. }
  9630. if (cur) this.finishNode(cur, "SwitchCase");
  9631. this.next(); // Closing brace
  9632. this.state.labels.pop();
  9633. return this.finishNode(node, "SwitchStatement");
  9634. };
  9635. pp$1.parseThrowStatement = function (node) {
  9636. this.next();
  9637. if (lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.start))) this.raise(this.state.lastTokEnd, "Illegal newline after throw");
  9638. node.argument = this.parseExpression();
  9639. this.semicolon();
  9640. return this.finishNode(node, "ThrowStatement");
  9641. };
  9642. // Reused empty array added for node fields that are always empty.
  9643. var empty = [];
  9644. pp$1.parseTryStatement = function (node) {
  9645. this.next();
  9646. node.block = this.parseBlock();
  9647. node.handler = null;
  9648. if (this.match(types._catch)) {
  9649. var clause = this.startNode();
  9650. this.next();
  9651. this.expect(types.parenL);
  9652. clause.param = this.parseBindingAtom();
  9653. this.checkLVal(clause.param, true, Object.create(null), "catch clause");
  9654. this.expect(types.parenR);
  9655. clause.body = this.parseBlock();
  9656. node.handler = this.finishNode(clause, "CatchClause");
  9657. }
  9658. node.guardedHandlers = empty;
  9659. node.finalizer = this.eat(types._finally) ? this.parseBlock() : null;
  9660. if (!node.handler && !node.finalizer) {
  9661. this.raise(node.start, "Missing catch or finally clause");
  9662. }
  9663. return this.finishNode(node, "TryStatement");
  9664. };
  9665. pp$1.parseVarStatement = function (node, kind) {
  9666. this.next();
  9667. this.parseVar(node, false, kind);
  9668. this.semicolon();
  9669. return this.finishNode(node, "VariableDeclaration");
  9670. };
  9671. pp$1.parseWhileStatement = function (node) {
  9672. this.next();
  9673. node.test = this.parseParenExpression();
  9674. this.state.labels.push(loopLabel);
  9675. node.body = this.parseStatement(false);
  9676. this.state.labels.pop();
  9677. return this.finishNode(node, "WhileStatement");
  9678. };
  9679. pp$1.parseWithStatement = function (node) {
  9680. if (this.state.strict) this.raise(this.state.start, "'with' in strict mode");
  9681. this.next();
  9682. node.object = this.parseParenExpression();
  9683. node.body = this.parseStatement(false);
  9684. return this.finishNode(node, "WithStatement");
  9685. };
  9686. pp$1.parseEmptyStatement = function (node) {
  9687. this.next();
  9688. return this.finishNode(node, "EmptyStatement");
  9689. };
  9690. pp$1.parseLabeledStatement = function (node, maybeName, expr) {
  9691. for (var _iterator = this.state.labels, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
  9692. var _ref;
  9693. if (_isArray) {
  9694. if (_i >= _iterator.length) break;
  9695. _ref = _iterator[_i++];
  9696. } else {
  9697. _i = _iterator.next();
  9698. if (_i.done) break;
  9699. _ref = _i.value;
  9700. }
  9701. var _label = _ref;
  9702. if (_label.name === maybeName) {
  9703. this.raise(expr.start, "Label '" + maybeName + "' is already declared");
  9704. }
  9705. }
  9706. var kind = this.state.type.isLoop ? "loop" : this.match(types._switch) ? "switch" : null;
  9707. for (var i = this.state.labels.length - 1; i >= 0; i--) {
  9708. var label = this.state.labels[i];
  9709. if (label.statementStart === node.start) {
  9710. label.statementStart = this.state.start;
  9711. label.kind = kind;
  9712. } else {
  9713. break;
  9714. }
  9715. }
  9716. this.state.labels.push({ name: maybeName, kind: kind, statementStart: this.state.start });
  9717. node.body = this.parseStatement(true);
  9718. this.state.labels.pop();
  9719. node.label = expr;
  9720. return this.finishNode(node, "LabeledStatement");
  9721. };
  9722. pp$1.parseExpressionStatement = function (node, expr) {
  9723. node.expression = expr;
  9724. this.semicolon();
  9725. return this.finishNode(node, "ExpressionStatement");
  9726. };
  9727. // Parse a semicolon-enclosed block of statements, handling `"use
  9728. // strict"` declarations when `allowStrict` is true (used for
  9729. // function bodies).
  9730. pp$1.parseBlock = function (allowDirectives) {
  9731. var node = this.startNode();
  9732. this.expect(types.braceL);
  9733. this.parseBlockBody(node, allowDirectives, false, types.braceR);
  9734. return this.finishNode(node, "BlockStatement");
  9735. };
  9736. pp$1.isValidDirective = function (stmt) {
  9737. return stmt.type === "ExpressionStatement" && stmt.expression.type === "StringLiteral" && !stmt.expression.extra.parenthesized;
  9738. };
  9739. pp$1.parseBlockBody = function (node, allowDirectives, topLevel, end) {
  9740. node.body = [];
  9741. node.directives = [];
  9742. var parsedNonDirective = false;
  9743. var oldStrict = void 0;
  9744. var octalPosition = void 0;
  9745. while (!this.eat(end)) {
  9746. if (!parsedNonDirective && this.state.containsOctal && !octalPosition) {
  9747. octalPosition = this.state.octalPosition;
  9748. }
  9749. var stmt = this.parseStatement(true, topLevel);
  9750. if (allowDirectives && !parsedNonDirective && this.isValidDirective(stmt)) {
  9751. var directive = this.stmtToDirective(stmt);
  9752. node.directives.push(directive);
  9753. if (oldStrict === undefined && directive.value.value === "use strict") {
  9754. oldStrict = this.state.strict;
  9755. this.setStrict(true);
  9756. if (octalPosition) {
  9757. this.raise(octalPosition, "Octal literal in strict mode");
  9758. }
  9759. }
  9760. continue;
  9761. }
  9762. parsedNonDirective = true;
  9763. node.body.push(stmt);
  9764. }
  9765. if (oldStrict === false) {
  9766. this.setStrict(false);
  9767. }
  9768. };
  9769. // Parse a regular `for` loop. The disambiguation code in
  9770. // `parseStatement` will already have parsed the init statement or
  9771. // expression.
  9772. pp$1.parseFor = function (node, init) {
  9773. node.init = init;
  9774. this.expect(types.semi);
  9775. node.test = this.match(types.semi) ? null : this.parseExpression();
  9776. this.expect(types.semi);
  9777. node.update = this.match(types.parenR) ? null : this.parseExpression();
  9778. this.expect(types.parenR);
  9779. node.body = this.parseStatement(false);
  9780. this.state.labels.pop();
  9781. return this.finishNode(node, "ForStatement");
  9782. };
  9783. // Parse a `for`/`in` and `for`/`of` loop, which are almost
  9784. // same from parser's perspective.
  9785. pp$1.parseForIn = function (node, init, forAwait) {
  9786. var type = void 0;
  9787. if (forAwait) {
  9788. this.eatContextual("of");
  9789. type = "ForAwaitStatement";
  9790. } else {
  9791. type = this.match(types._in) ? "ForInStatement" : "ForOfStatement";
  9792. this.next();
  9793. }
  9794. node.left = init;
  9795. node.right = this.parseExpression();
  9796. this.expect(types.parenR);
  9797. node.body = this.parseStatement(false);
  9798. this.state.labels.pop();
  9799. return this.finishNode(node, type);
  9800. };
  9801. // Parse a list of variable declarations.
  9802. pp$1.parseVar = function (node, isFor, kind) {
  9803. node.declarations = [];
  9804. node.kind = kind.keyword;
  9805. for (;;) {
  9806. var decl = this.startNode();
  9807. this.parseVarHead(decl);
  9808. if (this.eat(types.eq)) {
  9809. decl.init = this.parseMaybeAssign(isFor);
  9810. } else if (kind === types._const && !(this.match(types._in) || this.isContextual("of"))) {
  9811. this.unexpected();
  9812. } else if (decl.id.type !== "Identifier" && !(isFor && (this.match(types._in) || this.isContextual("of")))) {
  9813. this.raise(this.state.lastTokEnd, "Complex binding patterns require an initialization value");
  9814. } else {
  9815. decl.init = null;
  9816. }
  9817. node.declarations.push(this.finishNode(decl, "VariableDeclarator"));
  9818. if (!this.eat(types.comma)) break;
  9819. }
  9820. return node;
  9821. };
  9822. pp$1.parseVarHead = function (decl) {
  9823. decl.id = this.parseBindingAtom();
  9824. this.checkLVal(decl.id, true, undefined, "variable declaration");
  9825. };
  9826. // Parse a function declaration or literal (depending on the
  9827. // `isStatement` parameter).
  9828. pp$1.parseFunction = function (node, isStatement, allowExpressionBody, isAsync, optionalId) {
  9829. var oldInMethod = this.state.inMethod;
  9830. this.state.inMethod = false;
  9831. this.initFunction(node, isAsync);
  9832. if (this.match(types.star)) {
  9833. if (node.async && !this.hasPlugin("asyncGenerators")) {
  9834. this.unexpected();
  9835. } else {
  9836. node.generator = true;
  9837. this.next();
  9838. }
  9839. }
  9840. if (isStatement && !optionalId && !this.match(types.name) && !this.match(types._yield)) {
  9841. this.unexpected();
  9842. }
  9843. if (this.match(types.name) || this.match(types._yield)) {
  9844. node.id = this.parseBindingIdentifier();
  9845. }
  9846. this.parseFunctionParams(node);
  9847. this.parseFunctionBody(node, allowExpressionBody);
  9848. this.state.inMethod = oldInMethod;
  9849. return this.finishNode(node, isStatement ? "FunctionDeclaration" : "FunctionExpression");
  9850. };
  9851. pp$1.parseFunctionParams = function (node) {
  9852. this.expect(types.parenL);
  9853. node.params = this.parseBindingList(types.parenR);
  9854. };
  9855. // Parse a class declaration or literal (depending on the
  9856. // `isStatement` parameter).
  9857. pp$1.parseClass = function (node, isStatement, optionalId) {
  9858. this.next();
  9859. this.takeDecorators(node);
  9860. this.parseClassId(node, isStatement, optionalId);
  9861. this.parseClassSuper(node);
  9862. this.parseClassBody(node);
  9863. return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression");
  9864. };
  9865. pp$1.isClassProperty = function () {
  9866. return this.match(types.eq) || this.match(types.semi) || this.match(types.braceR);
  9867. };
  9868. pp$1.isClassMethod = function () {
  9869. return this.match(types.parenL);
  9870. };
  9871. pp$1.isNonstaticConstructor = function (method) {
  9872. return !method.computed && !method.static && (method.key.name === "constructor" || // Identifier
  9873. method.key.value === "constructor" // Literal
  9874. );
  9875. };
  9876. pp$1.parseClassBody = function (node) {
  9877. // class bodies are implicitly strict
  9878. var oldStrict = this.state.strict;
  9879. this.state.strict = true;
  9880. var hadConstructorCall = false;
  9881. var hadConstructor = false;
  9882. var decorators = [];
  9883. var classBody = this.startNode();
  9884. classBody.body = [];
  9885. this.expect(types.braceL);
  9886. while (!this.eat(types.braceR)) {
  9887. if (this.eat(types.semi)) {
  9888. if (decorators.length > 0) {
  9889. this.raise(this.state.lastTokEnd, "Decorators must not be followed by a semicolon");
  9890. }
  9891. continue;
  9892. }
  9893. if (this.match(types.at)) {
  9894. decorators.push(this.parseDecorator());
  9895. continue;
  9896. }
  9897. var method = this.startNode();
  9898. // steal the decorators if there are any
  9899. if (decorators.length) {
  9900. method.decorators = decorators;
  9901. decorators = [];
  9902. }
  9903. method.static = false;
  9904. if (this.match(types.name) && this.state.value === "static") {
  9905. var key = this.parseIdentifier(true); // eats 'static'
  9906. if (this.isClassMethod()) {
  9907. // a method named 'static'
  9908. method.kind = "method";
  9909. method.computed = false;
  9910. method.key = key;
  9911. this.parseClassMethod(classBody, method, false, false);
  9912. continue;
  9913. } else if (this.isClassProperty()) {
  9914. // a property named 'static'
  9915. method.computed = false;
  9916. method.key = key;
  9917. classBody.body.push(this.parseClassProperty(method));
  9918. continue;
  9919. }
  9920. // otherwise something static
  9921. method.static = true;
  9922. }
  9923. if (this.eat(types.star)) {
  9924. // a generator
  9925. method.kind = "method";
  9926. this.parsePropertyName(method);
  9927. if (this.isNonstaticConstructor(method)) {
  9928. this.raise(method.key.start, "Constructor can't be a generator");
  9929. }
  9930. if (!method.computed && method.static && (method.key.name === "prototype" || method.key.value === "prototype")) {
  9931. this.raise(method.key.start, "Classes may not have static property named prototype");
  9932. }
  9933. this.parseClassMethod(classBody, method, true, false);
  9934. } else {
  9935. var isSimple = this.match(types.name);
  9936. var _key = this.parsePropertyName(method);
  9937. if (!method.computed && method.static && (method.key.name === "prototype" || method.key.value === "prototype")) {
  9938. this.raise(method.key.start, "Classes may not have static property named prototype");
  9939. }
  9940. if (this.isClassMethod()) {
  9941. // a normal method
  9942. if (this.isNonstaticConstructor(method)) {
  9943. if (hadConstructor) {
  9944. this.raise(_key.start, "Duplicate constructor in the same class");
  9945. } else if (method.decorators) {
  9946. this.raise(method.start, "You can't attach decorators to a class constructor");
  9947. }
  9948. hadConstructor = true;
  9949. method.kind = "constructor";
  9950. } else {
  9951. method.kind = "method";
  9952. }
  9953. this.parseClassMethod(classBody, method, false, false);
  9954. } else if (this.isClassProperty()) {
  9955. // a normal property
  9956. if (this.isNonstaticConstructor(method)) {
  9957. this.raise(method.key.start, "Classes may not have a non-static field named 'constructor'");
  9958. }
  9959. classBody.body.push(this.parseClassProperty(method));
  9960. } else if (isSimple && _key.name === "async" && !this.isLineTerminator()) {
  9961. // an async method
  9962. var isGenerator = this.hasPlugin("asyncGenerators") && this.eat(types.star);
  9963. method.kind = "method";
  9964. this.parsePropertyName(method);
  9965. if (this.isNonstaticConstructor(method)) {
  9966. this.raise(method.key.start, "Constructor can't be an async function");
  9967. }
  9968. this.parseClassMethod(classBody, method, isGenerator, true);
  9969. } else if (isSimple && (_key.name === "get" || _key.name === "set") && !(this.isLineTerminator() && this.match(types.star))) {
  9970. // `get\n*` is an uninitialized property named 'get' followed by a generator.
  9971. // a getter or setter
  9972. method.kind = _key.name;
  9973. this.parsePropertyName(method);
  9974. if (this.isNonstaticConstructor(method)) {
  9975. this.raise(method.key.start, "Constructor can't have get/set modifier");
  9976. }
  9977. this.parseClassMethod(classBody, method, false, false);
  9978. this.checkGetterSetterParamCount(method);
  9979. } else if (this.hasPlugin("classConstructorCall") && isSimple && _key.name === "call" && this.match(types.name) && this.state.value === "constructor") {
  9980. // a (deprecated) call constructor
  9981. if (hadConstructorCall) {
  9982. this.raise(method.start, "Duplicate constructor call in the same class");
  9983. } else if (method.decorators) {
  9984. this.raise(method.start, "You can't attach decorators to a class constructor");
  9985. }
  9986. hadConstructorCall = true;
  9987. method.kind = "constructorCall";
  9988. this.parsePropertyName(method); // consume "constructor" and make it the method's name
  9989. this.parseClassMethod(classBody, method, false, false);
  9990. } else if (this.isLineTerminator()) {
  9991. // an uninitialized class property (due to ASI, since we don't otherwise recognize the next token)
  9992. if (this.isNonstaticConstructor(method)) {
  9993. this.raise(method.key.start, "Classes may not have a non-static field named 'constructor'");
  9994. }
  9995. classBody.body.push(this.parseClassProperty(method));
  9996. } else {
  9997. this.unexpected();
  9998. }
  9999. }
  10000. }
  10001. if (decorators.length) {
  10002. this.raise(this.state.start, "You have trailing decorators with no method");
  10003. }
  10004. node.body = this.finishNode(classBody, "ClassBody");
  10005. this.state.strict = oldStrict;
  10006. };
  10007. pp$1.parseClassProperty = function (node) {
  10008. this.state.inClassProperty = true;
  10009. if (this.match(types.eq)) {
  10010. if (!this.hasPlugin("classProperties")) this.unexpected();
  10011. this.next();
  10012. node.value = this.parseMaybeAssign();
  10013. } else {
  10014. node.value = null;
  10015. }
  10016. this.semicolon();
  10017. this.state.inClassProperty = false;
  10018. return this.finishNode(node, "ClassProperty");
  10019. };
  10020. pp$1.parseClassMethod = function (classBody, method, isGenerator, isAsync) {
  10021. this.parseMethod(method, isGenerator, isAsync);
  10022. classBody.body.push(this.finishNode(method, "ClassMethod"));
  10023. };
  10024. pp$1.parseClassId = function (node, isStatement, optionalId) {
  10025. if (this.match(types.name)) {
  10026. node.id = this.parseIdentifier();
  10027. } else {
  10028. if (optionalId || !isStatement) {
  10029. node.id = null;
  10030. } else {
  10031. this.unexpected();
  10032. }
  10033. }
  10034. };
  10035. pp$1.parseClassSuper = function (node) {
  10036. node.superClass = this.eat(types._extends) ? this.parseExprSubscripts() : null;
  10037. };
  10038. // Parses module export declaration.
  10039. pp$1.parseExport = function (node) {
  10040. this.next();
  10041. // export * from '...'
  10042. if (this.match(types.star)) {
  10043. var specifier = this.startNode();
  10044. this.next();
  10045. if (this.hasPlugin("exportExtensions") && this.eatContextual("as")) {
  10046. specifier.exported = this.parseIdentifier();
  10047. node.specifiers = [this.finishNode(specifier, "ExportNamespaceSpecifier")];
  10048. this.parseExportSpecifiersMaybe(node);
  10049. this.parseExportFrom(node, true);
  10050. } else {
  10051. this.parseExportFrom(node, true);
  10052. return this.finishNode(node, "ExportAllDeclaration");
  10053. }
  10054. } else if (this.hasPlugin("exportExtensions") && this.isExportDefaultSpecifier()) {
  10055. var _specifier = this.startNode();
  10056. _specifier.exported = this.parseIdentifier(true);
  10057. node.specifiers = [this.finishNode(_specifier, "ExportDefaultSpecifier")];
  10058. if (this.match(types.comma) && this.lookahead().type === types.star) {
  10059. this.expect(types.comma);
  10060. var _specifier2 = this.startNode();
  10061. this.expect(types.star);
  10062. this.expectContextual("as");
  10063. _specifier2.exported = this.parseIdentifier();
  10064. node.specifiers.push(this.finishNode(_specifier2, "ExportNamespaceSpecifier"));
  10065. } else {
  10066. this.parseExportSpecifiersMaybe(node);
  10067. }
  10068. this.parseExportFrom(node, true);
  10069. } else if (this.eat(types._default)) {
  10070. // export default ...
  10071. var expr = this.startNode();
  10072. var needsSemi = false;
  10073. if (this.eat(types._function)) {
  10074. expr = this.parseFunction(expr, true, false, false, true);
  10075. } else if (this.match(types._class)) {
  10076. expr = this.parseClass(expr, true, true);
  10077. } else {
  10078. needsSemi = true;
  10079. expr = this.parseMaybeAssign();
  10080. }
  10081. node.declaration = expr;
  10082. if (needsSemi) this.semicolon();
  10083. this.checkExport(node, true, true);
  10084. return this.finishNode(node, "ExportDefaultDeclaration");
  10085. } else if (this.shouldParseExportDeclaration()) {
  10086. node.specifiers = [];
  10087. node.source = null;
  10088. node.declaration = this.parseExportDeclaration(node);
  10089. } else {
  10090. // export { x, y as z } [from '...']
  10091. node.declaration = null;
  10092. node.specifiers = this.parseExportSpecifiers();
  10093. this.parseExportFrom(node);
  10094. }
  10095. this.checkExport(node, true);
  10096. return this.finishNode(node, "ExportNamedDeclaration");
  10097. };
  10098. pp$1.parseExportDeclaration = function () {
  10099. return this.parseStatement(true);
  10100. };
  10101. pp$1.isExportDefaultSpecifier = function () {
  10102. if (this.match(types.name)) {
  10103. return this.state.value !== "async";
  10104. }
  10105. if (!this.match(types._default)) {
  10106. return false;
  10107. }
  10108. var lookahead = this.lookahead();
  10109. return lookahead.type === types.comma || lookahead.type === types.name && lookahead.value === "from";
  10110. };
  10111. pp$1.parseExportSpecifiersMaybe = function (node) {
  10112. if (this.eat(types.comma)) {
  10113. node.specifiers = node.specifiers.concat(this.parseExportSpecifiers());
  10114. }
  10115. };
  10116. pp$1.parseExportFrom = function (node, expect) {
  10117. if (this.eatContextual("from")) {
  10118. node.source = this.match(types.string) ? this.parseExprAtom() : this.unexpected();
  10119. this.checkExport(node);
  10120. } else {
  10121. if (expect) {
  10122. this.unexpected();
  10123. } else {
  10124. node.source = null;
  10125. }
  10126. }
  10127. this.semicolon();
  10128. };
  10129. pp$1.shouldParseExportDeclaration = function () {
  10130. return this.state.type.keyword === "var" || this.state.type.keyword === "const" || this.state.type.keyword === "let" || this.state.type.keyword === "function" || this.state.type.keyword === "class" || this.isContextual("async");
  10131. };
  10132. pp$1.checkExport = function (node, checkNames, isDefault) {
  10133. if (checkNames) {
  10134. // Check for duplicate exports
  10135. if (isDefault) {
  10136. // Default exports
  10137. this.checkDuplicateExports(node, "default");
  10138. } else if (node.specifiers && node.specifiers.length) {
  10139. // Named exports
  10140. for (var _iterator2 = node.specifiers, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
  10141. var _ref2;
  10142. if (_isArray2) {
  10143. if (_i2 >= _iterator2.length) break;
  10144. _ref2 = _iterator2[_i2++];
  10145. } else {
  10146. _i2 = _iterator2.next();
  10147. if (_i2.done) break;
  10148. _ref2 = _i2.value;
  10149. }
  10150. var specifier = _ref2;
  10151. this.checkDuplicateExports(specifier, specifier.exported.name);
  10152. }
  10153. } else if (node.declaration) {
  10154. // Exported declarations
  10155. if (node.declaration.type === "FunctionDeclaration" || node.declaration.type === "ClassDeclaration") {
  10156. this.checkDuplicateExports(node, node.declaration.id.name);
  10157. } else if (node.declaration.type === "VariableDeclaration") {
  10158. for (var _iterator3 = node.declaration.declarations, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) {
  10159. var _ref3;
  10160. if (_isArray3) {
  10161. if (_i3 >= _iterator3.length) break;
  10162. _ref3 = _iterator3[_i3++];
  10163. } else {
  10164. _i3 = _iterator3.next();
  10165. if (_i3.done) break;
  10166. _ref3 = _i3.value;
  10167. }
  10168. var declaration = _ref3;
  10169. this.checkDeclaration(declaration.id);
  10170. }
  10171. }
  10172. }
  10173. }
  10174. if (this.state.decorators.length) {
  10175. var isClass = node.declaration && (node.declaration.type === "ClassDeclaration" || node.declaration.type === "ClassExpression");
  10176. if (!node.declaration || !isClass) {
  10177. this.raise(node.start, "You can only use decorators on an export when exporting a class");
  10178. }
  10179. this.takeDecorators(node.declaration);
  10180. }
  10181. };
  10182. pp$1.checkDeclaration = function (node) {
  10183. if (node.type === "ObjectPattern") {
  10184. for (var _iterator4 = node.properties, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) {
  10185. var _ref4;
  10186. if (_isArray4) {
  10187. if (_i4 >= _iterator4.length) break;
  10188. _ref4 = _iterator4[_i4++];
  10189. } else {
  10190. _i4 = _iterator4.next();
  10191. if (_i4.done) break;
  10192. _ref4 = _i4.value;
  10193. }
  10194. var prop = _ref4;
  10195. this.checkDeclaration(prop);
  10196. }
  10197. } else if (node.type === "ArrayPattern") {
  10198. for (var _iterator5 = node.elements, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : _iterator5[Symbol.iterator]();;) {
  10199. var _ref5;
  10200. if (_isArray5) {
  10201. if (_i5 >= _iterator5.length) break;
  10202. _ref5 = _iterator5[_i5++];
  10203. } else {
  10204. _i5 = _iterator5.next();
  10205. if (_i5.done) break;
  10206. _ref5 = _i5.value;
  10207. }
  10208. var elem = _ref5;
  10209. if (elem) {
  10210. this.checkDeclaration(elem);
  10211. }
  10212. }
  10213. } else if (node.type === "ObjectProperty") {
  10214. this.checkDeclaration(node.value);
  10215. } else if (node.type === "RestElement" || node.type === "RestProperty") {
  10216. this.checkDeclaration(node.argument);
  10217. } else if (node.type === "Identifier") {
  10218. this.checkDuplicateExports(node, node.name);
  10219. }
  10220. };
  10221. pp$1.checkDuplicateExports = function (node, name) {
  10222. if (this.state.exportedIdentifiers.indexOf(name) > -1) {
  10223. this.raiseDuplicateExportError(node, name);
  10224. }
  10225. this.state.exportedIdentifiers.push(name);
  10226. };
  10227. pp$1.raiseDuplicateExportError = function (node, name) {
  10228. this.raise(node.start, name === "default" ? "Only one default export allowed per module." : "`" + name + "` has already been exported. Exported identifiers must be unique.");
  10229. };
  10230. // Parses a comma-separated list of module exports.
  10231. pp$1.parseExportSpecifiers = function () {
  10232. var nodes = [];
  10233. var first = true;
  10234. var needsFrom = void 0;
  10235. // export { x, y as z } [from '...']
  10236. this.expect(types.braceL);
  10237. while (!this.eat(types.braceR)) {
  10238. if (first) {
  10239. first = false;
  10240. } else {
  10241. this.expect(types.comma);
  10242. if (this.eat(types.braceR)) break;
  10243. }
  10244. var isDefault = this.match(types._default);
  10245. if (isDefault && !needsFrom) needsFrom = true;
  10246. var node = this.startNode();
  10247. node.local = this.parseIdentifier(isDefault);
  10248. node.exported = this.eatContextual("as") ? this.parseIdentifier(true) : node.local.__clone();
  10249. nodes.push(this.finishNode(node, "ExportSpecifier"));
  10250. }
  10251. // https://github.com/ember-cli/ember-cli/pull/3739
  10252. if (needsFrom && !this.isContextual("from")) {
  10253. this.unexpected();
  10254. }
  10255. return nodes;
  10256. };
  10257. // Parses import declaration.
  10258. pp$1.parseImport = function (node) {
  10259. this.eat(types._import);
  10260. // import '...'
  10261. if (this.match(types.string)) {
  10262. node.specifiers = [];
  10263. node.source = this.parseExprAtom();
  10264. } else {
  10265. node.specifiers = [];
  10266. this.parseImportSpecifiers(node);
  10267. this.expectContextual("from");
  10268. node.source = this.match(types.string) ? this.parseExprAtom() : this.unexpected();
  10269. }
  10270. this.semicolon();
  10271. return this.finishNode(node, "ImportDeclaration");
  10272. };
  10273. // Parses a comma-separated list of module imports.
  10274. pp$1.parseImportSpecifiers = function (node) {
  10275. var first = true;
  10276. if (this.match(types.name)) {
  10277. // import defaultObj, { x, y as z } from '...'
  10278. var startPos = this.state.start;
  10279. var startLoc = this.state.startLoc;
  10280. node.specifiers.push(this.parseImportSpecifierDefault(this.parseIdentifier(), startPos, startLoc));
  10281. if (!this.eat(types.comma)) return;
  10282. }
  10283. if (this.match(types.star)) {
  10284. var specifier = this.startNode();
  10285. this.next();
  10286. this.expectContextual("as");
  10287. specifier.local = this.parseIdentifier();
  10288. this.checkLVal(specifier.local, true, undefined, "import namespace specifier");
  10289. node.specifiers.push(this.finishNode(specifier, "ImportNamespaceSpecifier"));
  10290. return;
  10291. }
  10292. this.expect(types.braceL);
  10293. while (!this.eat(types.braceR)) {
  10294. if (first) {
  10295. first = false;
  10296. } else {
  10297. // Detect an attempt to deep destructure
  10298. if (this.eat(types.colon)) {
  10299. this.unexpected(null, "ES2015 named imports do not destructure. Use another statement for destructuring after the import.");
  10300. }
  10301. this.expect(types.comma);
  10302. if (this.eat(types.braceR)) break;
  10303. }
  10304. this.parseImportSpecifier(node);
  10305. }
  10306. };
  10307. pp$1.parseImportSpecifier = function (node) {
  10308. var specifier = this.startNode();
  10309. specifier.imported = this.parseIdentifier(true);
  10310. if (this.eatContextual("as")) {
  10311. specifier.local = this.parseIdentifier();
  10312. } else {
  10313. this.checkReservedWord(specifier.imported.name, specifier.start, true, true);
  10314. specifier.local = specifier.imported.__clone();
  10315. }
  10316. this.checkLVal(specifier.local, true, undefined, "import specifier");
  10317. node.specifiers.push(this.finishNode(specifier, "ImportSpecifier"));
  10318. };
  10319. pp$1.parseImportSpecifierDefault = function (id, startPos, startLoc) {
  10320. var node = this.startNodeAt(startPos, startLoc);
  10321. node.local = id;
  10322. this.checkLVal(node.local, true, undefined, "default import specifier");
  10323. return this.finishNode(node, "ImportDefaultSpecifier");
  10324. };
  10325. var pp$2 = Parser.prototype;
  10326. // Convert existing expression atom to assignable pattern
  10327. // if possible.
  10328. pp$2.toAssignable = function (node, isBinding, contextDescription) {
  10329. if (node) {
  10330. switch (node.type) {
  10331. case "Identifier":
  10332. case "ObjectPattern":
  10333. case "ArrayPattern":
  10334. case "AssignmentPattern":
  10335. break;
  10336. case "ObjectExpression":
  10337. node.type = "ObjectPattern";
  10338. for (var _iterator = node.properties, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
  10339. var _ref;
  10340. if (_isArray) {
  10341. if (_i >= _iterator.length) break;
  10342. _ref = _iterator[_i++];
  10343. } else {
  10344. _i = _iterator.next();
  10345. if (_i.done) break;
  10346. _ref = _i.value;
  10347. }
  10348. var prop = _ref;
  10349. if (prop.type === "ObjectMethod") {
  10350. if (prop.kind === "get" || prop.kind === "set") {
  10351. this.raise(prop.key.start, "Object pattern can't contain getter or setter");
  10352. } else {
  10353. this.raise(prop.key.start, "Object pattern can't contain methods");
  10354. }
  10355. } else {
  10356. this.toAssignable(prop, isBinding, "object destructuring pattern");
  10357. }
  10358. }
  10359. break;
  10360. case "ObjectProperty":
  10361. this.toAssignable(node.value, isBinding, contextDescription);
  10362. break;
  10363. case "SpreadProperty":
  10364. node.type = "RestProperty";
  10365. var arg = node.argument;
  10366. this.toAssignable(arg, isBinding, contextDescription);
  10367. break;
  10368. case "ArrayExpression":
  10369. node.type = "ArrayPattern";
  10370. this.toAssignableList(node.elements, isBinding, contextDescription);
  10371. break;
  10372. case "AssignmentExpression":
  10373. if (node.operator === "=") {
  10374. node.type = "AssignmentPattern";
  10375. delete node.operator;
  10376. } else {
  10377. this.raise(node.left.end, "Only '=' operator can be used for specifying default value.");
  10378. }
  10379. break;
  10380. case "MemberExpression":
  10381. if (!isBinding) break;
  10382. default:
  10383. {
  10384. var message = "Invalid left-hand side" + (contextDescription ? " in " + contextDescription : /* istanbul ignore next */"expression");
  10385. this.raise(node.start, message);
  10386. }
  10387. }
  10388. }
  10389. return node;
  10390. };
  10391. // Convert list of expression atoms to binding list.
  10392. pp$2.toAssignableList = function (exprList, isBinding, contextDescription) {
  10393. var end = exprList.length;
  10394. if (end) {
  10395. var last = exprList[end - 1];
  10396. if (last && last.type === "RestElement") {
  10397. --end;
  10398. } else if (last && last.type === "SpreadElement") {
  10399. last.type = "RestElement";
  10400. var arg = last.argument;
  10401. this.toAssignable(arg, isBinding, contextDescription);
  10402. if (arg.type !== "Identifier" && arg.type !== "MemberExpression" && arg.type !== "ArrayPattern") {
  10403. this.unexpected(arg.start);
  10404. }
  10405. --end;
  10406. }
  10407. }
  10408. for (var i = 0; i < end; i++) {
  10409. var elt = exprList[i];
  10410. if (elt) this.toAssignable(elt, isBinding, contextDescription);
  10411. }
  10412. return exprList;
  10413. };
  10414. // Convert list of expression atoms to a list of
  10415. pp$2.toReferencedList = function (exprList) {
  10416. return exprList;
  10417. };
  10418. // Parses spread element.
  10419. pp$2.parseSpread = function (refShorthandDefaultPos) {
  10420. var node = this.startNode();
  10421. this.next();
  10422. node.argument = this.parseMaybeAssign(false, refShorthandDefaultPos);
  10423. return this.finishNode(node, "SpreadElement");
  10424. };
  10425. pp$2.parseRest = function () {
  10426. var node = this.startNode();
  10427. this.next();
  10428. node.argument = this.parseBindingIdentifier();
  10429. return this.finishNode(node, "RestElement");
  10430. };
  10431. pp$2.shouldAllowYieldIdentifier = function () {
  10432. return this.match(types._yield) && !this.state.strict && !this.state.inGenerator;
  10433. };
  10434. pp$2.parseBindingIdentifier = function () {
  10435. return this.parseIdentifier(this.shouldAllowYieldIdentifier());
  10436. };
  10437. // Parses lvalue (assignable) atom.
  10438. pp$2.parseBindingAtom = function () {
  10439. switch (this.state.type) {
  10440. case types._yield:
  10441. if (this.state.strict || this.state.inGenerator) this.unexpected();
  10442. // fall-through
  10443. case types.name:
  10444. return this.parseIdentifier(true);
  10445. case types.bracketL:
  10446. var node = this.startNode();
  10447. this.next();
  10448. node.elements = this.parseBindingList(types.bracketR, true);
  10449. return this.finishNode(node, "ArrayPattern");
  10450. case types.braceL:
  10451. return this.parseObj(true);
  10452. default:
  10453. this.unexpected();
  10454. }
  10455. };
  10456. pp$2.parseBindingList = function (close, allowEmpty) {
  10457. var elts = [];
  10458. var first = true;
  10459. while (!this.eat(close)) {
  10460. if (first) {
  10461. first = false;
  10462. } else {
  10463. this.expect(types.comma);
  10464. }
  10465. if (allowEmpty && this.match(types.comma)) {
  10466. elts.push(null);
  10467. } else if (this.eat(close)) {
  10468. break;
  10469. } else if (this.match(types.ellipsis)) {
  10470. elts.push(this.parseAssignableListItemTypes(this.parseRest()));
  10471. this.expect(close);
  10472. break;
  10473. } else {
  10474. var decorators = [];
  10475. while (this.match(types.at)) {
  10476. decorators.push(this.parseDecorator());
  10477. }
  10478. var left = this.parseMaybeDefault();
  10479. if (decorators.length) {
  10480. left.decorators = decorators;
  10481. }
  10482. this.parseAssignableListItemTypes(left);
  10483. elts.push(this.parseMaybeDefault(left.start, left.loc.start, left));
  10484. }
  10485. }
  10486. return elts;
  10487. };
  10488. pp$2.parseAssignableListItemTypes = function (param) {
  10489. return param;
  10490. };
  10491. // Parses assignment pattern around given atom if possible.
  10492. pp$2.parseMaybeDefault = function (startPos, startLoc, left) {
  10493. startLoc = startLoc || this.state.startLoc;
  10494. startPos = startPos || this.state.start;
  10495. left = left || this.parseBindingAtom();
  10496. if (!this.eat(types.eq)) return left;
  10497. var node = this.startNodeAt(startPos, startLoc);
  10498. node.left = left;
  10499. node.right = this.parseMaybeAssign();
  10500. return this.finishNode(node, "AssignmentPattern");
  10501. };
  10502. // Verify that a node is an lval — something that can be assigned
  10503. // to.
  10504. pp$2.checkLVal = function (expr, isBinding, checkClashes, contextDescription) {
  10505. switch (expr.type) {
  10506. case "Identifier":
  10507. this.checkReservedWord(expr.name, expr.start, false, true);
  10508. if (checkClashes) {
  10509. // we need to prefix this with an underscore for the cases where we have a key of
  10510. // `__proto__`. there's a bug in old V8 where the following wouldn't work:
  10511. //
  10512. // > var obj = Object.create(null);
  10513. // undefined
  10514. // > obj.__proto__
  10515. // null
  10516. // > obj.__proto__ = true;
  10517. // true
  10518. // > obj.__proto__
  10519. // null
  10520. var key = "_" + expr.name;
  10521. if (checkClashes[key]) {
  10522. this.raise(expr.start, "Argument name clash in strict mode");
  10523. } else {
  10524. checkClashes[key] = true;
  10525. }
  10526. }
  10527. break;
  10528. case "MemberExpression":
  10529. if (isBinding) this.raise(expr.start, (isBinding ? "Binding" : "Assigning to") + " member expression");
  10530. break;
  10531. case "ObjectPattern":
  10532. for (var _iterator2 = expr.properties, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
  10533. var _ref2;
  10534. if (_isArray2) {
  10535. if (_i2 >= _iterator2.length) break;
  10536. _ref2 = _iterator2[_i2++];
  10537. } else {
  10538. _i2 = _iterator2.next();
  10539. if (_i2.done) break;
  10540. _ref2 = _i2.value;
  10541. }
  10542. var prop = _ref2;
  10543. if (prop.type === "ObjectProperty") prop = prop.value;
  10544. this.checkLVal(prop, isBinding, checkClashes, "object destructuring pattern");
  10545. }
  10546. break;
  10547. case "ArrayPattern":
  10548. for (var _iterator3 = expr.elements, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) {
  10549. var _ref3;
  10550. if (_isArray3) {
  10551. if (_i3 >= _iterator3.length) break;
  10552. _ref3 = _iterator3[_i3++];
  10553. } else {
  10554. _i3 = _iterator3.next();
  10555. if (_i3.done) break;
  10556. _ref3 = _i3.value;
  10557. }
  10558. var elem = _ref3;
  10559. if (elem) this.checkLVal(elem, isBinding, checkClashes, "array destructuring pattern");
  10560. }
  10561. break;
  10562. case "AssignmentPattern":
  10563. this.checkLVal(expr.left, isBinding, checkClashes, "assignment pattern");
  10564. break;
  10565. case "RestProperty":
  10566. this.checkLVal(expr.argument, isBinding, checkClashes, "rest property");
  10567. break;
  10568. case "RestElement":
  10569. this.checkLVal(expr.argument, isBinding, checkClashes, "rest element");
  10570. break;
  10571. default:
  10572. {
  10573. var message = (isBinding ? /* istanbul ignore next */"Binding invalid" : "Invalid") + " left-hand side" + (contextDescription ? " in " + contextDescription : /* istanbul ignore next */"expression");
  10574. this.raise(expr.start, message);
  10575. }
  10576. }
  10577. };
  10578. /* eslint max-len: 0 */
  10579. // A recursive descent parser operates by defining functions for all
  10580. // syntactic elements, and recursively calling those, each function
  10581. // advancing the input stream and returning an AST node. Precedence
  10582. // of constructs (for example, the fact that `!x[1]` means `!(x[1])`
  10583. // instead of `(!x)[1]` is handled by the fact that the parser
  10584. // function that parses unary prefix operators is called first, and
  10585. // in turn calls the function that parses `[]` subscripts — that
  10586. // way, it'll receive the node for `x[1]` already parsed, and wraps
  10587. // *that* in the unary operator node.
  10588. //
  10589. // Acorn uses an [operator precedence parser][opp] to handle binary
  10590. // operator precedence, because it is much more compact than using
  10591. // the technique outlined above, which uses different, nesting
  10592. // functions to specify precedence, for all of the ten binary
  10593. // precedence levels that JavaScript defines.
  10594. //
  10595. // [opp]: http://en.wikipedia.org/wiki/Operator-precedence_parser
  10596. var pp$3 = Parser.prototype;
  10597. // Check if property name clashes with already added.
  10598. // Object/class getters and setters are not allowed to clash —
  10599. // either with each other or with an init property — and in
  10600. // strict mode, init properties are also not allowed to be repeated.
  10601. pp$3.checkPropClash = function (prop, propHash) {
  10602. if (prop.computed || prop.kind) return;
  10603. var key = prop.key;
  10604. // It is either an Identifier or a String/NumericLiteral
  10605. var name = key.type === "Identifier" ? key.name : String(key.value);
  10606. if (name === "__proto__") {
  10607. if (propHash.proto) this.raise(key.start, "Redefinition of __proto__ property");
  10608. propHash.proto = true;
  10609. }
  10610. };
  10611. // Convenience method to parse an Expression only
  10612. pp$3.getExpression = function () {
  10613. this.nextToken();
  10614. var expr = this.parseExpression();
  10615. if (!this.match(types.eof)) {
  10616. this.unexpected();
  10617. }
  10618. return expr;
  10619. };
  10620. // ### Expression parsing
  10621. // These nest, from the most general expression type at the top to
  10622. // 'atomic', nondivisible expression types at the bottom. Most of
  10623. // the functions will simply let the function (s) below them parse,
  10624. // and, *if* the syntactic construct they handle is present, wrap
  10625. // the AST node that the inner parser gave them in another node.
  10626. // Parse a full expression. The optional arguments are used to
  10627. // forbid the `in` operator (in for loops initialization expressions)
  10628. // and provide reference for storing '=' operator inside shorthand
  10629. // property assignment in contexts where both object expression
  10630. // and object pattern might appear (so it's possible to raise
  10631. // delayed syntax error at correct position).
  10632. pp$3.parseExpression = function (noIn, refShorthandDefaultPos) {
  10633. var startPos = this.state.start;
  10634. var startLoc = this.state.startLoc;
  10635. var expr = this.parseMaybeAssign(noIn, refShorthandDefaultPos);
  10636. if (this.match(types.comma)) {
  10637. var node = this.startNodeAt(startPos, startLoc);
  10638. node.expressions = [expr];
  10639. while (this.eat(types.comma)) {
  10640. node.expressions.push(this.parseMaybeAssign(noIn, refShorthandDefaultPos));
  10641. }
  10642. this.toReferencedList(node.expressions);
  10643. return this.finishNode(node, "SequenceExpression");
  10644. }
  10645. return expr;
  10646. };
  10647. // Parse an assignment expression. This includes applications of
  10648. // operators like `+=`.
  10649. pp$3.parseMaybeAssign = function (noIn, refShorthandDefaultPos, afterLeftParse, refNeedsArrowPos) {
  10650. var startPos = this.state.start;
  10651. var startLoc = this.state.startLoc;
  10652. if (this.match(types._yield) && this.state.inGenerator) {
  10653. var _left = this.parseYield();
  10654. if (afterLeftParse) _left = afterLeftParse.call(this, _left, startPos, startLoc);
  10655. return _left;
  10656. }
  10657. var failOnShorthandAssign = void 0;
  10658. if (refShorthandDefaultPos) {
  10659. failOnShorthandAssign = false;
  10660. } else {
  10661. refShorthandDefaultPos = { start: 0 };
  10662. failOnShorthandAssign = true;
  10663. }
  10664. if (this.match(types.parenL) || this.match(types.name)) {
  10665. this.state.potentialArrowAt = this.state.start;
  10666. }
  10667. var left = this.parseMaybeConditional(noIn, refShorthandDefaultPos, refNeedsArrowPos);
  10668. if (afterLeftParse) left = afterLeftParse.call(this, left, startPos, startLoc);
  10669. if (this.state.type.isAssign) {
  10670. var node = this.startNodeAt(startPos, startLoc);
  10671. node.operator = this.state.value;
  10672. node.left = this.match(types.eq) ? this.toAssignable(left, undefined, "assignment expression") : left;
  10673. refShorthandDefaultPos.start = 0; // reset because shorthand default was used correctly
  10674. this.checkLVal(left, undefined, undefined, "assignment expression");
  10675. if (left.extra && left.extra.parenthesized) {
  10676. var errorMsg = void 0;
  10677. if (left.type === "ObjectPattern") {
  10678. errorMsg = "`({a}) = 0` use `({a} = 0)`";
  10679. } else if (left.type === "ArrayPattern") {
  10680. errorMsg = "`([a]) = 0` use `([a] = 0)`";
  10681. }
  10682. if (errorMsg) {
  10683. this.raise(left.start, "You're trying to assign to a parenthesized expression, eg. instead of " + errorMsg);
  10684. }
  10685. }
  10686. this.next();
  10687. node.right = this.parseMaybeAssign(noIn);
  10688. return this.finishNode(node, "AssignmentExpression");
  10689. } else if (failOnShorthandAssign && refShorthandDefaultPos.start) {
  10690. this.unexpected(refShorthandDefaultPos.start);
  10691. }
  10692. return left;
  10693. };
  10694. // Parse a ternary conditional (`?:`) operator.
  10695. pp$3.parseMaybeConditional = function (noIn, refShorthandDefaultPos, refNeedsArrowPos) {
  10696. var startPos = this.state.start;
  10697. var startLoc = this.state.startLoc;
  10698. var expr = this.parseExprOps(noIn, refShorthandDefaultPos);
  10699. if (refShorthandDefaultPos && refShorthandDefaultPos.start) return expr;
  10700. return this.parseConditional(expr, noIn, startPos, startLoc, refNeedsArrowPos);
  10701. };
  10702. pp$3.parseConditional = function (expr, noIn, startPos, startLoc) {
  10703. if (this.eat(types.question)) {
  10704. var node = this.startNodeAt(startPos, startLoc);
  10705. node.test = expr;
  10706. node.consequent = this.parseMaybeAssign();
  10707. this.expect(types.colon);
  10708. node.alternate = this.parseMaybeAssign(noIn);
  10709. return this.finishNode(node, "ConditionalExpression");
  10710. }
  10711. return expr;
  10712. };
  10713. // Start the precedence parser.
  10714. pp$3.parseExprOps = function (noIn, refShorthandDefaultPos) {
  10715. var startPos = this.state.start;
  10716. var startLoc = this.state.startLoc;
  10717. var expr = this.parseMaybeUnary(refShorthandDefaultPos);
  10718. if (refShorthandDefaultPos && refShorthandDefaultPos.start) {
  10719. return expr;
  10720. } else {
  10721. return this.parseExprOp(expr, startPos, startLoc, -1, noIn);
  10722. }
  10723. };
  10724. // Parse binary operators with the operator precedence parsing
  10725. // algorithm. `left` is the left-hand side of the operator.
  10726. // `minPrec` provides context that allows the function to stop and
  10727. // defer further parser to one of its callers when it encounters an
  10728. // operator that has a lower precedence than the set it is parsing.
  10729. pp$3.parseExprOp = function (left, leftStartPos, leftStartLoc, minPrec, noIn) {
  10730. var prec = this.state.type.binop;
  10731. if (prec != null && (!noIn || !this.match(types._in))) {
  10732. if (prec > minPrec) {
  10733. var node = this.startNodeAt(leftStartPos, leftStartLoc);
  10734. node.left = left;
  10735. node.operator = this.state.value;
  10736. if (node.operator === "**" && left.type === "UnaryExpression" && left.extra && !left.extra.parenthesizedArgument && !left.extra.parenthesized) {
  10737. this.raise(left.argument.start, "Illegal expression. Wrap left hand side or entire exponentiation in parentheses.");
  10738. }
  10739. var op = this.state.type;
  10740. this.next();
  10741. var startPos = this.state.start;
  10742. var startLoc = this.state.startLoc;
  10743. node.right = this.parseExprOp(this.parseMaybeUnary(), startPos, startLoc, op.rightAssociative ? prec - 1 : prec, noIn);
  10744. this.finishNode(node, op === types.logicalOR || op === types.logicalAND ? "LogicalExpression" : "BinaryExpression");
  10745. return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, noIn);
  10746. }
  10747. }
  10748. return left;
  10749. };
  10750. // Parse unary operators, both prefix and postfix.
  10751. pp$3.parseMaybeUnary = function (refShorthandDefaultPos) {
  10752. if (this.state.type.prefix) {
  10753. var node = this.startNode();
  10754. var update = this.match(types.incDec);
  10755. node.operator = this.state.value;
  10756. node.prefix = true;
  10757. this.next();
  10758. var argType = this.state.type;
  10759. node.argument = this.parseMaybeUnary();
  10760. this.addExtra(node, "parenthesizedArgument", argType === types.parenL && (!node.argument.extra || !node.argument.extra.parenthesized));
  10761. if (refShorthandDefaultPos && refShorthandDefaultPos.start) {
  10762. this.unexpected(refShorthandDefaultPos.start);
  10763. }
  10764. if (update) {
  10765. this.checkLVal(node.argument, undefined, undefined, "prefix operation");
  10766. } else if (this.state.strict && node.operator === "delete" && node.argument.type === "Identifier") {
  10767. this.raise(node.start, "Deleting local variable in strict mode");
  10768. }
  10769. return this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression");
  10770. }
  10771. var startPos = this.state.start;
  10772. var startLoc = this.state.startLoc;
  10773. var expr = this.parseExprSubscripts(refShorthandDefaultPos);
  10774. if (refShorthandDefaultPos && refShorthandDefaultPos.start) return expr;
  10775. while (this.state.type.postfix && !this.canInsertSemicolon()) {
  10776. var _node = this.startNodeAt(startPos, startLoc);
  10777. _node.operator = this.state.value;
  10778. _node.prefix = false;
  10779. _node.argument = expr;
  10780. this.checkLVal(expr, undefined, undefined, "postfix operation");
  10781. this.next();
  10782. expr = this.finishNode(_node, "UpdateExpression");
  10783. }
  10784. return expr;
  10785. };
  10786. // Parse call, dot, and `[]`-subscript expressions.
  10787. pp$3.parseExprSubscripts = function (refShorthandDefaultPos) {
  10788. var startPos = this.state.start;
  10789. var startLoc = this.state.startLoc;
  10790. var potentialArrowAt = this.state.potentialArrowAt;
  10791. var expr = this.parseExprAtom(refShorthandDefaultPos);
  10792. if (expr.type === "ArrowFunctionExpression" && expr.start === potentialArrowAt) {
  10793. return expr;
  10794. }
  10795. if (refShorthandDefaultPos && refShorthandDefaultPos.start) {
  10796. return expr;
  10797. }
  10798. return this.parseSubscripts(expr, startPos, startLoc);
  10799. };
  10800. pp$3.parseSubscripts = function (base, startPos, startLoc, noCalls) {
  10801. for (;;) {
  10802. if (!noCalls && this.eat(types.doubleColon)) {
  10803. var node = this.startNodeAt(startPos, startLoc);
  10804. node.object = base;
  10805. node.callee = this.parseNoCallExpr();
  10806. return this.parseSubscripts(this.finishNode(node, "BindExpression"), startPos, startLoc, noCalls);
  10807. } else if (this.eat(types.dot)) {
  10808. var _node2 = this.startNodeAt(startPos, startLoc);
  10809. _node2.object = base;
  10810. _node2.property = this.parseIdentifier(true);
  10811. _node2.computed = false;
  10812. base = this.finishNode(_node2, "MemberExpression");
  10813. } else if (this.eat(types.bracketL)) {
  10814. var _node3 = this.startNodeAt(startPos, startLoc);
  10815. _node3.object = base;
  10816. _node3.property = this.parseExpression();
  10817. _node3.computed = true;
  10818. this.expect(types.bracketR);
  10819. base = this.finishNode(_node3, "MemberExpression");
  10820. } else if (!noCalls && this.match(types.parenL)) {
  10821. var possibleAsync = this.state.potentialArrowAt === base.start && base.type === "Identifier" && base.name === "async" && !this.canInsertSemicolon();
  10822. this.next();
  10823. var _node4 = this.startNodeAt(startPos, startLoc);
  10824. _node4.callee = base;
  10825. _node4.arguments = this.parseCallExpressionArguments(types.parenR, possibleAsync);
  10826. if (_node4.callee.type === "Import" && _node4.arguments.length !== 1) {
  10827. this.raise(_node4.start, "import() requires exactly one argument");
  10828. }
  10829. base = this.finishNode(_node4, "CallExpression");
  10830. if (possibleAsync && this.shouldParseAsyncArrow()) {
  10831. return this.parseAsyncArrowFromCallExpression(this.startNodeAt(startPos, startLoc), _node4);
  10832. } else {
  10833. this.toReferencedList(_node4.arguments);
  10834. }
  10835. } else if (this.match(types.backQuote)) {
  10836. var _node5 = this.startNodeAt(startPos, startLoc);
  10837. _node5.tag = base;
  10838. _node5.quasi = this.parseTemplate(true);
  10839. base = this.finishNode(_node5, "TaggedTemplateExpression");
  10840. } else {
  10841. return base;
  10842. }
  10843. }
  10844. };
  10845. pp$3.parseCallExpressionArguments = function (close, possibleAsyncArrow) {
  10846. var elts = [];
  10847. var innerParenStart = void 0;
  10848. var first = true;
  10849. while (!this.eat(close)) {
  10850. if (first) {
  10851. first = false;
  10852. } else {
  10853. this.expect(types.comma);
  10854. if (this.eat(close)) break;
  10855. }
  10856. // we need to make sure that if this is an async arrow functions, that we don't allow inner parens inside the params
  10857. if (this.match(types.parenL) && !innerParenStart) {
  10858. innerParenStart = this.state.start;
  10859. }
  10860. elts.push(this.parseExprListItem(false, possibleAsyncArrow ? { start: 0 } : undefined, possibleAsyncArrow ? { start: 0 } : undefined));
  10861. }
  10862. // we found an async arrow function so let's not allow any inner parens
  10863. if (possibleAsyncArrow && innerParenStart && this.shouldParseAsyncArrow()) {
  10864. this.unexpected();
  10865. }
  10866. return elts;
  10867. };
  10868. pp$3.shouldParseAsyncArrow = function () {
  10869. return this.match(types.arrow);
  10870. };
  10871. pp$3.parseAsyncArrowFromCallExpression = function (node, call) {
  10872. this.expect(types.arrow);
  10873. return this.parseArrowExpression(node, call.arguments, true);
  10874. };
  10875. // Parse a no-call expression (like argument of `new` or `::` operators).
  10876. pp$3.parseNoCallExpr = function () {
  10877. var startPos = this.state.start;
  10878. var startLoc = this.state.startLoc;
  10879. return this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true);
  10880. };
  10881. // Parse an atomic expression — either a single token that is an
  10882. // expression, an expression started by a keyword like `function` or
  10883. // `new`, or an expression wrapped in punctuation like `()`, `[]`,
  10884. // or `{}`.
  10885. pp$3.parseExprAtom = function (refShorthandDefaultPos) {
  10886. var canBeArrow = this.state.potentialArrowAt === this.state.start;
  10887. var node = void 0;
  10888. switch (this.state.type) {
  10889. case types._super:
  10890. if (!this.state.inMethod && !this.state.inClassProperty && !this.options.allowSuperOutsideMethod) {
  10891. this.raise(this.state.start, "'super' outside of function or class");
  10892. }
  10893. node = this.startNode();
  10894. this.next();
  10895. if (!this.match(types.parenL) && !this.match(types.bracketL) && !this.match(types.dot)) {
  10896. this.unexpected();
  10897. }
  10898. if (this.match(types.parenL) && this.state.inMethod !== "constructor" && !this.options.allowSuperOutsideMethod) {
  10899. this.raise(node.start, "super() outside of class constructor");
  10900. }
  10901. return this.finishNode(node, "Super");
  10902. case types._import:
  10903. if (!this.hasPlugin("dynamicImport")) this.unexpected();
  10904. node = this.startNode();
  10905. this.next();
  10906. if (!this.match(types.parenL)) {
  10907. this.unexpected(null, types.parenL);
  10908. }
  10909. return this.finishNode(node, "Import");
  10910. case types._this:
  10911. node = this.startNode();
  10912. this.next();
  10913. return this.finishNode(node, "ThisExpression");
  10914. case types._yield:
  10915. if (this.state.inGenerator) this.unexpected();
  10916. case types.name:
  10917. node = this.startNode();
  10918. var allowAwait = this.state.value === "await" && this.state.inAsync;
  10919. var allowYield = this.shouldAllowYieldIdentifier();
  10920. var id = this.parseIdentifier(allowAwait || allowYield);
  10921. if (id.name === "await") {
  10922. if (this.state.inAsync || this.inModule) {
  10923. return this.parseAwait(node);
  10924. }
  10925. } else if (id.name === "async" && this.match(types._function) && !this.canInsertSemicolon()) {
  10926. this.next();
  10927. return this.parseFunction(node, false, false, true);
  10928. } else if (canBeArrow && id.name === "async" && this.match(types.name)) {
  10929. var params = [this.parseIdentifier()];
  10930. this.expect(types.arrow);
  10931. // let foo = bar => {};
  10932. return this.parseArrowExpression(node, params, true);
  10933. }
  10934. if (canBeArrow && !this.canInsertSemicolon() && this.eat(types.arrow)) {
  10935. return this.parseArrowExpression(node, [id]);
  10936. }
  10937. return id;
  10938. case types._do:
  10939. if (this.hasPlugin("doExpressions")) {
  10940. var _node6 = this.startNode();
  10941. this.next();
  10942. var oldInFunction = this.state.inFunction;
  10943. var oldLabels = this.state.labels;
  10944. this.state.labels = [];
  10945. this.state.inFunction = false;
  10946. _node6.body = this.parseBlock(false, true);
  10947. this.state.inFunction = oldInFunction;
  10948. this.state.labels = oldLabels;
  10949. return this.finishNode(_node6, "DoExpression");
  10950. }
  10951. case types.regexp:
  10952. var value = this.state.value;
  10953. node = this.parseLiteral(value.value, "RegExpLiteral");
  10954. node.pattern = value.pattern;
  10955. node.flags = value.flags;
  10956. return node;
  10957. case types.num:
  10958. return this.parseLiteral(this.state.value, "NumericLiteral");
  10959. case types.string:
  10960. return this.parseLiteral(this.state.value, "StringLiteral");
  10961. case types._null:
  10962. node = this.startNode();
  10963. this.next();
  10964. return this.finishNode(node, "NullLiteral");
  10965. case types._true:case types._false:
  10966. node = this.startNode();
  10967. node.value = this.match(types._true);
  10968. this.next();
  10969. return this.finishNode(node, "BooleanLiteral");
  10970. case types.parenL:
  10971. return this.parseParenAndDistinguishExpression(null, null, canBeArrow);
  10972. case types.bracketL:
  10973. node = this.startNode();
  10974. this.next();
  10975. node.elements = this.parseExprList(types.bracketR, true, refShorthandDefaultPos);
  10976. this.toReferencedList(node.elements);
  10977. return this.finishNode(node, "ArrayExpression");
  10978. case types.braceL:
  10979. return this.parseObj(false, refShorthandDefaultPos);
  10980. case types._function:
  10981. return this.parseFunctionExpression();
  10982. case types.at:
  10983. this.parseDecorators();
  10984. case types._class:
  10985. node = this.startNode();
  10986. this.takeDecorators(node);
  10987. return this.parseClass(node, false);
  10988. case types._new:
  10989. return this.parseNew();
  10990. case types.backQuote:
  10991. return this.parseTemplate(false);
  10992. case types.doubleColon:
  10993. node = this.startNode();
  10994. this.next();
  10995. node.object = null;
  10996. var callee = node.callee = this.parseNoCallExpr();
  10997. if (callee.type === "MemberExpression") {
  10998. return this.finishNode(node, "BindExpression");
  10999. } else {
  11000. this.raise(callee.start, "Binding should be performed on object property.");
  11001. }
  11002. default:
  11003. this.unexpected();
  11004. }
  11005. };
  11006. pp$3.parseFunctionExpression = function () {
  11007. var node = this.startNode();
  11008. var meta = this.parseIdentifier(true);
  11009. if (this.state.inGenerator && this.eat(types.dot) && this.hasPlugin("functionSent")) {
  11010. return this.parseMetaProperty(node, meta, "sent");
  11011. } else {
  11012. return this.parseFunction(node, false);
  11013. }
  11014. };
  11015. pp$3.parseMetaProperty = function (node, meta, propertyName) {
  11016. node.meta = meta;
  11017. node.property = this.parseIdentifier(true);
  11018. if (node.property.name !== propertyName) {
  11019. this.raise(node.property.start, "The only valid meta property for new is " + meta.name + "." + propertyName);
  11020. }
  11021. return this.finishNode(node, "MetaProperty");
  11022. };
  11023. pp$3.parseLiteral = function (value, type, startPos, startLoc) {
  11024. startPos = startPos || this.state.start;
  11025. startLoc = startLoc || this.state.startLoc;
  11026. var node = this.startNodeAt(startPos, startLoc);
  11027. this.addExtra(node, "rawValue", value);
  11028. this.addExtra(node, "raw", this.input.slice(startPos, this.state.end));
  11029. node.value = value;
  11030. this.next();
  11031. return this.finishNode(node, type);
  11032. };
  11033. pp$3.parseParenExpression = function () {
  11034. this.expect(types.parenL);
  11035. var val = this.parseExpression();
  11036. this.expect(types.parenR);
  11037. return val;
  11038. };
  11039. pp$3.parseParenAndDistinguishExpression = function (startPos, startLoc, canBeArrow) {
  11040. startPos = startPos || this.state.start;
  11041. startLoc = startLoc || this.state.startLoc;
  11042. var val = void 0;
  11043. this.expect(types.parenL);
  11044. var innerStartPos = this.state.start;
  11045. var innerStartLoc = this.state.startLoc;
  11046. var exprList = [];
  11047. var refShorthandDefaultPos = { start: 0 };
  11048. var refNeedsArrowPos = { start: 0 };
  11049. var first = true;
  11050. var spreadStart = void 0;
  11051. var optionalCommaStart = void 0;
  11052. while (!this.match(types.parenR)) {
  11053. if (first) {
  11054. first = false;
  11055. } else {
  11056. this.expect(types.comma, refNeedsArrowPos.start || null);
  11057. if (this.match(types.parenR)) {
  11058. optionalCommaStart = this.state.start;
  11059. break;
  11060. }
  11061. }
  11062. if (this.match(types.ellipsis)) {
  11063. var spreadNodeStartPos = this.state.start;
  11064. var spreadNodeStartLoc = this.state.startLoc;
  11065. spreadStart = this.state.start;
  11066. exprList.push(this.parseParenItem(this.parseRest(), spreadNodeStartPos, spreadNodeStartLoc));
  11067. break;
  11068. } else {
  11069. exprList.push(this.parseMaybeAssign(false, refShorthandDefaultPos, this.parseParenItem, refNeedsArrowPos));
  11070. }
  11071. }
  11072. var innerEndPos = this.state.start;
  11073. var innerEndLoc = this.state.startLoc;
  11074. this.expect(types.parenR);
  11075. var arrowNode = this.startNodeAt(startPos, startLoc);
  11076. if (canBeArrow && this.shouldParseArrow() && (arrowNode = this.parseArrow(arrowNode))) {
  11077. for (var _iterator = exprList, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
  11078. var _ref;
  11079. if (_isArray) {
  11080. if (_i >= _iterator.length) break;
  11081. _ref = _iterator[_i++];
  11082. } else {
  11083. _i = _iterator.next();
  11084. if (_i.done) break;
  11085. _ref = _i.value;
  11086. }
  11087. var param = _ref;
  11088. if (param.extra && param.extra.parenthesized) this.unexpected(param.extra.parenStart);
  11089. }
  11090. return this.parseArrowExpression(arrowNode, exprList);
  11091. }
  11092. if (!exprList.length) {
  11093. this.unexpected(this.state.lastTokStart);
  11094. }
  11095. if (optionalCommaStart) this.unexpected(optionalCommaStart);
  11096. if (spreadStart) this.unexpected(spreadStart);
  11097. if (refShorthandDefaultPos.start) this.unexpected(refShorthandDefaultPos.start);
  11098. if (refNeedsArrowPos.start) this.unexpected(refNeedsArrowPos.start);
  11099. if (exprList.length > 1) {
  11100. val = this.startNodeAt(innerStartPos, innerStartLoc);
  11101. val.expressions = exprList;
  11102. this.toReferencedList(val.expressions);
  11103. this.finishNodeAt(val, "SequenceExpression", innerEndPos, innerEndLoc);
  11104. } else {
  11105. val = exprList[0];
  11106. }
  11107. this.addExtra(val, "parenthesized", true);
  11108. this.addExtra(val, "parenStart", startPos);
  11109. return val;
  11110. };
  11111. pp$3.shouldParseArrow = function () {
  11112. return !this.canInsertSemicolon();
  11113. };
  11114. pp$3.parseArrow = function (node) {
  11115. if (this.eat(types.arrow)) {
  11116. return node;
  11117. }
  11118. };
  11119. pp$3.parseParenItem = function (node) {
  11120. return node;
  11121. };
  11122. // New's precedence is slightly tricky. It must allow its argument
  11123. // to be a `[]` or dot subscript expression, but not a call — at
  11124. // least, not without wrapping it in parentheses. Thus, it uses the
  11125. pp$3.parseNew = function () {
  11126. var node = this.startNode();
  11127. var meta = this.parseIdentifier(true);
  11128. if (this.eat(types.dot)) {
  11129. var metaProp = this.parseMetaProperty(node, meta, "target");
  11130. if (!this.state.inFunction) {
  11131. this.raise(metaProp.property.start, "new.target can only be used in functions");
  11132. }
  11133. return metaProp;
  11134. }
  11135. node.callee = this.parseNoCallExpr();
  11136. if (this.eat(types.parenL)) {
  11137. node.arguments = this.parseExprList(types.parenR);
  11138. this.toReferencedList(node.arguments);
  11139. } else {
  11140. node.arguments = [];
  11141. }
  11142. return this.finishNode(node, "NewExpression");
  11143. };
  11144. // Parse template expression.
  11145. pp$3.parseTemplateElement = function (isTagged) {
  11146. var elem = this.startNode();
  11147. if (this.state.value === null) {
  11148. if (!isTagged || !this.hasPlugin("templateInvalidEscapes")) {
  11149. this.raise(this.state.invalidTemplateEscapePosition, "Invalid escape sequence in template");
  11150. } else {
  11151. this.state.invalidTemplateEscapePosition = null;
  11152. }
  11153. }
  11154. elem.value = {
  11155. raw: this.input.slice(this.state.start, this.state.end).replace(/\r\n?/g, "\n"),
  11156. cooked: this.state.value
  11157. };
  11158. this.next();
  11159. elem.tail = this.match(types.backQuote);
  11160. return this.finishNode(elem, "TemplateElement");
  11161. };
  11162. pp$3.parseTemplate = function (isTagged) {
  11163. var node = this.startNode();
  11164. this.next();
  11165. node.expressions = [];
  11166. var curElt = this.parseTemplateElement(isTagged);
  11167. node.quasis = [curElt];
  11168. while (!curElt.tail) {
  11169. this.expect(types.dollarBraceL);
  11170. node.expressions.push(this.parseExpression());
  11171. this.expect(types.braceR);
  11172. node.quasis.push(curElt = this.parseTemplateElement(isTagged));
  11173. }
  11174. this.next();
  11175. return this.finishNode(node, "TemplateLiteral");
  11176. };
  11177. // Parse an object literal or binding pattern.
  11178. pp$3.parseObj = function (isPattern, refShorthandDefaultPos) {
  11179. var decorators = [];
  11180. var propHash = Object.create(null);
  11181. var first = true;
  11182. var node = this.startNode();
  11183. node.properties = [];
  11184. this.next();
  11185. var firstRestLocation = null;
  11186. while (!this.eat(types.braceR)) {
  11187. if (first) {
  11188. first = false;
  11189. } else {
  11190. this.expect(types.comma);
  11191. if (this.eat(types.braceR)) break;
  11192. }
  11193. while (this.match(types.at)) {
  11194. decorators.push(this.parseDecorator());
  11195. }
  11196. var prop = this.startNode(),
  11197. isGenerator = false,
  11198. isAsync = false,
  11199. startPos = void 0,
  11200. startLoc = void 0;
  11201. if (decorators.length) {
  11202. prop.decorators = decorators;
  11203. decorators = [];
  11204. }
  11205. if (this.hasPlugin("objectRestSpread") && this.match(types.ellipsis)) {
  11206. prop = this.parseSpread(isPattern ? { start: 0 } : undefined);
  11207. prop.type = isPattern ? "RestProperty" : "SpreadProperty";
  11208. if (isPattern) this.toAssignable(prop.argument, true, "object pattern");
  11209. node.properties.push(prop);
  11210. if (isPattern) {
  11211. var position = this.state.start;
  11212. if (firstRestLocation !== null) {
  11213. this.unexpected(firstRestLocation, "Cannot have multiple rest elements when destructuring");
  11214. } else if (this.eat(types.braceR)) {
  11215. break;
  11216. } else if (this.match(types.comma) && this.lookahead().type === types.braceR) {
  11217. // TODO: temporary rollback
  11218. // this.unexpected(position, "A trailing comma is not permitted after the rest element");
  11219. continue;
  11220. } else {
  11221. firstRestLocation = position;
  11222. continue;
  11223. }
  11224. } else {
  11225. continue;
  11226. }
  11227. }
  11228. prop.method = false;
  11229. prop.shorthand = false;
  11230. if (isPattern || refShorthandDefaultPos) {
  11231. startPos = this.state.start;
  11232. startLoc = this.state.startLoc;
  11233. }
  11234. if (!isPattern) {
  11235. isGenerator = this.eat(types.star);
  11236. }
  11237. if (!isPattern && this.isContextual("async")) {
  11238. if (isGenerator) this.unexpected();
  11239. var asyncId = this.parseIdentifier();
  11240. if (this.match(types.colon) || this.match(types.parenL) || this.match(types.braceR) || this.match(types.eq) || this.match(types.comma)) {
  11241. prop.key = asyncId;
  11242. prop.computed = false;
  11243. } else {
  11244. isAsync = true;
  11245. if (this.hasPlugin("asyncGenerators")) isGenerator = this.eat(types.star);
  11246. this.parsePropertyName(prop);
  11247. }
  11248. } else {
  11249. this.parsePropertyName(prop);
  11250. }
  11251. this.parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, isPattern, refShorthandDefaultPos);
  11252. this.checkPropClash(prop, propHash);
  11253. if (prop.shorthand) {
  11254. this.addExtra(prop, "shorthand", true);
  11255. }
  11256. node.properties.push(prop);
  11257. }
  11258. if (firstRestLocation !== null) {
  11259. this.unexpected(firstRestLocation, "The rest element has to be the last element when destructuring");
  11260. }
  11261. if (decorators.length) {
  11262. this.raise(this.state.start, "You have trailing decorators with no property");
  11263. }
  11264. return this.finishNode(node, isPattern ? "ObjectPattern" : "ObjectExpression");
  11265. };
  11266. pp$3.isGetterOrSetterMethod = function (prop, isPattern) {
  11267. return !isPattern && !prop.computed && prop.key.type === "Identifier" && (prop.key.name === "get" || prop.key.name === "set") && (this.match(types.string) || // get "string"() {}
  11268. this.match(types.num) || // get 1() {}
  11269. this.match(types.bracketL) || // get ["string"]() {}
  11270. this.match(types.name) || // get foo() {}
  11271. this.state.type.keyword // get debugger() {}
  11272. );
  11273. };
  11274. // get methods aren't allowed to have any parameters
  11275. // set methods must have exactly 1 parameter
  11276. pp$3.checkGetterSetterParamCount = function (method) {
  11277. var paramCount = method.kind === "get" ? 0 : 1;
  11278. if (method.params.length !== paramCount) {
  11279. var start = method.start;
  11280. if (method.kind === "get") {
  11281. this.raise(start, "getter should have no params");
  11282. } else {
  11283. this.raise(start, "setter should have exactly one param");
  11284. }
  11285. }
  11286. };
  11287. pp$3.parseObjectMethod = function (prop, isGenerator, isAsync, isPattern) {
  11288. if (isAsync || isGenerator || this.match(types.parenL)) {
  11289. if (isPattern) this.unexpected();
  11290. prop.kind = "method";
  11291. prop.method = true;
  11292. this.parseMethod(prop, isGenerator, isAsync);
  11293. return this.finishNode(prop, "ObjectMethod");
  11294. }
  11295. if (this.isGetterOrSetterMethod(prop, isPattern)) {
  11296. if (isGenerator || isAsync) this.unexpected();
  11297. prop.kind = prop.key.name;
  11298. this.parsePropertyName(prop);
  11299. this.parseMethod(prop);
  11300. this.checkGetterSetterParamCount(prop);
  11301. return this.finishNode(prop, "ObjectMethod");
  11302. }
  11303. };
  11304. pp$3.parseObjectProperty = function (prop, startPos, startLoc, isPattern, refShorthandDefaultPos) {
  11305. if (this.eat(types.colon)) {
  11306. prop.value = isPattern ? this.parseMaybeDefault(this.state.start, this.state.startLoc) : this.parseMaybeAssign(false, refShorthandDefaultPos);
  11307. return this.finishNode(prop, "ObjectProperty");
  11308. }
  11309. if (!prop.computed && prop.key.type === "Identifier") {
  11310. this.checkReservedWord(prop.key.name, prop.key.start, true, true);
  11311. if (isPattern) {
  11312. prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key.__clone());
  11313. } else if (this.match(types.eq) && refShorthandDefaultPos) {
  11314. if (!refShorthandDefaultPos.start) {
  11315. refShorthandDefaultPos.start = this.state.start;
  11316. }
  11317. prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key.__clone());
  11318. } else {
  11319. prop.value = prop.key.__clone();
  11320. }
  11321. prop.shorthand = true;
  11322. return this.finishNode(prop, "ObjectProperty");
  11323. }
  11324. };
  11325. pp$3.parseObjPropValue = function (prop, startPos, startLoc, isGenerator, isAsync, isPattern, refShorthandDefaultPos) {
  11326. var node = this.parseObjectMethod(prop, isGenerator, isAsync, isPattern) || this.parseObjectProperty(prop, startPos, startLoc, isPattern, refShorthandDefaultPos);
  11327. if (!node) this.unexpected();
  11328. return node;
  11329. };
  11330. pp$3.parsePropertyName = function (prop) {
  11331. if (this.eat(types.bracketL)) {
  11332. prop.computed = true;
  11333. prop.key = this.parseMaybeAssign();
  11334. this.expect(types.bracketR);
  11335. } else {
  11336. prop.computed = false;
  11337. var oldInPropertyName = this.state.inPropertyName;
  11338. this.state.inPropertyName = true;
  11339. prop.key = this.match(types.num) || this.match(types.string) ? this.parseExprAtom() : this.parseIdentifier(true);
  11340. this.state.inPropertyName = oldInPropertyName;
  11341. }
  11342. return prop.key;
  11343. };
  11344. // Initialize empty function node.
  11345. pp$3.initFunction = function (node, isAsync) {
  11346. node.id = null;
  11347. node.generator = false;
  11348. node.expression = false;
  11349. node.async = !!isAsync;
  11350. };
  11351. // Parse object or class method.
  11352. pp$3.parseMethod = function (node, isGenerator, isAsync) {
  11353. var oldInMethod = this.state.inMethod;
  11354. this.state.inMethod = node.kind || true;
  11355. this.initFunction(node, isAsync);
  11356. this.expect(types.parenL);
  11357. node.params = this.parseBindingList(types.parenR);
  11358. node.generator = !!isGenerator;
  11359. this.parseFunctionBody(node);
  11360. this.state.inMethod = oldInMethod;
  11361. return node;
  11362. };
  11363. // Parse arrow function expression with given parameters.
  11364. pp$3.parseArrowExpression = function (node, params, isAsync) {
  11365. this.initFunction(node, isAsync);
  11366. node.params = this.toAssignableList(params, true, "arrow function parameters");
  11367. this.parseFunctionBody(node, true);
  11368. return this.finishNode(node, "ArrowFunctionExpression");
  11369. };
  11370. pp$3.isStrictBody = function (node, isExpression) {
  11371. if (!isExpression && node.body.directives.length) {
  11372. for (var _iterator2 = node.body.directives, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
  11373. var _ref2;
  11374. if (_isArray2) {
  11375. if (_i2 >= _iterator2.length) break;
  11376. _ref2 = _iterator2[_i2++];
  11377. } else {
  11378. _i2 = _iterator2.next();
  11379. if (_i2.done) break;
  11380. _ref2 = _i2.value;
  11381. }
  11382. var directive = _ref2;
  11383. if (directive.value.value === "use strict") {
  11384. return true;
  11385. }
  11386. }
  11387. }
  11388. return false;
  11389. };
  11390. // Parse function body and check parameters.
  11391. pp$3.parseFunctionBody = function (node, allowExpression) {
  11392. var isExpression = allowExpression && !this.match(types.braceL);
  11393. var oldInAsync = this.state.inAsync;
  11394. this.state.inAsync = node.async;
  11395. if (isExpression) {
  11396. node.body = this.parseMaybeAssign();
  11397. node.expression = true;
  11398. } else {
  11399. // Start a new scope with regard to labels and the `inFunction`
  11400. // flag (restore them to their old value afterwards).
  11401. var oldInFunc = this.state.inFunction;
  11402. var oldInGen = this.state.inGenerator;
  11403. var oldLabels = this.state.labels;
  11404. this.state.inFunction = true;this.state.inGenerator = node.generator;this.state.labels = [];
  11405. node.body = this.parseBlock(true);
  11406. node.expression = false;
  11407. this.state.inFunction = oldInFunc;this.state.inGenerator = oldInGen;this.state.labels = oldLabels;
  11408. }
  11409. this.state.inAsync = oldInAsync;
  11410. // If this is a strict mode function, verify that argument names
  11411. // are not repeated, and it does not try to bind the words `eval`
  11412. // or `arguments`.
  11413. var isStrict = this.isStrictBody(node, isExpression);
  11414. // Also check when allowExpression === true for arrow functions
  11415. var checkLVal = this.state.strict || allowExpression || isStrict;
  11416. if (isStrict && node.id && node.id.type === "Identifier" && node.id.name === "yield") {
  11417. this.raise(node.id.start, "Binding yield in strict mode");
  11418. }
  11419. if (checkLVal) {
  11420. var nameHash = Object.create(null);
  11421. var oldStrict = this.state.strict;
  11422. if (isStrict) this.state.strict = true;
  11423. if (node.id) {
  11424. this.checkLVal(node.id, true, undefined, "function name");
  11425. }
  11426. for (var _iterator3 = node.params, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) {
  11427. var _ref3;
  11428. if (_isArray3) {
  11429. if (_i3 >= _iterator3.length) break;
  11430. _ref3 = _iterator3[_i3++];
  11431. } else {
  11432. _i3 = _iterator3.next();
  11433. if (_i3.done) break;
  11434. _ref3 = _i3.value;
  11435. }
  11436. var param = _ref3;
  11437. if (isStrict && param.type !== "Identifier") {
  11438. this.raise(param.start, "Non-simple parameter in strict mode");
  11439. }
  11440. this.checkLVal(param, true, nameHash, "function parameter list");
  11441. }
  11442. this.state.strict = oldStrict;
  11443. }
  11444. };
  11445. // Parses a comma-separated list of expressions, and returns them as
  11446. // an array. `close` is the token type that ends the list, and
  11447. // `allowEmpty` can be turned on to allow subsequent commas with
  11448. // nothing in between them to be parsed as `null` (which is needed
  11449. // for array literals).
  11450. pp$3.parseExprList = function (close, allowEmpty, refShorthandDefaultPos) {
  11451. var elts = [];
  11452. var first = true;
  11453. while (!this.eat(close)) {
  11454. if (first) {
  11455. first = false;
  11456. } else {
  11457. this.expect(types.comma);
  11458. if (this.eat(close)) break;
  11459. }
  11460. elts.push(this.parseExprListItem(allowEmpty, refShorthandDefaultPos));
  11461. }
  11462. return elts;
  11463. };
  11464. pp$3.parseExprListItem = function (allowEmpty, refShorthandDefaultPos, refNeedsArrowPos) {
  11465. var elt = void 0;
  11466. if (allowEmpty && this.match(types.comma)) {
  11467. elt = null;
  11468. } else if (this.match(types.ellipsis)) {
  11469. elt = this.parseSpread(refShorthandDefaultPos);
  11470. } else {
  11471. elt = this.parseMaybeAssign(false, refShorthandDefaultPos, this.parseParenItem, refNeedsArrowPos);
  11472. }
  11473. return elt;
  11474. };
  11475. // Parse the next token as an identifier. If `liberal` is true (used
  11476. // when parsing properties), it will also convert keywords into
  11477. // identifiers.
  11478. pp$3.parseIdentifier = function (liberal) {
  11479. var node = this.startNode();
  11480. if (!liberal) {
  11481. this.checkReservedWord(this.state.value, this.state.start, !!this.state.type.keyword, false);
  11482. }
  11483. if (this.match(types.name)) {
  11484. node.name = this.state.value;
  11485. } else if (this.state.type.keyword) {
  11486. node.name = this.state.type.keyword;
  11487. } else {
  11488. this.unexpected();
  11489. }
  11490. if (!liberal && node.name === "await" && this.state.inAsync) {
  11491. this.raise(node.start, "invalid use of await inside of an async function");
  11492. }
  11493. node.loc.identifierName = node.name;
  11494. this.next();
  11495. return this.finishNode(node, "Identifier");
  11496. };
  11497. pp$3.checkReservedWord = function (word, startLoc, checkKeywords, isBinding) {
  11498. if (this.isReservedWord(word) || checkKeywords && this.isKeyword(word)) {
  11499. this.raise(startLoc, word + " is a reserved word");
  11500. }
  11501. if (this.state.strict && (reservedWords.strict(word) || isBinding && reservedWords.strictBind(word))) {
  11502. this.raise(startLoc, word + " is a reserved word in strict mode");
  11503. }
  11504. };
  11505. // Parses await expression inside async function.
  11506. pp$3.parseAwait = function (node) {
  11507. // istanbul ignore next: this condition is checked at the call site so won't be hit here
  11508. if (!this.state.inAsync) {
  11509. this.unexpected();
  11510. }
  11511. if (this.match(types.star)) {
  11512. this.raise(node.start, "await* has been removed from the async functions proposal. Use Promise.all() instead.");
  11513. }
  11514. node.argument = this.parseMaybeUnary();
  11515. return this.finishNode(node, "AwaitExpression");
  11516. };
  11517. // Parses yield expression inside generator.
  11518. pp$3.parseYield = function () {
  11519. var node = this.startNode();
  11520. this.next();
  11521. if (this.match(types.semi) || this.canInsertSemicolon() || !this.match(types.star) && !this.state.type.startsExpr) {
  11522. node.delegate = false;
  11523. node.argument = null;
  11524. } else {
  11525. node.delegate = this.eat(types.star);
  11526. node.argument = this.parseMaybeAssign();
  11527. }
  11528. return this.finishNode(node, "YieldExpression");
  11529. };
  11530. // Start an AST node, attaching a start offset.
  11531. var pp$4 = Parser.prototype;
  11532. var commentKeys = ["leadingComments", "trailingComments", "innerComments"];
  11533. var Node = function () {
  11534. function Node(pos, loc, filename) {
  11535. classCallCheck(this, Node);
  11536. this.type = "";
  11537. this.start = pos;
  11538. this.end = 0;
  11539. this.loc = new SourceLocation(loc);
  11540. if (filename) this.loc.filename = filename;
  11541. }
  11542. Node.prototype.__clone = function __clone() {
  11543. var node2 = new Node();
  11544. for (var key in this) {
  11545. // Do not clone comments that are already attached to the node
  11546. if (commentKeys.indexOf(key) < 0) {
  11547. node2[key] = this[key];
  11548. }
  11549. }
  11550. return node2;
  11551. };
  11552. return Node;
  11553. }();
  11554. pp$4.startNode = function () {
  11555. return new Node(this.state.start, this.state.startLoc, this.filename);
  11556. };
  11557. pp$4.startNodeAt = function (pos, loc) {
  11558. return new Node(pos, loc, this.filename);
  11559. };
  11560. function finishNodeAt(node, type, pos, loc) {
  11561. node.type = type;
  11562. node.end = pos;
  11563. node.loc.end = loc;
  11564. this.processComment(node);
  11565. return node;
  11566. }
  11567. // Finish an AST node, adding `type` and `end` properties.
  11568. pp$4.finishNode = function (node, type) {
  11569. return finishNodeAt.call(this, node, type, this.state.lastTokEnd, this.state.lastTokEndLoc);
  11570. };
  11571. // Finish node at given position
  11572. pp$4.finishNodeAt = function (node, type, pos, loc) {
  11573. return finishNodeAt.call(this, node, type, pos, loc);
  11574. };
  11575. var pp$5 = Parser.prototype;
  11576. // This function is used to raise exceptions on parse errors. It
  11577. // takes an offset integer (into the current `input`) to indicate
  11578. // the location of the error, attaches the position to the end
  11579. // of the error message, and then raises a `SyntaxError` with that
  11580. // message.
  11581. pp$5.raise = function (pos, message) {
  11582. var loc = getLineInfo(this.input, pos);
  11583. message += " (" + loc.line + ":" + loc.column + ")";
  11584. var err = new SyntaxError(message);
  11585. err.pos = pos;
  11586. err.loc = loc;
  11587. throw err;
  11588. };
  11589. /* eslint max-len: 0 */
  11590. /**
  11591. * Based on the comment attachment algorithm used in espree and estraverse.
  11592. *
  11593. * Redistribution and use in source and binary forms, with or without
  11594. * modification, are permitted provided that the following conditions are met:
  11595. *
  11596. * * Redistributions of source code must retain the above copyright
  11597. * notice, this list of conditions and the following disclaimer.
  11598. * * Redistributions in binary form must reproduce the above copyright
  11599. * notice, this list of conditions and the following disclaimer in the
  11600. * documentation and/or other materials provided with the distribution.
  11601. *
  11602. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  11603. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  11604. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  11605. * ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
  11606. * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  11607. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  11608. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  11609. * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  11610. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  11611. * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  11612. */
  11613. function last(stack) {
  11614. return stack[stack.length - 1];
  11615. }
  11616. var pp$6 = Parser.prototype;
  11617. pp$6.addComment = function (comment) {
  11618. if (this.filename) comment.loc.filename = this.filename;
  11619. this.state.trailingComments.push(comment);
  11620. this.state.leadingComments.push(comment);
  11621. };
  11622. pp$6.processComment = function (node) {
  11623. if (node.type === "Program" && node.body.length > 0) return;
  11624. var stack = this.state.commentStack;
  11625. var firstChild = void 0,
  11626. lastChild = void 0,
  11627. trailingComments = void 0,
  11628. i = void 0,
  11629. j = void 0;
  11630. if (this.state.trailingComments.length > 0) {
  11631. // If the first comment in trailingComments comes after the
  11632. // current node, then we're good - all comments in the array will
  11633. // come after the node and so it's safe to add them as official
  11634. // trailingComments.
  11635. if (this.state.trailingComments[0].start >= node.end) {
  11636. trailingComments = this.state.trailingComments;
  11637. this.state.trailingComments = [];
  11638. } else {
  11639. // Otherwise, if the first comment doesn't come after the
  11640. // current node, that means we have a mix of leading and trailing
  11641. // comments in the array and that leadingComments contains the
  11642. // same items as trailingComments. Reset trailingComments to
  11643. // zero items and we'll handle this by evaluating leadingComments
  11644. // later.
  11645. this.state.trailingComments.length = 0;
  11646. }
  11647. } else {
  11648. var lastInStack = last(stack);
  11649. if (stack.length > 0 && lastInStack.trailingComments && lastInStack.trailingComments[0].start >= node.end) {
  11650. trailingComments = lastInStack.trailingComments;
  11651. lastInStack.trailingComments = null;
  11652. }
  11653. }
  11654. // Eating the stack.
  11655. if (stack.length > 0 && last(stack).start >= node.start) {
  11656. firstChild = stack.pop();
  11657. }
  11658. while (stack.length > 0 && last(stack).start >= node.start) {
  11659. lastChild = stack.pop();
  11660. }
  11661. if (!lastChild && firstChild) lastChild = firstChild;
  11662. // Attach comments that follow a trailing comma on the last
  11663. // property in an object literal or a trailing comma in function arguments
  11664. // as trailing comments
  11665. if (firstChild && this.state.leadingComments.length > 0) {
  11666. var lastComment = last(this.state.leadingComments);
  11667. if (firstChild.type === "ObjectProperty") {
  11668. if (lastComment.start >= node.start) {
  11669. if (this.state.commentPreviousNode) {
  11670. for (j = 0; j < this.state.leadingComments.length; j++) {
  11671. if (this.state.leadingComments[j].end < this.state.commentPreviousNode.end) {
  11672. this.state.leadingComments.splice(j, 1);
  11673. j--;
  11674. }
  11675. }
  11676. if (this.state.leadingComments.length > 0) {
  11677. firstChild.trailingComments = this.state.leadingComments;
  11678. this.state.leadingComments = [];
  11679. }
  11680. }
  11681. }
  11682. } else if (node.type === "CallExpression" && node.arguments && node.arguments.length) {
  11683. var lastArg = last(node.arguments);
  11684. if (lastArg && lastComment.start >= lastArg.start && lastComment.end <= node.end) {
  11685. if (this.state.commentPreviousNode) {
  11686. if (this.state.leadingComments.length > 0) {
  11687. lastArg.trailingComments = this.state.leadingComments;
  11688. this.state.leadingComments = [];
  11689. }
  11690. }
  11691. }
  11692. }
  11693. }
  11694. if (lastChild) {
  11695. if (lastChild.leadingComments) {
  11696. if (lastChild !== node && last(lastChild.leadingComments).end <= node.start) {
  11697. node.leadingComments = lastChild.leadingComments;
  11698. lastChild.leadingComments = null;
  11699. } else {
  11700. // A leading comment for an anonymous class had been stolen by its first ClassMethod,
  11701. // so this takes back the leading comment.
  11702. // See also: https://github.com/eslint/espree/issues/158
  11703. for (i = lastChild.leadingComments.length - 2; i >= 0; --i) {
  11704. if (lastChild.leadingComments[i].end <= node.start) {
  11705. node.leadingComments = lastChild.leadingComments.splice(0, i + 1);
  11706. break;
  11707. }
  11708. }
  11709. }
  11710. }
  11711. } else if (this.state.leadingComments.length > 0) {
  11712. if (last(this.state.leadingComments).end <= node.start) {
  11713. if (this.state.commentPreviousNode) {
  11714. for (j = 0; j < this.state.leadingComments.length; j++) {
  11715. if (this.state.leadingComments[j].end < this.state.commentPreviousNode.end) {
  11716. this.state.leadingComments.splice(j, 1);
  11717. j--;
  11718. }
  11719. }
  11720. }
  11721. if (this.state.leadingComments.length > 0) {
  11722. node.leadingComments = this.state.leadingComments;
  11723. this.state.leadingComments = [];
  11724. }
  11725. } else {
  11726. // https://github.com/eslint/espree/issues/2
  11727. //
  11728. // In special cases, such as return (without a value) and
  11729. // debugger, all comments will end up as leadingComments and
  11730. // will otherwise be eliminated. This step runs when the
  11731. // commentStack is empty and there are comments left
  11732. // in leadingComments.
  11733. //
  11734. // This loop figures out the stopping point between the actual
  11735. // leading and trailing comments by finding the location of the
  11736. // first comment that comes after the given node.
  11737. for (i = 0; i < this.state.leadingComments.length; i++) {
  11738. if (this.state.leadingComments[i].end > node.start) {
  11739. break;
  11740. }
  11741. }
  11742. // Split the array based on the location of the first comment
  11743. // that comes after the node. Keep in mind that this could
  11744. // result in an empty array, and if so, the array must be
  11745. // deleted.
  11746. node.leadingComments = this.state.leadingComments.slice(0, i);
  11747. if (node.leadingComments.length === 0) {
  11748. node.leadingComments = null;
  11749. }
  11750. // Similarly, trailing comments are attached later. The variable
  11751. // must be reset to null if there are no trailing comments.
  11752. trailingComments = this.state.leadingComments.slice(i);
  11753. if (trailingComments.length === 0) {
  11754. trailingComments = null;
  11755. }
  11756. }
  11757. }
  11758. this.state.commentPreviousNode = node;
  11759. if (trailingComments) {
  11760. if (trailingComments.length && trailingComments[0].start >= node.start && last(trailingComments).end <= node.end) {
  11761. node.innerComments = trailingComments;
  11762. } else {
  11763. node.trailingComments = trailingComments;
  11764. }
  11765. }
  11766. stack.push(node);
  11767. };
  11768. var pp$7 = Parser.prototype;
  11769. pp$7.estreeParseRegExpLiteral = function (_ref) {
  11770. var pattern = _ref.pattern,
  11771. flags = _ref.flags;
  11772. var regex = null;
  11773. try {
  11774. regex = new RegExp(pattern, flags);
  11775. } catch (e) {
  11776. // In environments that don't support these flags value will
  11777. // be null as the regex can't be represented natively.
  11778. }
  11779. var node = this.estreeParseLiteral(regex);
  11780. node.regex = { pattern: pattern, flags: flags };
  11781. return node;
  11782. };
  11783. pp$7.estreeParseLiteral = function (value) {
  11784. return this.parseLiteral(value, "Literal");
  11785. };
  11786. pp$7.directiveToStmt = function (directive) {
  11787. var directiveLiteral = directive.value;
  11788. var stmt = this.startNodeAt(directive.start, directive.loc.start);
  11789. var expression = this.startNodeAt(directiveLiteral.start, directiveLiteral.loc.start);
  11790. expression.value = directiveLiteral.value;
  11791. expression.raw = directiveLiteral.extra.raw;
  11792. stmt.expression = this.finishNodeAt(expression, "Literal", directiveLiteral.end, directiveLiteral.loc.end);
  11793. stmt.directive = directiveLiteral.extra.raw.slice(1, -1);
  11794. return this.finishNodeAt(stmt, "ExpressionStatement", directive.end, directive.loc.end);
  11795. };
  11796. function isSimpleProperty(node) {
  11797. return node && node.type === "Property" && node.kind === "init" && node.method === false;
  11798. }
  11799. var estreePlugin = function estreePlugin(instance) {
  11800. instance.extend("checkDeclaration", function (inner) {
  11801. return function (node) {
  11802. if (isSimpleProperty(node)) {
  11803. this.checkDeclaration(node.value);
  11804. } else {
  11805. inner.call(this, node);
  11806. }
  11807. };
  11808. });
  11809. instance.extend("checkGetterSetterParamCount", function () {
  11810. return function (prop) {
  11811. var paramCount = prop.kind === "get" ? 0 : 1;
  11812. if (prop.value.params.length !== paramCount) {
  11813. var start = prop.start;
  11814. if (prop.kind === "get") {
  11815. this.raise(start, "getter should have no params");
  11816. } else {
  11817. this.raise(start, "setter should have exactly one param");
  11818. }
  11819. }
  11820. };
  11821. });
  11822. instance.extend("checkLVal", function (inner) {
  11823. return function (expr, isBinding, checkClashes) {
  11824. var _this = this;
  11825. switch (expr.type) {
  11826. case "ObjectPattern":
  11827. expr.properties.forEach(function (prop) {
  11828. _this.checkLVal(prop.type === "Property" ? prop.value : prop, isBinding, checkClashes, "object destructuring pattern");
  11829. });
  11830. break;
  11831. default:
  11832. for (var _len = arguments.length, args = Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
  11833. args[_key - 3] = arguments[_key];
  11834. }
  11835. inner.call.apply(inner, [this, expr, isBinding, checkClashes].concat(args));
  11836. }
  11837. };
  11838. });
  11839. instance.extend("checkPropClash", function () {
  11840. return function (prop, propHash) {
  11841. if (prop.computed || !isSimpleProperty(prop)) return;
  11842. var key = prop.key;
  11843. // It is either an Identifier or a String/NumericLiteral
  11844. var name = key.type === "Identifier" ? key.name : String(key.value);
  11845. if (name === "__proto__") {
  11846. if (propHash.proto) this.raise(key.start, "Redefinition of __proto__ property");
  11847. propHash.proto = true;
  11848. }
  11849. };
  11850. });
  11851. instance.extend("isStrictBody", function () {
  11852. return function (node, isExpression) {
  11853. if (!isExpression && node.body.body.length > 0) {
  11854. for (var _iterator = node.body.body, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
  11855. var _ref2;
  11856. if (_isArray) {
  11857. if (_i >= _iterator.length) break;
  11858. _ref2 = _iterator[_i++];
  11859. } else {
  11860. _i = _iterator.next();
  11861. if (_i.done) break;
  11862. _ref2 = _i.value;
  11863. }
  11864. var directive = _ref2;
  11865. if (directive.type === "ExpressionStatement" && directive.expression.type === "Literal") {
  11866. if (directive.expression.value === "use strict") return true;
  11867. } else {
  11868. // Break for the first non literal expression
  11869. break;
  11870. }
  11871. }
  11872. }
  11873. return false;
  11874. };
  11875. });
  11876. instance.extend("isValidDirective", function () {
  11877. return function (stmt) {
  11878. return stmt.type === "ExpressionStatement" && stmt.expression.type === "Literal" && typeof stmt.expression.value === "string" && (!stmt.expression.extra || !stmt.expression.extra.parenthesized);
  11879. };
  11880. });
  11881. instance.extend("stmtToDirective", function (inner) {
  11882. return function (stmt) {
  11883. var directive = inner.call(this, stmt);
  11884. var value = stmt.expression.value;
  11885. // Reset value to the actual value as in estree mode we want
  11886. // the stmt to have the real value and not the raw value
  11887. directive.value.value = value;
  11888. return directive;
  11889. };
  11890. });
  11891. instance.extend("parseBlockBody", function (inner) {
  11892. return function (node) {
  11893. var _this2 = this;
  11894. for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
  11895. args[_key2 - 1] = arguments[_key2];
  11896. }
  11897. inner.call.apply(inner, [this, node].concat(args));
  11898. node.directives.reverse().forEach(function (directive) {
  11899. node.body.unshift(_this2.directiveToStmt(directive));
  11900. });
  11901. delete node.directives;
  11902. };
  11903. });
  11904. instance.extend("parseClassMethod", function () {
  11905. return function (classBody, method, isGenerator, isAsync) {
  11906. this.parseMethod(method, isGenerator, isAsync);
  11907. if (method.typeParameters) {
  11908. method.value.typeParameters = method.typeParameters;
  11909. delete method.typeParameters;
  11910. }
  11911. classBody.body.push(this.finishNode(method, "MethodDefinition"));
  11912. };
  11913. });
  11914. instance.extend("parseExprAtom", function (inner) {
  11915. return function () {
  11916. switch (this.state.type) {
  11917. case types.regexp:
  11918. return this.estreeParseRegExpLiteral(this.state.value);
  11919. case types.num:
  11920. case types.string:
  11921. return this.estreeParseLiteral(this.state.value);
  11922. case types._null:
  11923. return this.estreeParseLiteral(null);
  11924. case types._true:
  11925. return this.estreeParseLiteral(true);
  11926. case types._false:
  11927. return this.estreeParseLiteral(false);
  11928. default:
  11929. for (var _len3 = arguments.length, args = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
  11930. args[_key3] = arguments[_key3];
  11931. }
  11932. return inner.call.apply(inner, [this].concat(args));
  11933. }
  11934. };
  11935. });
  11936. instance.extend("parseLiteral", function (inner) {
  11937. return function () {
  11938. for (var _len4 = arguments.length, args = Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
  11939. args[_key4] = arguments[_key4];
  11940. }
  11941. var node = inner.call.apply(inner, [this].concat(args));
  11942. node.raw = node.extra.raw;
  11943. delete node.extra;
  11944. return node;
  11945. };
  11946. });
  11947. instance.extend("parseMethod", function (inner) {
  11948. return function (node) {
  11949. var funcNode = this.startNode();
  11950. funcNode.kind = node.kind; // provide kind, so inner method correctly sets state
  11951. for (var _len5 = arguments.length, args = Array(_len5 > 1 ? _len5 - 1 : 0), _key5 = 1; _key5 < _len5; _key5++) {
  11952. args[_key5 - 1] = arguments[_key5];
  11953. }
  11954. funcNode = inner.call.apply(inner, [this, funcNode].concat(args));
  11955. delete funcNode.kind;
  11956. node.value = this.finishNode(funcNode, "FunctionExpression");
  11957. return node;
  11958. };
  11959. });
  11960. instance.extend("parseObjectMethod", function (inner) {
  11961. return function () {
  11962. for (var _len6 = arguments.length, args = Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
  11963. args[_key6] = arguments[_key6];
  11964. }
  11965. var node = inner.call.apply(inner, [this].concat(args));
  11966. if (node) {
  11967. if (node.kind === "method") node.kind = "init";
  11968. node.type = "Property";
  11969. }
  11970. return node;
  11971. };
  11972. });
  11973. instance.extend("parseObjectProperty", function (inner) {
  11974. return function () {
  11975. for (var _len7 = arguments.length, args = Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
  11976. args[_key7] = arguments[_key7];
  11977. }
  11978. var node = inner.call.apply(inner, [this].concat(args));
  11979. if (node) {
  11980. node.kind = "init";
  11981. node.type = "Property";
  11982. }
  11983. return node;
  11984. };
  11985. });
  11986. instance.extend("toAssignable", function (inner) {
  11987. return function (node, isBinding) {
  11988. for (var _len8 = arguments.length, args = Array(_len8 > 2 ? _len8 - 2 : 0), _key8 = 2; _key8 < _len8; _key8++) {
  11989. args[_key8 - 2] = arguments[_key8];
  11990. }
  11991. if (isSimpleProperty(node)) {
  11992. this.toAssignable.apply(this, [node.value, isBinding].concat(args));
  11993. return node;
  11994. } else if (node.type === "ObjectExpression") {
  11995. node.type = "ObjectPattern";
  11996. for (var _iterator2 = node.properties, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
  11997. var _ref3;
  11998. if (_isArray2) {
  11999. if (_i2 >= _iterator2.length) break;
  12000. _ref3 = _iterator2[_i2++];
  12001. } else {
  12002. _i2 = _iterator2.next();
  12003. if (_i2.done) break;
  12004. _ref3 = _i2.value;
  12005. }
  12006. var prop = _ref3;
  12007. if (prop.kind === "get" || prop.kind === "set") {
  12008. this.raise(prop.key.start, "Object pattern can't contain getter or setter");
  12009. } else if (prop.method) {
  12010. this.raise(prop.key.start, "Object pattern can't contain methods");
  12011. } else {
  12012. this.toAssignable(prop, isBinding, "object destructuring pattern");
  12013. }
  12014. }
  12015. return node;
  12016. }
  12017. return inner.call.apply(inner, [this, node, isBinding].concat(args));
  12018. };
  12019. });
  12020. };
  12021. /* eslint max-len: 0 */
  12022. var primitiveTypes = ["any", "mixed", "empty", "bool", "boolean", "number", "string", "void", "null"];
  12023. var pp$8 = Parser.prototype;
  12024. pp$8.flowParseTypeInitialiser = function (tok) {
  12025. var oldInType = this.state.inType;
  12026. this.state.inType = true;
  12027. this.expect(tok || types.colon);
  12028. var type = this.flowParseType();
  12029. this.state.inType = oldInType;
  12030. return type;
  12031. };
  12032. pp$8.flowParsePredicate = function () {
  12033. var node = this.startNode();
  12034. var moduloLoc = this.state.startLoc;
  12035. var moduloPos = this.state.start;
  12036. this.expect(types.modulo);
  12037. var checksLoc = this.state.startLoc;
  12038. this.expectContextual("checks");
  12039. // Force '%' and 'checks' to be adjacent
  12040. if (moduloLoc.line !== checksLoc.line || moduloLoc.column !== checksLoc.column - 1) {
  12041. this.raise(moduloPos, "Spaces between ´%´ and ´checks´ are not allowed here.");
  12042. }
  12043. if (this.eat(types.parenL)) {
  12044. node.expression = this.parseExpression();
  12045. this.expect(types.parenR);
  12046. return this.finishNode(node, "DeclaredPredicate");
  12047. } else {
  12048. return this.finishNode(node, "InferredPredicate");
  12049. }
  12050. };
  12051. pp$8.flowParseTypeAndPredicateInitialiser = function () {
  12052. var oldInType = this.state.inType;
  12053. this.state.inType = true;
  12054. this.expect(types.colon);
  12055. var type = null;
  12056. var predicate = null;
  12057. if (this.match(types.modulo)) {
  12058. this.state.inType = oldInType;
  12059. predicate = this.flowParsePredicate();
  12060. } else {
  12061. type = this.flowParseType();
  12062. this.state.inType = oldInType;
  12063. if (this.match(types.modulo)) {
  12064. predicate = this.flowParsePredicate();
  12065. }
  12066. }
  12067. return [type, predicate];
  12068. };
  12069. pp$8.flowParseDeclareClass = function (node) {
  12070. this.next();
  12071. this.flowParseInterfaceish(node, true);
  12072. return this.finishNode(node, "DeclareClass");
  12073. };
  12074. pp$8.flowParseDeclareFunction = function (node) {
  12075. this.next();
  12076. var id = node.id = this.parseIdentifier();
  12077. var typeNode = this.startNode();
  12078. var typeContainer = this.startNode();
  12079. if (this.isRelational("<")) {
  12080. typeNode.typeParameters = this.flowParseTypeParameterDeclaration();
  12081. } else {
  12082. typeNode.typeParameters = null;
  12083. }
  12084. this.expect(types.parenL);
  12085. var tmp = this.flowParseFunctionTypeParams();
  12086. typeNode.params = tmp.params;
  12087. typeNode.rest = tmp.rest;
  12088. this.expect(types.parenR);
  12089. var predicate = null;
  12090. var _flowParseTypeAndPred = this.flowParseTypeAndPredicateInitialiser();
  12091. typeNode.returnType = _flowParseTypeAndPred[0];
  12092. predicate = _flowParseTypeAndPred[1];
  12093. typeContainer.typeAnnotation = this.finishNode(typeNode, "FunctionTypeAnnotation");
  12094. typeContainer.predicate = predicate;
  12095. id.typeAnnotation = this.finishNode(typeContainer, "TypeAnnotation");
  12096. this.finishNode(id, id.type);
  12097. this.semicolon();
  12098. return this.finishNode(node, "DeclareFunction");
  12099. };
  12100. pp$8.flowParseDeclare = function (node) {
  12101. if (this.match(types._class)) {
  12102. return this.flowParseDeclareClass(node);
  12103. } else if (this.match(types._function)) {
  12104. return this.flowParseDeclareFunction(node);
  12105. } else if (this.match(types._var)) {
  12106. return this.flowParseDeclareVariable(node);
  12107. } else if (this.isContextual("module")) {
  12108. if (this.lookahead().type === types.dot) {
  12109. return this.flowParseDeclareModuleExports(node);
  12110. } else {
  12111. return this.flowParseDeclareModule(node);
  12112. }
  12113. } else if (this.isContextual("type")) {
  12114. return this.flowParseDeclareTypeAlias(node);
  12115. } else if (this.isContextual("opaque")) {
  12116. return this.flowParseDeclareOpaqueType(node);
  12117. } else if (this.isContextual("interface")) {
  12118. return this.flowParseDeclareInterface(node);
  12119. } else if (this.match(types._export)) {
  12120. return this.flowParseDeclareExportDeclaration(node);
  12121. } else {
  12122. this.unexpected();
  12123. }
  12124. };
  12125. pp$8.flowParseDeclareExportDeclaration = function (node) {
  12126. this.expect(types._export);
  12127. if (this.isContextual("opaque") // declare export opaque ...
  12128. ) {
  12129. node.declaration = this.flowParseDeclare(this.startNode());
  12130. node.default = false;
  12131. return this.finishNode(node, "DeclareExportDeclaration");
  12132. }
  12133. throw this.unexpected();
  12134. };
  12135. pp$8.flowParseDeclareVariable = function (node) {
  12136. this.next();
  12137. node.id = this.flowParseTypeAnnotatableIdentifier();
  12138. this.semicolon();
  12139. return this.finishNode(node, "DeclareVariable");
  12140. };
  12141. pp$8.flowParseDeclareModule = function (node) {
  12142. this.next();
  12143. if (this.match(types.string)) {
  12144. node.id = this.parseExprAtom();
  12145. } else {
  12146. node.id = this.parseIdentifier();
  12147. }
  12148. var bodyNode = node.body = this.startNode();
  12149. var body = bodyNode.body = [];
  12150. this.expect(types.braceL);
  12151. while (!this.match(types.braceR)) {
  12152. var _bodyNode = this.startNode();
  12153. if (this.match(types._import)) {
  12154. var lookahead = this.lookahead();
  12155. if (lookahead.value !== "type" && lookahead.value !== "typeof") {
  12156. this.unexpected(null, "Imports within a `declare module` body must always be `import type` or `import typeof`");
  12157. }
  12158. this.parseImport(_bodyNode);
  12159. } else {
  12160. this.expectContextual("declare", "Only declares and type imports are allowed inside declare module");
  12161. _bodyNode = this.flowParseDeclare(_bodyNode, true);
  12162. }
  12163. body.push(_bodyNode);
  12164. }
  12165. this.expect(types.braceR);
  12166. this.finishNode(bodyNode, "BlockStatement");
  12167. return this.finishNode(node, "DeclareModule");
  12168. };
  12169. pp$8.flowParseDeclareModuleExports = function (node) {
  12170. this.expectContextual("module");
  12171. this.expect(types.dot);
  12172. this.expectContextual("exports");
  12173. node.typeAnnotation = this.flowParseTypeAnnotation();
  12174. this.semicolon();
  12175. return this.finishNode(node, "DeclareModuleExports");
  12176. };
  12177. pp$8.flowParseDeclareTypeAlias = function (node) {
  12178. this.next();
  12179. this.flowParseTypeAlias(node);
  12180. return this.finishNode(node, "DeclareTypeAlias");
  12181. };
  12182. pp$8.flowParseDeclareOpaqueType = function (node) {
  12183. this.next();
  12184. this.flowParseOpaqueType(node, true);
  12185. return this.finishNode(node, "DeclareOpaqueType");
  12186. };
  12187. pp$8.flowParseDeclareInterface = function (node) {
  12188. this.next();
  12189. this.flowParseInterfaceish(node);
  12190. return this.finishNode(node, "DeclareInterface");
  12191. };
  12192. // Interfaces
  12193. pp$8.flowParseInterfaceish = function (node) {
  12194. node.id = this.parseIdentifier();
  12195. if (this.isRelational("<")) {
  12196. node.typeParameters = this.flowParseTypeParameterDeclaration();
  12197. } else {
  12198. node.typeParameters = null;
  12199. }
  12200. node.extends = [];
  12201. node.mixins = [];
  12202. if (this.eat(types._extends)) {
  12203. do {
  12204. node.extends.push(this.flowParseInterfaceExtends());
  12205. } while (this.eat(types.comma));
  12206. }
  12207. if (this.isContextual("mixins")) {
  12208. this.next();
  12209. do {
  12210. node.mixins.push(this.flowParseInterfaceExtends());
  12211. } while (this.eat(types.comma));
  12212. }
  12213. node.body = this.flowParseObjectType(true, false, false);
  12214. };
  12215. pp$8.flowParseInterfaceExtends = function () {
  12216. var node = this.startNode();
  12217. node.id = this.flowParseQualifiedTypeIdentifier();
  12218. if (this.isRelational("<")) {
  12219. node.typeParameters = this.flowParseTypeParameterInstantiation();
  12220. } else {
  12221. node.typeParameters = null;
  12222. }
  12223. return this.finishNode(node, "InterfaceExtends");
  12224. };
  12225. pp$8.flowParseInterface = function (node) {
  12226. this.flowParseInterfaceish(node, false);
  12227. return this.finishNode(node, "InterfaceDeclaration");
  12228. };
  12229. pp$8.flowParseRestrictedIdentifier = function (liberal) {
  12230. if (primitiveTypes.indexOf(this.state.value) > -1) {
  12231. this.raise(this.state.start, "Cannot overwrite primitive type " + this.state.value);
  12232. }
  12233. return this.parseIdentifier(liberal);
  12234. };
  12235. // Type aliases
  12236. pp$8.flowParseTypeAlias = function (node) {
  12237. node.id = this.flowParseRestrictedIdentifier();
  12238. if (this.isRelational("<")) {
  12239. node.typeParameters = this.flowParseTypeParameterDeclaration();
  12240. } else {
  12241. node.typeParameters = null;
  12242. }
  12243. node.right = this.flowParseTypeInitialiser(types.eq);
  12244. this.semicolon();
  12245. return this.finishNode(node, "TypeAlias");
  12246. };
  12247. // Opaque type aliases
  12248. pp$8.flowParseOpaqueType = function (node, declare) {
  12249. this.expectContextual("type");
  12250. node.id = this.flowParseRestrictedIdentifier();
  12251. if (this.isRelational("<")) {
  12252. node.typeParameters = this.flowParseTypeParameterDeclaration();
  12253. } else {
  12254. node.typeParameters = null;
  12255. }
  12256. // Parse the supertype
  12257. node.supertype = null;
  12258. if (this.match(types.colon)) {
  12259. node.supertype = this.flowParseTypeInitialiser(types.colon);
  12260. }
  12261. node.impltype = null;
  12262. if (!declare) {
  12263. node.impltype = this.flowParseTypeInitialiser(types.eq);
  12264. }
  12265. this.semicolon();
  12266. return this.finishNode(node, "OpaqueType");
  12267. };
  12268. // Type annotations
  12269. pp$8.flowParseTypeParameter = function () {
  12270. var node = this.startNode();
  12271. var variance = this.flowParseVariance();
  12272. var ident = this.flowParseTypeAnnotatableIdentifier();
  12273. node.name = ident.name;
  12274. node.variance = variance;
  12275. node.bound = ident.typeAnnotation;
  12276. if (this.match(types.eq)) {
  12277. this.eat(types.eq);
  12278. node.default = this.flowParseType();
  12279. }
  12280. return this.finishNode(node, "TypeParameter");
  12281. };
  12282. pp$8.flowParseTypeParameterDeclaration = function () {
  12283. var oldInType = this.state.inType;
  12284. var node = this.startNode();
  12285. node.params = [];
  12286. this.state.inType = true;
  12287. // istanbul ignore else: this condition is already checked at all call sites
  12288. if (this.isRelational("<") || this.match(types.jsxTagStart)) {
  12289. this.next();
  12290. } else {
  12291. this.unexpected();
  12292. }
  12293. do {
  12294. node.params.push(this.flowParseTypeParameter());
  12295. if (!this.isRelational(">")) {
  12296. this.expect(types.comma);
  12297. }
  12298. } while (!this.isRelational(">"));
  12299. this.expectRelational(">");
  12300. this.state.inType = oldInType;
  12301. return this.finishNode(node, "TypeParameterDeclaration");
  12302. };
  12303. pp$8.flowParseTypeParameterInstantiation = function () {
  12304. var node = this.startNode();
  12305. var oldInType = this.state.inType;
  12306. node.params = [];
  12307. this.state.inType = true;
  12308. this.expectRelational("<");
  12309. while (!this.isRelational(">")) {
  12310. node.params.push(this.flowParseType());
  12311. if (!this.isRelational(">")) {
  12312. this.expect(types.comma);
  12313. }
  12314. }
  12315. this.expectRelational(">");
  12316. this.state.inType = oldInType;
  12317. return this.finishNode(node, "TypeParameterInstantiation");
  12318. };
  12319. pp$8.flowParseObjectPropertyKey = function () {
  12320. return this.match(types.num) || this.match(types.string) ? this.parseExprAtom() : this.parseIdentifier(true);
  12321. };
  12322. pp$8.flowParseObjectTypeIndexer = function (node, isStatic, variance) {
  12323. node.static = isStatic;
  12324. this.expect(types.bracketL);
  12325. if (this.lookahead().type === types.colon) {
  12326. node.id = this.flowParseObjectPropertyKey();
  12327. node.key = this.flowParseTypeInitialiser();
  12328. } else {
  12329. node.id = null;
  12330. node.key = this.flowParseType();
  12331. }
  12332. this.expect(types.bracketR);
  12333. node.value = this.flowParseTypeInitialiser();
  12334. node.variance = variance;
  12335. this.flowObjectTypeSemicolon();
  12336. return this.finishNode(node, "ObjectTypeIndexer");
  12337. };
  12338. pp$8.flowParseObjectTypeMethodish = function (node) {
  12339. node.params = [];
  12340. node.rest = null;
  12341. node.typeParameters = null;
  12342. if (this.isRelational("<")) {
  12343. node.typeParameters = this.flowParseTypeParameterDeclaration();
  12344. }
  12345. this.expect(types.parenL);
  12346. while (!this.match(types.parenR) && !this.match(types.ellipsis)) {
  12347. node.params.push(this.flowParseFunctionTypeParam());
  12348. if (!this.match(types.parenR)) {
  12349. this.expect(types.comma);
  12350. }
  12351. }
  12352. if (this.eat(types.ellipsis)) {
  12353. node.rest = this.flowParseFunctionTypeParam();
  12354. }
  12355. this.expect(types.parenR);
  12356. node.returnType = this.flowParseTypeInitialiser();
  12357. return this.finishNode(node, "FunctionTypeAnnotation");
  12358. };
  12359. pp$8.flowParseObjectTypeMethod = function (startPos, startLoc, isStatic, key) {
  12360. var node = this.startNodeAt(startPos, startLoc);
  12361. node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(startPos, startLoc));
  12362. node.static = isStatic;
  12363. node.key = key;
  12364. node.optional = false;
  12365. this.flowObjectTypeSemicolon();
  12366. return this.finishNode(node, "ObjectTypeProperty");
  12367. };
  12368. pp$8.flowParseObjectTypeCallProperty = function (node, isStatic) {
  12369. var valueNode = this.startNode();
  12370. node.static = isStatic;
  12371. node.value = this.flowParseObjectTypeMethodish(valueNode);
  12372. this.flowObjectTypeSemicolon();
  12373. return this.finishNode(node, "ObjectTypeCallProperty");
  12374. };
  12375. pp$8.flowParseObjectType = function (allowStatic, allowExact, allowSpread) {
  12376. var oldInType = this.state.inType;
  12377. this.state.inType = true;
  12378. var nodeStart = this.startNode();
  12379. var node = void 0;
  12380. var propertyKey = void 0;
  12381. var isStatic = false;
  12382. nodeStart.callProperties = [];
  12383. nodeStart.properties = [];
  12384. nodeStart.indexers = [];
  12385. var endDelim = void 0;
  12386. var exact = void 0;
  12387. if (allowExact && this.match(types.braceBarL)) {
  12388. this.expect(types.braceBarL);
  12389. endDelim = types.braceBarR;
  12390. exact = true;
  12391. } else {
  12392. this.expect(types.braceL);
  12393. endDelim = types.braceR;
  12394. exact = false;
  12395. }
  12396. nodeStart.exact = exact;
  12397. while (!this.match(endDelim)) {
  12398. var optional = false;
  12399. var startPos = this.state.start;
  12400. var startLoc = this.state.startLoc;
  12401. node = this.startNode();
  12402. if (allowStatic && this.isContextual("static") && this.lookahead().type !== types.colon) {
  12403. this.next();
  12404. isStatic = true;
  12405. }
  12406. var variancePos = this.state.start;
  12407. var variance = this.flowParseVariance();
  12408. if (this.match(types.bracketL)) {
  12409. nodeStart.indexers.push(this.flowParseObjectTypeIndexer(node, isStatic, variance));
  12410. } else if (this.match(types.parenL) || this.isRelational("<")) {
  12411. if (variance) {
  12412. this.unexpected(variancePos);
  12413. }
  12414. nodeStart.callProperties.push(this.flowParseObjectTypeCallProperty(node, isStatic));
  12415. } else {
  12416. if (this.match(types.ellipsis)) {
  12417. if (!allowSpread) {
  12418. this.unexpected(null, "Spread operator cannot appear in class or interface definitions");
  12419. }
  12420. if (variance) {
  12421. this.unexpected(variance.start, "Spread properties cannot have variance");
  12422. }
  12423. this.expect(types.ellipsis);
  12424. node.argument = this.flowParseType();
  12425. this.flowObjectTypeSemicolon();
  12426. nodeStart.properties.push(this.finishNode(node, "ObjectTypeSpreadProperty"));
  12427. } else {
  12428. propertyKey = this.flowParseObjectPropertyKey();
  12429. if (this.isRelational("<") || this.match(types.parenL)) {
  12430. // This is a method property
  12431. if (variance) {
  12432. this.unexpected(variance.start);
  12433. }
  12434. nodeStart.properties.push(this.flowParseObjectTypeMethod(startPos, startLoc, isStatic, propertyKey));
  12435. } else {
  12436. if (this.eat(types.question)) {
  12437. optional = true;
  12438. }
  12439. node.key = propertyKey;
  12440. node.value = this.flowParseTypeInitialiser();
  12441. node.optional = optional;
  12442. node.static = isStatic;
  12443. node.variance = variance;
  12444. this.flowObjectTypeSemicolon();
  12445. nodeStart.properties.push(this.finishNode(node, "ObjectTypeProperty"));
  12446. }
  12447. }
  12448. }
  12449. isStatic = false;
  12450. }
  12451. this.expect(endDelim);
  12452. var out = this.finishNode(nodeStart, "ObjectTypeAnnotation");
  12453. this.state.inType = oldInType;
  12454. return out;
  12455. };
  12456. pp$8.flowObjectTypeSemicolon = function () {
  12457. if (!this.eat(types.semi) && !this.eat(types.comma) && !this.match(types.braceR) && !this.match(types.braceBarR)) {
  12458. this.unexpected();
  12459. }
  12460. };
  12461. pp$8.flowParseQualifiedTypeIdentifier = function (startPos, startLoc, id) {
  12462. startPos = startPos || this.state.start;
  12463. startLoc = startLoc || this.state.startLoc;
  12464. var node = id || this.parseIdentifier();
  12465. while (this.eat(types.dot)) {
  12466. var node2 = this.startNodeAt(startPos, startLoc);
  12467. node2.qualification = node;
  12468. node2.id = this.parseIdentifier();
  12469. node = this.finishNode(node2, "QualifiedTypeIdentifier");
  12470. }
  12471. return node;
  12472. };
  12473. pp$8.flowParseGenericType = function (startPos, startLoc, id) {
  12474. var node = this.startNodeAt(startPos, startLoc);
  12475. node.typeParameters = null;
  12476. node.id = this.flowParseQualifiedTypeIdentifier(startPos, startLoc, id);
  12477. if (this.isRelational("<")) {
  12478. node.typeParameters = this.flowParseTypeParameterInstantiation();
  12479. }
  12480. return this.finishNode(node, "GenericTypeAnnotation");
  12481. };
  12482. pp$8.flowParseTypeofType = function () {
  12483. var node = this.startNode();
  12484. this.expect(types._typeof);
  12485. node.argument = this.flowParsePrimaryType();
  12486. return this.finishNode(node, "TypeofTypeAnnotation");
  12487. };
  12488. pp$8.flowParseTupleType = function () {
  12489. var node = this.startNode();
  12490. node.types = [];
  12491. this.expect(types.bracketL);
  12492. // We allow trailing commas
  12493. while (this.state.pos < this.input.length && !this.match(types.bracketR)) {
  12494. node.types.push(this.flowParseType());
  12495. if (this.match(types.bracketR)) break;
  12496. this.expect(types.comma);
  12497. }
  12498. this.expect(types.bracketR);
  12499. return this.finishNode(node, "TupleTypeAnnotation");
  12500. };
  12501. pp$8.flowParseFunctionTypeParam = function () {
  12502. var name = null;
  12503. var optional = false;
  12504. var typeAnnotation = null;
  12505. var node = this.startNode();
  12506. var lh = this.lookahead();
  12507. if (lh.type === types.colon || lh.type === types.question) {
  12508. name = this.parseIdentifier();
  12509. if (this.eat(types.question)) {
  12510. optional = true;
  12511. }
  12512. typeAnnotation = this.flowParseTypeInitialiser();
  12513. } else {
  12514. typeAnnotation = this.flowParseType();
  12515. }
  12516. node.name = name;
  12517. node.optional = optional;
  12518. node.typeAnnotation = typeAnnotation;
  12519. return this.finishNode(node, "FunctionTypeParam");
  12520. };
  12521. pp$8.reinterpretTypeAsFunctionTypeParam = function (type) {
  12522. var node = this.startNodeAt(type.start, type.loc.start);
  12523. node.name = null;
  12524. node.optional = false;
  12525. node.typeAnnotation = type;
  12526. return this.finishNode(node, "FunctionTypeParam");
  12527. };
  12528. pp$8.flowParseFunctionTypeParams = function () {
  12529. var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  12530. var ret = { params: params, rest: null };
  12531. while (!this.match(types.parenR) && !this.match(types.ellipsis)) {
  12532. ret.params.push(this.flowParseFunctionTypeParam());
  12533. if (!this.match(types.parenR)) {
  12534. this.expect(types.comma);
  12535. }
  12536. }
  12537. if (this.eat(types.ellipsis)) {
  12538. ret.rest = this.flowParseFunctionTypeParam();
  12539. }
  12540. return ret;
  12541. };
  12542. pp$8.flowIdentToTypeAnnotation = function (startPos, startLoc, node, id) {
  12543. switch (id.name) {
  12544. case "any":
  12545. return this.finishNode(node, "AnyTypeAnnotation");
  12546. case "void":
  12547. return this.finishNode(node, "VoidTypeAnnotation");
  12548. case "bool":
  12549. case "boolean":
  12550. return this.finishNode(node, "BooleanTypeAnnotation");
  12551. case "mixed":
  12552. return this.finishNode(node, "MixedTypeAnnotation");
  12553. case "empty":
  12554. return this.finishNode(node, "EmptyTypeAnnotation");
  12555. case "number":
  12556. return this.finishNode(node, "NumberTypeAnnotation");
  12557. case "string":
  12558. return this.finishNode(node, "StringTypeAnnotation");
  12559. default:
  12560. return this.flowParseGenericType(startPos, startLoc, id);
  12561. }
  12562. };
  12563. // The parsing of types roughly parallels the parsing of expressions, and
  12564. // primary types are kind of like primary expressions...they're the
  12565. // primitives with which other types are constructed.
  12566. pp$8.flowParsePrimaryType = function () {
  12567. var startPos = this.state.start;
  12568. var startLoc = this.state.startLoc;
  12569. var node = this.startNode();
  12570. var tmp = void 0;
  12571. var type = void 0;
  12572. var isGroupedType = false;
  12573. var oldNoAnonFunctionType = this.state.noAnonFunctionType;
  12574. switch (this.state.type) {
  12575. case types.name:
  12576. return this.flowIdentToTypeAnnotation(startPos, startLoc, node, this.parseIdentifier());
  12577. case types.braceL:
  12578. return this.flowParseObjectType(false, false, true);
  12579. case types.braceBarL:
  12580. return this.flowParseObjectType(false, true, true);
  12581. case types.bracketL:
  12582. return this.flowParseTupleType();
  12583. case types.relational:
  12584. if (this.state.value === "<") {
  12585. node.typeParameters = this.flowParseTypeParameterDeclaration();
  12586. this.expect(types.parenL);
  12587. tmp = this.flowParseFunctionTypeParams();
  12588. node.params = tmp.params;
  12589. node.rest = tmp.rest;
  12590. this.expect(types.parenR);
  12591. this.expect(types.arrow);
  12592. node.returnType = this.flowParseType();
  12593. return this.finishNode(node, "FunctionTypeAnnotation");
  12594. }
  12595. break;
  12596. case types.parenL:
  12597. this.next();
  12598. // Check to see if this is actually a grouped type
  12599. if (!this.match(types.parenR) && !this.match(types.ellipsis)) {
  12600. if (this.match(types.name)) {
  12601. var token = this.lookahead().type;
  12602. isGroupedType = token !== types.question && token !== types.colon;
  12603. } else {
  12604. isGroupedType = true;
  12605. }
  12606. }
  12607. if (isGroupedType) {
  12608. this.state.noAnonFunctionType = false;
  12609. type = this.flowParseType();
  12610. this.state.noAnonFunctionType = oldNoAnonFunctionType;
  12611. // A `,` or a `) =>` means this is an anonymous function type
  12612. if (this.state.noAnonFunctionType || !(this.match(types.comma) || this.match(types.parenR) && this.lookahead().type === types.arrow)) {
  12613. this.expect(types.parenR);
  12614. return type;
  12615. } else {
  12616. // Eat a comma if there is one
  12617. this.eat(types.comma);
  12618. }
  12619. }
  12620. if (type) {
  12621. tmp = this.flowParseFunctionTypeParams([this.reinterpretTypeAsFunctionTypeParam(type)]);
  12622. } else {
  12623. tmp = this.flowParseFunctionTypeParams();
  12624. }
  12625. node.params = tmp.params;
  12626. node.rest = tmp.rest;
  12627. this.expect(types.parenR);
  12628. this.expect(types.arrow);
  12629. node.returnType = this.flowParseType();
  12630. node.typeParameters = null;
  12631. return this.finishNode(node, "FunctionTypeAnnotation");
  12632. case types.string:
  12633. return this.parseLiteral(this.state.value, "StringLiteralTypeAnnotation");
  12634. case types._true:case types._false:
  12635. node.value = this.match(types._true);
  12636. this.next();
  12637. return this.finishNode(node, "BooleanLiteralTypeAnnotation");
  12638. case types.plusMin:
  12639. if (this.state.value === "-") {
  12640. this.next();
  12641. if (!this.match(types.num)) this.unexpected(null, "Unexpected token, expected number");
  12642. return this.parseLiteral(-this.state.value, "NumericLiteralTypeAnnotation", node.start, node.loc.start);
  12643. }
  12644. this.unexpected();
  12645. case types.num:
  12646. return this.parseLiteral(this.state.value, "NumericLiteralTypeAnnotation");
  12647. case types._null:
  12648. node.value = this.match(types._null);
  12649. this.next();
  12650. return this.finishNode(node, "NullLiteralTypeAnnotation");
  12651. case types._this:
  12652. node.value = this.match(types._this);
  12653. this.next();
  12654. return this.finishNode(node, "ThisTypeAnnotation");
  12655. case types.star:
  12656. this.next();
  12657. return this.finishNode(node, "ExistentialTypeParam");
  12658. default:
  12659. if (this.state.type.keyword === "typeof") {
  12660. return this.flowParseTypeofType();
  12661. }
  12662. }
  12663. this.unexpected();
  12664. };
  12665. pp$8.flowParsePostfixType = function () {
  12666. var startPos = this.state.start,
  12667. startLoc = this.state.startLoc;
  12668. var type = this.flowParsePrimaryType();
  12669. while (!this.canInsertSemicolon() && this.match(types.bracketL)) {
  12670. var node = this.startNodeAt(startPos, startLoc);
  12671. node.elementType = type;
  12672. this.expect(types.bracketL);
  12673. this.expect(types.bracketR);
  12674. type = this.finishNode(node, "ArrayTypeAnnotation");
  12675. }
  12676. return type;
  12677. };
  12678. pp$8.flowParsePrefixType = function () {
  12679. var node = this.startNode();
  12680. if (this.eat(types.question)) {
  12681. node.typeAnnotation = this.flowParsePrefixType();
  12682. return this.finishNode(node, "NullableTypeAnnotation");
  12683. } else {
  12684. return this.flowParsePostfixType();
  12685. }
  12686. };
  12687. pp$8.flowParseAnonFunctionWithoutParens = function () {
  12688. var param = this.flowParsePrefixType();
  12689. if (!this.state.noAnonFunctionType && this.eat(types.arrow)) {
  12690. var node = this.startNodeAt(param.start, param.loc.start);
  12691. node.params = [this.reinterpretTypeAsFunctionTypeParam(param)];
  12692. node.rest = null;
  12693. node.returnType = this.flowParseType();
  12694. node.typeParameters = null;
  12695. return this.finishNode(node, "FunctionTypeAnnotation");
  12696. }
  12697. return param;
  12698. };
  12699. pp$8.flowParseIntersectionType = function () {
  12700. var node = this.startNode();
  12701. this.eat(types.bitwiseAND);
  12702. var type = this.flowParseAnonFunctionWithoutParens();
  12703. node.types = [type];
  12704. while (this.eat(types.bitwiseAND)) {
  12705. node.types.push(this.flowParseAnonFunctionWithoutParens());
  12706. }
  12707. return node.types.length === 1 ? type : this.finishNode(node, "IntersectionTypeAnnotation");
  12708. };
  12709. pp$8.flowParseUnionType = function () {
  12710. var node = this.startNode();
  12711. this.eat(types.bitwiseOR);
  12712. var type = this.flowParseIntersectionType();
  12713. node.types = [type];
  12714. while (this.eat(types.bitwiseOR)) {
  12715. node.types.push(this.flowParseIntersectionType());
  12716. }
  12717. return node.types.length === 1 ? type : this.finishNode(node, "UnionTypeAnnotation");
  12718. };
  12719. pp$8.flowParseType = function () {
  12720. var oldInType = this.state.inType;
  12721. this.state.inType = true;
  12722. var type = this.flowParseUnionType();
  12723. this.state.inType = oldInType;
  12724. return type;
  12725. };
  12726. pp$8.flowParseTypeAnnotation = function () {
  12727. var node = this.startNode();
  12728. node.typeAnnotation = this.flowParseTypeInitialiser();
  12729. return this.finishNode(node, "TypeAnnotation");
  12730. };
  12731. pp$8.flowParseTypeAndPredicateAnnotation = function () {
  12732. var node = this.startNode();
  12733. var _flowParseTypeAndPred2 = this.flowParseTypeAndPredicateInitialiser();
  12734. node.typeAnnotation = _flowParseTypeAndPred2[0];
  12735. node.predicate = _flowParseTypeAndPred2[1];
  12736. return this.finishNode(node, "TypeAnnotation");
  12737. };
  12738. pp$8.flowParseTypeAnnotatableIdentifier = function () {
  12739. var ident = this.flowParseRestrictedIdentifier();
  12740. if (this.match(types.colon)) {
  12741. ident.typeAnnotation = this.flowParseTypeAnnotation();
  12742. this.finishNode(ident, ident.type);
  12743. }
  12744. return ident;
  12745. };
  12746. pp$8.typeCastToParameter = function (node) {
  12747. node.expression.typeAnnotation = node.typeAnnotation;
  12748. return this.finishNodeAt(node.expression, node.expression.type, node.typeAnnotation.end, node.typeAnnotation.loc.end);
  12749. };
  12750. pp$8.flowParseVariance = function () {
  12751. var variance = null;
  12752. if (this.match(types.plusMin)) {
  12753. if (this.state.value === "+") {
  12754. variance = "plus";
  12755. } else if (this.state.value === "-") {
  12756. variance = "minus";
  12757. }
  12758. this.next();
  12759. }
  12760. return variance;
  12761. };
  12762. var flowPlugin = function flowPlugin(instance) {
  12763. // plain function return types: function name(): string {}
  12764. instance.extend("parseFunctionBody", function (inner) {
  12765. return function (node, allowExpression) {
  12766. if (this.match(types.colon) && !allowExpression) {
  12767. // if allowExpression is true then we're parsing an arrow function and if
  12768. // there's a return type then it's been handled elsewhere
  12769. node.returnType = this.flowParseTypeAndPredicateAnnotation();
  12770. }
  12771. return inner.call(this, node, allowExpression);
  12772. };
  12773. });
  12774. // interfaces
  12775. instance.extend("parseStatement", function (inner) {
  12776. return function (declaration, topLevel) {
  12777. // strict mode handling of `interface` since it's a reserved word
  12778. if (this.state.strict && this.match(types.name) && this.state.value === "interface") {
  12779. var node = this.startNode();
  12780. this.next();
  12781. return this.flowParseInterface(node);
  12782. } else {
  12783. return inner.call(this, declaration, topLevel);
  12784. }
  12785. };
  12786. });
  12787. // declares, interfaces and type aliases
  12788. instance.extend("parseExpressionStatement", function (inner) {
  12789. return function (node, expr) {
  12790. if (expr.type === "Identifier") {
  12791. if (expr.name === "declare") {
  12792. if (this.match(types._class) || this.match(types.name) || this.match(types._function) || this.match(types._var) || this.match(types._export)) {
  12793. return this.flowParseDeclare(node);
  12794. }
  12795. } else if (this.match(types.name)) {
  12796. if (expr.name === "interface") {
  12797. return this.flowParseInterface(node);
  12798. } else if (expr.name === "type") {
  12799. return this.flowParseTypeAlias(node);
  12800. } else if (expr.name === "opaque") {
  12801. return this.flowParseOpaqueType(node, false);
  12802. }
  12803. }
  12804. }
  12805. return inner.call(this, node, expr);
  12806. };
  12807. });
  12808. // export type
  12809. instance.extend("shouldParseExportDeclaration", function (inner) {
  12810. return function () {
  12811. return this.isContextual("type") || this.isContextual("interface") || this.isContextual("opaque") || inner.call(this);
  12812. };
  12813. });
  12814. instance.extend("isExportDefaultSpecifier", function (inner) {
  12815. return function () {
  12816. if (this.match(types.name) && (this.state.value === "type" || this.state.value === "interface" || this.state.value === "opaque")) {
  12817. return false;
  12818. }
  12819. return inner.call(this);
  12820. };
  12821. });
  12822. instance.extend("parseConditional", function (inner) {
  12823. return function (expr, noIn, startPos, startLoc, refNeedsArrowPos) {
  12824. // only do the expensive clone if there is a question mark
  12825. // and if we come from inside parens
  12826. if (refNeedsArrowPos && this.match(types.question)) {
  12827. var state = this.state.clone();
  12828. try {
  12829. return inner.call(this, expr, noIn, startPos, startLoc);
  12830. } catch (err) {
  12831. if (err instanceof SyntaxError) {
  12832. this.state = state;
  12833. refNeedsArrowPos.start = err.pos || this.state.start;
  12834. return expr;
  12835. } else {
  12836. // istanbul ignore next: no such error is expected
  12837. throw err;
  12838. }
  12839. }
  12840. }
  12841. return inner.call(this, expr, noIn, startPos, startLoc);
  12842. };
  12843. });
  12844. instance.extend("parseParenItem", function (inner) {
  12845. return function (node, startPos, startLoc) {
  12846. node = inner.call(this, node, startPos, startLoc);
  12847. if (this.eat(types.question)) {
  12848. node.optional = true;
  12849. }
  12850. if (this.match(types.colon)) {
  12851. var typeCastNode = this.startNodeAt(startPos, startLoc);
  12852. typeCastNode.expression = node;
  12853. typeCastNode.typeAnnotation = this.flowParseTypeAnnotation();
  12854. return this.finishNode(typeCastNode, "TypeCastExpression");
  12855. }
  12856. return node;
  12857. };
  12858. });
  12859. instance.extend("parseExport", function (inner) {
  12860. return function (node) {
  12861. node = inner.call(this, node);
  12862. if (node.type === "ExportNamedDeclaration") {
  12863. node.exportKind = node.exportKind || "value";
  12864. }
  12865. return node;
  12866. };
  12867. });
  12868. instance.extend("parseExportDeclaration", function (inner) {
  12869. return function (node) {
  12870. if (this.isContextual("type")) {
  12871. node.exportKind = "type";
  12872. var declarationNode = this.startNode();
  12873. this.next();
  12874. if (this.match(types.braceL)) {
  12875. // export type { foo, bar };
  12876. node.specifiers = this.parseExportSpecifiers();
  12877. this.parseExportFrom(node);
  12878. return null;
  12879. } else {
  12880. // export type Foo = Bar;
  12881. return this.flowParseTypeAlias(declarationNode);
  12882. }
  12883. } else if (this.isContextual("opaque")) {
  12884. node.exportKind = "type";
  12885. var _declarationNode = this.startNode();
  12886. this.next();
  12887. // export opaque type Foo = Bar;
  12888. return this.flowParseOpaqueType(_declarationNode, false);
  12889. } else if (this.isContextual("interface")) {
  12890. node.exportKind = "type";
  12891. var _declarationNode2 = this.startNode();
  12892. this.next();
  12893. return this.flowParseInterface(_declarationNode2);
  12894. } else {
  12895. return inner.call(this, node);
  12896. }
  12897. };
  12898. });
  12899. instance.extend("parseClassId", function (inner) {
  12900. return function (node) {
  12901. inner.apply(this, arguments);
  12902. if (this.isRelational("<")) {
  12903. node.typeParameters = this.flowParseTypeParameterDeclaration();
  12904. }
  12905. };
  12906. });
  12907. // don't consider `void` to be a keyword as then it'll use the void token type
  12908. // and set startExpr
  12909. instance.extend("isKeyword", function (inner) {
  12910. return function (name) {
  12911. if (this.state.inType && name === "void") {
  12912. return false;
  12913. } else {
  12914. return inner.call(this, name);
  12915. }
  12916. };
  12917. });
  12918. // ensure that inside flow types, we bypass the jsx parser plugin
  12919. instance.extend("readToken", function (inner) {
  12920. return function (code) {
  12921. if (this.state.inType && (code === 62 || code === 60)) {
  12922. return this.finishOp(types.relational, 1);
  12923. } else {
  12924. return inner.call(this, code);
  12925. }
  12926. };
  12927. });
  12928. // don't lex any token as a jsx one inside a flow type
  12929. instance.extend("jsx_readToken", function (inner) {
  12930. return function () {
  12931. if (!this.state.inType) return inner.call(this);
  12932. };
  12933. });
  12934. instance.extend("toAssignable", function (inner) {
  12935. return function (node, isBinding, contextDescription) {
  12936. if (node.type === "TypeCastExpression") {
  12937. return inner.call(this, this.typeCastToParameter(node), isBinding, contextDescription);
  12938. } else {
  12939. return inner.call(this, node, isBinding, contextDescription);
  12940. }
  12941. };
  12942. });
  12943. // turn type casts that we found in function parameter head into type annotated params
  12944. instance.extend("toAssignableList", function (inner) {
  12945. return function (exprList, isBinding, contextDescription) {
  12946. for (var i = 0; i < exprList.length; i++) {
  12947. var expr = exprList[i];
  12948. if (expr && expr.type === "TypeCastExpression") {
  12949. exprList[i] = this.typeCastToParameter(expr);
  12950. }
  12951. }
  12952. return inner.call(this, exprList, isBinding, contextDescription);
  12953. };
  12954. });
  12955. // this is a list of nodes, from something like a call expression, we need to filter the
  12956. // type casts that we've found that are illegal in this context
  12957. instance.extend("toReferencedList", function () {
  12958. return function (exprList) {
  12959. for (var i = 0; i < exprList.length; i++) {
  12960. var expr = exprList[i];
  12961. if (expr && expr._exprListItem && expr.type === "TypeCastExpression") {
  12962. this.raise(expr.start, "Unexpected type cast");
  12963. }
  12964. }
  12965. return exprList;
  12966. };
  12967. });
  12968. // parse an item inside a expression list eg. `(NODE, NODE)` where NODE represents
  12969. // the position where this function is called
  12970. instance.extend("parseExprListItem", function (inner) {
  12971. return function () {
  12972. var container = this.startNode();
  12973. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  12974. args[_key] = arguments[_key];
  12975. }
  12976. var node = inner.call.apply(inner, [this].concat(args));
  12977. if (this.match(types.colon)) {
  12978. container._exprListItem = true;
  12979. container.expression = node;
  12980. container.typeAnnotation = this.flowParseTypeAnnotation();
  12981. return this.finishNode(container, "TypeCastExpression");
  12982. } else {
  12983. return node;
  12984. }
  12985. };
  12986. });
  12987. instance.extend("checkLVal", function (inner) {
  12988. return function (node) {
  12989. if (node.type !== "TypeCastExpression") {
  12990. return inner.apply(this, arguments);
  12991. }
  12992. };
  12993. });
  12994. // parse class property type annotations
  12995. instance.extend("parseClassProperty", function (inner) {
  12996. return function (node) {
  12997. delete node.variancePos;
  12998. if (this.match(types.colon)) {
  12999. node.typeAnnotation = this.flowParseTypeAnnotation();
  13000. }
  13001. return inner.call(this, node);
  13002. };
  13003. });
  13004. // determine whether or not we're currently in the position where a class method would appear
  13005. instance.extend("isClassMethod", function (inner) {
  13006. return function () {
  13007. return this.isRelational("<") || inner.call(this);
  13008. };
  13009. });
  13010. // determine whether or not we're currently in the position where a class property would appear
  13011. instance.extend("isClassProperty", function (inner) {
  13012. return function () {
  13013. return this.match(types.colon) || inner.call(this);
  13014. };
  13015. });
  13016. instance.extend("isNonstaticConstructor", function (inner) {
  13017. return function (method) {
  13018. return !this.match(types.colon) && inner.call(this, method);
  13019. };
  13020. });
  13021. // parse type parameters for class methods
  13022. instance.extend("parseClassMethod", function (inner) {
  13023. return function (classBody, method) {
  13024. if (method.variance) {
  13025. this.unexpected(method.variancePos);
  13026. }
  13027. delete method.variance;
  13028. delete method.variancePos;
  13029. if (this.isRelational("<")) {
  13030. method.typeParameters = this.flowParseTypeParameterDeclaration();
  13031. }
  13032. for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
  13033. args[_key2 - 2] = arguments[_key2];
  13034. }
  13035. inner.call.apply(inner, [this, classBody, method].concat(args));
  13036. };
  13037. });
  13038. // parse a the super class type parameters and implements
  13039. instance.extend("parseClassSuper", function (inner) {
  13040. return function (node, isStatement) {
  13041. inner.call(this, node, isStatement);
  13042. if (node.superClass && this.isRelational("<")) {
  13043. node.superTypeParameters = this.flowParseTypeParameterInstantiation();
  13044. }
  13045. if (this.isContextual("implements")) {
  13046. this.next();
  13047. var implemented = node.implements = [];
  13048. do {
  13049. var _node = this.startNode();
  13050. _node.id = this.parseIdentifier();
  13051. if (this.isRelational("<")) {
  13052. _node.typeParameters = this.flowParseTypeParameterInstantiation();
  13053. } else {
  13054. _node.typeParameters = null;
  13055. }
  13056. implemented.push(this.finishNode(_node, "ClassImplements"));
  13057. } while (this.eat(types.comma));
  13058. }
  13059. };
  13060. });
  13061. instance.extend("parsePropertyName", function (inner) {
  13062. return function (node) {
  13063. var variancePos = this.state.start;
  13064. var variance = this.flowParseVariance();
  13065. var key = inner.call(this, node);
  13066. node.variance = variance;
  13067. node.variancePos = variancePos;
  13068. return key;
  13069. };
  13070. });
  13071. // parse type parameters for object method shorthand
  13072. instance.extend("parseObjPropValue", function (inner) {
  13073. return function (prop) {
  13074. if (prop.variance) {
  13075. this.unexpected(prop.variancePos);
  13076. }
  13077. delete prop.variance;
  13078. delete prop.variancePos;
  13079. var typeParameters = void 0;
  13080. // method shorthand
  13081. if (this.isRelational("<")) {
  13082. typeParameters = this.flowParseTypeParameterDeclaration();
  13083. if (!this.match(types.parenL)) this.unexpected();
  13084. }
  13085. inner.apply(this, arguments);
  13086. // add typeParameters if we found them
  13087. if (typeParameters) {
  13088. (prop.value || prop).typeParameters = typeParameters;
  13089. }
  13090. };
  13091. });
  13092. instance.extend("parseAssignableListItemTypes", function () {
  13093. return function (param) {
  13094. if (this.eat(types.question)) {
  13095. param.optional = true;
  13096. }
  13097. if (this.match(types.colon)) {
  13098. param.typeAnnotation = this.flowParseTypeAnnotation();
  13099. }
  13100. this.finishNode(param, param.type);
  13101. return param;
  13102. };
  13103. });
  13104. instance.extend("parseMaybeDefault", function (inner) {
  13105. return function () {
  13106. for (var _len3 = arguments.length, args = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
  13107. args[_key3] = arguments[_key3];
  13108. }
  13109. var node = inner.apply(this, args);
  13110. if (node.type === "AssignmentPattern" && node.typeAnnotation && node.right.start < node.typeAnnotation.start) {
  13111. this.raise(node.typeAnnotation.start, "Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`");
  13112. }
  13113. return node;
  13114. };
  13115. });
  13116. // parse typeof and type imports
  13117. instance.extend("parseImportSpecifiers", function (inner) {
  13118. return function (node) {
  13119. node.importKind = "value";
  13120. var kind = null;
  13121. if (this.match(types._typeof)) {
  13122. kind = "typeof";
  13123. } else if (this.isContextual("type")) {
  13124. kind = "type";
  13125. }
  13126. if (kind) {
  13127. var lh = this.lookahead();
  13128. if (lh.type === types.name && lh.value !== "from" || lh.type === types.braceL || lh.type === types.star) {
  13129. this.next();
  13130. node.importKind = kind;
  13131. }
  13132. }
  13133. inner.call(this, node);
  13134. };
  13135. });
  13136. // parse import-type/typeof shorthand
  13137. instance.extend("parseImportSpecifier", function () {
  13138. return function (node) {
  13139. var specifier = this.startNode();
  13140. var firstIdentLoc = this.state.start;
  13141. var firstIdent = this.parseIdentifier(true);
  13142. var specifierTypeKind = null;
  13143. if (firstIdent.name === "type") {
  13144. specifierTypeKind = "type";
  13145. } else if (firstIdent.name === "typeof") {
  13146. specifierTypeKind = "typeof";
  13147. }
  13148. var isBinding = false;
  13149. if (this.isContextual("as")) {
  13150. var as_ident = this.parseIdentifier(true);
  13151. if (specifierTypeKind !== null && !this.match(types.name) && !this.state.type.keyword) {
  13152. // `import {type as ,` or `import {type as }`
  13153. specifier.imported = as_ident;
  13154. specifier.importKind = specifierTypeKind;
  13155. specifier.local = as_ident.__clone();
  13156. } else {
  13157. // `import {type as foo`
  13158. specifier.imported = firstIdent;
  13159. specifier.importKind = null;
  13160. specifier.local = this.parseIdentifier();
  13161. }
  13162. } else if (specifierTypeKind !== null && (this.match(types.name) || this.state.type.keyword)) {
  13163. // `import {type foo`
  13164. specifier.imported = this.parseIdentifier(true);
  13165. specifier.importKind = specifierTypeKind;
  13166. if (this.eatContextual("as")) {
  13167. specifier.local = this.parseIdentifier();
  13168. } else {
  13169. isBinding = true;
  13170. specifier.local = specifier.imported.__clone();
  13171. }
  13172. } else {
  13173. isBinding = true;
  13174. specifier.imported = firstIdent;
  13175. specifier.importKind = null;
  13176. specifier.local = specifier.imported.__clone();
  13177. }
  13178. if ((node.importKind === "type" || node.importKind === "typeof") && (specifier.importKind === "type" || specifier.importKind === "typeof")) {
  13179. this.raise(firstIdentLoc, "`The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements`");
  13180. }
  13181. if (isBinding) this.checkReservedWord(specifier.local.name, specifier.start, true, true);
  13182. this.checkLVal(specifier.local, true, undefined, "import specifier");
  13183. node.specifiers.push(this.finishNode(specifier, "ImportSpecifier"));
  13184. };
  13185. });
  13186. // parse function type parameters - function foo<T>() {}
  13187. instance.extend("parseFunctionParams", function (inner) {
  13188. return function (node) {
  13189. if (this.isRelational("<")) {
  13190. node.typeParameters = this.flowParseTypeParameterDeclaration();
  13191. }
  13192. inner.call(this, node);
  13193. };
  13194. });
  13195. // parse flow type annotations on variable declarator heads - let foo: string = bar
  13196. instance.extend("parseVarHead", function (inner) {
  13197. return function (decl) {
  13198. inner.call(this, decl);
  13199. if (this.match(types.colon)) {
  13200. decl.id.typeAnnotation = this.flowParseTypeAnnotation();
  13201. this.finishNode(decl.id, decl.id.type);
  13202. }
  13203. };
  13204. });
  13205. // parse the return type of an async arrow function - let foo = (async (): number => {});
  13206. instance.extend("parseAsyncArrowFromCallExpression", function (inner) {
  13207. return function (node, call) {
  13208. if (this.match(types.colon)) {
  13209. var oldNoAnonFunctionType = this.state.noAnonFunctionType;
  13210. this.state.noAnonFunctionType = true;
  13211. node.returnType = this.flowParseTypeAnnotation();
  13212. this.state.noAnonFunctionType = oldNoAnonFunctionType;
  13213. }
  13214. return inner.call(this, node, call);
  13215. };
  13216. });
  13217. // todo description
  13218. instance.extend("shouldParseAsyncArrow", function (inner) {
  13219. return function () {
  13220. return this.match(types.colon) || inner.call(this);
  13221. };
  13222. });
  13223. // We need to support type parameter declarations for arrow functions. This
  13224. // is tricky. There are three situations we need to handle
  13225. //
  13226. // 1. This is either JSX or an arrow function. We'll try JSX first. If that
  13227. // fails, we'll try an arrow function. If that fails, we'll throw the JSX
  13228. // error.
  13229. // 2. This is an arrow function. We'll parse the type parameter declaration,
  13230. // parse the rest, make sure the rest is an arrow function, and go from
  13231. // there
  13232. // 3. This is neither. Just call the inner function
  13233. instance.extend("parseMaybeAssign", function (inner) {
  13234. return function () {
  13235. var jsxError = null;
  13236. for (var _len4 = arguments.length, args = Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
  13237. args[_key4] = arguments[_key4];
  13238. }
  13239. if (types.jsxTagStart && this.match(types.jsxTagStart)) {
  13240. var state = this.state.clone();
  13241. try {
  13242. return inner.apply(this, args);
  13243. } catch (err) {
  13244. if (err instanceof SyntaxError) {
  13245. this.state = state;
  13246. // Remove `tc.j_expr` and `tc.j_oTag` from context added
  13247. // by parsing `jsxTagStart` to stop the JSX plugin from
  13248. // messing with the tokens
  13249. this.state.context.length -= 2;
  13250. jsxError = err;
  13251. } else {
  13252. // istanbul ignore next: no such error is expected
  13253. throw err;
  13254. }
  13255. }
  13256. }
  13257. if (jsxError != null || this.isRelational("<")) {
  13258. var arrowExpression = void 0;
  13259. var typeParameters = void 0;
  13260. try {
  13261. typeParameters = this.flowParseTypeParameterDeclaration();
  13262. arrowExpression = inner.apply(this, args);
  13263. arrowExpression.typeParameters = typeParameters;
  13264. arrowExpression.start = typeParameters.start;
  13265. arrowExpression.loc.start = typeParameters.loc.start;
  13266. } catch (err) {
  13267. throw jsxError || err;
  13268. }
  13269. if (arrowExpression.type === "ArrowFunctionExpression") {
  13270. return arrowExpression;
  13271. } else if (jsxError != null) {
  13272. throw jsxError;
  13273. } else {
  13274. this.raise(typeParameters.start, "Expected an arrow function after this type parameter declaration");
  13275. }
  13276. }
  13277. return inner.apply(this, args);
  13278. };
  13279. });
  13280. // handle return types for arrow functions
  13281. instance.extend("parseArrow", function (inner) {
  13282. return function (node) {
  13283. if (this.match(types.colon)) {
  13284. var state = this.state.clone();
  13285. try {
  13286. var oldNoAnonFunctionType = this.state.noAnonFunctionType;
  13287. this.state.noAnonFunctionType = true;
  13288. var returnType = this.flowParseTypeAndPredicateAnnotation();
  13289. this.state.noAnonFunctionType = oldNoAnonFunctionType;
  13290. if (this.canInsertSemicolon()) this.unexpected();
  13291. if (!this.match(types.arrow)) this.unexpected();
  13292. // assign after it is clear it is an arrow
  13293. node.returnType = returnType;
  13294. } catch (err) {
  13295. if (err instanceof SyntaxError) {
  13296. this.state = state;
  13297. } else {
  13298. // istanbul ignore next: no such error is expected
  13299. throw err;
  13300. }
  13301. }
  13302. }
  13303. return inner.call(this, node);
  13304. };
  13305. });
  13306. instance.extend("shouldParseArrow", function (inner) {
  13307. return function () {
  13308. return this.match(types.colon) || inner.call(this);
  13309. };
  13310. });
  13311. };
  13312. // Adapted from String.fromcodepoint to export the function without modifying String
  13313. /*! https://mths.be/fromcodepoint v0.2.1 by @mathias */
  13314. // The MIT License (MIT)
  13315. // Copyright (c) Mathias Bynens
  13316. //
  13317. // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
  13318. // associated documentation files (the "Software"), to deal in the Software without restriction,
  13319. // including without limitation the rights to use, copy, modify, merge, publish, distribute,
  13320. // sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
  13321. // furnished to do so, subject to the following conditions:
  13322. //
  13323. // The above copyright notice and this permission notice shall be included in all copies or
  13324. // substantial portions of the Software.
  13325. //
  13326. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
  13327. // NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  13328. // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  13329. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  13330. // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  13331. var fromCodePoint = String.fromCodePoint;
  13332. if (!fromCodePoint) {
  13333. var stringFromCharCode = String.fromCharCode;
  13334. var floor = Math.floor;
  13335. fromCodePoint = function fromCodePoint() {
  13336. var MAX_SIZE = 0x4000;
  13337. var codeUnits = [];
  13338. var highSurrogate = void 0;
  13339. var lowSurrogate = void 0;
  13340. var index = -1;
  13341. var length = arguments.length;
  13342. if (!length) {
  13343. return "";
  13344. }
  13345. var result = "";
  13346. while (++index < length) {
  13347. var codePoint = Number(arguments[index]);
  13348. if (!isFinite(codePoint) || // `NaN`, `+Infinity`, or `-Infinity`
  13349. codePoint < 0 || // not a valid Unicode code point
  13350. codePoint > 0x10FFFF || // not a valid Unicode code point
  13351. floor(codePoint) != codePoint // not an integer
  13352. ) {
  13353. throw RangeError("Invalid code point: " + codePoint);
  13354. }
  13355. if (codePoint <= 0xFFFF) {
  13356. // BMP code point
  13357. codeUnits.push(codePoint);
  13358. } else {
  13359. // Astral code point; split in surrogate halves
  13360. // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
  13361. codePoint -= 0x10000;
  13362. highSurrogate = (codePoint >> 10) + 0xD800;
  13363. lowSurrogate = codePoint % 0x400 + 0xDC00;
  13364. codeUnits.push(highSurrogate, lowSurrogate);
  13365. }
  13366. if (index + 1 == length || codeUnits.length > MAX_SIZE) {
  13367. result += stringFromCharCode.apply(null, codeUnits);
  13368. codeUnits.length = 0;
  13369. }
  13370. }
  13371. return result;
  13372. };
  13373. }
  13374. var fromCodePoint$1 = fromCodePoint;
  13375. var XHTMLEntities = {
  13376. quot: "\"",
  13377. amp: "&",
  13378. apos: "'",
  13379. lt: "<",
  13380. gt: ">",
  13381. nbsp: "\xA0",
  13382. iexcl: "\xA1",
  13383. cent: "\xA2",
  13384. pound: "\xA3",
  13385. curren: "\xA4",
  13386. yen: "\xA5",
  13387. brvbar: "\xA6",
  13388. sect: "\xA7",
  13389. uml: "\xA8",
  13390. copy: "\xA9",
  13391. ordf: "\xAA",
  13392. laquo: "\xAB",
  13393. not: "\xAC",
  13394. shy: "\xAD",
  13395. reg: "\xAE",
  13396. macr: "\xAF",
  13397. deg: "\xB0",
  13398. plusmn: "\xB1",
  13399. sup2: "\xB2",
  13400. sup3: "\xB3",
  13401. acute: "\xB4",
  13402. micro: "\xB5",
  13403. para: "\xB6",
  13404. middot: "\xB7",
  13405. cedil: "\xB8",
  13406. sup1: "\xB9",
  13407. ordm: "\xBA",
  13408. raquo: "\xBB",
  13409. frac14: "\xBC",
  13410. frac12: "\xBD",
  13411. frac34: "\xBE",
  13412. iquest: "\xBF",
  13413. Agrave: "\xC0",
  13414. Aacute: "\xC1",
  13415. Acirc: "\xC2",
  13416. Atilde: "\xC3",
  13417. Auml: "\xC4",
  13418. Aring: "\xC5",
  13419. AElig: "\xC6",
  13420. Ccedil: "\xC7",
  13421. Egrave: "\xC8",
  13422. Eacute: "\xC9",
  13423. Ecirc: "\xCA",
  13424. Euml: "\xCB",
  13425. Igrave: "\xCC",
  13426. Iacute: "\xCD",
  13427. Icirc: "\xCE",
  13428. Iuml: "\xCF",
  13429. ETH: "\xD0",
  13430. Ntilde: "\xD1",
  13431. Ograve: "\xD2",
  13432. Oacute: "\xD3",
  13433. Ocirc: "\xD4",
  13434. Otilde: "\xD5",
  13435. Ouml: "\xD6",
  13436. times: "\xD7",
  13437. Oslash: "\xD8",
  13438. Ugrave: "\xD9",
  13439. Uacute: "\xDA",
  13440. Ucirc: "\xDB",
  13441. Uuml: "\xDC",
  13442. Yacute: "\xDD",
  13443. THORN: "\xDE",
  13444. szlig: "\xDF",
  13445. agrave: "\xE0",
  13446. aacute: "\xE1",
  13447. acirc: "\xE2",
  13448. atilde: "\xE3",
  13449. auml: "\xE4",
  13450. aring: "\xE5",
  13451. aelig: "\xE6",
  13452. ccedil: "\xE7",
  13453. egrave: "\xE8",
  13454. eacute: "\xE9",
  13455. ecirc: "\xEA",
  13456. euml: "\xEB",
  13457. igrave: "\xEC",
  13458. iacute: "\xED",
  13459. icirc: "\xEE",
  13460. iuml: "\xEF",
  13461. eth: "\xF0",
  13462. ntilde: "\xF1",
  13463. ograve: "\xF2",
  13464. oacute: "\xF3",
  13465. ocirc: "\xF4",
  13466. otilde: "\xF5",
  13467. ouml: "\xF6",
  13468. divide: "\xF7",
  13469. oslash: "\xF8",
  13470. ugrave: "\xF9",
  13471. uacute: "\xFA",
  13472. ucirc: "\xFB",
  13473. uuml: "\xFC",
  13474. yacute: "\xFD",
  13475. thorn: "\xFE",
  13476. yuml: "\xFF",
  13477. OElig: '\u0152',
  13478. oelig: '\u0153',
  13479. Scaron: '\u0160',
  13480. scaron: '\u0161',
  13481. Yuml: '\u0178',
  13482. fnof: '\u0192',
  13483. circ: '\u02C6',
  13484. tilde: '\u02DC',
  13485. Alpha: '\u0391',
  13486. Beta: '\u0392',
  13487. Gamma: '\u0393',
  13488. Delta: '\u0394',
  13489. Epsilon: '\u0395',
  13490. Zeta: '\u0396',
  13491. Eta: '\u0397',
  13492. Theta: '\u0398',
  13493. Iota: '\u0399',
  13494. Kappa: '\u039A',
  13495. Lambda: '\u039B',
  13496. Mu: '\u039C',
  13497. Nu: '\u039D',
  13498. Xi: '\u039E',
  13499. Omicron: '\u039F',
  13500. Pi: '\u03A0',
  13501. Rho: '\u03A1',
  13502. Sigma: '\u03A3',
  13503. Tau: '\u03A4',
  13504. Upsilon: '\u03A5',
  13505. Phi: '\u03A6',
  13506. Chi: '\u03A7',
  13507. Psi: '\u03A8',
  13508. Omega: '\u03A9',
  13509. alpha: '\u03B1',
  13510. beta: '\u03B2',
  13511. gamma: '\u03B3',
  13512. delta: '\u03B4',
  13513. epsilon: '\u03B5',
  13514. zeta: '\u03B6',
  13515. eta: '\u03B7',
  13516. theta: '\u03B8',
  13517. iota: '\u03B9',
  13518. kappa: '\u03BA',
  13519. lambda: '\u03BB',
  13520. mu: '\u03BC',
  13521. nu: '\u03BD',
  13522. xi: '\u03BE',
  13523. omicron: '\u03BF',
  13524. pi: '\u03C0',
  13525. rho: '\u03C1',
  13526. sigmaf: '\u03C2',
  13527. sigma: '\u03C3',
  13528. tau: '\u03C4',
  13529. upsilon: '\u03C5',
  13530. phi: '\u03C6',
  13531. chi: '\u03C7',
  13532. psi: '\u03C8',
  13533. omega: '\u03C9',
  13534. thetasym: '\u03D1',
  13535. upsih: '\u03D2',
  13536. piv: '\u03D6',
  13537. ensp: '\u2002',
  13538. emsp: '\u2003',
  13539. thinsp: '\u2009',
  13540. zwnj: '\u200C',
  13541. zwj: '\u200D',
  13542. lrm: '\u200E',
  13543. rlm: '\u200F',
  13544. ndash: '\u2013',
  13545. mdash: '\u2014',
  13546. lsquo: '\u2018',
  13547. rsquo: '\u2019',
  13548. sbquo: '\u201A',
  13549. ldquo: '\u201C',
  13550. rdquo: '\u201D',
  13551. bdquo: '\u201E',
  13552. dagger: '\u2020',
  13553. Dagger: '\u2021',
  13554. bull: '\u2022',
  13555. hellip: '\u2026',
  13556. permil: '\u2030',
  13557. prime: '\u2032',
  13558. Prime: '\u2033',
  13559. lsaquo: '\u2039',
  13560. rsaquo: '\u203A',
  13561. oline: '\u203E',
  13562. frasl: '\u2044',
  13563. euro: '\u20AC',
  13564. image: '\u2111',
  13565. weierp: '\u2118',
  13566. real: '\u211C',
  13567. trade: '\u2122',
  13568. alefsym: '\u2135',
  13569. larr: '\u2190',
  13570. uarr: '\u2191',
  13571. rarr: '\u2192',
  13572. darr: '\u2193',
  13573. harr: '\u2194',
  13574. crarr: '\u21B5',
  13575. lArr: '\u21D0',
  13576. uArr: '\u21D1',
  13577. rArr: '\u21D2',
  13578. dArr: '\u21D3',
  13579. hArr: '\u21D4',
  13580. forall: '\u2200',
  13581. part: '\u2202',
  13582. exist: '\u2203',
  13583. empty: '\u2205',
  13584. nabla: '\u2207',
  13585. isin: '\u2208',
  13586. notin: '\u2209',
  13587. ni: '\u220B',
  13588. prod: '\u220F',
  13589. sum: '\u2211',
  13590. minus: '\u2212',
  13591. lowast: '\u2217',
  13592. radic: '\u221A',
  13593. prop: '\u221D',
  13594. infin: '\u221E',
  13595. ang: '\u2220',
  13596. and: '\u2227',
  13597. or: '\u2228',
  13598. cap: '\u2229',
  13599. cup: '\u222A',
  13600. "int": '\u222B',
  13601. there4: '\u2234',
  13602. sim: '\u223C',
  13603. cong: '\u2245',
  13604. asymp: '\u2248',
  13605. ne: '\u2260',
  13606. equiv: '\u2261',
  13607. le: '\u2264',
  13608. ge: '\u2265',
  13609. sub: '\u2282',
  13610. sup: '\u2283',
  13611. nsub: '\u2284',
  13612. sube: '\u2286',
  13613. supe: '\u2287',
  13614. oplus: '\u2295',
  13615. otimes: '\u2297',
  13616. perp: '\u22A5',
  13617. sdot: '\u22C5',
  13618. lceil: '\u2308',
  13619. rceil: '\u2309',
  13620. lfloor: '\u230A',
  13621. rfloor: '\u230B',
  13622. lang: '\u2329',
  13623. rang: '\u232A',
  13624. loz: '\u25CA',
  13625. spades: '\u2660',
  13626. clubs: '\u2663',
  13627. hearts: '\u2665',
  13628. diams: '\u2666'
  13629. };
  13630. var HEX_NUMBER = /^[\da-fA-F]+$/;
  13631. var DECIMAL_NUMBER = /^\d+$/;
  13632. types$1.j_oTag = new TokContext("<tag", false);
  13633. types$1.j_cTag = new TokContext("</tag", false);
  13634. types$1.j_expr = new TokContext("<tag>...</tag>", true, true);
  13635. types.jsxName = new TokenType("jsxName");
  13636. types.jsxText = new TokenType("jsxText", { beforeExpr: true });
  13637. types.jsxTagStart = new TokenType("jsxTagStart", { startsExpr: true });
  13638. types.jsxTagEnd = new TokenType("jsxTagEnd");
  13639. types.jsxTagStart.updateContext = function () {
  13640. this.state.context.push(types$1.j_expr); // treat as beginning of JSX expression
  13641. this.state.context.push(types$1.j_oTag); // start opening tag context
  13642. this.state.exprAllowed = false;
  13643. };
  13644. types.jsxTagEnd.updateContext = function (prevType) {
  13645. var out = this.state.context.pop();
  13646. if (out === types$1.j_oTag && prevType === types.slash || out === types$1.j_cTag) {
  13647. this.state.context.pop();
  13648. this.state.exprAllowed = this.curContext() === types$1.j_expr;
  13649. } else {
  13650. this.state.exprAllowed = true;
  13651. }
  13652. };
  13653. var pp$9 = Parser.prototype;
  13654. // Reads inline JSX contents token.
  13655. pp$9.jsxReadToken = function () {
  13656. var out = "";
  13657. var chunkStart = this.state.pos;
  13658. for (;;) {
  13659. if (this.state.pos >= this.input.length) {
  13660. this.raise(this.state.start, "Unterminated JSX contents");
  13661. }
  13662. var ch = this.input.charCodeAt(this.state.pos);
  13663. switch (ch) {
  13664. case 60: // "<"
  13665. case 123:
  13666. // "{"
  13667. if (this.state.pos === this.state.start) {
  13668. if (ch === 60 && this.state.exprAllowed) {
  13669. ++this.state.pos;
  13670. return this.finishToken(types.jsxTagStart);
  13671. }
  13672. return this.getTokenFromCode(ch);
  13673. }
  13674. out += this.input.slice(chunkStart, this.state.pos);
  13675. return this.finishToken(types.jsxText, out);
  13676. case 38:
  13677. // "&"
  13678. out += this.input.slice(chunkStart, this.state.pos);
  13679. out += this.jsxReadEntity();
  13680. chunkStart = this.state.pos;
  13681. break;
  13682. default:
  13683. if (isNewLine(ch)) {
  13684. out += this.input.slice(chunkStart, this.state.pos);
  13685. out += this.jsxReadNewLine(true);
  13686. chunkStart = this.state.pos;
  13687. } else {
  13688. ++this.state.pos;
  13689. }
  13690. }
  13691. }
  13692. };
  13693. pp$9.jsxReadNewLine = function (normalizeCRLF) {
  13694. var ch = this.input.charCodeAt(this.state.pos);
  13695. var out = void 0;
  13696. ++this.state.pos;
  13697. if (ch === 13 && this.input.charCodeAt(this.state.pos) === 10) {
  13698. ++this.state.pos;
  13699. out = normalizeCRLF ? "\n" : "\r\n";
  13700. } else {
  13701. out = String.fromCharCode(ch);
  13702. }
  13703. ++this.state.curLine;
  13704. this.state.lineStart = this.state.pos;
  13705. return out;
  13706. };
  13707. pp$9.jsxReadString = function (quote) {
  13708. var out = "";
  13709. var chunkStart = ++this.state.pos;
  13710. for (;;) {
  13711. if (this.state.pos >= this.input.length) {
  13712. this.raise(this.state.start, "Unterminated string constant");
  13713. }
  13714. var ch = this.input.charCodeAt(this.state.pos);
  13715. if (ch === quote) break;
  13716. if (ch === 38) {
  13717. // "&"
  13718. out += this.input.slice(chunkStart, this.state.pos);
  13719. out += this.jsxReadEntity();
  13720. chunkStart = this.state.pos;
  13721. } else if (isNewLine(ch)) {
  13722. out += this.input.slice(chunkStart, this.state.pos);
  13723. out += this.jsxReadNewLine(false);
  13724. chunkStart = this.state.pos;
  13725. } else {
  13726. ++this.state.pos;
  13727. }
  13728. }
  13729. out += this.input.slice(chunkStart, this.state.pos++);
  13730. return this.finishToken(types.string, out);
  13731. };
  13732. pp$9.jsxReadEntity = function () {
  13733. var str = "";
  13734. var count = 0;
  13735. var entity = void 0;
  13736. var ch = this.input[this.state.pos];
  13737. var startPos = ++this.state.pos;
  13738. while (this.state.pos < this.input.length && count++ < 10) {
  13739. ch = this.input[this.state.pos++];
  13740. if (ch === ";") {
  13741. if (str[0] === "#") {
  13742. if (str[1] === "x") {
  13743. str = str.substr(2);
  13744. if (HEX_NUMBER.test(str)) entity = fromCodePoint$1(parseInt(str, 16));
  13745. } else {
  13746. str = str.substr(1);
  13747. if (DECIMAL_NUMBER.test(str)) entity = fromCodePoint$1(parseInt(str, 10));
  13748. }
  13749. } else {
  13750. entity = XHTMLEntities[str];
  13751. }
  13752. break;
  13753. }
  13754. str += ch;
  13755. }
  13756. if (!entity) {
  13757. this.state.pos = startPos;
  13758. return "&";
  13759. }
  13760. return entity;
  13761. };
  13762. // Read a JSX identifier (valid tag or attribute name).
  13763. //
  13764. // Optimized version since JSX identifiers can"t contain
  13765. // escape characters and so can be read as single slice.
  13766. // Also assumes that first character was already checked
  13767. // by isIdentifierStart in readToken.
  13768. pp$9.jsxReadWord = function () {
  13769. var ch = void 0;
  13770. var start = this.state.pos;
  13771. do {
  13772. ch = this.input.charCodeAt(++this.state.pos);
  13773. } while (isIdentifierChar(ch) || ch === 45); // "-"
  13774. return this.finishToken(types.jsxName, this.input.slice(start, this.state.pos));
  13775. };
  13776. // Transforms JSX element name to string.
  13777. function getQualifiedJSXName(object) {
  13778. if (object.type === "JSXIdentifier") {
  13779. return object.name;
  13780. }
  13781. if (object.type === "JSXNamespacedName") {
  13782. return object.namespace.name + ":" + object.name.name;
  13783. }
  13784. if (object.type === "JSXMemberExpression") {
  13785. return getQualifiedJSXName(object.object) + "." + getQualifiedJSXName(object.property);
  13786. }
  13787. }
  13788. // Parse next token as JSX identifier
  13789. pp$9.jsxParseIdentifier = function () {
  13790. var node = this.startNode();
  13791. if (this.match(types.jsxName)) {
  13792. node.name = this.state.value;
  13793. } else if (this.state.type.keyword) {
  13794. node.name = this.state.type.keyword;
  13795. } else {
  13796. this.unexpected();
  13797. }
  13798. this.next();
  13799. return this.finishNode(node, "JSXIdentifier");
  13800. };
  13801. // Parse namespaced identifier.
  13802. pp$9.jsxParseNamespacedName = function () {
  13803. var startPos = this.state.start;
  13804. var startLoc = this.state.startLoc;
  13805. var name = this.jsxParseIdentifier();
  13806. if (!this.eat(types.colon)) return name;
  13807. var node = this.startNodeAt(startPos, startLoc);
  13808. node.namespace = name;
  13809. node.name = this.jsxParseIdentifier();
  13810. return this.finishNode(node, "JSXNamespacedName");
  13811. };
  13812. // Parses element name in any form - namespaced, member
  13813. // or single identifier.
  13814. pp$9.jsxParseElementName = function () {
  13815. var startPos = this.state.start;
  13816. var startLoc = this.state.startLoc;
  13817. var node = this.jsxParseNamespacedName();
  13818. while (this.eat(types.dot)) {
  13819. var newNode = this.startNodeAt(startPos, startLoc);
  13820. newNode.object = node;
  13821. newNode.property = this.jsxParseIdentifier();
  13822. node = this.finishNode(newNode, "JSXMemberExpression");
  13823. }
  13824. return node;
  13825. };
  13826. // Parses any type of JSX attribute value.
  13827. pp$9.jsxParseAttributeValue = function () {
  13828. var node = void 0;
  13829. switch (this.state.type) {
  13830. case types.braceL:
  13831. node = this.jsxParseExpressionContainer();
  13832. if (node.expression.type === "JSXEmptyExpression") {
  13833. this.raise(node.start, "JSX attributes must only be assigned a non-empty expression");
  13834. } else {
  13835. return node;
  13836. }
  13837. case types.jsxTagStart:
  13838. case types.string:
  13839. node = this.parseExprAtom();
  13840. node.extra = null;
  13841. return node;
  13842. default:
  13843. this.raise(this.state.start, "JSX value should be either an expression or a quoted JSX text");
  13844. }
  13845. };
  13846. // JSXEmptyExpression is unique type since it doesn't actually parse anything,
  13847. // and so it should start at the end of last read token (left brace) and finish
  13848. // at the beginning of the next one (right brace).
  13849. pp$9.jsxParseEmptyExpression = function () {
  13850. var node = this.startNodeAt(this.state.lastTokEnd, this.state.lastTokEndLoc);
  13851. return this.finishNodeAt(node, "JSXEmptyExpression", this.state.start, this.state.startLoc);
  13852. };
  13853. // Parse JSX spread child
  13854. pp$9.jsxParseSpreadChild = function () {
  13855. var node = this.startNode();
  13856. this.expect(types.braceL);
  13857. this.expect(types.ellipsis);
  13858. node.expression = this.parseExpression();
  13859. this.expect(types.braceR);
  13860. return this.finishNode(node, "JSXSpreadChild");
  13861. };
  13862. // Parses JSX expression enclosed into curly brackets.
  13863. pp$9.jsxParseExpressionContainer = function () {
  13864. var node = this.startNode();
  13865. this.next();
  13866. if (this.match(types.braceR)) {
  13867. node.expression = this.jsxParseEmptyExpression();
  13868. } else {
  13869. node.expression = this.parseExpression();
  13870. }
  13871. this.expect(types.braceR);
  13872. return this.finishNode(node, "JSXExpressionContainer");
  13873. };
  13874. // Parses following JSX attribute name-value pair.
  13875. pp$9.jsxParseAttribute = function () {
  13876. var node = this.startNode();
  13877. if (this.eat(types.braceL)) {
  13878. this.expect(types.ellipsis);
  13879. node.argument = this.parseMaybeAssign();
  13880. this.expect(types.braceR);
  13881. return this.finishNode(node, "JSXSpreadAttribute");
  13882. }
  13883. node.name = this.jsxParseNamespacedName();
  13884. node.value = this.eat(types.eq) ? this.jsxParseAttributeValue() : null;
  13885. return this.finishNode(node, "JSXAttribute");
  13886. };
  13887. // Parses JSX opening tag starting after "<".
  13888. pp$9.jsxParseOpeningElementAt = function (startPos, startLoc) {
  13889. var node = this.startNodeAt(startPos, startLoc);
  13890. node.attributes = [];
  13891. node.name = this.jsxParseElementName();
  13892. while (!this.match(types.slash) && !this.match(types.jsxTagEnd)) {
  13893. node.attributes.push(this.jsxParseAttribute());
  13894. }
  13895. node.selfClosing = this.eat(types.slash);
  13896. this.expect(types.jsxTagEnd);
  13897. return this.finishNode(node, "JSXOpeningElement");
  13898. };
  13899. // Parses JSX closing tag starting after "</".
  13900. pp$9.jsxParseClosingElementAt = function (startPos, startLoc) {
  13901. var node = this.startNodeAt(startPos, startLoc);
  13902. node.name = this.jsxParseElementName();
  13903. this.expect(types.jsxTagEnd);
  13904. return this.finishNode(node, "JSXClosingElement");
  13905. };
  13906. // Parses entire JSX element, including it"s opening tag
  13907. // (starting after "<"), attributes, contents and closing tag.
  13908. pp$9.jsxParseElementAt = function (startPos, startLoc) {
  13909. var node = this.startNodeAt(startPos, startLoc);
  13910. var children = [];
  13911. var openingElement = this.jsxParseOpeningElementAt(startPos, startLoc);
  13912. var closingElement = null;
  13913. if (!openingElement.selfClosing) {
  13914. contents: for (;;) {
  13915. switch (this.state.type) {
  13916. case types.jsxTagStart:
  13917. startPos = this.state.start;startLoc = this.state.startLoc;
  13918. this.next();
  13919. if (this.eat(types.slash)) {
  13920. closingElement = this.jsxParseClosingElementAt(startPos, startLoc);
  13921. break contents;
  13922. }
  13923. children.push(this.jsxParseElementAt(startPos, startLoc));
  13924. break;
  13925. case types.jsxText:
  13926. children.push(this.parseExprAtom());
  13927. break;
  13928. case types.braceL:
  13929. if (this.lookahead().type === types.ellipsis) {
  13930. children.push(this.jsxParseSpreadChild());
  13931. } else {
  13932. children.push(this.jsxParseExpressionContainer());
  13933. }
  13934. break;
  13935. // istanbul ignore next - should never happen
  13936. default:
  13937. this.unexpected();
  13938. }
  13939. }
  13940. if (getQualifiedJSXName(closingElement.name) !== getQualifiedJSXName(openingElement.name)) {
  13941. this.raise(closingElement.start, "Expected corresponding JSX closing tag for <" + getQualifiedJSXName(openingElement.name) + ">");
  13942. }
  13943. }
  13944. node.openingElement = openingElement;
  13945. node.closingElement = closingElement;
  13946. node.children = children;
  13947. if (this.match(types.relational) && this.state.value === "<") {
  13948. this.raise(this.state.start, "Adjacent JSX elements must be wrapped in an enclosing tag");
  13949. }
  13950. return this.finishNode(node, "JSXElement");
  13951. };
  13952. // Parses entire JSX element from current position.
  13953. pp$9.jsxParseElement = function () {
  13954. var startPos = this.state.start;
  13955. var startLoc = this.state.startLoc;
  13956. this.next();
  13957. return this.jsxParseElementAt(startPos, startLoc);
  13958. };
  13959. var jsxPlugin = function jsxPlugin(instance) {
  13960. instance.extend("parseExprAtom", function (inner) {
  13961. return function (refShortHandDefaultPos) {
  13962. if (this.match(types.jsxText)) {
  13963. var node = this.parseLiteral(this.state.value, "JSXText");
  13964. // https://github.com/babel/babel/issues/2078
  13965. node.extra = null;
  13966. return node;
  13967. } else if (this.match(types.jsxTagStart)) {
  13968. return this.jsxParseElement();
  13969. } else {
  13970. return inner.call(this, refShortHandDefaultPos);
  13971. }
  13972. };
  13973. });
  13974. instance.extend("readToken", function (inner) {
  13975. return function (code) {
  13976. if (this.state.inPropertyName) return inner.call(this, code);
  13977. var context = this.curContext();
  13978. if (context === types$1.j_expr) {
  13979. return this.jsxReadToken();
  13980. }
  13981. if (context === types$1.j_oTag || context === types$1.j_cTag) {
  13982. if (isIdentifierStart(code)) {
  13983. return this.jsxReadWord();
  13984. }
  13985. if (code === 62) {
  13986. ++this.state.pos;
  13987. return this.finishToken(types.jsxTagEnd);
  13988. }
  13989. if ((code === 34 || code === 39) && context === types$1.j_oTag) {
  13990. return this.jsxReadString(code);
  13991. }
  13992. }
  13993. if (code === 60 && this.state.exprAllowed) {
  13994. ++this.state.pos;
  13995. return this.finishToken(types.jsxTagStart);
  13996. }
  13997. return inner.call(this, code);
  13998. };
  13999. });
  14000. instance.extend("updateContext", function (inner) {
  14001. return function (prevType) {
  14002. if (this.match(types.braceL)) {
  14003. var curContext = this.curContext();
  14004. if (curContext === types$1.j_oTag) {
  14005. this.state.context.push(types$1.braceExpression);
  14006. } else if (curContext === types$1.j_expr) {
  14007. this.state.context.push(types$1.templateQuasi);
  14008. } else {
  14009. inner.call(this, prevType);
  14010. }
  14011. this.state.exprAllowed = true;
  14012. } else if (this.match(types.slash) && prevType === types.jsxTagStart) {
  14013. this.state.context.length -= 2; // do not consider JSX expr -> JSX open tag -> ... anymore
  14014. this.state.context.push(types$1.j_cTag); // reconsider as closing tag context
  14015. this.state.exprAllowed = false;
  14016. } else {
  14017. return inner.call(this, prevType);
  14018. }
  14019. };
  14020. });
  14021. };
  14022. plugins.estree = estreePlugin;
  14023. plugins.flow = flowPlugin;
  14024. plugins.jsx = jsxPlugin;
  14025. function parse(input, options) {
  14026. return new Parser(options, input).parse();
  14027. }
  14028. function parseExpression(input, options) {
  14029. var parser = new Parser(options, input);
  14030. if (parser.options.strictMode) {
  14031. parser.state.strict = true;
  14032. }
  14033. return parser.getExpression();
  14034. }
  14035. exports.parse = parse;
  14036. exports.parseExpression = parseExpression;
  14037. exports.tokTypes = types;
  14038. /***/ }),
  14039. /* 90 */
  14040. /***/ (function(module, exports, __webpack_require__) {
  14041. 'use strict';
  14042. // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
  14043. var anObject = __webpack_require__(21);
  14044. var dPs = __webpack_require__(431);
  14045. var enumBugKeys = __webpack_require__(141);
  14046. var IE_PROTO = __webpack_require__(150)('IE_PROTO');
  14047. var Empty = function Empty() {/* empty */};
  14048. var PROTOTYPE = 'prototype';
  14049. // Create object with fake `null` prototype: use iframe Object with cleared prototype
  14050. var _createDict = function createDict() {
  14051. // Thrash, waste and sodomy: IE GC bug
  14052. var iframe = __webpack_require__(230)('iframe');
  14053. var i = enumBugKeys.length;
  14054. var lt = '<';
  14055. var gt = '>';
  14056. var iframeDocument;
  14057. iframe.style.display = 'none';
  14058. __webpack_require__(426).appendChild(iframe);
  14059. iframe.src = 'javascript:'; // eslint-disable-line no-script-url
  14060. // createDict = iframe.contentWindow.Object;
  14061. // html.removeChild(iframe);
  14062. iframeDocument = iframe.contentWindow.document;
  14063. iframeDocument.open();
  14064. iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
  14065. iframeDocument.close();
  14066. _createDict = iframeDocument.F;
  14067. while (i--) {
  14068. delete _createDict[PROTOTYPE][enumBugKeys[i]];
  14069. }return _createDict();
  14070. };
  14071. module.exports = Object.create || function create(O, Properties) {
  14072. var result;
  14073. if (O !== null) {
  14074. Empty[PROTOTYPE] = anObject(O);
  14075. result = new Empty();
  14076. Empty[PROTOTYPE] = null;
  14077. // add "__proto__" for Object.getPrototypeOf polyfill
  14078. result[IE_PROTO] = O;
  14079. } else result = _createDict();
  14080. return Properties === undefined ? result : dPs(result, Properties);
  14081. };
  14082. /***/ }),
  14083. /* 91 */
  14084. /***/ (function(module, exports) {
  14085. "use strict";
  14086. exports.f = {}.propertyIsEnumerable;
  14087. /***/ }),
  14088. /* 92 */
  14089. /***/ (function(module, exports) {
  14090. "use strict";
  14091. module.exports = function (bitmap, value) {
  14092. return {
  14093. enumerable: !(bitmap & 1),
  14094. configurable: !(bitmap & 2),
  14095. writable: !(bitmap & 4),
  14096. value: value
  14097. };
  14098. };
  14099. /***/ }),
  14100. /* 93 */
  14101. /***/ (function(module, exports, __webpack_require__) {
  14102. 'use strict';
  14103. var def = __webpack_require__(23).f;
  14104. var has = __webpack_require__(28);
  14105. var TAG = __webpack_require__(13)('toStringTag');
  14106. module.exports = function (it, tag, stat) {
  14107. if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });
  14108. };
  14109. /***/ }),
  14110. /* 94 */
  14111. /***/ (function(module, exports, __webpack_require__) {
  14112. 'use strict';
  14113. // 7.1.13 ToObject(argument)
  14114. var defined = __webpack_require__(140);
  14115. module.exports = function (it) {
  14116. return Object(defined(it));
  14117. };
  14118. /***/ }),
  14119. /* 95 */
  14120. /***/ (function(module, exports) {
  14121. 'use strict';
  14122. var id = 0;
  14123. var px = Math.random();
  14124. module.exports = function (key) {
  14125. return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
  14126. };
  14127. /***/ }),
  14128. /* 96 */
  14129. /***/ (function(module, exports) {
  14130. "use strict";
  14131. /***/ }),
  14132. /* 97 */
  14133. /***/ (function(module, exports, __webpack_require__) {
  14134. 'use strict';
  14135. /*
  14136. Copyright (C) 2013 Yusuke Suzuki <utatane.tea@gmail.com>
  14137. Redistribution and use in source and binary forms, with or without
  14138. modification, are permitted provided that the following conditions are met:
  14139. * Redistributions of source code must retain the above copyright
  14140. notice, this list of conditions and the following disclaimer.
  14141. * Redistributions in binary form must reproduce the above copyright
  14142. notice, this list of conditions and the following disclaimer in the
  14143. documentation and/or other materials provided with the distribution.
  14144. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  14145. AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  14146. IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  14147. ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
  14148. DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  14149. (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  14150. LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  14151. ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  14152. (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  14153. THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  14154. */
  14155. (function () {
  14156. 'use strict';
  14157. exports.ast = __webpack_require__(461);
  14158. exports.code = __webpack_require__(240);
  14159. exports.keyword = __webpack_require__(462);
  14160. })();
  14161. /* vim: set sw=4 ts=4 et tw=80 : */
  14162. /***/ }),
  14163. /* 98 */
  14164. /***/ (function(module, exports, __webpack_require__) {
  14165. 'use strict';
  14166. var listCacheClear = __webpack_require__(546),
  14167. listCacheDelete = __webpack_require__(547),
  14168. listCacheGet = __webpack_require__(548),
  14169. listCacheHas = __webpack_require__(549),
  14170. listCacheSet = __webpack_require__(550);
  14171. /**
  14172. * Creates an list cache object.
  14173. *
  14174. * @private
  14175. * @constructor
  14176. * @param {Array} [entries] The key-value pairs to cache.
  14177. */
  14178. function ListCache(entries) {
  14179. var index = -1,
  14180. length = entries == null ? 0 : entries.length;
  14181. this.clear();
  14182. while (++index < length) {
  14183. var entry = entries[index];
  14184. this.set(entry[0], entry[1]);
  14185. }
  14186. }
  14187. // Add methods to `ListCache`.
  14188. ListCache.prototype.clear = listCacheClear;
  14189. ListCache.prototype['delete'] = listCacheDelete;
  14190. ListCache.prototype.get = listCacheGet;
  14191. ListCache.prototype.has = listCacheHas;
  14192. ListCache.prototype.set = listCacheSet;
  14193. module.exports = ListCache;
  14194. /***/ }),
  14195. /* 99 */
  14196. /***/ (function(module, exports, __webpack_require__) {
  14197. 'use strict';
  14198. var ListCache = __webpack_require__(98),
  14199. stackClear = __webpack_require__(565),
  14200. stackDelete = __webpack_require__(566),
  14201. stackGet = __webpack_require__(567),
  14202. stackHas = __webpack_require__(568),
  14203. stackSet = __webpack_require__(569);
  14204. /**
  14205. * Creates a stack cache object to store key-value pairs.
  14206. *
  14207. * @private
  14208. * @constructor
  14209. * @param {Array} [entries] The key-value pairs to cache.
  14210. */
  14211. function Stack(entries) {
  14212. var data = this.__data__ = new ListCache(entries);
  14213. this.size = data.size;
  14214. }
  14215. // Add methods to `Stack`.
  14216. Stack.prototype.clear = stackClear;
  14217. Stack.prototype['delete'] = stackDelete;
  14218. Stack.prototype.get = stackGet;
  14219. Stack.prototype.has = stackHas;
  14220. Stack.prototype.set = stackSet;
  14221. module.exports = Stack;
  14222. /***/ }),
  14223. /* 100 */
  14224. /***/ (function(module, exports, __webpack_require__) {
  14225. 'use strict';
  14226. var eq = __webpack_require__(46);
  14227. /**
  14228. * Gets the index at which the `key` is found in `array` of key-value pairs.
  14229. *
  14230. * @private
  14231. * @param {Array} array The array to inspect.
  14232. * @param {*} key The key to search for.
  14233. * @returns {number} Returns the index of the matched value, else `-1`.
  14234. */
  14235. function assocIndexOf(array, key) {
  14236. var length = array.length;
  14237. while (length--) {
  14238. if (eq(array[length][0], key)) {
  14239. return length;
  14240. }
  14241. }
  14242. return -1;
  14243. }
  14244. module.exports = assocIndexOf;
  14245. /***/ }),
  14246. /* 101 */
  14247. /***/ (function(module, exports, __webpack_require__) {
  14248. 'use strict';
  14249. var identity = __webpack_require__(110),
  14250. overRest = __webpack_require__(560),
  14251. setToString = __webpack_require__(563);
  14252. /**
  14253. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  14254. *
  14255. * @private
  14256. * @param {Function} func The function to apply a rest parameter to.
  14257. * @param {number} [start=func.length-1] The start position of the rest parameter.
  14258. * @returns {Function} Returns the new function.
  14259. */
  14260. function baseRest(func, start) {
  14261. return setToString(overRest(func, start, identity), func + '');
  14262. }
  14263. module.exports = baseRest;
  14264. /***/ }),
  14265. /* 102 */
  14266. /***/ (function(module, exports) {
  14267. "use strict";
  14268. /**
  14269. * The base implementation of `_.unary` without support for storing metadata.
  14270. *
  14271. * @private
  14272. * @param {Function} func The function to cap arguments for.
  14273. * @returns {Function} Returns the new capped function.
  14274. */
  14275. function baseUnary(func) {
  14276. return function (value) {
  14277. return func(value);
  14278. };
  14279. }
  14280. module.exports = baseUnary;
  14281. /***/ }),
  14282. /* 103 */
  14283. /***/ (function(module, exports, __webpack_require__) {
  14284. 'use strict';
  14285. var baseRest = __webpack_require__(101),
  14286. isIterateeCall = __webpack_require__(172);
  14287. /**
  14288. * Creates a function like `_.assign`.
  14289. *
  14290. * @private
  14291. * @param {Function} assigner The function to assign values.
  14292. * @returns {Function} Returns the new assigner function.
  14293. */
  14294. function createAssigner(assigner) {
  14295. return baseRest(function (object, sources) {
  14296. var index = -1,
  14297. length = sources.length,
  14298. customizer = length > 1 ? sources[length - 1] : undefined,
  14299. guard = length > 2 ? sources[2] : undefined;
  14300. customizer = assigner.length > 3 && typeof customizer == 'function' ? (length--, customizer) : undefined;
  14301. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  14302. customizer = length < 3 ? undefined : customizer;
  14303. length = 1;
  14304. }
  14305. object = Object(object);
  14306. while (++index < length) {
  14307. var source = sources[index];
  14308. if (source) {
  14309. assigner(object, source, index, customizer);
  14310. }
  14311. }
  14312. return object;
  14313. });
  14314. }
  14315. module.exports = createAssigner;
  14316. /***/ }),
  14317. /* 104 */
  14318. /***/ (function(module, exports, __webpack_require__) {
  14319. 'use strict';
  14320. var isKeyable = __webpack_require__(544);
  14321. /**
  14322. * Gets the data for `map`.
  14323. *
  14324. * @private
  14325. * @param {Object} map The map to query.
  14326. * @param {string} key The reference key.
  14327. * @returns {*} Returns the map data.
  14328. */
  14329. function getMapData(map, key) {
  14330. var data = map.__data__;
  14331. return isKeyable(key) ? data[typeof key == 'string' ? 'string' : 'hash'] : data.map;
  14332. }
  14333. module.exports = getMapData;
  14334. /***/ }),
  14335. /* 105 */
  14336. /***/ (function(module, exports) {
  14337. 'use strict';
  14338. /** Used for built-in method references. */
  14339. var objectProto = Object.prototype;
  14340. /**
  14341. * Checks if `value` is likely a prototype object.
  14342. *
  14343. * @private
  14344. * @param {*} value The value to check.
  14345. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  14346. */
  14347. function isPrototype(value) {
  14348. var Ctor = value && value.constructor,
  14349. proto = typeof Ctor == 'function' && Ctor.prototype || objectProto;
  14350. return value === proto;
  14351. }
  14352. module.exports = isPrototype;
  14353. /***/ }),
  14354. /* 106 */
  14355. /***/ (function(module, exports, __webpack_require__) {
  14356. 'use strict';
  14357. var getNative = __webpack_require__(38);
  14358. /* Built-in method references that are verified to be native. */
  14359. var nativeCreate = getNative(Object, 'create');
  14360. module.exports = nativeCreate;
  14361. /***/ }),
  14362. /* 107 */
  14363. /***/ (function(module, exports) {
  14364. "use strict";
  14365. /**
  14366. * Converts `set` to an array of its values.
  14367. *
  14368. * @private
  14369. * @param {Object} set The set to convert.
  14370. * @returns {Array} Returns the values.
  14371. */
  14372. function setToArray(set) {
  14373. var index = -1,
  14374. result = Array(set.size);
  14375. set.forEach(function (value) {
  14376. result[++index] = value;
  14377. });
  14378. return result;
  14379. }
  14380. module.exports = setToArray;
  14381. /***/ }),
  14382. /* 108 */
  14383. /***/ (function(module, exports, __webpack_require__) {
  14384. 'use strict';
  14385. var isSymbol = __webpack_require__(62);
  14386. /** Used as references for various `Number` constants. */
  14387. var INFINITY = 1 / 0;
  14388. /**
  14389. * Converts `value` to a string key if it's not a string or symbol.
  14390. *
  14391. * @private
  14392. * @param {*} value The value to inspect.
  14393. * @returns {string|symbol} Returns the key.
  14394. */
  14395. function toKey(value) {
  14396. if (typeof value == 'string' || isSymbol(value)) {
  14397. return value;
  14398. }
  14399. var result = value + '';
  14400. return result == '0' && 1 / value == -INFINITY ? '-0' : result;
  14401. }
  14402. module.exports = toKey;
  14403. /***/ }),
  14404. /* 109 */
  14405. /***/ (function(module, exports, __webpack_require__) {
  14406. 'use strict';
  14407. var baseClone = __webpack_require__(164);
  14408. /** Used to compose bitmasks for cloning. */
  14409. var CLONE_SYMBOLS_FLAG = 4;
  14410. /**
  14411. * Creates a shallow clone of `value`.
  14412. *
  14413. * **Note:** This method is loosely based on the
  14414. * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
  14415. * and supports cloning arrays, array buffers, booleans, date objects, maps,
  14416. * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
  14417. * arrays. The own enumerable properties of `arguments` objects are cloned
  14418. * as plain objects. An empty object is returned for uncloneable values such
  14419. * as error objects, functions, DOM nodes, and WeakMaps.
  14420. *
  14421. * @static
  14422. * @memberOf _
  14423. * @since 0.1.0
  14424. * @category Lang
  14425. * @param {*} value The value to clone.
  14426. * @returns {*} Returns the cloned value.
  14427. * @see _.cloneDeep
  14428. * @example
  14429. *
  14430. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  14431. *
  14432. * var shallow = _.clone(objects);
  14433. * console.log(shallow[0] === objects[0]);
  14434. * // => true
  14435. */
  14436. function clone(value) {
  14437. return baseClone(value, CLONE_SYMBOLS_FLAG);
  14438. }
  14439. module.exports = clone;
  14440. /***/ }),
  14441. /* 110 */
  14442. /***/ (function(module, exports) {
  14443. "use strict";
  14444. /**
  14445. * This method returns the first argument it receives.
  14446. *
  14447. * @static
  14448. * @since 0.1.0
  14449. * @memberOf _
  14450. * @category Util
  14451. * @param {*} value Any value.
  14452. * @returns {*} Returns `value`.
  14453. * @example
  14454. *
  14455. * var object = { 'a': 1 };
  14456. *
  14457. * console.log(_.identity(object) === object);
  14458. * // => true
  14459. */
  14460. function identity(value) {
  14461. return value;
  14462. }
  14463. module.exports = identity;
  14464. /***/ }),
  14465. /* 111 */
  14466. /***/ (function(module, exports, __webpack_require__) {
  14467. 'use strict';
  14468. var baseIndexOf = __webpack_require__(166),
  14469. isArrayLike = __webpack_require__(24),
  14470. isString = __webpack_require__(587),
  14471. toInteger = __webpack_require__(48),
  14472. values = __webpack_require__(280);
  14473. /* Built-in method references for those with the same name as other `lodash` methods. */
  14474. var nativeMax = Math.max;
  14475. /**
  14476. * Checks if `value` is in `collection`. If `collection` is a string, it's
  14477. * checked for a substring of `value`, otherwise
  14478. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  14479. * is used for equality comparisons. If `fromIndex` is negative, it's used as
  14480. * the offset from the end of `collection`.
  14481. *
  14482. * @static
  14483. * @memberOf _
  14484. * @since 0.1.0
  14485. * @category Collection
  14486. * @param {Array|Object|string} collection The collection to inspect.
  14487. * @param {*} value The value to search for.
  14488. * @param {number} [fromIndex=0] The index to search from.
  14489. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  14490. * @returns {boolean} Returns `true` if `value` is found, else `false`.
  14491. * @example
  14492. *
  14493. * _.includes([1, 2, 3], 1);
  14494. * // => true
  14495. *
  14496. * _.includes([1, 2, 3], 1, 2);
  14497. * // => false
  14498. *
  14499. * _.includes({ 'a': 1, 'b': 2 }, 1);
  14500. * // => true
  14501. *
  14502. * _.includes('abcd', 'bc');
  14503. * // => true
  14504. */
  14505. function includes(collection, value, fromIndex, guard) {
  14506. collection = isArrayLike(collection) ? collection : values(collection);
  14507. fromIndex = fromIndex && !guard ? toInteger(fromIndex) : 0;
  14508. var length = collection.length;
  14509. if (fromIndex < 0) {
  14510. fromIndex = nativeMax(length + fromIndex, 0);
  14511. }
  14512. return isString(collection) ? fromIndex <= length && collection.indexOf(value, fromIndex) > -1 : !!length && baseIndexOf(collection, value, fromIndex) > -1;
  14513. }
  14514. module.exports = includes;
  14515. /***/ }),
  14516. /* 112 */
  14517. /***/ (function(module, exports, __webpack_require__) {
  14518. 'use strict';
  14519. var baseIsArguments = __webpack_require__(493),
  14520. isObjectLike = __webpack_require__(25);
  14521. /** Used for built-in method references. */
  14522. var objectProto = Object.prototype;
  14523. /** Used to check objects for own properties. */
  14524. var hasOwnProperty = objectProto.hasOwnProperty;
  14525. /** Built-in value references. */
  14526. var propertyIsEnumerable = objectProto.propertyIsEnumerable;
  14527. /**
  14528. * Checks if `value` is likely an `arguments` object.
  14529. *
  14530. * @static
  14531. * @memberOf _
  14532. * @since 0.1.0
  14533. * @category Lang
  14534. * @param {*} value The value to check.
  14535. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  14536. * else `false`.
  14537. * @example
  14538. *
  14539. * _.isArguments(function() { return arguments; }());
  14540. * // => true
  14541. *
  14542. * _.isArguments([1, 2, 3]);
  14543. * // => false
  14544. */
  14545. var isArguments = baseIsArguments(function () {
  14546. return arguments;
  14547. }()) ? baseIsArguments : function (value) {
  14548. return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee');
  14549. };
  14550. module.exports = isArguments;
  14551. /***/ }),
  14552. /* 113 */
  14553. /***/ (function(module, exports, __webpack_require__) {
  14554. /* WEBPACK VAR INJECTION */(function(module) {'use strict';
  14555. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  14556. var root = __webpack_require__(17),
  14557. stubFalse = __webpack_require__(596);
  14558. /** Detect free variable `exports`. */
  14559. var freeExports = ( false ? 'undefined' : _typeof(exports)) == 'object' && exports && !exports.nodeType && exports;
  14560. /** Detect free variable `module`. */
  14561. var freeModule = freeExports && ( false ? 'undefined' : _typeof(module)) == 'object' && module && !module.nodeType && module;
  14562. /** Detect the popular CommonJS extension `module.exports`. */
  14563. var moduleExports = freeModule && freeModule.exports === freeExports;
  14564. /** Built-in value references. */
  14565. var Buffer = moduleExports ? root.Buffer : undefined;
  14566. /* Built-in method references for those with the same name as other `lodash` methods. */
  14567. var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
  14568. /**
  14569. * Checks if `value` is a buffer.
  14570. *
  14571. * @static
  14572. * @memberOf _
  14573. * @since 4.3.0
  14574. * @category Lang
  14575. * @param {*} value The value to check.
  14576. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  14577. * @example
  14578. *
  14579. * _.isBuffer(new Buffer(2));
  14580. * // => true
  14581. *
  14582. * _.isBuffer(new Uint8Array(2));
  14583. * // => false
  14584. */
  14585. var isBuffer = nativeIsBuffer || stubFalse;
  14586. module.exports = isBuffer;
  14587. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(39)(module)))
  14588. /***/ }),
  14589. /* 114 */
  14590. /***/ (function(module, exports, __webpack_require__) {
  14591. 'use strict';
  14592. var baseToString = __webpack_require__(253);
  14593. /**
  14594. * Converts `value` to a string. An empty string is returned for `null`
  14595. * and `undefined` values. The sign of `-0` is preserved.
  14596. *
  14597. * @static
  14598. * @memberOf _
  14599. * @since 4.0.0
  14600. * @category Lang
  14601. * @param {*} value The value to convert.
  14602. * @returns {string} Returns the converted string.
  14603. * @example
  14604. *
  14605. * _.toString(null);
  14606. * // => ''
  14607. *
  14608. * _.toString(-0);
  14609. * // => '-0'
  14610. *
  14611. * _.toString([1, 2, 3]);
  14612. * // => '1,2,3'
  14613. */
  14614. function toString(value) {
  14615. return value == null ? '' : baseToString(value);
  14616. }
  14617. module.exports = toString;
  14618. /***/ }),
  14619. /* 115 */
  14620. 96,
  14621. /* 116 */
  14622. /***/ (function(module, exports, __webpack_require__) {
  14623. "use strict";
  14624. exports.__esModule = true;
  14625. exports.runtimeProperty = runtimeProperty;
  14626. exports.isReference = isReference;
  14627. exports.replaceWithOrRemove = replaceWithOrRemove;
  14628. var _babelTypes = __webpack_require__(1);
  14629. var t = _interopRequireWildcard(_babelTypes);
  14630. function _interopRequireWildcard(obj) {
  14631. if (obj && obj.__esModule) {
  14632. return obj;
  14633. } else {
  14634. var newObj = {};if (obj != null) {
  14635. for (var key in obj) {
  14636. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  14637. }
  14638. }newObj.default = obj;return newObj;
  14639. }
  14640. }
  14641. function runtimeProperty(name) {
  14642. return t.memberExpression(t.identifier("regeneratorRuntime"), t.identifier(name), false);
  14643. } /**
  14644. * Copyright (c) 2014, Facebook, Inc.
  14645. * All rights reserved.
  14646. *
  14647. * This source code is licensed under the BSD-style license found in the
  14648. * https://raw.github.com/facebook/regenerator/master/LICENSE file. An
  14649. * additional grant of patent rights can be found in the PATENTS file in
  14650. * the same directory.
  14651. */
  14652. function isReference(path) {
  14653. return path.isReferenced() || path.parentPath.isAssignmentExpression({ left: path.node });
  14654. }
  14655. function replaceWithOrRemove(path, replacement) {
  14656. if (replacement) {
  14657. path.replaceWith(replacement);
  14658. } else {
  14659. path.remove();
  14660. }
  14661. }
  14662. /***/ }),
  14663. /* 117 */
  14664. /***/ (function(module, exports, __webpack_require__) {
  14665. /* WEBPACK VAR INJECTION */(function(global, process) {'use strict';
  14666. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  14667. // Copyright Joyent, Inc. and other Node contributors.
  14668. //
  14669. // Permission is hereby granted, free of charge, to any person obtaining a
  14670. // copy of this software and associated documentation files (the
  14671. // "Software"), to deal in the Software without restriction, including
  14672. // without limitation the rights to use, copy, modify, merge, publish,
  14673. // distribute, sublicense, and/or sell copies of the Software, and to permit
  14674. // persons to whom the Software is furnished to do so, subject to the
  14675. // following conditions:
  14676. //
  14677. // The above copyright notice and this permission notice shall be included
  14678. // in all copies or substantial portions of the Software.
  14679. //
  14680. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  14681. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  14682. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  14683. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  14684. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  14685. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  14686. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  14687. var formatRegExp = /%[sdj%]/g;
  14688. exports.format = function (f) {
  14689. if (!isString(f)) {
  14690. var objects = [];
  14691. for (var i = 0; i < arguments.length; i++) {
  14692. objects.push(inspect(arguments[i]));
  14693. }
  14694. return objects.join(' ');
  14695. }
  14696. var i = 1;
  14697. var args = arguments;
  14698. var len = args.length;
  14699. var str = String(f).replace(formatRegExp, function (x) {
  14700. if (x === '%%') return '%';
  14701. if (i >= len) return x;
  14702. switch (x) {
  14703. case '%s':
  14704. return String(args[i++]);
  14705. case '%d':
  14706. return Number(args[i++]);
  14707. case '%j':
  14708. try {
  14709. return JSON.stringify(args[i++]);
  14710. } catch (_) {
  14711. return '[Circular]';
  14712. }
  14713. default:
  14714. return x;
  14715. }
  14716. });
  14717. for (var x = args[i]; i < len; x = args[++i]) {
  14718. if (isNull(x) || !isObject(x)) {
  14719. str += ' ' + x;
  14720. } else {
  14721. str += ' ' + inspect(x);
  14722. }
  14723. }
  14724. return str;
  14725. };
  14726. // Mark that a method should not be used.
  14727. // Returns a modified function which warns once by default.
  14728. // If --no-deprecation is set, then it is a no-op.
  14729. exports.deprecate = function (fn, msg) {
  14730. // Allow for deprecating things in the process of starting up.
  14731. if (isUndefined(global.process)) {
  14732. return function () {
  14733. return exports.deprecate(fn, msg).apply(this, arguments);
  14734. };
  14735. }
  14736. if (process.noDeprecation === true) {
  14737. return fn;
  14738. }
  14739. var warned = false;
  14740. function deprecated() {
  14741. if (!warned) {
  14742. if (process.throwDeprecation) {
  14743. throw new Error(msg);
  14744. } else if (process.traceDeprecation) {
  14745. console.trace(msg);
  14746. } else {
  14747. console.error(msg);
  14748. }
  14749. warned = true;
  14750. }
  14751. return fn.apply(this, arguments);
  14752. }
  14753. return deprecated;
  14754. };
  14755. var debugs = {};
  14756. var debugEnviron;
  14757. exports.debuglog = function (set) {
  14758. if (isUndefined(debugEnviron)) debugEnviron = process.env.NODE_DEBUG || '';
  14759. set = set.toUpperCase();
  14760. if (!debugs[set]) {
  14761. if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) {
  14762. var pid = process.pid;
  14763. debugs[set] = function () {
  14764. var msg = exports.format.apply(exports, arguments);
  14765. console.error('%s %d: %s', set, pid, msg);
  14766. };
  14767. } else {
  14768. debugs[set] = function () {};
  14769. }
  14770. }
  14771. return debugs[set];
  14772. };
  14773. /**
  14774. * Echos the value of a value. Trys to print the value out
  14775. * in the best way possible given the different types.
  14776. *
  14777. * @param {Object} obj The object to print out.
  14778. * @param {Object} opts Optional options object that alters the output.
  14779. */
  14780. /* legacy: obj, showHidden, depth, colors*/
  14781. function inspect(obj, opts) {
  14782. // default options
  14783. var ctx = {
  14784. seen: [],
  14785. stylize: stylizeNoColor
  14786. };
  14787. // legacy...
  14788. if (arguments.length >= 3) ctx.depth = arguments[2];
  14789. if (arguments.length >= 4) ctx.colors = arguments[3];
  14790. if (isBoolean(opts)) {
  14791. // legacy...
  14792. ctx.showHidden = opts;
  14793. } else if (opts) {
  14794. // got an "options" object
  14795. exports._extend(ctx, opts);
  14796. }
  14797. // set default options
  14798. if (isUndefined(ctx.showHidden)) ctx.showHidden = false;
  14799. if (isUndefined(ctx.depth)) ctx.depth = 2;
  14800. if (isUndefined(ctx.colors)) ctx.colors = false;
  14801. if (isUndefined(ctx.customInspect)) ctx.customInspect = true;
  14802. if (ctx.colors) ctx.stylize = stylizeWithColor;
  14803. return formatValue(ctx, obj, ctx.depth);
  14804. }
  14805. exports.inspect = inspect;
  14806. // http://en.wikipedia.org/wiki/ANSI_escape_code#graphics
  14807. inspect.colors = {
  14808. 'bold': [1, 22],
  14809. 'italic': [3, 23],
  14810. 'underline': [4, 24],
  14811. 'inverse': [7, 27],
  14812. 'white': [37, 39],
  14813. 'grey': [90, 39],
  14814. 'black': [30, 39],
  14815. 'blue': [34, 39],
  14816. 'cyan': [36, 39],
  14817. 'green': [32, 39],
  14818. 'magenta': [35, 39],
  14819. 'red': [31, 39],
  14820. 'yellow': [33, 39]
  14821. };
  14822. // Don't use 'blue' not visible on cmd.exe
  14823. inspect.styles = {
  14824. 'special': 'cyan',
  14825. 'number': 'yellow',
  14826. 'boolean': 'yellow',
  14827. 'undefined': 'grey',
  14828. 'null': 'bold',
  14829. 'string': 'green',
  14830. 'date': 'magenta',
  14831. // "name": intentionally not styling
  14832. 'regexp': 'red'
  14833. };
  14834. function stylizeWithColor(str, styleType) {
  14835. var style = inspect.styles[styleType];
  14836. if (style) {
  14837. return '\x1B[' + inspect.colors[style][0] + 'm' + str + '\x1B[' + inspect.colors[style][1] + 'm';
  14838. } else {
  14839. return str;
  14840. }
  14841. }
  14842. function stylizeNoColor(str, styleType) {
  14843. return str;
  14844. }
  14845. function arrayToHash(array) {
  14846. var hash = {};
  14847. array.forEach(function (val, idx) {
  14848. hash[val] = true;
  14849. });
  14850. return hash;
  14851. }
  14852. function formatValue(ctx, value, recurseTimes) {
  14853. // Provide a hook for user-specified inspect functions.
  14854. // Check that value is an object with an inspect function on it
  14855. if (ctx.customInspect && value && isFunction(value.inspect) &&
  14856. // Filter out the util module, it's inspect function is special
  14857. value.inspect !== exports.inspect &&
  14858. // Also filter out any prototype objects using the circular check.
  14859. !(value.constructor && value.constructor.prototype === value)) {
  14860. var ret = value.inspect(recurseTimes, ctx);
  14861. if (!isString(ret)) {
  14862. ret = formatValue(ctx, ret, recurseTimes);
  14863. }
  14864. return ret;
  14865. }
  14866. // Primitive types cannot have properties
  14867. var primitive = formatPrimitive(ctx, value);
  14868. if (primitive) {
  14869. return primitive;
  14870. }
  14871. // Look up the keys of the object.
  14872. var keys = Object.keys(value);
  14873. var visibleKeys = arrayToHash(keys);
  14874. if (ctx.showHidden) {
  14875. keys = Object.getOwnPropertyNames(value);
  14876. }
  14877. // IE doesn't make error fields non-enumerable
  14878. // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx
  14879. if (isError(value) && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {
  14880. return formatError(value);
  14881. }
  14882. // Some type of object without properties can be shortcutted.
  14883. if (keys.length === 0) {
  14884. if (isFunction(value)) {
  14885. var name = value.name ? ': ' + value.name : '';
  14886. return ctx.stylize('[Function' + name + ']', 'special');
  14887. }
  14888. if (isRegExp(value)) {
  14889. return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
  14890. }
  14891. if (isDate(value)) {
  14892. return ctx.stylize(Date.prototype.toString.call(value), 'date');
  14893. }
  14894. if (isError(value)) {
  14895. return formatError(value);
  14896. }
  14897. }
  14898. var base = '',
  14899. array = false,
  14900. braces = ['{', '}'];
  14901. // Make Array say that they are Array
  14902. if (isArray(value)) {
  14903. array = true;
  14904. braces = ['[', ']'];
  14905. }
  14906. // Make functions say that they are functions
  14907. if (isFunction(value)) {
  14908. var n = value.name ? ': ' + value.name : '';
  14909. base = ' [Function' + n + ']';
  14910. }
  14911. // Make RegExps say that they are RegExps
  14912. if (isRegExp(value)) {
  14913. base = ' ' + RegExp.prototype.toString.call(value);
  14914. }
  14915. // Make dates with properties first say the date
  14916. if (isDate(value)) {
  14917. base = ' ' + Date.prototype.toUTCString.call(value);
  14918. }
  14919. // Make error with message first say the error
  14920. if (isError(value)) {
  14921. base = ' ' + formatError(value);
  14922. }
  14923. if (keys.length === 0 && (!array || value.length == 0)) {
  14924. return braces[0] + base + braces[1];
  14925. }
  14926. if (recurseTimes < 0) {
  14927. if (isRegExp(value)) {
  14928. return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
  14929. } else {
  14930. return ctx.stylize('[Object]', 'special');
  14931. }
  14932. }
  14933. ctx.seen.push(value);
  14934. var output;
  14935. if (array) {
  14936. output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);
  14937. } else {
  14938. output = keys.map(function (key) {
  14939. return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);
  14940. });
  14941. }
  14942. ctx.seen.pop();
  14943. return reduceToSingleString(output, base, braces);
  14944. }
  14945. function formatPrimitive(ctx, value) {
  14946. if (isUndefined(value)) return ctx.stylize('undefined', 'undefined');
  14947. if (isString(value)) {
  14948. var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '').replace(/'/g, "\\'").replace(/\\"/g, '"') + '\'';
  14949. return ctx.stylize(simple, 'string');
  14950. }
  14951. if (isNumber(value)) return ctx.stylize('' + value, 'number');
  14952. if (isBoolean(value)) return ctx.stylize('' + value, 'boolean');
  14953. // For some reason typeof null is "object", so special case here.
  14954. if (isNull(value)) return ctx.stylize('null', 'null');
  14955. }
  14956. function formatError(value) {
  14957. return '[' + Error.prototype.toString.call(value) + ']';
  14958. }
  14959. function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
  14960. var output = [];
  14961. for (var i = 0, l = value.length; i < l; ++i) {
  14962. if (hasOwnProperty(value, String(i))) {
  14963. output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, String(i), true));
  14964. } else {
  14965. output.push('');
  14966. }
  14967. }
  14968. keys.forEach(function (key) {
  14969. if (!key.match(/^\d+$/)) {
  14970. output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, key, true));
  14971. }
  14972. });
  14973. return output;
  14974. }
  14975. function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
  14976. var name, str, desc;
  14977. desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };
  14978. if (desc.get) {
  14979. if (desc.set) {
  14980. str = ctx.stylize('[Getter/Setter]', 'special');
  14981. } else {
  14982. str = ctx.stylize('[Getter]', 'special');
  14983. }
  14984. } else {
  14985. if (desc.set) {
  14986. str = ctx.stylize('[Setter]', 'special');
  14987. }
  14988. }
  14989. if (!hasOwnProperty(visibleKeys, key)) {
  14990. name = '[' + key + ']';
  14991. }
  14992. if (!str) {
  14993. if (ctx.seen.indexOf(desc.value) < 0) {
  14994. if (isNull(recurseTimes)) {
  14995. str = formatValue(ctx, desc.value, null);
  14996. } else {
  14997. str = formatValue(ctx, desc.value, recurseTimes - 1);
  14998. }
  14999. if (str.indexOf('\n') > -1) {
  15000. if (array) {
  15001. str = str.split('\n').map(function (line) {
  15002. return ' ' + line;
  15003. }).join('\n').substr(2);
  15004. } else {
  15005. str = '\n' + str.split('\n').map(function (line) {
  15006. return ' ' + line;
  15007. }).join('\n');
  15008. }
  15009. }
  15010. } else {
  15011. str = ctx.stylize('[Circular]', 'special');
  15012. }
  15013. }
  15014. if (isUndefined(name)) {
  15015. if (array && key.match(/^\d+$/)) {
  15016. return str;
  15017. }
  15018. name = JSON.stringify('' + key);
  15019. if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
  15020. name = name.substr(1, name.length - 2);
  15021. name = ctx.stylize(name, 'name');
  15022. } else {
  15023. name = name.replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'");
  15024. name = ctx.stylize(name, 'string');
  15025. }
  15026. }
  15027. return name + ': ' + str;
  15028. }
  15029. function reduceToSingleString(output, base, braces) {
  15030. var numLinesEst = 0;
  15031. var length = output.reduce(function (prev, cur) {
  15032. numLinesEst++;
  15033. if (cur.indexOf('\n') >= 0) numLinesEst++;
  15034. return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1;
  15035. }, 0);
  15036. if (length > 60) {
  15037. return braces[0] + (base === '' ? '' : base + '\n ') + ' ' + output.join(',\n ') + ' ' + braces[1];
  15038. }
  15039. return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];
  15040. }
  15041. // NOTE: These type checking functions intentionally don't use `instanceof`
  15042. // because it is fragile and can be easily faked with `Object.create()`.
  15043. function isArray(ar) {
  15044. return Array.isArray(ar);
  15045. }
  15046. exports.isArray = isArray;
  15047. function isBoolean(arg) {
  15048. return typeof arg === 'boolean';
  15049. }
  15050. exports.isBoolean = isBoolean;
  15051. function isNull(arg) {
  15052. return arg === null;
  15053. }
  15054. exports.isNull = isNull;
  15055. function isNullOrUndefined(arg) {
  15056. return arg == null;
  15057. }
  15058. exports.isNullOrUndefined = isNullOrUndefined;
  15059. function isNumber(arg) {
  15060. return typeof arg === 'number';
  15061. }
  15062. exports.isNumber = isNumber;
  15063. function isString(arg) {
  15064. return typeof arg === 'string';
  15065. }
  15066. exports.isString = isString;
  15067. function isSymbol(arg) {
  15068. return (typeof arg === 'undefined' ? 'undefined' : _typeof(arg)) === 'symbol';
  15069. }
  15070. exports.isSymbol = isSymbol;
  15071. function isUndefined(arg) {
  15072. return arg === void 0;
  15073. }
  15074. exports.isUndefined = isUndefined;
  15075. function isRegExp(re) {
  15076. return isObject(re) && objectToString(re) === '[object RegExp]';
  15077. }
  15078. exports.isRegExp = isRegExp;
  15079. function isObject(arg) {
  15080. return (typeof arg === 'undefined' ? 'undefined' : _typeof(arg)) === 'object' && arg !== null;
  15081. }
  15082. exports.isObject = isObject;
  15083. function isDate(d) {
  15084. return isObject(d) && objectToString(d) === '[object Date]';
  15085. }
  15086. exports.isDate = isDate;
  15087. function isError(e) {
  15088. return isObject(e) && (objectToString(e) === '[object Error]' || e instanceof Error);
  15089. }
  15090. exports.isError = isError;
  15091. function isFunction(arg) {
  15092. return typeof arg === 'function';
  15093. }
  15094. exports.isFunction = isFunction;
  15095. function isPrimitive(arg) {
  15096. return arg === null || typeof arg === 'boolean' || typeof arg === 'number' || typeof arg === 'string' || (typeof arg === 'undefined' ? 'undefined' : _typeof(arg)) === 'symbol' || // ES6 symbol
  15097. typeof arg === 'undefined';
  15098. }
  15099. exports.isPrimitive = isPrimitive;
  15100. exports.isBuffer = __webpack_require__(627);
  15101. function objectToString(o) {
  15102. return Object.prototype.toString.call(o);
  15103. }
  15104. function pad(n) {
  15105. return n < 10 ? '0' + n.toString(10) : n.toString(10);
  15106. }
  15107. var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
  15108. // 26 Feb 16:19:34
  15109. function timestamp() {
  15110. var d = new Date();
  15111. var time = [pad(d.getHours()), pad(d.getMinutes()), pad(d.getSeconds())].join(':');
  15112. return [d.getDate(), months[d.getMonth()], time].join(' ');
  15113. }
  15114. // log is just a thin wrapper to console.log that prepends a timestamp
  15115. exports.log = function () {
  15116. console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));
  15117. };
  15118. /**
  15119. * Inherit the prototype methods from one constructor into another.
  15120. *
  15121. * The Function.prototype.inherits from lang.js rewritten as a standalone
  15122. * function (not on Function.prototype). NOTE: If this file is to be loaded
  15123. * during bootstrapping this function needs to be rewritten using some native
  15124. * functions as prototype setup using normal JavaScript does not work as
  15125. * expected during bootstrapping (see mirror.js in r114903).
  15126. *
  15127. * @param {function} ctor Constructor function which needs to inherit the
  15128. * prototype.
  15129. * @param {function} superCtor Constructor function to inherit prototype from.
  15130. */
  15131. exports.inherits = __webpack_require__(626);
  15132. exports._extend = function (origin, add) {
  15133. // Don't do anything if add isn't an object
  15134. if (!add || !isObject(add)) return origin;
  15135. var keys = Object.keys(add);
  15136. var i = keys.length;
  15137. while (i--) {
  15138. origin[keys[i]] = add[keys[i]];
  15139. }
  15140. return origin;
  15141. };
  15142. function hasOwnProperty(obj, prop) {
  15143. return Object.prototype.hasOwnProperty.call(obj, prop);
  15144. }
  15145. /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()), __webpack_require__(8)))
  15146. /***/ }),
  15147. /* 118 */
  15148. /***/ (function(module, exports, __webpack_require__) {
  15149. /* WEBPACK VAR INJECTION */(function(process) {"use strict";
  15150. exports.__esModule = true;
  15151. var _typeof2 = __webpack_require__(11);
  15152. var _typeof3 = _interopRequireDefault(_typeof2);
  15153. exports.default = function (loc) {
  15154. var relative = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : process.cwd();
  15155. if ((typeof _module2.default === "undefined" ? "undefined" : (0, _typeof3.default)(_module2.default)) === "object") return null;
  15156. var relativeMod = relativeModules[relative];
  15157. if (!relativeMod) {
  15158. relativeMod = new _module2.default();
  15159. var filename = _path2.default.join(relative, ".babelrc");
  15160. relativeMod.id = filename;
  15161. relativeMod.filename = filename;
  15162. relativeMod.paths = _module2.default._nodeModulePaths(relative);
  15163. relativeModules[relative] = relativeMod;
  15164. }
  15165. try {
  15166. return _module2.default._resolveFilename(loc, relativeMod);
  15167. } catch (err) {
  15168. return null;
  15169. }
  15170. };
  15171. var _module = __webpack_require__(115);
  15172. var _module2 = _interopRequireDefault(_module);
  15173. var _path = __webpack_require__(19);
  15174. var _path2 = _interopRequireDefault(_path);
  15175. function _interopRequireDefault(obj) {
  15176. return obj && obj.__esModule ? obj : { default: obj };
  15177. }
  15178. var relativeModules = {};
  15179. module.exports = exports["default"];
  15180. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(8)))
  15181. /***/ }),
  15182. /* 119 */
  15183. /***/ (function(module, exports, __webpack_require__) {
  15184. "use strict";
  15185. exports.__esModule = true;
  15186. var _map = __webpack_require__(133);
  15187. var _map2 = _interopRequireDefault(_map);
  15188. var _classCallCheck2 = __webpack_require__(3);
  15189. var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
  15190. var _possibleConstructorReturn2 = __webpack_require__(42);
  15191. var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
  15192. var _inherits2 = __webpack_require__(41);
  15193. var _inherits3 = _interopRequireDefault(_inherits2);
  15194. function _interopRequireDefault(obj) {
  15195. return obj && obj.__esModule ? obj : { default: obj };
  15196. }
  15197. var Store = function (_Map) {
  15198. (0, _inherits3.default)(Store, _Map);
  15199. function Store() {
  15200. (0, _classCallCheck3.default)(this, Store);
  15201. var _this = (0, _possibleConstructorReturn3.default)(this, _Map.call(this));
  15202. _this.dynamicData = {};
  15203. return _this;
  15204. }
  15205. Store.prototype.setDynamic = function setDynamic(key, fn) {
  15206. this.dynamicData[key] = fn;
  15207. };
  15208. Store.prototype.get = function get(key) {
  15209. if (this.has(key)) {
  15210. return _Map.prototype.get.call(this, key);
  15211. } else {
  15212. if (Object.prototype.hasOwnProperty.call(this.dynamicData, key)) {
  15213. var val = this.dynamicData[key]();
  15214. this.set(key, val);
  15215. return val;
  15216. }
  15217. }
  15218. };
  15219. return Store;
  15220. }(_map2.default);
  15221. exports.default = Store;
  15222. module.exports = exports["default"];
  15223. /***/ }),
  15224. /* 120 */
  15225. /***/ (function(module, exports, __webpack_require__) {
  15226. "use strict";
  15227. exports.__esModule = true;
  15228. var _classCallCheck2 = __webpack_require__(3);
  15229. var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
  15230. var _node = __webpack_require__(239);
  15231. var _node2 = _interopRequireDefault(_node);
  15232. function _interopRequireDefault(obj) {
  15233. return obj && obj.__esModule ? obj : { default: obj };
  15234. }
  15235. var verboseDebug = (0, _node2.default)("babel:verbose");
  15236. var generalDebug = (0, _node2.default)("babel");
  15237. var seenDeprecatedMessages = [];
  15238. var Logger = function () {
  15239. function Logger(file, filename) {
  15240. (0, _classCallCheck3.default)(this, Logger);
  15241. this.filename = filename;
  15242. this.file = file;
  15243. }
  15244. Logger.prototype._buildMessage = function _buildMessage(msg) {
  15245. var parts = "[BABEL] " + this.filename;
  15246. if (msg) parts += ": " + msg;
  15247. return parts;
  15248. };
  15249. Logger.prototype.warn = function warn(msg) {
  15250. console.warn(this._buildMessage(msg));
  15251. };
  15252. Logger.prototype.error = function error(msg) {
  15253. var Constructor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Error;
  15254. throw new Constructor(this._buildMessage(msg));
  15255. };
  15256. Logger.prototype.deprecate = function deprecate(msg) {
  15257. if (this.file.opts && this.file.opts.suppressDeprecationMessages) return;
  15258. msg = this._buildMessage(msg);
  15259. if (seenDeprecatedMessages.indexOf(msg) >= 0) return;
  15260. seenDeprecatedMessages.push(msg);
  15261. console.error(msg);
  15262. };
  15263. Logger.prototype.verbose = function verbose(msg) {
  15264. if (verboseDebug.enabled) verboseDebug(this._buildMessage(msg));
  15265. };
  15266. Logger.prototype.debug = function debug(msg) {
  15267. if (generalDebug.enabled) generalDebug(this._buildMessage(msg));
  15268. };
  15269. Logger.prototype.deopt = function deopt(node, msg) {
  15270. this.debug(msg);
  15271. };
  15272. return Logger;
  15273. }();
  15274. exports.default = Logger;
  15275. module.exports = exports["default"];
  15276. /***/ }),
  15277. /* 121 */
  15278. /***/ (function(module, exports, __webpack_require__) {
  15279. "use strict";
  15280. exports.__esModule = true;
  15281. exports.ImportDeclaration = exports.ModuleDeclaration = undefined;
  15282. var _getIterator2 = __webpack_require__(2);
  15283. var _getIterator3 = _interopRequireDefault(_getIterator2);
  15284. exports.ExportDeclaration = ExportDeclaration;
  15285. exports.Scope = Scope;
  15286. var _babelTypes = __webpack_require__(1);
  15287. var t = _interopRequireWildcard(_babelTypes);
  15288. function _interopRequireWildcard(obj) {
  15289. if (obj && obj.__esModule) {
  15290. return obj;
  15291. } else {
  15292. var newObj = {};if (obj != null) {
  15293. for (var key in obj) {
  15294. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  15295. }
  15296. }newObj.default = obj;return newObj;
  15297. }
  15298. }
  15299. function _interopRequireDefault(obj) {
  15300. return obj && obj.__esModule ? obj : { default: obj };
  15301. }
  15302. var ModuleDeclaration = exports.ModuleDeclaration = {
  15303. enter: function enter(path, file) {
  15304. var node = path.node;
  15305. if (node.source) {
  15306. node.source.value = file.resolveModuleSource(node.source.value);
  15307. }
  15308. }
  15309. };
  15310. var ImportDeclaration = exports.ImportDeclaration = {
  15311. exit: function exit(path, file) {
  15312. var node = path.node;
  15313. var specifiers = [];
  15314. var imported = [];
  15315. file.metadata.modules.imports.push({
  15316. source: node.source.value,
  15317. imported: imported,
  15318. specifiers: specifiers
  15319. });
  15320. for (var _iterator = path.get("specifiers"), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
  15321. var _ref;
  15322. if (_isArray) {
  15323. if (_i >= _iterator.length) break;
  15324. _ref = _iterator[_i++];
  15325. } else {
  15326. _i = _iterator.next();
  15327. if (_i.done) break;
  15328. _ref = _i.value;
  15329. }
  15330. var specifier = _ref;
  15331. var local = specifier.node.local.name;
  15332. if (specifier.isImportDefaultSpecifier()) {
  15333. imported.push("default");
  15334. specifiers.push({
  15335. kind: "named",
  15336. imported: "default",
  15337. local: local
  15338. });
  15339. }
  15340. if (specifier.isImportSpecifier()) {
  15341. var importedName = specifier.node.imported.name;
  15342. imported.push(importedName);
  15343. specifiers.push({
  15344. kind: "named",
  15345. imported: importedName,
  15346. local: local
  15347. });
  15348. }
  15349. if (specifier.isImportNamespaceSpecifier()) {
  15350. imported.push("*");
  15351. specifiers.push({
  15352. kind: "namespace",
  15353. local: local
  15354. });
  15355. }
  15356. }
  15357. }
  15358. };
  15359. function ExportDeclaration(path, file) {
  15360. var node = path.node;
  15361. var source = node.source ? node.source.value : null;
  15362. var exports = file.metadata.modules.exports;
  15363. var declar = path.get("declaration");
  15364. if (declar.isStatement()) {
  15365. var bindings = declar.getBindingIdentifiers();
  15366. for (var name in bindings) {
  15367. exports.exported.push(name);
  15368. exports.specifiers.push({
  15369. kind: "local",
  15370. local: name,
  15371. exported: path.isExportDefaultDeclaration() ? "default" : name
  15372. });
  15373. }
  15374. }
  15375. if (path.isExportNamedDeclaration() && node.specifiers) {
  15376. for (var _iterator2 = node.specifiers, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) {
  15377. var _ref2;
  15378. if (_isArray2) {
  15379. if (_i2 >= _iterator2.length) break;
  15380. _ref2 = _iterator2[_i2++];
  15381. } else {
  15382. _i2 = _iterator2.next();
  15383. if (_i2.done) break;
  15384. _ref2 = _i2.value;
  15385. }
  15386. var specifier = _ref2;
  15387. var exported = specifier.exported.name;
  15388. exports.exported.push(exported);
  15389. if (t.isExportDefaultSpecifier(specifier)) {
  15390. exports.specifiers.push({
  15391. kind: "external",
  15392. local: exported,
  15393. exported: exported,
  15394. source: source
  15395. });
  15396. }
  15397. if (t.isExportNamespaceSpecifier(specifier)) {
  15398. exports.specifiers.push({
  15399. kind: "external-namespace",
  15400. exported: exported,
  15401. source: source
  15402. });
  15403. }
  15404. var local = specifier.local;
  15405. if (!local) continue;
  15406. if (source) {
  15407. exports.specifiers.push({
  15408. kind: "external",
  15409. local: local.name,
  15410. exported: exported,
  15411. source: source
  15412. });
  15413. }
  15414. if (!source) {
  15415. exports.specifiers.push({
  15416. kind: "local",
  15417. local: local.name,
  15418. exported: exported
  15419. });
  15420. }
  15421. }
  15422. }
  15423. if (path.isExportAllDeclaration()) {
  15424. exports.specifiers.push({
  15425. kind: "external-all",
  15426. source: source
  15427. });
  15428. }
  15429. }
  15430. function Scope(path) {
  15431. path.skip();
  15432. }
  15433. /***/ }),
  15434. /* 122 */
  15435. /***/ (function(module, exports, __webpack_require__) {
  15436. "use strict";
  15437. exports.__esModule = true;
  15438. exports.inspect = exports.inherits = undefined;
  15439. var _getIterator2 = __webpack_require__(2);
  15440. var _getIterator3 = _interopRequireDefault(_getIterator2);
  15441. var _util = __webpack_require__(117);
  15442. Object.defineProperty(exports, "inherits", {
  15443. enumerable: true,
  15444. get: function get() {
  15445. return _util.inherits;
  15446. }
  15447. });
  15448. Object.defineProperty(exports, "inspect", {
  15449. enumerable: true,
  15450. get: function get() {
  15451. return _util.inspect;
  15452. }
  15453. });
  15454. exports.canCompile = canCompile;
  15455. exports.list = list;
  15456. exports.regexify = regexify;
  15457. exports.arrayify = arrayify;
  15458. exports.booleanify = booleanify;
  15459. exports.shouldIgnore = shouldIgnore;
  15460. var _escapeRegExp = __webpack_require__(577);
  15461. var _escapeRegExp2 = _interopRequireDefault(_escapeRegExp);
  15462. var _startsWith = __webpack_require__(595);
  15463. var _startsWith2 = _interopRequireDefault(_startsWith);
  15464. var _minimatch = __webpack_require__(601);
  15465. var _minimatch2 = _interopRequireDefault(_minimatch);
  15466. var _includes = __webpack_require__(111);
  15467. var _includes2 = _interopRequireDefault(_includes);
  15468. var _isRegExp = __webpack_require__(276);
  15469. var _isRegExp2 = _interopRequireDefault(_isRegExp);
  15470. var _path = __webpack_require__(19);
  15471. var _path2 = _interopRequireDefault(_path);
  15472. var _slash = __webpack_require__(284);
  15473. var _slash2 = _interopRequireDefault(_slash);
  15474. function _interopRequireDefault(obj) {
  15475. return obj && obj.__esModule ? obj : { default: obj };
  15476. }
  15477. function canCompile(filename, altExts) {
  15478. var exts = altExts || canCompile.EXTENSIONS;
  15479. var ext = _path2.default.extname(filename);
  15480. return (0, _includes2.default)(exts, ext);
  15481. }
  15482. canCompile.EXTENSIONS = [".js", ".jsx", ".es6", ".es"];
  15483. function list(val) {
  15484. if (!val) {
  15485. return [];
  15486. } else if (Array.isArray(val)) {
  15487. return val;
  15488. } else if (typeof val === "string") {
  15489. return val.split(",");
  15490. } else {
  15491. return [val];
  15492. }
  15493. }
  15494. function regexify(val) {
  15495. if (!val) {
  15496. return new RegExp(/.^/);
  15497. }
  15498. if (Array.isArray(val)) {
  15499. val = new RegExp(val.map(_escapeRegExp2.default).join("|"), "i");
  15500. }
  15501. if (typeof val === "string") {
  15502. val = (0, _slash2.default)(val);
  15503. if ((0, _startsWith2.default)(val, "./") || (0, _startsWith2.default)(val, "*/")) val = val.slice(2);
  15504. if ((0, _startsWith2.default)(val, "**/")) val = val.slice(3);
  15505. var regex = _minimatch2.default.makeRe(val, { nocase: true });
  15506. return new RegExp(regex.source.slice(1, -1), "i");
  15507. }
  15508. if ((0, _isRegExp2.default)(val)) {
  15509. return val;
  15510. }
  15511. throw new TypeError("illegal type for regexify");
  15512. }
  15513. function arrayify(val, mapFn) {
  15514. if (!val) return [];
  15515. if (typeof val === "boolean") return arrayify([val], mapFn);
  15516. if (typeof val === "string") return arrayify(list(val), mapFn);
  15517. if (Array.isArray(val)) {
  15518. if (mapFn) val = val.map(mapFn);
  15519. return val;
  15520. }
  15521. return [val];
  15522. }
  15523. function booleanify(val) {
  15524. if (val === "true" || val == 1) {
  15525. return true;
  15526. }
  15527. if (val === "false" || val == 0 || !val) {
  15528. return false;
  15529. }
  15530. return val;
  15531. }
  15532. function shouldIgnore(filename) {
  15533. var ignore = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  15534. var only = arguments[2];
  15535. filename = filename.replace(/\\/g, "/");
  15536. if (only) {
  15537. for (var _iterator = only, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
  15538. var _ref;
  15539. if (_isArray) {
  15540. if (_i >= _iterator.length) break;
  15541. _ref = _iterator[_i++];
  15542. } else {
  15543. _i = _iterator.next();
  15544. if (_i.done) break;
  15545. _ref = _i.value;
  15546. }
  15547. var pattern = _ref;
  15548. if (_shouldIgnore(pattern, filename)) return false;
  15549. }
  15550. return true;
  15551. } else if (ignore.length) {
  15552. for (var _iterator2 = ignore, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) {
  15553. var _ref2;
  15554. if (_isArray2) {
  15555. if (_i2 >= _iterator2.length) break;
  15556. _ref2 = _iterator2[_i2++];
  15557. } else {
  15558. _i2 = _iterator2.next();
  15559. if (_i2.done) break;
  15560. _ref2 = _i2.value;
  15561. }
  15562. var _pattern = _ref2;
  15563. if (_shouldIgnore(_pattern, filename)) return true;
  15564. }
  15565. }
  15566. return false;
  15567. }
  15568. function _shouldIgnore(pattern, filename) {
  15569. if (typeof pattern === "function") {
  15570. return pattern(filename);
  15571. } else {
  15572. return pattern.test(filename);
  15573. }
  15574. }
  15575. /***/ }),
  15576. /* 123 */
  15577. /***/ (function(module, exports, __webpack_require__) {
  15578. "use strict";
  15579. exports.__esModule = true;
  15580. exports.ArrayPattern = exports.ObjectPattern = exports.RestProperty = exports.SpreadProperty = exports.SpreadElement = undefined;
  15581. exports.Identifier = Identifier;
  15582. exports.RestElement = RestElement;
  15583. exports.ObjectExpression = ObjectExpression;
  15584. exports.ObjectMethod = ObjectMethod;
  15585. exports.ObjectProperty = ObjectProperty;
  15586. exports.ArrayExpression = ArrayExpression;
  15587. exports.RegExpLiteral = RegExpLiteral;
  15588. exports.BooleanLiteral = BooleanLiteral;
  15589. exports.NullLiteral = NullLiteral;
  15590. exports.NumericLiteral = NumericLiteral;
  15591. exports.StringLiteral = StringLiteral;
  15592. var _babelTypes = __webpack_require__(1);
  15593. var t = _interopRequireWildcard(_babelTypes);
  15594. var _jsesc = __webpack_require__(469);
  15595. var _jsesc2 = _interopRequireDefault(_jsesc);
  15596. function _interopRequireDefault(obj) {
  15597. return obj && obj.__esModule ? obj : { default: obj };
  15598. }
  15599. function _interopRequireWildcard(obj) {
  15600. if (obj && obj.__esModule) {
  15601. return obj;
  15602. } else {
  15603. var newObj = {};if (obj != null) {
  15604. for (var key in obj) {
  15605. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  15606. }
  15607. }newObj.default = obj;return newObj;
  15608. }
  15609. }
  15610. function Identifier(node) {
  15611. if (node.variance) {
  15612. if (node.variance === "plus") {
  15613. this.token("+");
  15614. } else if (node.variance === "minus") {
  15615. this.token("-");
  15616. }
  15617. }
  15618. this.word(node.name);
  15619. }
  15620. function RestElement(node) {
  15621. this.token("...");
  15622. this.print(node.argument, node);
  15623. }
  15624. exports.SpreadElement = RestElement;
  15625. exports.SpreadProperty = RestElement;
  15626. exports.RestProperty = RestElement;
  15627. function ObjectExpression(node) {
  15628. var props = node.properties;
  15629. this.token("{");
  15630. this.printInnerComments(node);
  15631. if (props.length) {
  15632. this.space();
  15633. this.printList(props, node, { indent: true, statement: true });
  15634. this.space();
  15635. }
  15636. this.token("}");
  15637. }
  15638. exports.ObjectPattern = ObjectExpression;
  15639. function ObjectMethod(node) {
  15640. this.printJoin(node.decorators, node);
  15641. this._method(node);
  15642. }
  15643. function ObjectProperty(node) {
  15644. this.printJoin(node.decorators, node);
  15645. if (node.computed) {
  15646. this.token("[");
  15647. this.print(node.key, node);
  15648. this.token("]");
  15649. } else {
  15650. if (t.isAssignmentPattern(node.value) && t.isIdentifier(node.key) && node.key.name === node.value.left.name) {
  15651. this.print(node.value, node);
  15652. return;
  15653. }
  15654. this.print(node.key, node);
  15655. if (node.shorthand && t.isIdentifier(node.key) && t.isIdentifier(node.value) && node.key.name === node.value.name) {
  15656. return;
  15657. }
  15658. }
  15659. this.token(":");
  15660. this.space();
  15661. this.print(node.value, node);
  15662. }
  15663. function ArrayExpression(node) {
  15664. var elems = node.elements;
  15665. var len = elems.length;
  15666. this.token("[");
  15667. this.printInnerComments(node);
  15668. for (var i = 0; i < elems.length; i++) {
  15669. var elem = elems[i];
  15670. if (elem) {
  15671. if (i > 0) this.space();
  15672. this.print(elem, node);
  15673. if (i < len - 1) this.token(",");
  15674. } else {
  15675. this.token(",");
  15676. }
  15677. }
  15678. this.token("]");
  15679. }
  15680. exports.ArrayPattern = ArrayExpression;
  15681. function RegExpLiteral(node) {
  15682. this.word("/" + node.pattern + "/" + node.flags);
  15683. }
  15684. function BooleanLiteral(node) {
  15685. this.word(node.value ? "true" : "false");
  15686. }
  15687. function NullLiteral() {
  15688. this.word("null");
  15689. }
  15690. function NumericLiteral(node) {
  15691. var raw = this.getPossibleRaw(node);
  15692. var value = node.value + "";
  15693. if (raw == null) {
  15694. this.number(value);
  15695. } else if (this.format.minified) {
  15696. this.number(raw.length < value.length ? raw : value);
  15697. } else {
  15698. this.number(raw);
  15699. }
  15700. }
  15701. function StringLiteral(node, parent) {
  15702. var raw = this.getPossibleRaw(node);
  15703. if (!this.format.minified && raw != null) {
  15704. this.token(raw);
  15705. return;
  15706. }
  15707. var opts = {
  15708. quotes: t.isJSX(parent) ? "double" : this.format.quotes,
  15709. wrap: true
  15710. };
  15711. if (this.format.jsonCompatibleStrings) {
  15712. opts.json = true;
  15713. }
  15714. var val = (0, _jsesc2.default)(node.value, opts);
  15715. return this.token(val);
  15716. }
  15717. /***/ }),
  15718. /* 124 */
  15719. /***/ (function(module, exports, __webpack_require__) {
  15720. "use strict";
  15721. exports.__esModule = true;
  15722. exports.default = function (path, file, helpers) {
  15723. if (!helpers) {
  15724. helpers = { wrapAsync: file };
  15725. file = null;
  15726. }
  15727. path.traverse(awaitVisitor, {
  15728. file: file,
  15729. wrapAwait: helpers.wrapAwait
  15730. });
  15731. if (path.isClassMethod() || path.isObjectMethod()) {
  15732. classOrObjectMethod(path, helpers.wrapAsync);
  15733. } else {
  15734. plainFunction(path, helpers.wrapAsync);
  15735. }
  15736. };
  15737. var _babelHelperFunctionName = __webpack_require__(40);
  15738. var _babelHelperFunctionName2 = _interopRequireDefault(_babelHelperFunctionName);
  15739. var _babelTemplate = __webpack_require__(4);
  15740. var _babelTemplate2 = _interopRequireDefault(_babelTemplate);
  15741. var _babelTypes = __webpack_require__(1);
  15742. var t = _interopRequireWildcard(_babelTypes);
  15743. var _forAwait = __webpack_require__(320);
  15744. var _forAwait2 = _interopRequireDefault(_forAwait);
  15745. function _interopRequireWildcard(obj) {
  15746. if (obj && obj.__esModule) {
  15747. return obj;
  15748. } else {
  15749. var newObj = {};if (obj != null) {
  15750. for (var key in obj) {
  15751. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  15752. }
  15753. }newObj.default = obj;return newObj;
  15754. }
  15755. }
  15756. function _interopRequireDefault(obj) {
  15757. return obj && obj.__esModule ? obj : { default: obj };
  15758. }
  15759. var buildWrapper = (0, _babelTemplate2.default)("\n (() => {\n var REF = FUNCTION;\n return function NAME(PARAMS) {\n return REF.apply(this, arguments);\n };\n })\n");
  15760. var namedBuildWrapper = (0, _babelTemplate2.default)("\n (() => {\n var REF = FUNCTION;\n function NAME(PARAMS) {\n return REF.apply(this, arguments);\n }\n return NAME;\n })\n");
  15761. var awaitVisitor = {
  15762. Function: function Function(path) {
  15763. if (path.isArrowFunctionExpression() && !path.node.async) {
  15764. path.arrowFunctionToShadowed();
  15765. return;
  15766. }
  15767. path.skip();
  15768. },
  15769. AwaitExpression: function AwaitExpression(_ref, _ref2) {
  15770. var node = _ref.node;
  15771. var wrapAwait = _ref2.wrapAwait;
  15772. node.type = "YieldExpression";
  15773. if (wrapAwait) {
  15774. node.argument = t.callExpression(wrapAwait, [node.argument]);
  15775. }
  15776. },
  15777. ForAwaitStatement: function ForAwaitStatement(path, _ref3) {
  15778. var file = _ref3.file,
  15779. wrapAwait = _ref3.wrapAwait;
  15780. var node = path.node;
  15781. var build = (0, _forAwait2.default)(path, {
  15782. getAsyncIterator: file.addHelper("asyncIterator"),
  15783. wrapAwait: wrapAwait
  15784. });
  15785. var declar = build.declar,
  15786. loop = build.loop;
  15787. var block = loop.body;
  15788. path.ensureBlock();
  15789. if (declar) {
  15790. block.body.push(declar);
  15791. }
  15792. block.body = block.body.concat(node.body.body);
  15793. t.inherits(loop, node);
  15794. t.inherits(loop.body, node.body);
  15795. if (build.replaceParent) {
  15796. path.parentPath.replaceWithMultiple(build.node);
  15797. path.remove();
  15798. } else {
  15799. path.replaceWithMultiple(build.node);
  15800. }
  15801. }
  15802. };
  15803. function classOrObjectMethod(path, callId) {
  15804. var node = path.node;
  15805. var body = node.body;
  15806. node.async = false;
  15807. var container = t.functionExpression(null, [], t.blockStatement(body.body), true);
  15808. container.shadow = true;
  15809. body.body = [t.returnStatement(t.callExpression(t.callExpression(callId, [container]), []))];
  15810. node.generator = false;
  15811. }
  15812. function plainFunction(path, callId) {
  15813. var node = path.node;
  15814. var isDeclaration = path.isFunctionDeclaration();
  15815. var asyncFnId = node.id;
  15816. var wrapper = buildWrapper;
  15817. if (path.isArrowFunctionExpression()) {
  15818. path.arrowFunctionToShadowed();
  15819. } else if (!isDeclaration && asyncFnId) {
  15820. wrapper = namedBuildWrapper;
  15821. }
  15822. node.async = false;
  15823. node.generator = true;
  15824. node.id = null;
  15825. if (isDeclaration) {
  15826. node.type = "FunctionExpression";
  15827. }
  15828. var built = t.callExpression(callId, [node]);
  15829. var container = wrapper({
  15830. NAME: asyncFnId,
  15831. REF: path.scope.generateUidIdentifier("ref"),
  15832. FUNCTION: built,
  15833. PARAMS: node.params.reduce(function (acc, param) {
  15834. acc.done = acc.done || t.isAssignmentPattern(param) || t.isRestElement(param);
  15835. if (!acc.done) {
  15836. acc.params.push(path.scope.generateUidIdentifier("x"));
  15837. }
  15838. return acc;
  15839. }, {
  15840. params: [],
  15841. done: false
  15842. }).params
  15843. }).expression;
  15844. if (isDeclaration) {
  15845. var declar = t.variableDeclaration("let", [t.variableDeclarator(t.identifier(asyncFnId.name), t.callExpression(container, []))]);
  15846. declar._blockHoist = true;
  15847. path.replaceWith(declar);
  15848. } else {
  15849. var retFunction = container.body.body[1].argument;
  15850. if (!asyncFnId) {
  15851. (0, _babelHelperFunctionName2.default)({
  15852. node: retFunction,
  15853. parent: path.parent,
  15854. scope: path.scope
  15855. });
  15856. }
  15857. if (!retFunction || retFunction.id || node.params.length) {
  15858. path.replaceWith(t.callExpression(container, []));
  15859. } else {
  15860. path.replaceWith(built);
  15861. }
  15862. }
  15863. }
  15864. module.exports = exports["default"];
  15865. /***/ }),
  15866. /* 125 */
  15867. /***/ (function(module, exports) {
  15868. "use strict";
  15869. exports.__esModule = true;
  15870. exports.default = function () {
  15871. return {
  15872. manipulateOptions: function manipulateOptions(opts, parserOpts) {
  15873. parserOpts.plugins.push("decorators");
  15874. }
  15875. };
  15876. };
  15877. module.exports = exports["default"];
  15878. /***/ }),
  15879. /* 126 */
  15880. /***/ (function(module, exports) {
  15881. "use strict";
  15882. exports.__esModule = true;
  15883. exports.default = function () {
  15884. return {
  15885. manipulateOptions: function manipulateOptions(opts, parserOpts) {
  15886. parserOpts.plugins.push("flow");
  15887. }
  15888. };
  15889. };
  15890. module.exports = exports["default"];
  15891. /***/ }),
  15892. /* 127 */
  15893. /***/ (function(module, exports) {
  15894. "use strict";
  15895. exports.__esModule = true;
  15896. exports.default = function () {
  15897. return {
  15898. manipulateOptions: function manipulateOptions(opts, parserOpts) {
  15899. parserOpts.plugins.push("jsx");
  15900. }
  15901. };
  15902. };
  15903. module.exports = exports["default"];
  15904. /***/ }),
  15905. /* 128 */
  15906. /***/ (function(module, exports) {
  15907. "use strict";
  15908. exports.__esModule = true;
  15909. exports.default = function () {
  15910. return {
  15911. manipulateOptions: function manipulateOptions(opts, parserOpts) {
  15912. parserOpts.plugins.push("trailingFunctionCommas");
  15913. }
  15914. };
  15915. };
  15916. module.exports = exports["default"];
  15917. /***/ }),
  15918. /* 129 */
  15919. /***/ (function(module, exports, __webpack_require__) {
  15920. "use strict";
  15921. exports.__esModule = true;
  15922. exports.default = function () {
  15923. return {
  15924. inherits: __webpack_require__(67),
  15925. visitor: {
  15926. Function: function Function(path, state) {
  15927. if (!path.node.async || path.node.generator) return;
  15928. (0, _babelHelperRemapAsyncToGenerator2.default)(path, state.file, {
  15929. wrapAsync: state.addHelper("asyncToGenerator")
  15930. });
  15931. }
  15932. }
  15933. };
  15934. };
  15935. var _babelHelperRemapAsyncToGenerator = __webpack_require__(124);
  15936. var _babelHelperRemapAsyncToGenerator2 = _interopRequireDefault(_babelHelperRemapAsyncToGenerator);
  15937. function _interopRequireDefault(obj) {
  15938. return obj && obj.__esModule ? obj : { default: obj };
  15939. }
  15940. module.exports = exports["default"];
  15941. /***/ }),
  15942. /* 130 */
  15943. /***/ (function(module, exports, __webpack_require__) {
  15944. "use strict";
  15945. exports.__esModule = true;
  15946. var _getIterator2 = __webpack_require__(2);
  15947. var _getIterator3 = _interopRequireDefault(_getIterator2);
  15948. var _create = __webpack_require__(9);
  15949. var _create2 = _interopRequireDefault(_create);
  15950. exports.default = function () {
  15951. return {
  15952. visitor: {
  15953. ObjectExpression: function ObjectExpression(path) {
  15954. var node = path.node;
  15955. var plainProps = node.properties.filter(function (prop) {
  15956. return !t.isSpreadProperty(prop) && !prop.computed;
  15957. });
  15958. var alreadySeenData = (0, _create2.default)(null);
  15959. var alreadySeenGetters = (0, _create2.default)(null);
  15960. var alreadySeenSetters = (0, _create2.default)(null);
  15961. for (var _iterator = plainProps, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
  15962. var _ref;
  15963. if (_isArray) {
  15964. if (_i >= _iterator.length) break;
  15965. _ref = _iterator[_i++];
  15966. } else {
  15967. _i = _iterator.next();
  15968. if (_i.done) break;
  15969. _ref = _i.value;
  15970. }
  15971. var prop = _ref;
  15972. var name = getName(prop.key);
  15973. var isDuplicate = false;
  15974. switch (prop.kind) {
  15975. case "get":
  15976. if (alreadySeenData[name] || alreadySeenGetters[name]) {
  15977. isDuplicate = true;
  15978. }
  15979. alreadySeenGetters[name] = true;
  15980. break;
  15981. case "set":
  15982. if (alreadySeenData[name] || alreadySeenSetters[name]) {
  15983. isDuplicate = true;
  15984. }
  15985. alreadySeenSetters[name] = true;
  15986. break;
  15987. default:
  15988. if (alreadySeenData[name] || alreadySeenGetters[name] || alreadySeenSetters[name]) {
  15989. isDuplicate = true;
  15990. }
  15991. alreadySeenData[name] = true;
  15992. }
  15993. if (isDuplicate) {
  15994. prop.computed = true;
  15995. prop.key = t.stringLiteral(name);
  15996. }
  15997. }
  15998. }
  15999. }
  16000. };
  16001. };
  16002. var _babelTypes = __webpack_require__(1);
  16003. var t = _interopRequireWildcard(_babelTypes);
  16004. function _interopRequireWildcard(obj) {
  16005. if (obj && obj.__esModule) {
  16006. return obj;
  16007. } else {
  16008. var newObj = {};if (obj != null) {
  16009. for (var key in obj) {
  16010. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  16011. }
  16012. }newObj.default = obj;return newObj;
  16013. }
  16014. }
  16015. function _interopRequireDefault(obj) {
  16016. return obj && obj.__esModule ? obj : { default: obj };
  16017. }
  16018. function getName(key) {
  16019. if (t.isIdentifier(key)) {
  16020. return key.name;
  16021. }
  16022. return key.value.toString();
  16023. }
  16024. module.exports = exports["default"];
  16025. /***/ }),
  16026. /* 131 */
  16027. /***/ (function(module, exports, __webpack_require__) {
  16028. "use strict";
  16029. exports.__esModule = true;
  16030. var _create = __webpack_require__(9);
  16031. var _create2 = _interopRequireDefault(_create);
  16032. exports.default = function (_ref) {
  16033. var t = _ref.types;
  16034. function isValidRequireCall(path) {
  16035. if (!path.isCallExpression()) return false;
  16036. if (!path.get("callee").isIdentifier({ name: "require" })) return false;
  16037. if (path.scope.getBinding("require")) return false;
  16038. var args = path.get("arguments");
  16039. if (args.length !== 1) return false;
  16040. var arg = args[0];
  16041. if (!arg.isStringLiteral()) return false;
  16042. return true;
  16043. }
  16044. var amdVisitor = {
  16045. ReferencedIdentifier: function ReferencedIdentifier(_ref2) {
  16046. var node = _ref2.node,
  16047. scope = _ref2.scope;
  16048. if (node.name === "exports" && !scope.getBinding("exports")) {
  16049. this.hasExports = true;
  16050. }
  16051. if (node.name === "module" && !scope.getBinding("module")) {
  16052. this.hasModule = true;
  16053. }
  16054. },
  16055. CallExpression: function CallExpression(path) {
  16056. if (!isValidRequireCall(path)) return;
  16057. this.bareSources.push(path.node.arguments[0]);
  16058. path.remove();
  16059. },
  16060. VariableDeclarator: function VariableDeclarator(path) {
  16061. var id = path.get("id");
  16062. if (!id.isIdentifier()) return;
  16063. var init = path.get("init");
  16064. if (!isValidRequireCall(init)) return;
  16065. var source = init.node.arguments[0];
  16066. this.sourceNames[source.value] = true;
  16067. this.sources.push([id.node, source]);
  16068. path.remove();
  16069. }
  16070. };
  16071. return {
  16072. inherits: __webpack_require__(77),
  16073. pre: function pre() {
  16074. this.sources = [];
  16075. this.sourceNames = (0, _create2.default)(null);
  16076. this.bareSources = [];
  16077. this.hasExports = false;
  16078. this.hasModule = false;
  16079. },
  16080. visitor: {
  16081. Program: {
  16082. exit: function exit(path) {
  16083. var _this = this;
  16084. if (this.ran) return;
  16085. this.ran = true;
  16086. path.traverse(amdVisitor, this);
  16087. var params = this.sources.map(function (source) {
  16088. return source[0];
  16089. });
  16090. var sources = this.sources.map(function (source) {
  16091. return source[1];
  16092. });
  16093. sources = sources.concat(this.bareSources.filter(function (str) {
  16094. return !_this.sourceNames[str.value];
  16095. }));
  16096. var moduleName = this.getModuleName();
  16097. if (moduleName) moduleName = t.stringLiteral(moduleName);
  16098. if (this.hasExports) {
  16099. sources.unshift(t.stringLiteral("exports"));
  16100. params.unshift(t.identifier("exports"));
  16101. }
  16102. if (this.hasModule) {
  16103. sources.unshift(t.stringLiteral("module"));
  16104. params.unshift(t.identifier("module"));
  16105. }
  16106. var node = path.node;
  16107. var factory = buildFactory({
  16108. PARAMS: params,
  16109. BODY: node.body
  16110. });
  16111. factory.expression.body.directives = node.directives;
  16112. node.directives = [];
  16113. node.body = [buildDefine({
  16114. MODULE_NAME: moduleName,
  16115. SOURCES: sources,
  16116. FACTORY: factory
  16117. })];
  16118. }
  16119. }
  16120. }
  16121. };
  16122. };
  16123. var _babelTemplate = __webpack_require__(4);
  16124. var _babelTemplate2 = _interopRequireDefault(_babelTemplate);
  16125. function _interopRequireDefault(obj) {
  16126. return obj && obj.__esModule ? obj : { default: obj };
  16127. }
  16128. var buildDefine = (0, _babelTemplate2.default)("\n define(MODULE_NAME, [SOURCES], FACTORY);\n");
  16129. var buildFactory = (0, _babelTemplate2.default)("\n (function (PARAMS) {\n BODY;\n })\n");
  16130. module.exports = exports["default"];
  16131. /***/ }),
  16132. /* 132 */
  16133. /***/ (function(module, exports, __webpack_require__) {
  16134. "use strict";
  16135. exports.__esModule = true;
  16136. exports.default = function (_ref) {
  16137. var t = _ref.types;
  16138. return {
  16139. inherits: __webpack_require__(199),
  16140. visitor: (0, _babelHelperBuilderBinaryAssignmentOperatorVisitor2.default)({
  16141. operator: "**",
  16142. build: function build(left, right) {
  16143. return t.callExpression(t.memberExpression(t.identifier("Math"), t.identifier("pow")), [left, right]);
  16144. }
  16145. })
  16146. };
  16147. };
  16148. var _babelHelperBuilderBinaryAssignmentOperatorVisitor = __webpack_require__(316);
  16149. var _babelHelperBuilderBinaryAssignmentOperatorVisitor2 = _interopRequireDefault(_babelHelperBuilderBinaryAssignmentOperatorVisitor);
  16150. function _interopRequireDefault(obj) {
  16151. return obj && obj.__esModule ? obj : { default: obj };
  16152. }
  16153. module.exports = exports["default"];
  16154. /***/ }),
  16155. /* 133 */
  16156. /***/ (function(module, exports, __webpack_require__) {
  16157. "use strict";
  16158. module.exports = { "default": __webpack_require__(406), __esModule: true };
  16159. /***/ }),
  16160. /* 134 */
  16161. /***/ (function(module, exports, __webpack_require__) {
  16162. "use strict";
  16163. exports.__esModule = true;
  16164. var _keys = __webpack_require__(14);
  16165. var _keys2 = _interopRequireDefault(_keys);
  16166. var _create = __webpack_require__(9);
  16167. var _create2 = _interopRequireDefault(_create);
  16168. var _map = __webpack_require__(133);
  16169. var _map2 = _interopRequireDefault(_map);
  16170. var _classCallCheck2 = __webpack_require__(3);
  16171. var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
  16172. var _getIterator2 = __webpack_require__(2);
  16173. var _getIterator3 = _interopRequireDefault(_getIterator2);
  16174. var _includes = __webpack_require__(111);
  16175. var _includes2 = _interopRequireDefault(_includes);
  16176. var _repeat = __webpack_require__(278);
  16177. var _repeat2 = _interopRequireDefault(_repeat);
  16178. var _renamer = __webpack_require__(383);
  16179. var _renamer2 = _interopRequireDefault(_renamer);
  16180. var _index = __webpack_require__(7);
  16181. var _index2 = _interopRequireDefault(_index);
  16182. var _defaults = __webpack_require__(273);
  16183. var _defaults2 = _interopRequireDefault(_defaults);
  16184. var _babelMessages = __webpack_require__(20);
  16185. var messages = _interopRequireWildcard(_babelMessages);
  16186. var _binding2 = __webpack_require__(225);
  16187. var _binding3 = _interopRequireDefault(_binding2);
  16188. var _globals = __webpack_require__(463);
  16189. var _globals2 = _interopRequireDefault(_globals);
  16190. var _babelTypes = __webpack_require__(1);
  16191. var t = _interopRequireWildcard(_babelTypes);
  16192. var _cache = __webpack_require__(88);
  16193. function _interopRequireWildcard(obj) {
  16194. if (obj && obj.__esModule) {
  16195. return obj;
  16196. } else {
  16197. var newObj = {};if (obj != null) {
  16198. for (var key in obj) {
  16199. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  16200. }
  16201. }newObj.default = obj;return newObj;
  16202. }
  16203. }
  16204. function _interopRequireDefault(obj) {
  16205. return obj && obj.__esModule ? obj : { default: obj };
  16206. }
  16207. var _crawlCallsCount = 0;
  16208. function getCache(path, parentScope, self) {
  16209. var scopes = _cache.scope.get(path.node) || [];
  16210. for (var _iterator = scopes, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
  16211. var _ref;
  16212. if (_isArray) {
  16213. if (_i >= _iterator.length) break;
  16214. _ref = _iterator[_i++];
  16215. } else {
  16216. _i = _iterator.next();
  16217. if (_i.done) break;
  16218. _ref = _i.value;
  16219. }
  16220. var scope = _ref;
  16221. if (scope.parent === parentScope && scope.path === path) return scope;
  16222. }
  16223. scopes.push(self);
  16224. if (!_cache.scope.has(path.node)) {
  16225. _cache.scope.set(path.node, scopes);
  16226. }
  16227. }
  16228. function gatherNodeParts(node, parts) {
  16229. if (t.isModuleDeclaration(node)) {
  16230. if (node.source) {
  16231. gatherNodeParts(node.source, parts);
  16232. } else if (node.specifiers && node.specifiers.length) {
  16233. for (var _iterator2 = node.specifiers, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) {
  16234. var _ref2;
  16235. if (_isArray2) {
  16236. if (_i2 >= _iterator2.length) break;
  16237. _ref2 = _iterator2[_i2++];
  16238. } else {
  16239. _i2 = _iterator2.next();
  16240. if (_i2.done) break;
  16241. _ref2 = _i2.value;
  16242. }
  16243. var specifier = _ref2;
  16244. gatherNodeParts(specifier, parts);
  16245. }
  16246. } else if (node.declaration) {
  16247. gatherNodeParts(node.declaration, parts);
  16248. }
  16249. } else if (t.isModuleSpecifier(node)) {
  16250. gatherNodeParts(node.local, parts);
  16251. } else if (t.isMemberExpression(node)) {
  16252. gatherNodeParts(node.object, parts);
  16253. gatherNodeParts(node.property, parts);
  16254. } else if (t.isIdentifier(node)) {
  16255. parts.push(node.name);
  16256. } else if (t.isLiteral(node)) {
  16257. parts.push(node.value);
  16258. } else if (t.isCallExpression(node)) {
  16259. gatherNodeParts(node.callee, parts);
  16260. } else if (t.isObjectExpression(node) || t.isObjectPattern(node)) {
  16261. for (var _iterator3 = node.properties, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) {
  16262. var _ref3;
  16263. if (_isArray3) {
  16264. if (_i3 >= _iterator3.length) break;
  16265. _ref3 = _iterator3[_i3++];
  16266. } else {
  16267. _i3 = _iterator3.next();
  16268. if (_i3.done) break;
  16269. _ref3 = _i3.value;
  16270. }
  16271. var prop = _ref3;
  16272. gatherNodeParts(prop.key || prop.argument, parts);
  16273. }
  16274. }
  16275. }
  16276. var collectorVisitor = {
  16277. For: function For(path) {
  16278. for (var _iterator4 = t.FOR_INIT_KEYS, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, _getIterator3.default)(_iterator4);;) {
  16279. var _ref4;
  16280. if (_isArray4) {
  16281. if (_i4 >= _iterator4.length) break;
  16282. _ref4 = _iterator4[_i4++];
  16283. } else {
  16284. _i4 = _iterator4.next();
  16285. if (_i4.done) break;
  16286. _ref4 = _i4.value;
  16287. }
  16288. var key = _ref4;
  16289. var declar = path.get(key);
  16290. if (declar.isVar()) path.scope.getFunctionParent().registerBinding("var", declar);
  16291. }
  16292. },
  16293. Declaration: function Declaration(path) {
  16294. if (path.isBlockScoped()) return;
  16295. if (path.isExportDeclaration() && path.get("declaration").isDeclaration()) return;
  16296. path.scope.getFunctionParent().registerDeclaration(path);
  16297. },
  16298. ReferencedIdentifier: function ReferencedIdentifier(path, state) {
  16299. state.references.push(path);
  16300. },
  16301. ForXStatement: function ForXStatement(path, state) {
  16302. var left = path.get("left");
  16303. if (left.isPattern() || left.isIdentifier()) {
  16304. state.constantViolations.push(left);
  16305. }
  16306. },
  16307. ExportDeclaration: {
  16308. exit: function exit(path) {
  16309. var node = path.node,
  16310. scope = path.scope;
  16311. var declar = node.declaration;
  16312. if (t.isClassDeclaration(declar) || t.isFunctionDeclaration(declar)) {
  16313. var _id = declar.id;
  16314. if (!_id) return;
  16315. var binding = scope.getBinding(_id.name);
  16316. if (binding) binding.reference(path);
  16317. } else if (t.isVariableDeclaration(declar)) {
  16318. for (var _iterator5 = declar.declarations, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, _getIterator3.default)(_iterator5);;) {
  16319. var _ref5;
  16320. if (_isArray5) {
  16321. if (_i5 >= _iterator5.length) break;
  16322. _ref5 = _iterator5[_i5++];
  16323. } else {
  16324. _i5 = _iterator5.next();
  16325. if (_i5.done) break;
  16326. _ref5 = _i5.value;
  16327. }
  16328. var decl = _ref5;
  16329. var ids = t.getBindingIdentifiers(decl);
  16330. for (var name in ids) {
  16331. var _binding = scope.getBinding(name);
  16332. if (_binding) _binding.reference(path);
  16333. }
  16334. }
  16335. }
  16336. }
  16337. },
  16338. LabeledStatement: function LabeledStatement(path) {
  16339. path.scope.getProgramParent().addGlobal(path.node);
  16340. path.scope.getBlockParent().registerDeclaration(path);
  16341. },
  16342. AssignmentExpression: function AssignmentExpression(path, state) {
  16343. state.assignments.push(path);
  16344. },
  16345. UpdateExpression: function UpdateExpression(path, state) {
  16346. state.constantViolations.push(path.get("argument"));
  16347. },
  16348. UnaryExpression: function UnaryExpression(path, state) {
  16349. if (path.node.operator === "delete") {
  16350. state.constantViolations.push(path.get("argument"));
  16351. }
  16352. },
  16353. BlockScoped: function BlockScoped(path) {
  16354. var scope = path.scope;
  16355. if (scope.path === path) scope = scope.parent;
  16356. scope.getBlockParent().registerDeclaration(path);
  16357. },
  16358. ClassDeclaration: function ClassDeclaration(path) {
  16359. var id = path.node.id;
  16360. if (!id) return;
  16361. var name = id.name;
  16362. path.scope.bindings[name] = path.scope.getBinding(name);
  16363. },
  16364. Block: function Block(path) {
  16365. var paths = path.get("body");
  16366. for (var _iterator6 = paths, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, _getIterator3.default)(_iterator6);;) {
  16367. var _ref6;
  16368. if (_isArray6) {
  16369. if (_i6 >= _iterator6.length) break;
  16370. _ref6 = _iterator6[_i6++];
  16371. } else {
  16372. _i6 = _iterator6.next();
  16373. if (_i6.done) break;
  16374. _ref6 = _i6.value;
  16375. }
  16376. var bodyPath = _ref6;
  16377. if (bodyPath.isFunctionDeclaration()) {
  16378. path.scope.getBlockParent().registerDeclaration(bodyPath);
  16379. }
  16380. }
  16381. }
  16382. };
  16383. var uid = 0;
  16384. var Scope = function () {
  16385. function Scope(path, parentScope) {
  16386. (0, _classCallCheck3.default)(this, Scope);
  16387. if (parentScope && parentScope.block === path.node) {
  16388. return parentScope;
  16389. }
  16390. var cached = getCache(path, parentScope, this);
  16391. if (cached) return cached;
  16392. this.uid = uid++;
  16393. this.parent = parentScope;
  16394. this.hub = path.hub;
  16395. this.parentBlock = path.parent;
  16396. this.block = path.node;
  16397. this.path = path;
  16398. this.labels = new _map2.default();
  16399. }
  16400. Scope.prototype.traverse = function traverse(node, opts, state) {
  16401. (0, _index2.default)(node, opts, this, state, this.path);
  16402. };
  16403. Scope.prototype.generateDeclaredUidIdentifier = function generateDeclaredUidIdentifier() {
  16404. var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "temp";
  16405. var id = this.generateUidIdentifier(name);
  16406. this.push({ id: id });
  16407. return id;
  16408. };
  16409. Scope.prototype.generateUidIdentifier = function generateUidIdentifier() {
  16410. var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "temp";
  16411. return t.identifier(this.generateUid(name));
  16412. };
  16413. Scope.prototype.generateUid = function generateUid() {
  16414. var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "temp";
  16415. name = t.toIdentifier(name).replace(/^_+/, "").replace(/[0-9]+$/g, "");
  16416. var uid = void 0;
  16417. var i = 0;
  16418. do {
  16419. uid = this._generateUid(name, i);
  16420. i++;
  16421. } while (this.hasLabel(uid) || this.hasBinding(uid) || this.hasGlobal(uid) || this.hasReference(uid));
  16422. var program = this.getProgramParent();
  16423. program.references[uid] = true;
  16424. program.uids[uid] = true;
  16425. return uid;
  16426. };
  16427. Scope.prototype._generateUid = function _generateUid(name, i) {
  16428. var id = name;
  16429. if (i > 1) id += i;
  16430. return "_" + id;
  16431. };
  16432. Scope.prototype.generateUidIdentifierBasedOnNode = function generateUidIdentifierBasedOnNode(parent, defaultName) {
  16433. var node = parent;
  16434. if (t.isAssignmentExpression(parent)) {
  16435. node = parent.left;
  16436. } else if (t.isVariableDeclarator(parent)) {
  16437. node = parent.id;
  16438. } else if (t.isObjectProperty(node) || t.isObjectMethod(node)) {
  16439. node = node.key;
  16440. }
  16441. var parts = [];
  16442. gatherNodeParts(node, parts);
  16443. var id = parts.join("$");
  16444. id = id.replace(/^_/, "") || defaultName || "ref";
  16445. return this.generateUidIdentifier(id.slice(0, 20));
  16446. };
  16447. Scope.prototype.isStatic = function isStatic(node) {
  16448. if (t.isThisExpression(node) || t.isSuper(node)) {
  16449. return true;
  16450. }
  16451. if (t.isIdentifier(node)) {
  16452. var binding = this.getBinding(node.name);
  16453. if (binding) {
  16454. return binding.constant;
  16455. } else {
  16456. return this.hasBinding(node.name);
  16457. }
  16458. }
  16459. return false;
  16460. };
  16461. Scope.prototype.maybeGenerateMemoised = function maybeGenerateMemoised(node, dontPush) {
  16462. if (this.isStatic(node)) {
  16463. return null;
  16464. } else {
  16465. var _id2 = this.generateUidIdentifierBasedOnNode(node);
  16466. if (!dontPush) this.push({ id: _id2 });
  16467. return _id2;
  16468. }
  16469. };
  16470. Scope.prototype.checkBlockScopedCollisions = function checkBlockScopedCollisions(local, kind, name, id) {
  16471. if (kind === "param") return;
  16472. if (kind === "hoisted" && local.kind === "let") return;
  16473. var duplicate = kind === "let" || local.kind === "let" || local.kind === "const" || local.kind === "module" || local.kind === "param" && (kind === "let" || kind === "const");
  16474. if (duplicate) {
  16475. throw this.hub.file.buildCodeFrameError(id, messages.get("scopeDuplicateDeclaration", name), TypeError);
  16476. }
  16477. };
  16478. Scope.prototype.rename = function rename(oldName, newName, block) {
  16479. var binding = this.getBinding(oldName);
  16480. if (binding) {
  16481. newName = newName || this.generateUidIdentifier(oldName).name;
  16482. return new _renamer2.default(binding, oldName, newName).rename(block);
  16483. }
  16484. };
  16485. Scope.prototype._renameFromMap = function _renameFromMap(map, oldName, newName, value) {
  16486. if (map[oldName]) {
  16487. map[newName] = value;
  16488. map[oldName] = null;
  16489. }
  16490. };
  16491. Scope.prototype.dump = function dump() {
  16492. var sep = (0, _repeat2.default)("-", 60);
  16493. console.log(sep);
  16494. var scope = this;
  16495. do {
  16496. console.log("#", scope.block.type);
  16497. for (var name in scope.bindings) {
  16498. var binding = scope.bindings[name];
  16499. console.log(" -", name, {
  16500. constant: binding.constant,
  16501. references: binding.references,
  16502. violations: binding.constantViolations.length,
  16503. kind: binding.kind
  16504. });
  16505. }
  16506. } while (scope = scope.parent);
  16507. console.log(sep);
  16508. };
  16509. Scope.prototype.toArray = function toArray(node, i) {
  16510. var file = this.hub.file;
  16511. if (t.isIdentifier(node)) {
  16512. var binding = this.getBinding(node.name);
  16513. if (binding && binding.constant && binding.path.isGenericType("Array")) return node;
  16514. }
  16515. if (t.isArrayExpression(node)) {
  16516. return node;
  16517. }
  16518. if (t.isIdentifier(node, { name: "arguments" })) {
  16519. return t.callExpression(t.memberExpression(t.memberExpression(t.memberExpression(t.identifier("Array"), t.identifier("prototype")), t.identifier("slice")), t.identifier("call")), [node]);
  16520. }
  16521. var helperName = "toArray";
  16522. var args = [node];
  16523. if (i === true) {
  16524. helperName = "toConsumableArray";
  16525. } else if (i) {
  16526. args.push(t.numericLiteral(i));
  16527. helperName = "slicedToArray";
  16528. }
  16529. return t.callExpression(file.addHelper(helperName), args);
  16530. };
  16531. Scope.prototype.hasLabel = function hasLabel(name) {
  16532. return !!this.getLabel(name);
  16533. };
  16534. Scope.prototype.getLabel = function getLabel(name) {
  16535. return this.labels.get(name);
  16536. };
  16537. Scope.prototype.registerLabel = function registerLabel(path) {
  16538. this.labels.set(path.node.label.name, path);
  16539. };
  16540. Scope.prototype.registerDeclaration = function registerDeclaration(path) {
  16541. if (path.isLabeledStatement()) {
  16542. this.registerLabel(path);
  16543. } else if (path.isFunctionDeclaration()) {
  16544. this.registerBinding("hoisted", path.get("id"), path);
  16545. } else if (path.isVariableDeclaration()) {
  16546. var declarations = path.get("declarations");
  16547. for (var _iterator7 = declarations, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : (0, _getIterator3.default)(_iterator7);;) {
  16548. var _ref7;
  16549. if (_isArray7) {
  16550. if (_i7 >= _iterator7.length) break;
  16551. _ref7 = _iterator7[_i7++];
  16552. } else {
  16553. _i7 = _iterator7.next();
  16554. if (_i7.done) break;
  16555. _ref7 = _i7.value;
  16556. }
  16557. var declar = _ref7;
  16558. this.registerBinding(path.node.kind, declar);
  16559. }
  16560. } else if (path.isClassDeclaration()) {
  16561. this.registerBinding("let", path);
  16562. } else if (path.isImportDeclaration()) {
  16563. var specifiers = path.get("specifiers");
  16564. for (var _iterator8 = specifiers, _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : (0, _getIterator3.default)(_iterator8);;) {
  16565. var _ref8;
  16566. if (_isArray8) {
  16567. if (_i8 >= _iterator8.length) break;
  16568. _ref8 = _iterator8[_i8++];
  16569. } else {
  16570. _i8 = _iterator8.next();
  16571. if (_i8.done) break;
  16572. _ref8 = _i8.value;
  16573. }
  16574. var specifier = _ref8;
  16575. this.registerBinding("module", specifier);
  16576. }
  16577. } else if (path.isExportDeclaration()) {
  16578. var _declar = path.get("declaration");
  16579. if (_declar.isClassDeclaration() || _declar.isFunctionDeclaration() || _declar.isVariableDeclaration()) {
  16580. this.registerDeclaration(_declar);
  16581. }
  16582. } else {
  16583. this.registerBinding("unknown", path);
  16584. }
  16585. };
  16586. Scope.prototype.buildUndefinedNode = function buildUndefinedNode() {
  16587. if (this.hasBinding("undefined")) {
  16588. return t.unaryExpression("void", t.numericLiteral(0), true);
  16589. } else {
  16590. return t.identifier("undefined");
  16591. }
  16592. };
  16593. Scope.prototype.registerConstantViolation = function registerConstantViolation(path) {
  16594. var ids = path.getBindingIdentifiers();
  16595. for (var name in ids) {
  16596. var binding = this.getBinding(name);
  16597. if (binding) binding.reassign(path);
  16598. }
  16599. };
  16600. Scope.prototype.registerBinding = function registerBinding(kind, path) {
  16601. var bindingPath = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : path;
  16602. if (!kind) throw new ReferenceError("no `kind`");
  16603. if (path.isVariableDeclaration()) {
  16604. var declarators = path.get("declarations");
  16605. for (var _iterator9 = declarators, _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : (0, _getIterator3.default)(_iterator9);;) {
  16606. var _ref9;
  16607. if (_isArray9) {
  16608. if (_i9 >= _iterator9.length) break;
  16609. _ref9 = _iterator9[_i9++];
  16610. } else {
  16611. _i9 = _iterator9.next();
  16612. if (_i9.done) break;
  16613. _ref9 = _i9.value;
  16614. }
  16615. var declar = _ref9;
  16616. this.registerBinding(kind, declar);
  16617. }
  16618. return;
  16619. }
  16620. var parent = this.getProgramParent();
  16621. var ids = path.getBindingIdentifiers(true);
  16622. for (var name in ids) {
  16623. for (var _iterator10 = ids[name], _isArray10 = Array.isArray(_iterator10), _i10 = 0, _iterator10 = _isArray10 ? _iterator10 : (0, _getIterator3.default)(_iterator10);;) {
  16624. var _ref10;
  16625. if (_isArray10) {
  16626. if (_i10 >= _iterator10.length) break;
  16627. _ref10 = _iterator10[_i10++];
  16628. } else {
  16629. _i10 = _iterator10.next();
  16630. if (_i10.done) break;
  16631. _ref10 = _i10.value;
  16632. }
  16633. var _id3 = _ref10;
  16634. var local = this.getOwnBinding(name);
  16635. if (local) {
  16636. if (local.identifier === _id3) continue;
  16637. this.checkBlockScopedCollisions(local, kind, name, _id3);
  16638. }
  16639. if (local && local.path.isFlow()) local = null;
  16640. parent.references[name] = true;
  16641. this.bindings[name] = new _binding3.default({
  16642. identifier: _id3,
  16643. existing: local,
  16644. scope: this,
  16645. path: bindingPath,
  16646. kind: kind
  16647. });
  16648. }
  16649. }
  16650. };
  16651. Scope.prototype.addGlobal = function addGlobal(node) {
  16652. this.globals[node.name] = node;
  16653. };
  16654. Scope.prototype.hasUid = function hasUid(name) {
  16655. var scope = this;
  16656. do {
  16657. if (scope.uids[name]) return true;
  16658. } while (scope = scope.parent);
  16659. return false;
  16660. };
  16661. Scope.prototype.hasGlobal = function hasGlobal(name) {
  16662. var scope = this;
  16663. do {
  16664. if (scope.globals[name]) return true;
  16665. } while (scope = scope.parent);
  16666. return false;
  16667. };
  16668. Scope.prototype.hasReference = function hasReference(name) {
  16669. var scope = this;
  16670. do {
  16671. if (scope.references[name]) return true;
  16672. } while (scope = scope.parent);
  16673. return false;
  16674. };
  16675. Scope.prototype.isPure = function isPure(node, constantsOnly) {
  16676. if (t.isIdentifier(node)) {
  16677. var binding = this.getBinding(node.name);
  16678. if (!binding) return false;
  16679. if (constantsOnly) return binding.constant;
  16680. return true;
  16681. } else if (t.isClass(node)) {
  16682. if (node.superClass && !this.isPure(node.superClass, constantsOnly)) return false;
  16683. return this.isPure(node.body, constantsOnly);
  16684. } else if (t.isClassBody(node)) {
  16685. for (var _iterator11 = node.body, _isArray11 = Array.isArray(_iterator11), _i11 = 0, _iterator11 = _isArray11 ? _iterator11 : (0, _getIterator3.default)(_iterator11);;) {
  16686. var _ref11;
  16687. if (_isArray11) {
  16688. if (_i11 >= _iterator11.length) break;
  16689. _ref11 = _iterator11[_i11++];
  16690. } else {
  16691. _i11 = _iterator11.next();
  16692. if (_i11.done) break;
  16693. _ref11 = _i11.value;
  16694. }
  16695. var method = _ref11;
  16696. if (!this.isPure(method, constantsOnly)) return false;
  16697. }
  16698. return true;
  16699. } else if (t.isBinary(node)) {
  16700. return this.isPure(node.left, constantsOnly) && this.isPure(node.right, constantsOnly);
  16701. } else if (t.isArrayExpression(node)) {
  16702. for (var _iterator12 = node.elements, _isArray12 = Array.isArray(_iterator12), _i12 = 0, _iterator12 = _isArray12 ? _iterator12 : (0, _getIterator3.default)(_iterator12);;) {
  16703. var _ref12;
  16704. if (_isArray12) {
  16705. if (_i12 >= _iterator12.length) break;
  16706. _ref12 = _iterator12[_i12++];
  16707. } else {
  16708. _i12 = _iterator12.next();
  16709. if (_i12.done) break;
  16710. _ref12 = _i12.value;
  16711. }
  16712. var elem = _ref12;
  16713. if (!this.isPure(elem, constantsOnly)) return false;
  16714. }
  16715. return true;
  16716. } else if (t.isObjectExpression(node)) {
  16717. for (var _iterator13 = node.properties, _isArray13 = Array.isArray(_iterator13), _i13 = 0, _iterator13 = _isArray13 ? _iterator13 : (0, _getIterator3.default)(_iterator13);;) {
  16718. var _ref13;
  16719. if (_isArray13) {
  16720. if (_i13 >= _iterator13.length) break;
  16721. _ref13 = _iterator13[_i13++];
  16722. } else {
  16723. _i13 = _iterator13.next();
  16724. if (_i13.done) break;
  16725. _ref13 = _i13.value;
  16726. }
  16727. var prop = _ref13;
  16728. if (!this.isPure(prop, constantsOnly)) return false;
  16729. }
  16730. return true;
  16731. } else if (t.isClassMethod(node)) {
  16732. if (node.computed && !this.isPure(node.key, constantsOnly)) return false;
  16733. if (node.kind === "get" || node.kind === "set") return false;
  16734. return true;
  16735. } else if (t.isClassProperty(node) || t.isObjectProperty(node)) {
  16736. if (node.computed && !this.isPure(node.key, constantsOnly)) return false;
  16737. return this.isPure(node.value, constantsOnly);
  16738. } else if (t.isUnaryExpression(node)) {
  16739. return this.isPure(node.argument, constantsOnly);
  16740. } else {
  16741. return t.isPureish(node);
  16742. }
  16743. };
  16744. Scope.prototype.setData = function setData(key, val) {
  16745. return this.data[key] = val;
  16746. };
  16747. Scope.prototype.getData = function getData(key) {
  16748. var scope = this;
  16749. do {
  16750. var data = scope.data[key];
  16751. if (data != null) return data;
  16752. } while (scope = scope.parent);
  16753. };
  16754. Scope.prototype.removeData = function removeData(key) {
  16755. var scope = this;
  16756. do {
  16757. var data = scope.data[key];
  16758. if (data != null) scope.data[key] = null;
  16759. } while (scope = scope.parent);
  16760. };
  16761. Scope.prototype.init = function init() {
  16762. if (!this.references) this.crawl();
  16763. };
  16764. Scope.prototype.crawl = function crawl() {
  16765. _crawlCallsCount++;
  16766. this._crawl();
  16767. _crawlCallsCount--;
  16768. };
  16769. Scope.prototype._crawl = function _crawl() {
  16770. var path = this.path;
  16771. this.references = (0, _create2.default)(null);
  16772. this.bindings = (0, _create2.default)(null);
  16773. this.globals = (0, _create2.default)(null);
  16774. this.uids = (0, _create2.default)(null);
  16775. this.data = (0, _create2.default)(null);
  16776. if (path.isLoop()) {
  16777. for (var _iterator14 = t.FOR_INIT_KEYS, _isArray14 = Array.isArray(_iterator14), _i14 = 0, _iterator14 = _isArray14 ? _iterator14 : (0, _getIterator3.default)(_iterator14);;) {
  16778. var _ref14;
  16779. if (_isArray14) {
  16780. if (_i14 >= _iterator14.length) break;
  16781. _ref14 = _iterator14[_i14++];
  16782. } else {
  16783. _i14 = _iterator14.next();
  16784. if (_i14.done) break;
  16785. _ref14 = _i14.value;
  16786. }
  16787. var key = _ref14;
  16788. var node = path.get(key);
  16789. if (node.isBlockScoped()) this.registerBinding(node.node.kind, node);
  16790. }
  16791. }
  16792. if (path.isFunctionExpression() && path.has("id")) {
  16793. if (!path.get("id").node[t.NOT_LOCAL_BINDING]) {
  16794. this.registerBinding("local", path.get("id"), path);
  16795. }
  16796. }
  16797. if (path.isClassExpression() && path.has("id")) {
  16798. if (!path.get("id").node[t.NOT_LOCAL_BINDING]) {
  16799. this.registerBinding("local", path);
  16800. }
  16801. }
  16802. if (path.isFunction()) {
  16803. var params = path.get("params");
  16804. for (var _iterator15 = params, _isArray15 = Array.isArray(_iterator15), _i15 = 0, _iterator15 = _isArray15 ? _iterator15 : (0, _getIterator3.default)(_iterator15);;) {
  16805. var _ref15;
  16806. if (_isArray15) {
  16807. if (_i15 >= _iterator15.length) break;
  16808. _ref15 = _iterator15[_i15++];
  16809. } else {
  16810. _i15 = _iterator15.next();
  16811. if (_i15.done) break;
  16812. _ref15 = _i15.value;
  16813. }
  16814. var param = _ref15;
  16815. this.registerBinding("param", param);
  16816. }
  16817. }
  16818. if (path.isCatchClause()) {
  16819. this.registerBinding("let", path);
  16820. }
  16821. var parent = this.getProgramParent();
  16822. if (parent.crawling) return;
  16823. var state = {
  16824. references: [],
  16825. constantViolations: [],
  16826. assignments: []
  16827. };
  16828. this.crawling = true;
  16829. path.traverse(collectorVisitor, state);
  16830. this.crawling = false;
  16831. for (var _iterator16 = state.assignments, _isArray16 = Array.isArray(_iterator16), _i16 = 0, _iterator16 = _isArray16 ? _iterator16 : (0, _getIterator3.default)(_iterator16);;) {
  16832. var _ref16;
  16833. if (_isArray16) {
  16834. if (_i16 >= _iterator16.length) break;
  16835. _ref16 = _iterator16[_i16++];
  16836. } else {
  16837. _i16 = _iterator16.next();
  16838. if (_i16.done) break;
  16839. _ref16 = _i16.value;
  16840. }
  16841. var _path = _ref16;
  16842. var ids = _path.getBindingIdentifiers();
  16843. var programParent = void 0;
  16844. for (var name in ids) {
  16845. if (_path.scope.getBinding(name)) continue;
  16846. programParent = programParent || _path.scope.getProgramParent();
  16847. programParent.addGlobal(ids[name]);
  16848. }
  16849. _path.scope.registerConstantViolation(_path);
  16850. }
  16851. for (var _iterator17 = state.references, _isArray17 = Array.isArray(_iterator17), _i17 = 0, _iterator17 = _isArray17 ? _iterator17 : (0, _getIterator3.default)(_iterator17);;) {
  16852. var _ref17;
  16853. if (_isArray17) {
  16854. if (_i17 >= _iterator17.length) break;
  16855. _ref17 = _iterator17[_i17++];
  16856. } else {
  16857. _i17 = _iterator17.next();
  16858. if (_i17.done) break;
  16859. _ref17 = _i17.value;
  16860. }
  16861. var ref = _ref17;
  16862. var binding = ref.scope.getBinding(ref.node.name);
  16863. if (binding) {
  16864. binding.reference(ref);
  16865. } else {
  16866. ref.scope.getProgramParent().addGlobal(ref.node);
  16867. }
  16868. }
  16869. for (var _iterator18 = state.constantViolations, _isArray18 = Array.isArray(_iterator18), _i18 = 0, _iterator18 = _isArray18 ? _iterator18 : (0, _getIterator3.default)(_iterator18);;) {
  16870. var _ref18;
  16871. if (_isArray18) {
  16872. if (_i18 >= _iterator18.length) break;
  16873. _ref18 = _iterator18[_i18++];
  16874. } else {
  16875. _i18 = _iterator18.next();
  16876. if (_i18.done) break;
  16877. _ref18 = _i18.value;
  16878. }
  16879. var _path2 = _ref18;
  16880. _path2.scope.registerConstantViolation(_path2);
  16881. }
  16882. };
  16883. Scope.prototype.push = function push(opts) {
  16884. var path = this.path;
  16885. if (!path.isBlockStatement() && !path.isProgram()) {
  16886. path = this.getBlockParent().path;
  16887. }
  16888. if (path.isSwitchStatement()) {
  16889. path = this.getFunctionParent().path;
  16890. }
  16891. if (path.isLoop() || path.isCatchClause() || path.isFunction()) {
  16892. t.ensureBlock(path.node);
  16893. path = path.get("body");
  16894. }
  16895. var unique = opts.unique;
  16896. var kind = opts.kind || "var";
  16897. var blockHoist = opts._blockHoist == null ? 2 : opts._blockHoist;
  16898. var dataKey = "declaration:" + kind + ":" + blockHoist;
  16899. var declarPath = !unique && path.getData(dataKey);
  16900. if (!declarPath) {
  16901. var declar = t.variableDeclaration(kind, []);
  16902. declar._generated = true;
  16903. declar._blockHoist = blockHoist;
  16904. var _path$unshiftContaine = path.unshiftContainer("body", [declar]);
  16905. declarPath = _path$unshiftContaine[0];
  16906. if (!unique) path.setData(dataKey, declarPath);
  16907. }
  16908. var declarator = t.variableDeclarator(opts.id, opts.init);
  16909. declarPath.node.declarations.push(declarator);
  16910. this.registerBinding(kind, declarPath.get("declarations").pop());
  16911. };
  16912. Scope.prototype.getProgramParent = function getProgramParent() {
  16913. var scope = this;
  16914. do {
  16915. if (scope.path.isProgram()) {
  16916. return scope;
  16917. }
  16918. } while (scope = scope.parent);
  16919. throw new Error("We couldn't find a Function or Program...");
  16920. };
  16921. Scope.prototype.getFunctionParent = function getFunctionParent() {
  16922. var scope = this;
  16923. do {
  16924. if (scope.path.isFunctionParent()) {
  16925. return scope;
  16926. }
  16927. } while (scope = scope.parent);
  16928. throw new Error("We couldn't find a Function or Program...");
  16929. };
  16930. Scope.prototype.getBlockParent = function getBlockParent() {
  16931. var scope = this;
  16932. do {
  16933. if (scope.path.isBlockParent()) {
  16934. return scope;
  16935. }
  16936. } while (scope = scope.parent);
  16937. throw new Error("We couldn't find a BlockStatement, For, Switch, Function, Loop or Program...");
  16938. };
  16939. Scope.prototype.getAllBindings = function getAllBindings() {
  16940. var ids = (0, _create2.default)(null);
  16941. var scope = this;
  16942. do {
  16943. (0, _defaults2.default)(ids, scope.bindings);
  16944. scope = scope.parent;
  16945. } while (scope);
  16946. return ids;
  16947. };
  16948. Scope.prototype.getAllBindingsOfKind = function getAllBindingsOfKind() {
  16949. var ids = (0, _create2.default)(null);
  16950. for (var _iterator19 = arguments, _isArray19 = Array.isArray(_iterator19), _i19 = 0, _iterator19 = _isArray19 ? _iterator19 : (0, _getIterator3.default)(_iterator19);;) {
  16951. var _ref19;
  16952. if (_isArray19) {
  16953. if (_i19 >= _iterator19.length) break;
  16954. _ref19 = _iterator19[_i19++];
  16955. } else {
  16956. _i19 = _iterator19.next();
  16957. if (_i19.done) break;
  16958. _ref19 = _i19.value;
  16959. }
  16960. var kind = _ref19;
  16961. var scope = this;
  16962. do {
  16963. for (var name in scope.bindings) {
  16964. var binding = scope.bindings[name];
  16965. if (binding.kind === kind) ids[name] = binding;
  16966. }
  16967. scope = scope.parent;
  16968. } while (scope);
  16969. }
  16970. return ids;
  16971. };
  16972. Scope.prototype.bindingIdentifierEquals = function bindingIdentifierEquals(name, node) {
  16973. return this.getBindingIdentifier(name) === node;
  16974. };
  16975. Scope.prototype.warnOnFlowBinding = function warnOnFlowBinding(binding) {
  16976. if (_crawlCallsCount === 0 && binding && binding.path.isFlow()) {
  16977. console.warn("\n You or one of the Babel plugins you are using are using Flow declarations as bindings.\n Support for this will be removed in version 7. To find out the caller, grep for this\n message and change it to a `console.trace()`.\n ");
  16978. }
  16979. return binding;
  16980. };
  16981. Scope.prototype.getBinding = function getBinding(name) {
  16982. var scope = this;
  16983. do {
  16984. var binding = scope.getOwnBinding(name);
  16985. if (binding) return this.warnOnFlowBinding(binding);
  16986. } while (scope = scope.parent);
  16987. };
  16988. Scope.prototype.getOwnBinding = function getOwnBinding(name) {
  16989. return this.warnOnFlowBinding(this.bindings[name]);
  16990. };
  16991. Scope.prototype.getBindingIdentifier = function getBindingIdentifier(name) {
  16992. var info = this.getBinding(name);
  16993. return info && info.identifier;
  16994. };
  16995. Scope.prototype.getOwnBindingIdentifier = function getOwnBindingIdentifier(name) {
  16996. var binding = this.bindings[name];
  16997. return binding && binding.identifier;
  16998. };
  16999. Scope.prototype.hasOwnBinding = function hasOwnBinding(name) {
  17000. return !!this.getOwnBinding(name);
  17001. };
  17002. Scope.prototype.hasBinding = function hasBinding(name, noGlobals) {
  17003. if (!name) return false;
  17004. if (this.hasOwnBinding(name)) return true;
  17005. if (this.parentHasBinding(name, noGlobals)) return true;
  17006. if (this.hasUid(name)) return true;
  17007. if (!noGlobals && (0, _includes2.default)(Scope.globals, name)) return true;
  17008. if (!noGlobals && (0, _includes2.default)(Scope.contextVariables, name)) return true;
  17009. return false;
  17010. };
  17011. Scope.prototype.parentHasBinding = function parentHasBinding(name, noGlobals) {
  17012. return this.parent && this.parent.hasBinding(name, noGlobals);
  17013. };
  17014. Scope.prototype.moveBindingTo = function moveBindingTo(name, scope) {
  17015. var info = this.getBinding(name);
  17016. if (info) {
  17017. info.scope.removeOwnBinding(name);
  17018. info.scope = scope;
  17019. scope.bindings[name] = info;
  17020. }
  17021. };
  17022. Scope.prototype.removeOwnBinding = function removeOwnBinding(name) {
  17023. delete this.bindings[name];
  17024. };
  17025. Scope.prototype.removeBinding = function removeBinding(name) {
  17026. var info = this.getBinding(name);
  17027. if (info) {
  17028. info.scope.removeOwnBinding(name);
  17029. }
  17030. var scope = this;
  17031. do {
  17032. if (scope.uids[name]) {
  17033. scope.uids[name] = false;
  17034. }
  17035. } while (scope = scope.parent);
  17036. };
  17037. return Scope;
  17038. }();
  17039. Scope.globals = (0, _keys2.default)(_globals2.default.builtin);
  17040. Scope.contextVariables = ["arguments", "undefined", "Infinity", "NaN"];
  17041. exports.default = Scope;
  17042. module.exports = exports["default"];
  17043. /***/ }),
  17044. /* 135 */
  17045. /***/ (function(module, exports, __webpack_require__) {
  17046. "use strict";
  17047. exports.__esModule = true;
  17048. exports.NOT_LOCAL_BINDING = exports.BLOCK_SCOPED_SYMBOL = exports.INHERIT_KEYS = exports.UNARY_OPERATORS = exports.STRING_UNARY_OPERATORS = exports.NUMBER_UNARY_OPERATORS = exports.BOOLEAN_UNARY_OPERATORS = exports.BINARY_OPERATORS = exports.NUMBER_BINARY_OPERATORS = exports.BOOLEAN_BINARY_OPERATORS = exports.COMPARISON_BINARY_OPERATORS = exports.EQUALITY_BINARY_OPERATORS = exports.BOOLEAN_NUMBER_BINARY_OPERATORS = exports.UPDATE_OPERATORS = exports.LOGICAL_OPERATORS = exports.COMMENT_KEYS = exports.FOR_INIT_KEYS = exports.FLATTENABLE_KEYS = exports.STATEMENT_OR_BLOCK_KEYS = undefined;
  17049. var _for = __webpack_require__(362);
  17050. var _for2 = _interopRequireDefault(_for);
  17051. function _interopRequireDefault(obj) {
  17052. return obj && obj.__esModule ? obj : { default: obj };
  17053. }
  17054. var STATEMENT_OR_BLOCK_KEYS = exports.STATEMENT_OR_BLOCK_KEYS = ["consequent", "body", "alternate"];
  17055. var FLATTENABLE_KEYS = exports.FLATTENABLE_KEYS = ["body", "expressions"];
  17056. var FOR_INIT_KEYS = exports.FOR_INIT_KEYS = ["left", "init"];
  17057. var COMMENT_KEYS = exports.COMMENT_KEYS = ["leadingComments", "trailingComments", "innerComments"];
  17058. var LOGICAL_OPERATORS = exports.LOGICAL_OPERATORS = ["||", "&&"];
  17059. var UPDATE_OPERATORS = exports.UPDATE_OPERATORS = ["++", "--"];
  17060. var BOOLEAN_NUMBER_BINARY_OPERATORS = exports.BOOLEAN_NUMBER_BINARY_OPERATORS = [">", "<", ">=", "<="];
  17061. var EQUALITY_BINARY_OPERATORS = exports.EQUALITY_BINARY_OPERATORS = ["==", "===", "!=", "!=="];
  17062. var COMPARISON_BINARY_OPERATORS = exports.COMPARISON_BINARY_OPERATORS = [].concat(EQUALITY_BINARY_OPERATORS, ["in", "instanceof"]);
  17063. var BOOLEAN_BINARY_OPERATORS = exports.BOOLEAN_BINARY_OPERATORS = [].concat(COMPARISON_BINARY_OPERATORS, BOOLEAN_NUMBER_BINARY_OPERATORS);
  17064. var NUMBER_BINARY_OPERATORS = exports.NUMBER_BINARY_OPERATORS = ["-", "/", "%", "*", "**", "&", "|", ">>", ">>>", "<<", "^"];
  17065. var BINARY_OPERATORS = exports.BINARY_OPERATORS = ["+"].concat(NUMBER_BINARY_OPERATORS, BOOLEAN_BINARY_OPERATORS);
  17066. var BOOLEAN_UNARY_OPERATORS = exports.BOOLEAN_UNARY_OPERATORS = ["delete", "!"];
  17067. var NUMBER_UNARY_OPERATORS = exports.NUMBER_UNARY_OPERATORS = ["+", "-", "++", "--", "~"];
  17068. var STRING_UNARY_OPERATORS = exports.STRING_UNARY_OPERATORS = ["typeof"];
  17069. var UNARY_OPERATORS = exports.UNARY_OPERATORS = ["void"].concat(BOOLEAN_UNARY_OPERATORS, NUMBER_UNARY_OPERATORS, STRING_UNARY_OPERATORS);
  17070. var INHERIT_KEYS = exports.INHERIT_KEYS = {
  17071. optional: ["typeAnnotation", "typeParameters", "returnType"],
  17072. force: ["start", "loc", "end"]
  17073. };
  17074. var BLOCK_SCOPED_SYMBOL = exports.BLOCK_SCOPED_SYMBOL = (0, _for2.default)("var used to be block scoped");
  17075. var NOT_LOCAL_BINDING = exports.NOT_LOCAL_BINDING = (0, _for2.default)("should not be considered a local binding");
  17076. /***/ }),
  17077. /* 136 */
  17078. /***/ (function(module, exports) {
  17079. 'use strict';
  17080. module.exports = function (it, Constructor, name, forbiddenField) {
  17081. if (!(it instanceof Constructor) || forbiddenField !== undefined && forbiddenField in it) {
  17082. throw TypeError(name + ': incorrect invocation!');
  17083. }return it;
  17084. };
  17085. /***/ }),
  17086. /* 137 */
  17087. /***/ (function(module, exports, __webpack_require__) {
  17088. 'use strict';
  17089. // 0 -> Array#forEach
  17090. // 1 -> Array#map
  17091. // 2 -> Array#filter
  17092. // 3 -> Array#some
  17093. // 4 -> Array#every
  17094. // 5 -> Array#find
  17095. // 6 -> Array#findIndex
  17096. var ctx = __webpack_require__(43);
  17097. var IObject = __webpack_require__(142);
  17098. var toObject = __webpack_require__(94);
  17099. var toLength = __webpack_require__(153);
  17100. var asc = __webpack_require__(422);
  17101. module.exports = function (TYPE, $create) {
  17102. var IS_MAP = TYPE == 1;
  17103. var IS_FILTER = TYPE == 2;
  17104. var IS_SOME = TYPE == 3;
  17105. var IS_EVERY = TYPE == 4;
  17106. var IS_FIND_INDEX = TYPE == 6;
  17107. var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
  17108. var create = $create || asc;
  17109. return function ($this, callbackfn, that) {
  17110. var O = toObject($this);
  17111. var self = IObject(O);
  17112. var f = ctx(callbackfn, that, 3);
  17113. var length = toLength(self.length);
  17114. var index = 0;
  17115. var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;
  17116. var val, res;
  17117. for (; length > index; index++) {
  17118. if (NO_HOLES || index in self) {
  17119. val = self[index];
  17120. res = f(val, index, O);
  17121. if (TYPE) {
  17122. if (IS_MAP) result[index] = res; // map
  17123. else if (res) switch (TYPE) {
  17124. case 3:
  17125. return true; // some
  17126. case 5:
  17127. return val; // find
  17128. case 6:
  17129. return index; // findIndex
  17130. case 2:
  17131. result.push(val); // filter
  17132. } else if (IS_EVERY) return false; // every
  17133. }
  17134. }
  17135. }return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;
  17136. };
  17137. };
  17138. /***/ }),
  17139. /* 138 */
  17140. /***/ (function(module, exports) {
  17141. "use strict";
  17142. var toString = {}.toString;
  17143. module.exports = function (it) {
  17144. return toString.call(it).slice(8, -1);
  17145. };
  17146. /***/ }),
  17147. /* 139 */
  17148. /***/ (function(module, exports, __webpack_require__) {
  17149. 'use strict';
  17150. var global = __webpack_require__(15);
  17151. var $export = __webpack_require__(12);
  17152. var meta = __webpack_require__(57);
  17153. var fails = __webpack_require__(27);
  17154. var hide = __webpack_require__(29);
  17155. var redefineAll = __webpack_require__(146);
  17156. var forOf = __webpack_require__(55);
  17157. var anInstance = __webpack_require__(136);
  17158. var isObject = __webpack_require__(16);
  17159. var setToStringTag = __webpack_require__(93);
  17160. var dP = __webpack_require__(23).f;
  17161. var each = __webpack_require__(137)(0);
  17162. var DESCRIPTORS = __webpack_require__(22);
  17163. module.exports = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) {
  17164. var Base = global[NAME];
  17165. var C = Base;
  17166. var ADDER = IS_MAP ? 'set' : 'add';
  17167. var proto = C && C.prototype;
  17168. var O = {};
  17169. if (!DESCRIPTORS || typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function () {
  17170. new C().entries().next();
  17171. }))) {
  17172. // create collection constructor
  17173. C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER);
  17174. redefineAll(C.prototype, methods);
  17175. meta.NEED = true;
  17176. } else {
  17177. C = wrapper(function (target, iterable) {
  17178. anInstance(target, C, NAME, '_c');
  17179. target._c = new Base();
  17180. if (iterable != undefined) forOf(iterable, IS_MAP, target[ADDER], target);
  17181. });
  17182. each('add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON'.split(','), function (KEY) {
  17183. var IS_ADDER = KEY == 'add' || KEY == 'set';
  17184. if (KEY in proto && !(IS_WEAK && KEY == 'clear')) hide(C.prototype, KEY, function (a, b) {
  17185. anInstance(this, C, KEY);
  17186. if (!IS_ADDER && IS_WEAK && !isObject(a)) return KEY == 'get' ? undefined : false;
  17187. var result = this._c[KEY](a === 0 ? 0 : a, b);
  17188. return IS_ADDER ? this : result;
  17189. });
  17190. });
  17191. IS_WEAK || dP(C.prototype, 'size', {
  17192. get: function get() {
  17193. return this._c.size;
  17194. }
  17195. });
  17196. }
  17197. setToStringTag(C, NAME);
  17198. O[NAME] = C;
  17199. $export($export.G + $export.W + $export.F, O);
  17200. if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP);
  17201. return C;
  17202. };
  17203. /***/ }),
  17204. /* 140 */
  17205. /***/ (function(module, exports) {
  17206. "use strict";
  17207. // 7.2.1 RequireObjectCoercible(argument)
  17208. module.exports = function (it) {
  17209. if (it == undefined) throw TypeError("Can't call method on " + it);
  17210. return it;
  17211. };
  17212. /***/ }),
  17213. /* 141 */
  17214. /***/ (function(module, exports) {
  17215. 'use strict';
  17216. // IE 8- don't enum bug keys
  17217. module.exports = 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'.split(',');
  17218. /***/ }),
  17219. /* 142 */
  17220. /***/ (function(module, exports, __webpack_require__) {
  17221. 'use strict';
  17222. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  17223. var cof = __webpack_require__(138);
  17224. // eslint-disable-next-line no-prototype-builtins
  17225. module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
  17226. return cof(it) == 'String' ? it.split('') : Object(it);
  17227. };
  17228. /***/ }),
  17229. /* 143 */
  17230. /***/ (function(module, exports, __webpack_require__) {
  17231. 'use strict';
  17232. var LIBRARY = __webpack_require__(144);
  17233. var $export = __webpack_require__(12);
  17234. var redefine = __webpack_require__(147);
  17235. var hide = __webpack_require__(29);
  17236. var has = __webpack_require__(28);
  17237. var Iterators = __webpack_require__(56);
  17238. var $iterCreate = __webpack_require__(429);
  17239. var setToStringTag = __webpack_require__(93);
  17240. var getPrototypeOf = __webpack_require__(433);
  17241. var ITERATOR = __webpack_require__(13)('iterator');
  17242. var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`
  17243. var FF_ITERATOR = '@@iterator';
  17244. var KEYS = 'keys';
  17245. var VALUES = 'values';
  17246. var returnThis = function returnThis() {
  17247. return this;
  17248. };
  17249. module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {
  17250. $iterCreate(Constructor, NAME, next);
  17251. var getMethod = function getMethod(kind) {
  17252. if (!BUGGY && kind in proto) return proto[kind];
  17253. switch (kind) {
  17254. case KEYS:
  17255. return function keys() {
  17256. return new Constructor(this, kind);
  17257. };
  17258. case VALUES:
  17259. return function values() {
  17260. return new Constructor(this, kind);
  17261. };
  17262. }return function entries() {
  17263. return new Constructor(this, kind);
  17264. };
  17265. };
  17266. var TAG = NAME + ' Iterator';
  17267. var DEF_VALUES = DEFAULT == VALUES;
  17268. var VALUES_BUG = false;
  17269. var proto = Base.prototype;
  17270. var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];
  17271. var $default = $native || getMethod(DEFAULT);
  17272. var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;
  17273. var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;
  17274. var methods, key, IteratorPrototype;
  17275. // Fix native
  17276. if ($anyNative) {
  17277. IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));
  17278. if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {
  17279. // Set @@toStringTag to native iterators
  17280. setToStringTag(IteratorPrototype, TAG, true);
  17281. // fix for some old engines
  17282. if (!LIBRARY && !has(IteratorPrototype, ITERATOR)) hide(IteratorPrototype, ITERATOR, returnThis);
  17283. }
  17284. }
  17285. // fix Array#{values, @@iterator}.name in V8 / FF
  17286. if (DEF_VALUES && $native && $native.name !== VALUES) {
  17287. VALUES_BUG = true;
  17288. $default = function values() {
  17289. return $native.call(this);
  17290. };
  17291. }
  17292. // Define iterator
  17293. if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {
  17294. hide(proto, ITERATOR, $default);
  17295. }
  17296. // Plug for library
  17297. Iterators[NAME] = $default;
  17298. Iterators[TAG] = returnThis;
  17299. if (DEFAULT) {
  17300. methods = {
  17301. values: DEF_VALUES ? $default : getMethod(VALUES),
  17302. keys: IS_SET ? $default : getMethod(KEYS),
  17303. entries: $entries
  17304. };
  17305. if (FORCED) for (key in methods) {
  17306. if (!(key in proto)) redefine(proto, key, methods[key]);
  17307. } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);
  17308. }
  17309. return methods;
  17310. };
  17311. /***/ }),
  17312. /* 144 */
  17313. /***/ (function(module, exports) {
  17314. "use strict";
  17315. module.exports = true;
  17316. /***/ }),
  17317. /* 145 */
  17318. /***/ (function(module, exports) {
  17319. "use strict";
  17320. exports.f = Object.getOwnPropertySymbols;
  17321. /***/ }),
  17322. /* 146 */
  17323. /***/ (function(module, exports, __webpack_require__) {
  17324. 'use strict';
  17325. var hide = __webpack_require__(29);
  17326. module.exports = function (target, src, safe) {
  17327. for (var key in src) {
  17328. if (safe && target[key]) target[key] = src[key];else hide(target, key, src[key]);
  17329. }return target;
  17330. };
  17331. /***/ }),
  17332. /* 147 */
  17333. /***/ (function(module, exports, __webpack_require__) {
  17334. 'use strict';
  17335. module.exports = __webpack_require__(29);
  17336. /***/ }),
  17337. /* 148 */
  17338. /***/ (function(module, exports, __webpack_require__) {
  17339. 'use strict';
  17340. // https://tc39.github.io/proposal-setmap-offrom/
  17341. var $export = __webpack_require__(12);
  17342. var aFunction = __webpack_require__(227);
  17343. var ctx = __webpack_require__(43);
  17344. var forOf = __webpack_require__(55);
  17345. module.exports = function (COLLECTION) {
  17346. $export($export.S, COLLECTION, { from: function from(source /* , mapFn, thisArg */) {
  17347. var mapFn = arguments[1];
  17348. var mapping, A, n, cb;
  17349. aFunction(this);
  17350. mapping = mapFn !== undefined;
  17351. if (mapping) aFunction(mapFn);
  17352. if (source == undefined) return new this();
  17353. A = [];
  17354. if (mapping) {
  17355. n = 0;
  17356. cb = ctx(mapFn, arguments[2], 2);
  17357. forOf(source, false, function (nextItem) {
  17358. A.push(cb(nextItem, n++));
  17359. });
  17360. } else {
  17361. forOf(source, false, A.push, A);
  17362. }
  17363. return new this(A);
  17364. } });
  17365. };
  17366. /***/ }),
  17367. /* 149 */
  17368. /***/ (function(module, exports, __webpack_require__) {
  17369. 'use strict';
  17370. // https://tc39.github.io/proposal-setmap-offrom/
  17371. var $export = __webpack_require__(12);
  17372. module.exports = function (COLLECTION) {
  17373. $export($export.S, COLLECTION, { of: function of() {
  17374. var length = arguments.length;
  17375. var A = Array(length);
  17376. while (length--) {
  17377. A[length] = arguments[length];
  17378. }return new this(A);
  17379. } });
  17380. };
  17381. /***/ }),
  17382. /* 150 */
  17383. /***/ (function(module, exports, __webpack_require__) {
  17384. 'use strict';
  17385. var shared = __webpack_require__(151)('keys');
  17386. var uid = __webpack_require__(95);
  17387. module.exports = function (key) {
  17388. return shared[key] || (shared[key] = uid(key));
  17389. };
  17390. /***/ }),
  17391. /* 151 */
  17392. /***/ (function(module, exports, __webpack_require__) {
  17393. 'use strict';
  17394. var global = __webpack_require__(15);
  17395. var SHARED = '__core-js_shared__';
  17396. var store = global[SHARED] || (global[SHARED] = {});
  17397. module.exports = function (key) {
  17398. return store[key] || (store[key] = {});
  17399. };
  17400. /***/ }),
  17401. /* 152 */
  17402. /***/ (function(module, exports) {
  17403. "use strict";
  17404. // 7.1.4 ToInteger
  17405. var ceil = Math.ceil;
  17406. var floor = Math.floor;
  17407. module.exports = function (it) {
  17408. return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
  17409. };
  17410. /***/ }),
  17411. /* 153 */
  17412. /***/ (function(module, exports, __webpack_require__) {
  17413. 'use strict';
  17414. // 7.1.15 ToLength
  17415. var toInteger = __webpack_require__(152);
  17416. var min = Math.min;
  17417. module.exports = function (it) {
  17418. return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
  17419. };
  17420. /***/ }),
  17421. /* 154 */
  17422. /***/ (function(module, exports, __webpack_require__) {
  17423. 'use strict';
  17424. // 7.1.1 ToPrimitive(input [, PreferredType])
  17425. var isObject = __webpack_require__(16);
  17426. // instead of the ES6 spec version, we didn't implement @@toPrimitive case
  17427. // and the second argument - flag - preferred type is a string
  17428. module.exports = function (it, S) {
  17429. if (!isObject(it)) return it;
  17430. var fn, val;
  17431. if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
  17432. if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;
  17433. if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
  17434. throw TypeError("Can't convert object to primitive value");
  17435. };
  17436. /***/ }),
  17437. /* 155 */
  17438. /***/ (function(module, exports, __webpack_require__) {
  17439. 'use strict';
  17440. var global = __webpack_require__(15);
  17441. var core = __webpack_require__(5);
  17442. var LIBRARY = __webpack_require__(144);
  17443. var wksExt = __webpack_require__(156);
  17444. var defineProperty = __webpack_require__(23).f;
  17445. module.exports = function (name) {
  17446. var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {});
  17447. if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) });
  17448. };
  17449. /***/ }),
  17450. /* 156 */
  17451. /***/ (function(module, exports, __webpack_require__) {
  17452. 'use strict';
  17453. exports.f = __webpack_require__(13);
  17454. /***/ }),
  17455. /* 157 */
  17456. /***/ (function(module, exports, __webpack_require__) {
  17457. 'use strict';
  17458. var $at = __webpack_require__(437)(true);
  17459. // 21.1.3.27 String.prototype[@@iterator]()
  17460. __webpack_require__(143)(String, 'String', function (iterated) {
  17461. this._t = String(iterated); // target
  17462. this._i = 0; // next index
  17463. // 21.1.5.2.1 %StringIteratorPrototype%.next()
  17464. }, function () {
  17465. var O = this._t;
  17466. var index = this._i;
  17467. var point;
  17468. if (index >= O.length) return { value: undefined, done: true };
  17469. point = $at(O, index);
  17470. this._i += point.length;
  17471. return { value: point, done: false };
  17472. });
  17473. /***/ }),
  17474. /* 158 */
  17475. /***/ (function(module, exports, __webpack_require__) {
  17476. 'use strict';
  17477. // ECMAScript 6 symbols shim
  17478. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  17479. var global = __webpack_require__(15);
  17480. var has = __webpack_require__(28);
  17481. var DESCRIPTORS = __webpack_require__(22);
  17482. var $export = __webpack_require__(12);
  17483. var redefine = __webpack_require__(147);
  17484. var META = __webpack_require__(57).KEY;
  17485. var $fails = __webpack_require__(27);
  17486. var shared = __webpack_require__(151);
  17487. var setToStringTag = __webpack_require__(93);
  17488. var uid = __webpack_require__(95);
  17489. var wks = __webpack_require__(13);
  17490. var wksExt = __webpack_require__(156);
  17491. var wksDefine = __webpack_require__(155);
  17492. var keyOf = __webpack_require__(430);
  17493. var enumKeys = __webpack_require__(425);
  17494. var isArray = __webpack_require__(232);
  17495. var anObject = __webpack_require__(21);
  17496. var toIObject = __webpack_require__(37);
  17497. var toPrimitive = __webpack_require__(154);
  17498. var createDesc = __webpack_require__(92);
  17499. var _create = __webpack_require__(90);
  17500. var gOPNExt = __webpack_require__(432);
  17501. var $GOPD = __webpack_require__(235);
  17502. var $DP = __webpack_require__(23);
  17503. var $keys = __webpack_require__(44);
  17504. var gOPD = $GOPD.f;
  17505. var dP = $DP.f;
  17506. var gOPN = gOPNExt.f;
  17507. var $Symbol = global.Symbol;
  17508. var $JSON = global.JSON;
  17509. var _stringify = $JSON && $JSON.stringify;
  17510. var PROTOTYPE = 'prototype';
  17511. var HIDDEN = wks('_hidden');
  17512. var TO_PRIMITIVE = wks('toPrimitive');
  17513. var isEnum = {}.propertyIsEnumerable;
  17514. var SymbolRegistry = shared('symbol-registry');
  17515. var AllSymbols = shared('symbols');
  17516. var OPSymbols = shared('op-symbols');
  17517. var ObjectProto = Object[PROTOTYPE];
  17518. var USE_NATIVE = typeof $Symbol == 'function';
  17519. var QObject = global.QObject;
  17520. // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
  17521. var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
  17522. // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687
  17523. var setSymbolDesc = DESCRIPTORS && $fails(function () {
  17524. return _create(dP({}, 'a', {
  17525. get: function get() {
  17526. return dP(this, 'a', { value: 7 }).a;
  17527. }
  17528. })).a != 7;
  17529. }) ? function (it, key, D) {
  17530. var protoDesc = gOPD(ObjectProto, key);
  17531. if (protoDesc) delete ObjectProto[key];
  17532. dP(it, key, D);
  17533. if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc);
  17534. } : dP;
  17535. var wrap = function wrap(tag) {
  17536. var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);
  17537. sym._k = tag;
  17538. return sym;
  17539. };
  17540. var isSymbol = USE_NATIVE && _typeof($Symbol.iterator) == 'symbol' ? function (it) {
  17541. return (typeof it === 'undefined' ? 'undefined' : _typeof(it)) == 'symbol';
  17542. } : function (it) {
  17543. return it instanceof $Symbol;
  17544. };
  17545. var $defineProperty = function defineProperty(it, key, D) {
  17546. if (it === ObjectProto) $defineProperty(OPSymbols, key, D);
  17547. anObject(it);
  17548. key = toPrimitive(key, true);
  17549. anObject(D);
  17550. if (has(AllSymbols, key)) {
  17551. if (!D.enumerable) {
  17552. if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {}));
  17553. it[HIDDEN][key] = true;
  17554. } else {
  17555. if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false;
  17556. D = _create(D, { enumerable: createDesc(0, false) });
  17557. }return setSymbolDesc(it, key, D);
  17558. }return dP(it, key, D);
  17559. };
  17560. var $defineProperties = function defineProperties(it, P) {
  17561. anObject(it);
  17562. var keys = enumKeys(P = toIObject(P));
  17563. var i = 0;
  17564. var l = keys.length;
  17565. var key;
  17566. while (l > i) {
  17567. $defineProperty(it, key = keys[i++], P[key]);
  17568. }return it;
  17569. };
  17570. var $create = function create(it, P) {
  17571. return P === undefined ? _create(it) : $defineProperties(_create(it), P);
  17572. };
  17573. var $propertyIsEnumerable = function propertyIsEnumerable(key) {
  17574. var E = isEnum.call(this, key = toPrimitive(key, true));
  17575. if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false;
  17576. return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;
  17577. };
  17578. var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) {
  17579. it = toIObject(it);
  17580. key = toPrimitive(key, true);
  17581. if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return;
  17582. var D = gOPD(it, key);
  17583. if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true;
  17584. return D;
  17585. };
  17586. var $getOwnPropertyNames = function getOwnPropertyNames(it) {
  17587. var names = gOPN(toIObject(it));
  17588. var result = [];
  17589. var i = 0;
  17590. var key;
  17591. while (names.length > i) {
  17592. if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key);
  17593. }return result;
  17594. };
  17595. var $getOwnPropertySymbols = function getOwnPropertySymbols(it) {
  17596. var IS_OP = it === ObjectProto;
  17597. var names = gOPN(IS_OP ? OPSymbols : toIObject(it));
  17598. var result = [];
  17599. var i = 0;
  17600. var key;
  17601. while (names.length > i) {
  17602. if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]);
  17603. }return result;
  17604. };
  17605. // 19.4.1.1 Symbol([description])
  17606. if (!USE_NATIVE) {
  17607. $Symbol = function _Symbol() {
  17608. if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!');
  17609. var tag = uid(arguments.length > 0 ? arguments[0] : undefined);
  17610. var $set = function $set(value) {
  17611. if (this === ObjectProto) $set.call(OPSymbols, value);
  17612. if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;
  17613. setSymbolDesc(this, tag, createDesc(1, value));
  17614. };
  17615. if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set });
  17616. return wrap(tag);
  17617. };
  17618. redefine($Symbol[PROTOTYPE], 'toString', function toString() {
  17619. return this._k;
  17620. });
  17621. $GOPD.f = $getOwnPropertyDescriptor;
  17622. $DP.f = $defineProperty;
  17623. __webpack_require__(236).f = gOPNExt.f = $getOwnPropertyNames;
  17624. __webpack_require__(91).f = $propertyIsEnumerable;
  17625. __webpack_require__(145).f = $getOwnPropertySymbols;
  17626. if (DESCRIPTORS && !__webpack_require__(144)) {
  17627. redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);
  17628. }
  17629. wksExt.f = function (name) {
  17630. return wrap(wks(name));
  17631. };
  17632. }
  17633. $export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol });
  17634. for (var es6Symbols =
  17635. // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14
  17636. 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'.split(','), j = 0; es6Symbols.length > j;) {
  17637. wks(es6Symbols[j++]);
  17638. }for (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) {
  17639. wksDefine(wellKnownSymbols[k++]);
  17640. }$export($export.S + $export.F * !USE_NATIVE, 'Symbol', {
  17641. // 19.4.2.1 Symbol.for(key)
  17642. 'for': function _for(key) {
  17643. return has(SymbolRegistry, key += '') ? SymbolRegistry[key] : SymbolRegistry[key] = $Symbol(key);
  17644. },
  17645. // 19.4.2.5 Symbol.keyFor(sym)
  17646. keyFor: function keyFor(key) {
  17647. if (isSymbol(key)) return keyOf(SymbolRegistry, key);
  17648. throw TypeError(key + ' is not a symbol!');
  17649. },
  17650. useSetter: function useSetter() {
  17651. setter = true;
  17652. },
  17653. useSimple: function useSimple() {
  17654. setter = false;
  17655. }
  17656. });
  17657. $export($export.S + $export.F * !USE_NATIVE, 'Object', {
  17658. // 19.1.2.2 Object.create(O [, Properties])
  17659. create: $create,
  17660. // 19.1.2.4 Object.defineProperty(O, P, Attributes)
  17661. defineProperty: $defineProperty,
  17662. // 19.1.2.3 Object.defineProperties(O, Properties)
  17663. defineProperties: $defineProperties,
  17664. // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
  17665. getOwnPropertyDescriptor: $getOwnPropertyDescriptor,
  17666. // 19.1.2.7 Object.getOwnPropertyNames(O)
  17667. getOwnPropertyNames: $getOwnPropertyNames,
  17668. // 19.1.2.8 Object.getOwnPropertySymbols(O)
  17669. getOwnPropertySymbols: $getOwnPropertySymbols
  17670. });
  17671. // 24.3.2 JSON.stringify(value [, replacer [, space]])
  17672. $JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () {
  17673. var S = $Symbol();
  17674. // MS Edge converts symbol values to JSON as {}
  17675. // WebKit converts symbol values to JSON as null
  17676. // V8 throws on boxed symbols
  17677. return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}';
  17678. })), 'JSON', {
  17679. stringify: function stringify(it) {
  17680. if (it === undefined || isSymbol(it)) return; // IE8 returns string on undefined
  17681. var args = [it];
  17682. var i = 1;
  17683. var replacer, $replacer;
  17684. while (arguments.length > i) {
  17685. args.push(arguments[i++]);
  17686. }replacer = args[1];
  17687. if (typeof replacer == 'function') $replacer = replacer;
  17688. if ($replacer || !isArray(replacer)) replacer = function replacer(key, value) {
  17689. if ($replacer) value = $replacer.call(this, key, value);
  17690. if (!isSymbol(value)) return value;
  17691. };
  17692. args[1] = replacer;
  17693. return _stringify.apply($JSON, args);
  17694. }
  17695. });
  17696. // 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)
  17697. $Symbol[PROTOTYPE][TO_PRIMITIVE] || __webpack_require__(29)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);
  17698. // 19.4.3.5 Symbol.prototype[@@toStringTag]
  17699. setToStringTag($Symbol, 'Symbol');
  17700. // 20.2.1.9 Math[@@toStringTag]
  17701. setToStringTag(Math, 'Math', true);
  17702. // 24.3.3 JSON[@@toStringTag]
  17703. setToStringTag(global.JSON, 'JSON', true);
  17704. /***/ }),
  17705. /* 159 */
  17706. /***/ (function(module, exports, __webpack_require__) {
  17707. 'use strict';
  17708. var getNative = __webpack_require__(38),
  17709. root = __webpack_require__(17);
  17710. /* Built-in method references that are verified to be native. */
  17711. var Map = getNative(root, 'Map');
  17712. module.exports = Map;
  17713. /***/ }),
  17714. /* 160 */
  17715. /***/ (function(module, exports, __webpack_require__) {
  17716. 'use strict';
  17717. var mapCacheClear = __webpack_require__(551),
  17718. mapCacheDelete = __webpack_require__(552),
  17719. mapCacheGet = __webpack_require__(553),
  17720. mapCacheHas = __webpack_require__(554),
  17721. mapCacheSet = __webpack_require__(555);
  17722. /**
  17723. * Creates a map cache object to store key-value pairs.
  17724. *
  17725. * @private
  17726. * @constructor
  17727. * @param {Array} [entries] The key-value pairs to cache.
  17728. */
  17729. function MapCache(entries) {
  17730. var index = -1,
  17731. length = entries == null ? 0 : entries.length;
  17732. this.clear();
  17733. while (++index < length) {
  17734. var entry = entries[index];
  17735. this.set(entry[0], entry[1]);
  17736. }
  17737. }
  17738. // Add methods to `MapCache`.
  17739. MapCache.prototype.clear = mapCacheClear;
  17740. MapCache.prototype['delete'] = mapCacheDelete;
  17741. MapCache.prototype.get = mapCacheGet;
  17742. MapCache.prototype.has = mapCacheHas;
  17743. MapCache.prototype.set = mapCacheSet;
  17744. module.exports = MapCache;
  17745. /***/ }),
  17746. /* 161 */
  17747. /***/ (function(module, exports) {
  17748. "use strict";
  17749. /**
  17750. * Appends the elements of `values` to `array`.
  17751. *
  17752. * @private
  17753. * @param {Array} array The array to modify.
  17754. * @param {Array} values The values to append.
  17755. * @returns {Array} Returns `array`.
  17756. */
  17757. function arrayPush(array, values) {
  17758. var index = -1,
  17759. length = values.length,
  17760. offset = array.length;
  17761. while (++index < length) {
  17762. array[offset + index] = values[index];
  17763. }
  17764. return array;
  17765. }
  17766. module.exports = arrayPush;
  17767. /***/ }),
  17768. /* 162 */
  17769. /***/ (function(module, exports, __webpack_require__) {
  17770. 'use strict';
  17771. var baseAssignValue = __webpack_require__(163),
  17772. eq = __webpack_require__(46);
  17773. /** Used for built-in method references. */
  17774. var objectProto = Object.prototype;
  17775. /** Used to check objects for own properties. */
  17776. var hasOwnProperty = objectProto.hasOwnProperty;
  17777. /**
  17778. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  17779. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  17780. * for equality comparisons.
  17781. *
  17782. * @private
  17783. * @param {Object} object The object to modify.
  17784. * @param {string} key The key of the property to assign.
  17785. * @param {*} value The value to assign.
  17786. */
  17787. function assignValue(object, key, value) {
  17788. var objValue = object[key];
  17789. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || value === undefined && !(key in object)) {
  17790. baseAssignValue(object, key, value);
  17791. }
  17792. }
  17793. module.exports = assignValue;
  17794. /***/ }),
  17795. /* 163 */
  17796. /***/ (function(module, exports, __webpack_require__) {
  17797. 'use strict';
  17798. var defineProperty = __webpack_require__(259);
  17799. /**
  17800. * The base implementation of `assignValue` and `assignMergeValue` without
  17801. * value checks.
  17802. *
  17803. * @private
  17804. * @param {Object} object The object to modify.
  17805. * @param {string} key The key of the property to assign.
  17806. * @param {*} value The value to assign.
  17807. */
  17808. function baseAssignValue(object, key, value) {
  17809. if (key == '__proto__' && defineProperty) {
  17810. defineProperty(object, key, {
  17811. 'configurable': true,
  17812. 'enumerable': true,
  17813. 'value': value,
  17814. 'writable': true
  17815. });
  17816. } else {
  17817. object[key] = value;
  17818. }
  17819. }
  17820. module.exports = baseAssignValue;
  17821. /***/ }),
  17822. /* 164 */
  17823. /***/ (function(module, exports, __webpack_require__) {
  17824. 'use strict';
  17825. var Stack = __webpack_require__(99),
  17826. arrayEach = __webpack_require__(478),
  17827. assignValue = __webpack_require__(162),
  17828. baseAssign = __webpack_require__(483),
  17829. baseAssignIn = __webpack_require__(484),
  17830. cloneBuffer = __webpack_require__(256),
  17831. copyArray = __webpack_require__(168),
  17832. copySymbols = __webpack_require__(523),
  17833. copySymbolsIn = __webpack_require__(524),
  17834. getAllKeys = __webpack_require__(262),
  17835. getAllKeysIn = __webpack_require__(532),
  17836. getTag = __webpack_require__(264),
  17837. initCloneArray = __webpack_require__(541),
  17838. initCloneByTag = __webpack_require__(542),
  17839. initCloneObject = __webpack_require__(266),
  17840. isArray = __webpack_require__(6),
  17841. isBuffer = __webpack_require__(113),
  17842. isObject = __webpack_require__(18),
  17843. keys = __webpack_require__(32);
  17844. /** Used to compose bitmasks for cloning. */
  17845. var CLONE_DEEP_FLAG = 1,
  17846. CLONE_FLAT_FLAG = 2,
  17847. CLONE_SYMBOLS_FLAG = 4;
  17848. /** `Object#toString` result references. */
  17849. var argsTag = '[object Arguments]',
  17850. arrayTag = '[object Array]',
  17851. boolTag = '[object Boolean]',
  17852. dateTag = '[object Date]',
  17853. errorTag = '[object Error]',
  17854. funcTag = '[object Function]',
  17855. genTag = '[object GeneratorFunction]',
  17856. mapTag = '[object Map]',
  17857. numberTag = '[object Number]',
  17858. objectTag = '[object Object]',
  17859. regexpTag = '[object RegExp]',
  17860. setTag = '[object Set]',
  17861. stringTag = '[object String]',
  17862. symbolTag = '[object Symbol]',
  17863. weakMapTag = '[object WeakMap]';
  17864. var arrayBufferTag = '[object ArrayBuffer]',
  17865. dataViewTag = '[object DataView]',
  17866. float32Tag = '[object Float32Array]',
  17867. float64Tag = '[object Float64Array]',
  17868. int8Tag = '[object Int8Array]',
  17869. int16Tag = '[object Int16Array]',
  17870. int32Tag = '[object Int32Array]',
  17871. uint8Tag = '[object Uint8Array]',
  17872. uint8ClampedTag = '[object Uint8ClampedArray]',
  17873. uint16Tag = '[object Uint16Array]',
  17874. uint32Tag = '[object Uint32Array]';
  17875. /** Used to identify `toStringTag` values supported by `_.clone`. */
  17876. var cloneableTags = {};
  17877. cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag] = cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  17878. cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false;
  17879. /**
  17880. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  17881. * traversed objects.
  17882. *
  17883. * @private
  17884. * @param {*} value The value to clone.
  17885. * @param {boolean} bitmask The bitmask flags.
  17886. * 1 - Deep clone
  17887. * 2 - Flatten inherited properties
  17888. * 4 - Clone symbols
  17889. * @param {Function} [customizer] The function to customize cloning.
  17890. * @param {string} [key] The key of `value`.
  17891. * @param {Object} [object] The parent object of `value`.
  17892. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  17893. * @returns {*} Returns the cloned value.
  17894. */
  17895. function baseClone(value, bitmask, customizer, key, object, stack) {
  17896. var result,
  17897. isDeep = bitmask & CLONE_DEEP_FLAG,
  17898. isFlat = bitmask & CLONE_FLAT_FLAG,
  17899. isFull = bitmask & CLONE_SYMBOLS_FLAG;
  17900. if (customizer) {
  17901. result = object ? customizer(value, key, object, stack) : customizer(value);
  17902. }
  17903. if (result !== undefined) {
  17904. return result;
  17905. }
  17906. if (!isObject(value)) {
  17907. return value;
  17908. }
  17909. var isArr = isArray(value);
  17910. if (isArr) {
  17911. result = initCloneArray(value);
  17912. if (!isDeep) {
  17913. return copyArray(value, result);
  17914. }
  17915. } else {
  17916. var tag = getTag(value),
  17917. isFunc = tag == funcTag || tag == genTag;
  17918. if (isBuffer(value)) {
  17919. return cloneBuffer(value, isDeep);
  17920. }
  17921. if (tag == objectTag || tag == argsTag || isFunc && !object) {
  17922. result = isFlat || isFunc ? {} : initCloneObject(value);
  17923. if (!isDeep) {
  17924. return isFlat ? copySymbolsIn(value, baseAssignIn(result, value)) : copySymbols(value, baseAssign(result, value));
  17925. }
  17926. } else {
  17927. if (!cloneableTags[tag]) {
  17928. return object ? value : {};
  17929. }
  17930. result = initCloneByTag(value, tag, baseClone, isDeep);
  17931. }
  17932. }
  17933. // Check for circular references and return its corresponding clone.
  17934. stack || (stack = new Stack());
  17935. var stacked = stack.get(value);
  17936. if (stacked) {
  17937. return stacked;
  17938. }
  17939. stack.set(value, result);
  17940. var keysFunc = isFull ? isFlat ? getAllKeysIn : getAllKeys : isFlat ? keysIn : keys;
  17941. var props = isArr ? undefined : keysFunc(value);
  17942. arrayEach(props || value, function (subValue, key) {
  17943. if (props) {
  17944. key = subValue;
  17945. subValue = value[key];
  17946. }
  17947. // Recursively populate clone (susceptible to call stack limits).
  17948. assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  17949. });
  17950. return result;
  17951. }
  17952. module.exports = baseClone;
  17953. /***/ }),
  17954. /* 165 */
  17955. /***/ (function(module, exports) {
  17956. "use strict";
  17957. /**
  17958. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  17959. * support for iteratee shorthands.
  17960. *
  17961. * @private
  17962. * @param {Array} array The array to inspect.
  17963. * @param {Function} predicate The function invoked per iteration.
  17964. * @param {number} fromIndex The index to search from.
  17965. * @param {boolean} [fromRight] Specify iterating from right to left.
  17966. * @returns {number} Returns the index of the matched value, else `-1`.
  17967. */
  17968. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  17969. var length = array.length,
  17970. index = fromIndex + (fromRight ? 1 : -1);
  17971. while (fromRight ? index-- : ++index < length) {
  17972. if (predicate(array[index], index, array)) {
  17973. return index;
  17974. }
  17975. }
  17976. return -1;
  17977. }
  17978. module.exports = baseFindIndex;
  17979. /***/ }),
  17980. /* 166 */
  17981. /***/ (function(module, exports, __webpack_require__) {
  17982. 'use strict';
  17983. var baseFindIndex = __webpack_require__(165),
  17984. baseIsNaN = __webpack_require__(496),
  17985. strictIndexOf = __webpack_require__(570);
  17986. /**
  17987. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  17988. *
  17989. * @private
  17990. * @param {Array} array The array to inspect.
  17991. * @param {*} value The value to search for.
  17992. * @param {number} fromIndex The index to search from.
  17993. * @returns {number} Returns the index of the matched value, else `-1`.
  17994. */
  17995. function baseIndexOf(array, value, fromIndex) {
  17996. return value === value ? strictIndexOf(array, value, fromIndex) : baseFindIndex(array, baseIsNaN, fromIndex);
  17997. }
  17998. module.exports = baseIndexOf;
  17999. /***/ }),
  18000. /* 167 */
  18001. /***/ (function(module, exports, __webpack_require__) {
  18002. 'use strict';
  18003. var Uint8Array = __webpack_require__(243);
  18004. /**
  18005. * Creates a clone of `arrayBuffer`.
  18006. *
  18007. * @private
  18008. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  18009. * @returns {ArrayBuffer} Returns the cloned array buffer.
  18010. */
  18011. function cloneArrayBuffer(arrayBuffer) {
  18012. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  18013. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  18014. return result;
  18015. }
  18016. module.exports = cloneArrayBuffer;
  18017. /***/ }),
  18018. /* 168 */
  18019. /***/ (function(module, exports) {
  18020. "use strict";
  18021. /**
  18022. * Copies the values of `source` to `array`.
  18023. *
  18024. * @private
  18025. * @param {Array} source The array to copy values from.
  18026. * @param {Array} [array=[]] The array to copy values to.
  18027. * @returns {Array} Returns `array`.
  18028. */
  18029. function copyArray(source, array) {
  18030. var index = -1,
  18031. length = source.length;
  18032. array || (array = Array(length));
  18033. while (++index < length) {
  18034. array[index] = source[index];
  18035. }
  18036. return array;
  18037. }
  18038. module.exports = copyArray;
  18039. /***/ }),
  18040. /* 169 */
  18041. /***/ (function(module, exports, __webpack_require__) {
  18042. 'use strict';
  18043. var overArg = __webpack_require__(271);
  18044. /** Built-in value references. */
  18045. var getPrototype = overArg(Object.getPrototypeOf, Object);
  18046. module.exports = getPrototype;
  18047. /***/ }),
  18048. /* 170 */
  18049. /***/ (function(module, exports, __webpack_require__) {
  18050. 'use strict';
  18051. var arrayFilter = __webpack_require__(479),
  18052. stubArray = __webpack_require__(279);
  18053. /** Used for built-in method references. */
  18054. var objectProto = Object.prototype;
  18055. /** Built-in value references. */
  18056. var propertyIsEnumerable = objectProto.propertyIsEnumerable;
  18057. /* Built-in method references for those with the same name as other `lodash` methods. */
  18058. var nativeGetSymbols = Object.getOwnPropertySymbols;
  18059. /**
  18060. * Creates an array of the own enumerable symbols of `object`.
  18061. *
  18062. * @private
  18063. * @param {Object} object The object to query.
  18064. * @returns {Array} Returns the array of symbols.
  18065. */
  18066. var getSymbols = !nativeGetSymbols ? stubArray : function (object) {
  18067. if (object == null) {
  18068. return [];
  18069. }
  18070. object = Object(object);
  18071. return arrayFilter(nativeGetSymbols(object), function (symbol) {
  18072. return propertyIsEnumerable.call(object, symbol);
  18073. });
  18074. };
  18075. module.exports = getSymbols;
  18076. /***/ }),
  18077. /* 171 */
  18078. /***/ (function(module, exports) {
  18079. 'use strict';
  18080. /** Used as references for various `Number` constants. */
  18081. var MAX_SAFE_INTEGER = 9007199254740991;
  18082. /** Used to detect unsigned integer values. */
  18083. var reIsUint = /^(?:0|[1-9]\d*)$/;
  18084. /**
  18085. * Checks if `value` is a valid array-like index.
  18086. *
  18087. * @private
  18088. * @param {*} value The value to check.
  18089. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  18090. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  18091. */
  18092. function isIndex(value, length) {
  18093. length = length == null ? MAX_SAFE_INTEGER : length;
  18094. return !!length && (typeof value == 'number' || reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length;
  18095. }
  18096. module.exports = isIndex;
  18097. /***/ }),
  18098. /* 172 */
  18099. /***/ (function(module, exports, __webpack_require__) {
  18100. 'use strict';
  18101. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  18102. var eq = __webpack_require__(46),
  18103. isArrayLike = __webpack_require__(24),
  18104. isIndex = __webpack_require__(171),
  18105. isObject = __webpack_require__(18);
  18106. /**
  18107. * Checks if the given arguments are from an iteratee call.
  18108. *
  18109. * @private
  18110. * @param {*} value The potential iteratee value argument.
  18111. * @param {*} index The potential iteratee index or key argument.
  18112. * @param {*} object The potential iteratee object argument.
  18113. * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
  18114. * else `false`.
  18115. */
  18116. function isIterateeCall(value, index, object) {
  18117. if (!isObject(object)) {
  18118. return false;
  18119. }
  18120. var type = typeof index === 'undefined' ? 'undefined' : _typeof(index);
  18121. if (type == 'number' ? isArrayLike(object) && isIndex(index, object.length) : type == 'string' && index in object) {
  18122. return eq(object[index], value);
  18123. }
  18124. return false;
  18125. }
  18126. module.exports = isIterateeCall;
  18127. /***/ }),
  18128. /* 173 */
  18129. /***/ (function(module, exports, __webpack_require__) {
  18130. 'use strict';
  18131. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  18132. var isArray = __webpack_require__(6),
  18133. isSymbol = __webpack_require__(62);
  18134. /** Used to match property names within property paths. */
  18135. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  18136. reIsPlainProp = /^\w*$/;
  18137. /**
  18138. * Checks if `value` is a property name and not a property path.
  18139. *
  18140. * @private
  18141. * @param {*} value The value to check.
  18142. * @param {Object} [object] The object to query keys on.
  18143. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  18144. */
  18145. function isKey(value, object) {
  18146. if (isArray(value)) {
  18147. return false;
  18148. }
  18149. var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);
  18150. if (type == 'number' || type == 'symbol' || type == 'boolean' || value == null || isSymbol(value)) {
  18151. return true;
  18152. }
  18153. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object);
  18154. }
  18155. module.exports = isKey;
  18156. /***/ }),
  18157. /* 174 */
  18158. /***/ (function(module, exports, __webpack_require__) {
  18159. 'use strict';
  18160. var assignValue = __webpack_require__(162),
  18161. copyObject = __webpack_require__(31),
  18162. createAssigner = __webpack_require__(103),
  18163. isArrayLike = __webpack_require__(24),
  18164. isPrototype = __webpack_require__(105),
  18165. keys = __webpack_require__(32);
  18166. /** Used for built-in method references. */
  18167. var objectProto = Object.prototype;
  18168. /** Used to check objects for own properties. */
  18169. var hasOwnProperty = objectProto.hasOwnProperty;
  18170. /**
  18171. * Assigns own enumerable string keyed properties of source objects to the
  18172. * destination object. Source objects are applied from left to right.
  18173. * Subsequent sources overwrite property assignments of previous sources.
  18174. *
  18175. * **Note:** This method mutates `object` and is loosely based on
  18176. * [`Object.assign`](https://mdn.io/Object/assign).
  18177. *
  18178. * @static
  18179. * @memberOf _
  18180. * @since 0.10.0
  18181. * @category Object
  18182. * @param {Object} object The destination object.
  18183. * @param {...Object} [sources] The source objects.
  18184. * @returns {Object} Returns `object`.
  18185. * @see _.assignIn
  18186. * @example
  18187. *
  18188. * function Foo() {
  18189. * this.a = 1;
  18190. * }
  18191. *
  18192. * function Bar() {
  18193. * this.c = 3;
  18194. * }
  18195. *
  18196. * Foo.prototype.b = 2;
  18197. * Bar.prototype.d = 4;
  18198. *
  18199. * _.assign({ 'a': 0 }, new Foo, new Bar);
  18200. * // => { 'a': 1, 'c': 3 }
  18201. */
  18202. var assign = createAssigner(function (object, source) {
  18203. if (isPrototype(source) || isArrayLike(source)) {
  18204. copyObject(source, keys(source), object);
  18205. return;
  18206. }
  18207. for (var key in source) {
  18208. if (hasOwnProperty.call(source, key)) {
  18209. assignValue(object, key, source[key]);
  18210. }
  18211. }
  18212. });
  18213. module.exports = assign;
  18214. /***/ }),
  18215. /* 175 */
  18216. /***/ (function(module, exports, __webpack_require__) {
  18217. 'use strict';
  18218. var baseGetTag = __webpack_require__(30),
  18219. isObject = __webpack_require__(18);
  18220. /** `Object#toString` result references. */
  18221. var asyncTag = '[object AsyncFunction]',
  18222. funcTag = '[object Function]',
  18223. genTag = '[object GeneratorFunction]',
  18224. proxyTag = '[object Proxy]';
  18225. /**
  18226. * Checks if `value` is classified as a `Function` object.
  18227. *
  18228. * @static
  18229. * @memberOf _
  18230. * @since 0.1.0
  18231. * @category Lang
  18232. * @param {*} value The value to check.
  18233. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  18234. * @example
  18235. *
  18236. * _.isFunction(_);
  18237. * // => true
  18238. *
  18239. * _.isFunction(/abc/);
  18240. * // => false
  18241. */
  18242. function isFunction(value) {
  18243. if (!isObject(value)) {
  18244. return false;
  18245. }
  18246. // The use of `Object#toString` avoids issues with the `typeof` operator
  18247. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  18248. var tag = baseGetTag(value);
  18249. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  18250. }
  18251. module.exports = isFunction;
  18252. /***/ }),
  18253. /* 176 */
  18254. /***/ (function(module, exports) {
  18255. 'use strict';
  18256. /** Used as references for various `Number` constants. */
  18257. var MAX_SAFE_INTEGER = 9007199254740991;
  18258. /**
  18259. * Checks if `value` is a valid array-like length.
  18260. *
  18261. * **Note:** This method is loosely based on
  18262. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  18263. *
  18264. * @static
  18265. * @memberOf _
  18266. * @since 4.0.0
  18267. * @category Lang
  18268. * @param {*} value The value to check.
  18269. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  18270. * @example
  18271. *
  18272. * _.isLength(3);
  18273. * // => true
  18274. *
  18275. * _.isLength(Number.MIN_VALUE);
  18276. * // => false
  18277. *
  18278. * _.isLength(Infinity);
  18279. * // => false
  18280. *
  18281. * _.isLength('3');
  18282. * // => false
  18283. */
  18284. function isLength(value) {
  18285. return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  18286. }
  18287. module.exports = isLength;
  18288. /***/ }),
  18289. /* 177 */
  18290. /***/ (function(module, exports, __webpack_require__) {
  18291. 'use strict';
  18292. var baseIsTypedArray = __webpack_require__(499),
  18293. baseUnary = __webpack_require__(102),
  18294. nodeUtil = __webpack_require__(270);
  18295. /* Node.js helper references. */
  18296. var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  18297. /**
  18298. * Checks if `value` is classified as a typed array.
  18299. *
  18300. * @static
  18301. * @memberOf _
  18302. * @since 3.0.0
  18303. * @category Lang
  18304. * @param {*} value The value to check.
  18305. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  18306. * @example
  18307. *
  18308. * _.isTypedArray(new Uint8Array);
  18309. * // => true
  18310. *
  18311. * _.isTypedArray([]);
  18312. * // => false
  18313. */
  18314. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  18315. module.exports = isTypedArray;
  18316. /***/ }),
  18317. /* 178 */
  18318. /***/ (function(module, exports, __webpack_require__) {
  18319. var map = {
  18320. "./index": 50,
  18321. "./index.js": 50,
  18322. "./logger": 120,
  18323. "./logger.js": 120,
  18324. "./metadata": 121,
  18325. "./metadata.js": 121,
  18326. "./options/build-config-chain": 51,
  18327. "./options/build-config-chain.js": 51,
  18328. "./options/config": 33,
  18329. "./options/config.js": 33,
  18330. "./options/index": 52,
  18331. "./options/index.js": 52,
  18332. "./options/option-manager": 34,
  18333. "./options/option-manager.js": 34,
  18334. "./options/parsers": 53,
  18335. "./options/parsers.js": 53,
  18336. "./options/removed": 54,
  18337. "./options/removed.js": 54
  18338. };
  18339. function webpackContext(req) {
  18340. return __webpack_require__(webpackContextResolve(req));
  18341. };
  18342. function webpackContextResolve(req) {
  18343. return map[req] || (function() { throw new Error("Cannot find module '" + req + "'.") }());
  18344. };
  18345. webpackContext.keys = function webpackContextKeys() {
  18346. return Object.keys(map);
  18347. };
  18348. webpackContext.resolve = webpackContextResolve;
  18349. module.exports = webpackContext;
  18350. webpackContext.id = 178;
  18351. /***/ }),
  18352. /* 179 */
  18353. /***/ (function(module, exports, __webpack_require__) {
  18354. var map = {
  18355. "./build-config-chain": 51,
  18356. "./build-config-chain.js": 51,
  18357. "./config": 33,
  18358. "./config.js": 33,
  18359. "./index": 52,
  18360. "./index.js": 52,
  18361. "./option-manager": 34,
  18362. "./option-manager.js": 34,
  18363. "./parsers": 53,
  18364. "./parsers.js": 53,
  18365. "./removed": 54,
  18366. "./removed.js": 54
  18367. };
  18368. function webpackContext(req) {
  18369. return __webpack_require__(webpackContextResolve(req));
  18370. };
  18371. function webpackContextResolve(req) {
  18372. return map[req] || (function() { throw new Error("Cannot find module '" + req + "'.") }());
  18373. };
  18374. webpackContext.keys = function webpackContextKeys() {
  18375. return Object.keys(map);
  18376. };
  18377. webpackContext.resolve = webpackContextResolve;
  18378. module.exports = webpackContext;
  18379. webpackContext.id = 179;
  18380. /***/ }),
  18381. /* 180 */
  18382. /***/ (function(module, exports) {
  18383. 'use strict';
  18384. module.exports = function () {
  18385. return (/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-PRZcf-nqry=><]/g
  18386. );
  18387. };
  18388. /***/ }),
  18389. /* 181 */
  18390. /***/ (function(module, exports, __webpack_require__) {
  18391. "use strict";
  18392. exports.__esModule = true;
  18393. exports.default = function (rawLines, lineNumber, colNumber) {
  18394. var opts = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
  18395. colNumber = Math.max(colNumber, 0);
  18396. var highlighted = opts.highlightCode && _chalk2.default.supportsColor || opts.forceColor;
  18397. var chalk = _chalk2.default;
  18398. if (opts.forceColor) {
  18399. chalk = new _chalk2.default.constructor({ enabled: true });
  18400. }
  18401. var maybeHighlight = function maybeHighlight(chalkFn, string) {
  18402. return highlighted ? chalkFn(string) : string;
  18403. };
  18404. var defs = getDefs(chalk);
  18405. if (highlighted) rawLines = highlight(defs, rawLines);
  18406. var linesAbove = opts.linesAbove || 2;
  18407. var linesBelow = opts.linesBelow || 3;
  18408. var lines = rawLines.split(NEWLINE);
  18409. var start = Math.max(lineNumber - (linesAbove + 1), 0);
  18410. var end = Math.min(lines.length, lineNumber + linesBelow);
  18411. if (!lineNumber && !colNumber) {
  18412. start = 0;
  18413. end = lines.length;
  18414. }
  18415. var numberMaxWidth = String(end).length;
  18416. var frame = lines.slice(start, end).map(function (line, index) {
  18417. var number = start + 1 + index;
  18418. var paddedNumber = (" " + number).slice(-numberMaxWidth);
  18419. var gutter = " " + paddedNumber + " | ";
  18420. if (number === lineNumber) {
  18421. var markerLine = "";
  18422. if (colNumber) {
  18423. var markerSpacing = line.slice(0, colNumber - 1).replace(/[^\t]/g, " ");
  18424. markerLine = ["\n ", maybeHighlight(defs.gutter, gutter.replace(/\d/g, " ")), markerSpacing, maybeHighlight(defs.marker, "^")].join("");
  18425. }
  18426. return [maybeHighlight(defs.marker, ">"), maybeHighlight(defs.gutter, gutter), line, markerLine].join("");
  18427. } else {
  18428. return " " + maybeHighlight(defs.gutter, gutter) + line;
  18429. }
  18430. }).join("\n");
  18431. if (highlighted) {
  18432. return chalk.reset(frame);
  18433. } else {
  18434. return frame;
  18435. }
  18436. };
  18437. var _jsTokens = __webpack_require__(468);
  18438. var _jsTokens2 = _interopRequireDefault(_jsTokens);
  18439. var _esutils = __webpack_require__(97);
  18440. var _esutils2 = _interopRequireDefault(_esutils);
  18441. var _chalk = __webpack_require__(401);
  18442. var _chalk2 = _interopRequireDefault(_chalk);
  18443. function _interopRequireDefault(obj) {
  18444. return obj && obj.__esModule ? obj : { default: obj };
  18445. }
  18446. function getDefs(chalk) {
  18447. return {
  18448. keyword: chalk.cyan,
  18449. capitalized: chalk.yellow,
  18450. jsx_tag: chalk.yellow,
  18451. punctuator: chalk.yellow,
  18452. number: chalk.magenta,
  18453. string: chalk.green,
  18454. regex: chalk.magenta,
  18455. comment: chalk.grey,
  18456. invalid: chalk.white.bgRed.bold,
  18457. gutter: chalk.grey,
  18458. marker: chalk.red.bold
  18459. };
  18460. }
  18461. var NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
  18462. var JSX_TAG = /^[a-z][\w-]*$/i;
  18463. var BRACKET = /^[()\[\]{}]$/;
  18464. function getTokenType(match) {
  18465. var _match$slice = match.slice(-2),
  18466. offset = _match$slice[0],
  18467. text = _match$slice[1];
  18468. var token = (0, _jsTokens.matchToToken)(match);
  18469. if (token.type === "name") {
  18470. if (_esutils2.default.keyword.isReservedWordES6(token.value)) {
  18471. return "keyword";
  18472. }
  18473. if (JSX_TAG.test(token.value) && (text[offset - 1] === "<" || text.substr(offset - 2, 2) == "</")) {
  18474. return "jsx_tag";
  18475. }
  18476. if (token.value[0] !== token.value[0].toLowerCase()) {
  18477. return "capitalized";
  18478. }
  18479. }
  18480. if (token.type === "punctuator" && BRACKET.test(token.value)) {
  18481. return "bracket";
  18482. }
  18483. return token.type;
  18484. }
  18485. function highlight(defs, text) {
  18486. return text.replace(_jsTokens2.default, function () {
  18487. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  18488. args[_key] = arguments[_key];
  18489. }
  18490. var type = getTokenType(args);
  18491. var colorize = defs[type];
  18492. if (colorize) {
  18493. return args[0].split(NEWLINE).map(function (str) {
  18494. return colorize(str);
  18495. }).join("\n");
  18496. } else {
  18497. return args[0];
  18498. }
  18499. });
  18500. }
  18501. module.exports = exports["default"];
  18502. /***/ }),
  18503. /* 182 */
  18504. /***/ (function(module, exports, __webpack_require__) {
  18505. "use strict";
  18506. exports.__esModule = true;
  18507. exports.transformFromAst = exports.transform = exports.analyse = exports.Pipeline = exports.OptionManager = exports.traverse = exports.types = exports.messages = exports.util = exports.version = exports.resolvePreset = exports.resolvePlugin = exports.template = exports.buildExternalHelpers = exports.options = exports.File = undefined;
  18508. var _file = __webpack_require__(50);
  18509. Object.defineProperty(exports, "File", {
  18510. enumerable: true,
  18511. get: function get() {
  18512. return _interopRequireDefault(_file).default;
  18513. }
  18514. });
  18515. var _config = __webpack_require__(33);
  18516. Object.defineProperty(exports, "options", {
  18517. enumerable: true,
  18518. get: function get() {
  18519. return _interopRequireDefault(_config).default;
  18520. }
  18521. });
  18522. var _buildExternalHelpers = __webpack_require__(295);
  18523. Object.defineProperty(exports, "buildExternalHelpers", {
  18524. enumerable: true,
  18525. get: function get() {
  18526. return _interopRequireDefault(_buildExternalHelpers).default;
  18527. }
  18528. });
  18529. var _babelTemplate = __webpack_require__(4);
  18530. Object.defineProperty(exports, "template", {
  18531. enumerable: true,
  18532. get: function get() {
  18533. return _interopRequireDefault(_babelTemplate).default;
  18534. }
  18535. });
  18536. var _resolvePlugin = __webpack_require__(184);
  18537. Object.defineProperty(exports, "resolvePlugin", {
  18538. enumerable: true,
  18539. get: function get() {
  18540. return _interopRequireDefault(_resolvePlugin).default;
  18541. }
  18542. });
  18543. var _resolvePreset = __webpack_require__(185);
  18544. Object.defineProperty(exports, "resolvePreset", {
  18545. enumerable: true,
  18546. get: function get() {
  18547. return _interopRequireDefault(_resolvePreset).default;
  18548. }
  18549. });
  18550. var _package = __webpack_require__(628);
  18551. Object.defineProperty(exports, "version", {
  18552. enumerable: true,
  18553. get: function get() {
  18554. return _package.version;
  18555. }
  18556. });
  18557. exports.Plugin = Plugin;
  18558. exports.transformFile = transformFile;
  18559. exports.transformFileSync = transformFileSync;
  18560. var _fs = __webpack_require__(115);
  18561. var _fs2 = _interopRequireDefault(_fs);
  18562. var _util = __webpack_require__(122);
  18563. var util = _interopRequireWildcard(_util);
  18564. var _babelMessages = __webpack_require__(20);
  18565. var messages = _interopRequireWildcard(_babelMessages);
  18566. var _babelTypes = __webpack_require__(1);
  18567. var t = _interopRequireWildcard(_babelTypes);
  18568. var _babelTraverse = __webpack_require__(7);
  18569. var _babelTraverse2 = _interopRequireDefault(_babelTraverse);
  18570. var _optionManager = __webpack_require__(34);
  18571. var _optionManager2 = _interopRequireDefault(_optionManager);
  18572. var _pipeline = __webpack_require__(298);
  18573. var _pipeline2 = _interopRequireDefault(_pipeline);
  18574. function _interopRequireWildcard(obj) {
  18575. if (obj && obj.__esModule) {
  18576. return obj;
  18577. } else {
  18578. var newObj = {};if (obj != null) {
  18579. for (var key in obj) {
  18580. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  18581. }
  18582. }newObj.default = obj;return newObj;
  18583. }
  18584. }
  18585. function _interopRequireDefault(obj) {
  18586. return obj && obj.__esModule ? obj : { default: obj };
  18587. }
  18588. exports.util = util;
  18589. exports.messages = messages;
  18590. exports.types = t;
  18591. exports.traverse = _babelTraverse2.default;
  18592. exports.OptionManager = _optionManager2.default;
  18593. function Plugin(alias) {
  18594. throw new Error("The (" + alias + ") Babel 5 plugin is being run with Babel 6.");
  18595. }
  18596. exports.Pipeline = _pipeline2.default;
  18597. var pipeline = new _pipeline2.default();
  18598. var analyse = exports.analyse = pipeline.analyse.bind(pipeline);
  18599. var transform = exports.transform = pipeline.transform.bind(pipeline);
  18600. var transformFromAst = exports.transformFromAst = pipeline.transformFromAst.bind(pipeline);
  18601. function transformFile(filename, opts, callback) {
  18602. if (typeof opts === "function") {
  18603. callback = opts;
  18604. opts = {};
  18605. }
  18606. opts.filename = filename;
  18607. _fs2.default.readFile(filename, function (err, code) {
  18608. var result = void 0;
  18609. if (!err) {
  18610. try {
  18611. result = transform(code, opts);
  18612. } catch (_err) {
  18613. err = _err;
  18614. }
  18615. }
  18616. if (err) {
  18617. callback(err);
  18618. } else {
  18619. callback(null, result);
  18620. }
  18621. });
  18622. }
  18623. function transformFileSync(filename) {
  18624. var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  18625. opts.filename = filename;
  18626. return transform(_fs2.default.readFileSync(filename, "utf8"), opts);
  18627. }
  18628. /***/ }),
  18629. /* 183 */
  18630. /***/ (function(module, exports, __webpack_require__) {
  18631. "use strict";
  18632. exports.__esModule = true;
  18633. exports.default = resolveFromPossibleNames;
  18634. var _resolve = __webpack_require__(118);
  18635. var _resolve2 = _interopRequireDefault(_resolve);
  18636. function _interopRequireDefault(obj) {
  18637. return obj && obj.__esModule ? obj : { default: obj };
  18638. }
  18639. function resolveFromPossibleNames(possibleNames, dirname) {
  18640. return possibleNames.reduce(function (accum, curr) {
  18641. return accum || (0, _resolve2.default)(curr, dirname);
  18642. }, null);
  18643. }
  18644. module.exports = exports["default"];
  18645. /***/ }),
  18646. /* 184 */
  18647. /***/ (function(module, exports, __webpack_require__) {
  18648. /* WEBPACK VAR INJECTION */(function(process) {"use strict";
  18649. exports.__esModule = true;
  18650. exports.default = resolvePlugin;
  18651. var _resolveFromPossibleNames = __webpack_require__(183);
  18652. var _resolveFromPossibleNames2 = _interopRequireDefault(_resolveFromPossibleNames);
  18653. var _getPossiblePluginNames = __webpack_require__(291);
  18654. var _getPossiblePluginNames2 = _interopRequireDefault(_getPossiblePluginNames);
  18655. function _interopRequireDefault(obj) {
  18656. return obj && obj.__esModule ? obj : { default: obj };
  18657. }
  18658. function resolvePlugin(pluginName) {
  18659. var dirname = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : process.cwd();
  18660. return (0, _resolveFromPossibleNames2.default)((0, _getPossiblePluginNames2.default)(pluginName), dirname);
  18661. }
  18662. module.exports = exports["default"];
  18663. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(8)))
  18664. /***/ }),
  18665. /* 185 */
  18666. /***/ (function(module, exports, __webpack_require__) {
  18667. /* WEBPACK VAR INJECTION */(function(process) {"use strict";
  18668. exports.__esModule = true;
  18669. exports.default = resolvePreset;
  18670. var _resolveFromPossibleNames = __webpack_require__(183);
  18671. var _resolveFromPossibleNames2 = _interopRequireDefault(_resolveFromPossibleNames);
  18672. var _getPossiblePresetNames = __webpack_require__(292);
  18673. var _getPossiblePresetNames2 = _interopRequireDefault(_getPossiblePresetNames);
  18674. function _interopRequireDefault(obj) {
  18675. return obj && obj.__esModule ? obj : { default: obj };
  18676. }
  18677. function resolvePreset(presetName) {
  18678. var dirname = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : process.cwd();
  18679. return (0, _resolveFromPossibleNames2.default)((0, _getPossiblePresetNames2.default)(presetName), dirname);
  18680. }
  18681. module.exports = exports["default"];
  18682. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(8)))
  18683. /***/ }),
  18684. /* 186 */
  18685. /***/ (function(module, exports, __webpack_require__) {
  18686. "use strict";
  18687. exports.__esModule = true;
  18688. exports.CodeGenerator = undefined;
  18689. var _classCallCheck2 = __webpack_require__(3);
  18690. var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
  18691. var _possibleConstructorReturn2 = __webpack_require__(42);
  18692. var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
  18693. var _inherits2 = __webpack_require__(41);
  18694. var _inherits3 = _interopRequireDefault(_inherits2);
  18695. exports.default = function (ast, opts, code) {
  18696. var gen = new Generator(ast, opts, code);
  18697. return gen.generate();
  18698. };
  18699. var _detectIndent = __webpack_require__(459);
  18700. var _detectIndent2 = _interopRequireDefault(_detectIndent);
  18701. var _sourceMap = __webpack_require__(313);
  18702. var _sourceMap2 = _interopRequireDefault(_sourceMap);
  18703. var _babelMessages = __webpack_require__(20);
  18704. var messages = _interopRequireWildcard(_babelMessages);
  18705. var _printer = __webpack_require__(312);
  18706. var _printer2 = _interopRequireDefault(_printer);
  18707. function _interopRequireWildcard(obj) {
  18708. if (obj && obj.__esModule) {
  18709. return obj;
  18710. } else {
  18711. var newObj = {};if (obj != null) {
  18712. for (var key in obj) {
  18713. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  18714. }
  18715. }newObj.default = obj;return newObj;
  18716. }
  18717. }
  18718. function _interopRequireDefault(obj) {
  18719. return obj && obj.__esModule ? obj : { default: obj };
  18720. }
  18721. var Generator = function (_Printer) {
  18722. (0, _inherits3.default)(Generator, _Printer);
  18723. function Generator(ast) {
  18724. var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  18725. var code = arguments[2];
  18726. (0, _classCallCheck3.default)(this, Generator);
  18727. var tokens = ast.tokens || [];
  18728. var format = normalizeOptions(code, opts, tokens);
  18729. var map = opts.sourceMaps ? new _sourceMap2.default(opts, code) : null;
  18730. var _this = (0, _possibleConstructorReturn3.default)(this, _Printer.call(this, format, map, tokens));
  18731. _this.ast = ast;
  18732. return _this;
  18733. }
  18734. Generator.prototype.generate = function generate() {
  18735. return _Printer.prototype.generate.call(this, this.ast);
  18736. };
  18737. return Generator;
  18738. }(_printer2.default);
  18739. function normalizeOptions(code, opts, tokens) {
  18740. var style = " ";
  18741. if (code && typeof code === "string") {
  18742. var indent = (0, _detectIndent2.default)(code).indent;
  18743. if (indent && indent !== " ") style = indent;
  18744. }
  18745. var format = {
  18746. auxiliaryCommentBefore: opts.auxiliaryCommentBefore,
  18747. auxiliaryCommentAfter: opts.auxiliaryCommentAfter,
  18748. shouldPrintComment: opts.shouldPrintComment,
  18749. retainLines: opts.retainLines,
  18750. retainFunctionParens: opts.retainFunctionParens,
  18751. comments: opts.comments == null || opts.comments,
  18752. compact: opts.compact,
  18753. minified: opts.minified,
  18754. concise: opts.concise,
  18755. quotes: opts.quotes || findCommonStringDelimiter(code, tokens),
  18756. jsonCompatibleStrings: opts.jsonCompatibleStrings,
  18757. indent: {
  18758. adjustMultilineComment: true,
  18759. style: style,
  18760. base: 0
  18761. },
  18762. flowCommaSeparator: opts.flowCommaSeparator
  18763. };
  18764. if (format.minified) {
  18765. format.compact = true;
  18766. format.shouldPrintComment = format.shouldPrintComment || function () {
  18767. return format.comments;
  18768. };
  18769. } else {
  18770. format.shouldPrintComment = format.shouldPrintComment || function (value) {
  18771. return format.comments || value.indexOf("@license") >= 0 || value.indexOf("@preserve") >= 0;
  18772. };
  18773. }
  18774. if (format.compact === "auto") {
  18775. format.compact = code.length > 500000;
  18776. if (format.compact) {
  18777. console.error("[BABEL] " + messages.get("codeGeneratorDeopt", opts.filename, "500KB"));
  18778. }
  18779. }
  18780. if (format.compact) {
  18781. format.indent.adjustMultilineComment = false;
  18782. }
  18783. return format;
  18784. }
  18785. function findCommonStringDelimiter(code, tokens) {
  18786. var DEFAULT_STRING_DELIMITER = "double";
  18787. if (!code) {
  18788. return DEFAULT_STRING_DELIMITER;
  18789. }
  18790. var occurrences = {
  18791. single: 0,
  18792. double: 0
  18793. };
  18794. var checked = 0;
  18795. for (var i = 0; i < tokens.length; i++) {
  18796. var token = tokens[i];
  18797. if (token.type.label !== "string") continue;
  18798. var raw = code.slice(token.start, token.end);
  18799. if (raw[0] === "'") {
  18800. occurrences.single++;
  18801. } else {
  18802. occurrences.double++;
  18803. }
  18804. checked++;
  18805. if (checked >= 3) break;
  18806. }
  18807. if (occurrences.single > occurrences.double) {
  18808. return "single";
  18809. } else {
  18810. return "double";
  18811. }
  18812. }
  18813. var CodeGenerator = exports.CodeGenerator = function () {
  18814. function CodeGenerator(ast, opts, code) {
  18815. (0, _classCallCheck3.default)(this, CodeGenerator);
  18816. this._generator = new Generator(ast, opts, code);
  18817. }
  18818. CodeGenerator.prototype.generate = function generate() {
  18819. return this._generator.generate();
  18820. };
  18821. return CodeGenerator;
  18822. }();
  18823. /***/ }),
  18824. /* 187 */
  18825. /***/ (function(module, exports, __webpack_require__) {
  18826. "use strict";
  18827. exports.__esModule = true;
  18828. var _getIterator2 = __webpack_require__(2);
  18829. var _getIterator3 = _interopRequireDefault(_getIterator2);
  18830. var _keys = __webpack_require__(14);
  18831. var _keys2 = _interopRequireDefault(_keys);
  18832. exports.needsWhitespace = needsWhitespace;
  18833. exports.needsWhitespaceBefore = needsWhitespaceBefore;
  18834. exports.needsWhitespaceAfter = needsWhitespaceAfter;
  18835. exports.needsParens = needsParens;
  18836. var _whitespace = __webpack_require__(311);
  18837. var _whitespace2 = _interopRequireDefault(_whitespace);
  18838. var _parentheses = __webpack_require__(310);
  18839. var parens = _interopRequireWildcard(_parentheses);
  18840. var _babelTypes = __webpack_require__(1);
  18841. var t = _interopRequireWildcard(_babelTypes);
  18842. function _interopRequireWildcard(obj) {
  18843. if (obj && obj.__esModule) {
  18844. return obj;
  18845. } else {
  18846. var newObj = {};if (obj != null) {
  18847. for (var key in obj) {
  18848. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  18849. }
  18850. }newObj.default = obj;return newObj;
  18851. }
  18852. }
  18853. function _interopRequireDefault(obj) {
  18854. return obj && obj.__esModule ? obj : { default: obj };
  18855. }
  18856. function expandAliases(obj) {
  18857. var newObj = {};
  18858. function add(type, func) {
  18859. var fn = newObj[type];
  18860. newObj[type] = fn ? function (node, parent, stack) {
  18861. var result = fn(node, parent, stack);
  18862. return result == null ? func(node, parent, stack) : result;
  18863. } : func;
  18864. }
  18865. for (var _iterator = (0, _keys2.default)(obj), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
  18866. var _ref;
  18867. if (_isArray) {
  18868. if (_i >= _iterator.length) break;
  18869. _ref = _iterator[_i++];
  18870. } else {
  18871. _i = _iterator.next();
  18872. if (_i.done) break;
  18873. _ref = _i.value;
  18874. }
  18875. var type = _ref;
  18876. var aliases = t.FLIPPED_ALIAS_KEYS[type];
  18877. if (aliases) {
  18878. for (var _iterator2 = aliases, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) {
  18879. var _ref2;
  18880. if (_isArray2) {
  18881. if (_i2 >= _iterator2.length) break;
  18882. _ref2 = _iterator2[_i2++];
  18883. } else {
  18884. _i2 = _iterator2.next();
  18885. if (_i2.done) break;
  18886. _ref2 = _i2.value;
  18887. }
  18888. var alias = _ref2;
  18889. add(alias, obj[type]);
  18890. }
  18891. } else {
  18892. add(type, obj[type]);
  18893. }
  18894. }
  18895. return newObj;
  18896. }
  18897. var expandedParens = expandAliases(parens);
  18898. var expandedWhitespaceNodes = expandAliases(_whitespace2.default.nodes);
  18899. var expandedWhitespaceList = expandAliases(_whitespace2.default.list);
  18900. function find(obj, node, parent, printStack) {
  18901. var fn = obj[node.type];
  18902. return fn ? fn(node, parent, printStack) : null;
  18903. }
  18904. function isOrHasCallExpression(node) {
  18905. if (t.isCallExpression(node)) {
  18906. return true;
  18907. }
  18908. if (t.isMemberExpression(node)) {
  18909. return isOrHasCallExpression(node.object) || !node.computed && isOrHasCallExpression(node.property);
  18910. } else {
  18911. return false;
  18912. }
  18913. }
  18914. function needsWhitespace(node, parent, type) {
  18915. if (!node) return 0;
  18916. if (t.isExpressionStatement(node)) {
  18917. node = node.expression;
  18918. }
  18919. var linesInfo = find(expandedWhitespaceNodes, node, parent);
  18920. if (!linesInfo) {
  18921. var items = find(expandedWhitespaceList, node, parent);
  18922. if (items) {
  18923. for (var i = 0; i < items.length; i++) {
  18924. linesInfo = needsWhitespace(items[i], node, type);
  18925. if (linesInfo) break;
  18926. }
  18927. }
  18928. }
  18929. return linesInfo && linesInfo[type] || 0;
  18930. }
  18931. function needsWhitespaceBefore(node, parent) {
  18932. return needsWhitespace(node, parent, "before");
  18933. }
  18934. function needsWhitespaceAfter(node, parent) {
  18935. return needsWhitespace(node, parent, "after");
  18936. }
  18937. function needsParens(node, parent, printStack) {
  18938. if (!parent) return false;
  18939. if (t.isNewExpression(parent) && parent.callee === node) {
  18940. if (isOrHasCallExpression(node)) return true;
  18941. }
  18942. return find(expandedParens, node, parent, printStack);
  18943. }
  18944. /***/ }),
  18945. /* 188 */
  18946. /***/ (function(module, exports, __webpack_require__) {
  18947. "use strict";
  18948. exports.__esModule = true;
  18949. var _keys = __webpack_require__(14);
  18950. var _keys2 = _interopRequireDefault(_keys);
  18951. exports.push = push;
  18952. exports.hasComputed = hasComputed;
  18953. exports.toComputedObjectFromClass = toComputedObjectFromClass;
  18954. exports.toClassObject = toClassObject;
  18955. exports.toDefineObject = toDefineObject;
  18956. var _babelHelperFunctionName = __webpack_require__(40);
  18957. var _babelHelperFunctionName2 = _interopRequireDefault(_babelHelperFunctionName);
  18958. var _has = __webpack_require__(274);
  18959. var _has2 = _interopRequireDefault(_has);
  18960. var _babelTypes = __webpack_require__(1);
  18961. var t = _interopRequireWildcard(_babelTypes);
  18962. function _interopRequireWildcard(obj) {
  18963. if (obj && obj.__esModule) {
  18964. return obj;
  18965. } else {
  18966. var newObj = {};if (obj != null) {
  18967. for (var key in obj) {
  18968. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  18969. }
  18970. }newObj.default = obj;return newObj;
  18971. }
  18972. }
  18973. function _interopRequireDefault(obj) {
  18974. return obj && obj.__esModule ? obj : { default: obj };
  18975. }
  18976. function toKind(node) {
  18977. if (t.isClassMethod(node) || t.isObjectMethod(node)) {
  18978. if (node.kind === "get" || node.kind === "set") {
  18979. return node.kind;
  18980. }
  18981. }
  18982. return "value";
  18983. }
  18984. function push(mutatorMap, node, kind, file, scope) {
  18985. var alias = t.toKeyAlias(node);
  18986. var map = {};
  18987. if ((0, _has2.default)(mutatorMap, alias)) map = mutatorMap[alias];
  18988. mutatorMap[alias] = map;
  18989. map._inherits = map._inherits || [];
  18990. map._inherits.push(node);
  18991. map._key = node.key;
  18992. if (node.computed) {
  18993. map._computed = true;
  18994. }
  18995. if (node.decorators) {
  18996. var decorators = map.decorators = map.decorators || t.arrayExpression([]);
  18997. decorators.elements = decorators.elements.concat(node.decorators.map(function (dec) {
  18998. return dec.expression;
  18999. }).reverse());
  19000. }
  19001. if (map.value || map.initializer) {
  19002. throw file.buildCodeFrameError(node, "Key conflict with sibling node");
  19003. }
  19004. var key = void 0,
  19005. value = void 0;
  19006. if (t.isObjectProperty(node) || t.isObjectMethod(node) || t.isClassMethod(node)) {
  19007. key = t.toComputedKey(node, node.key);
  19008. }
  19009. if (t.isObjectProperty(node) || t.isClassProperty(node)) {
  19010. value = node.value;
  19011. } else if (t.isObjectMethod(node) || t.isClassMethod(node)) {
  19012. value = t.functionExpression(null, node.params, node.body, node.generator, node.async);
  19013. value.returnType = node.returnType;
  19014. }
  19015. var inheritedKind = toKind(node);
  19016. if (!kind || inheritedKind !== "value") {
  19017. kind = inheritedKind;
  19018. }
  19019. if (scope && t.isStringLiteral(key) && (kind === "value" || kind === "initializer") && t.isFunctionExpression(value)) {
  19020. value = (0, _babelHelperFunctionName2.default)({ id: key, node: value, scope: scope });
  19021. }
  19022. if (value) {
  19023. t.inheritsComments(value, node);
  19024. map[kind] = value;
  19025. }
  19026. return map;
  19027. }
  19028. function hasComputed(mutatorMap) {
  19029. for (var key in mutatorMap) {
  19030. if (mutatorMap[key]._computed) {
  19031. return true;
  19032. }
  19033. }
  19034. return false;
  19035. }
  19036. function toComputedObjectFromClass(obj) {
  19037. var objExpr = t.arrayExpression([]);
  19038. for (var i = 0; i < obj.properties.length; i++) {
  19039. var prop = obj.properties[i];
  19040. var val = prop.value;
  19041. val.properties.unshift(t.objectProperty(t.identifier("key"), t.toComputedKey(prop)));
  19042. objExpr.elements.push(val);
  19043. }
  19044. return objExpr;
  19045. }
  19046. function toClassObject(mutatorMap) {
  19047. var objExpr = t.objectExpression([]);
  19048. (0, _keys2.default)(mutatorMap).forEach(function (mutatorMapKey) {
  19049. var map = mutatorMap[mutatorMapKey];
  19050. var mapNode = t.objectExpression([]);
  19051. var propNode = t.objectProperty(map._key, mapNode, map._computed);
  19052. (0, _keys2.default)(map).forEach(function (key) {
  19053. var node = map[key];
  19054. if (key[0] === "_") return;
  19055. var inheritNode = node;
  19056. if (t.isClassMethod(node) || t.isClassProperty(node)) node = node.value;
  19057. var prop = t.objectProperty(t.identifier(key), node);
  19058. t.inheritsComments(prop, inheritNode);
  19059. t.removeComments(inheritNode);
  19060. mapNode.properties.push(prop);
  19061. });
  19062. objExpr.properties.push(propNode);
  19063. });
  19064. return objExpr;
  19065. }
  19066. function toDefineObject(mutatorMap) {
  19067. (0, _keys2.default)(mutatorMap).forEach(function (key) {
  19068. var map = mutatorMap[key];
  19069. if (map.value) map.writable = t.booleanLiteral(true);
  19070. map.configurable = t.booleanLiteral(true);
  19071. map.enumerable = t.booleanLiteral(true);
  19072. });
  19073. return toClassObject(mutatorMap);
  19074. }
  19075. /***/ }),
  19076. /* 189 */
  19077. /***/ (function(module, exports, __webpack_require__) {
  19078. "use strict";
  19079. exports.__esModule = true;
  19080. exports.default = function (node) {
  19081. var params = node.params;
  19082. for (var i = 0; i < params.length; i++) {
  19083. var param = params[i];
  19084. if (t.isAssignmentPattern(param) || t.isRestElement(param)) {
  19085. return i;
  19086. }
  19087. }
  19088. return params.length;
  19089. };
  19090. var _babelTypes = __webpack_require__(1);
  19091. var t = _interopRequireWildcard(_babelTypes);
  19092. function _interopRequireWildcard(obj) {
  19093. if (obj && obj.__esModule) {
  19094. return obj;
  19095. } else {
  19096. var newObj = {};if (obj != null) {
  19097. for (var key in obj) {
  19098. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  19099. }
  19100. }newObj.default = obj;return newObj;
  19101. }
  19102. }
  19103. module.exports = exports["default"];
  19104. /***/ }),
  19105. /* 190 */
  19106. /***/ (function(module, exports, __webpack_require__) {
  19107. "use strict";
  19108. exports.__esModule = true;
  19109. var _getIterator2 = __webpack_require__(2);
  19110. var _getIterator3 = _interopRequireDefault(_getIterator2);
  19111. exports.default = function (path, emit) {
  19112. var kind = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "var";
  19113. path.traverse(visitor, { kind: kind, emit: emit });
  19114. };
  19115. var _babelTypes = __webpack_require__(1);
  19116. var t = _interopRequireWildcard(_babelTypes);
  19117. function _interopRequireWildcard(obj) {
  19118. if (obj && obj.__esModule) {
  19119. return obj;
  19120. } else {
  19121. var newObj = {};if (obj != null) {
  19122. for (var key in obj) {
  19123. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  19124. }
  19125. }newObj.default = obj;return newObj;
  19126. }
  19127. }
  19128. function _interopRequireDefault(obj) {
  19129. return obj && obj.__esModule ? obj : { default: obj };
  19130. }
  19131. var visitor = {
  19132. Scope: function Scope(path, state) {
  19133. if (state.kind === "let") path.skip();
  19134. },
  19135. Function: function Function(path) {
  19136. path.skip();
  19137. },
  19138. VariableDeclaration: function VariableDeclaration(path, state) {
  19139. if (state.kind && path.node.kind !== state.kind) return;
  19140. var nodes = [];
  19141. var declarations = path.get("declarations");
  19142. var firstId = void 0;
  19143. for (var _iterator = declarations, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
  19144. var _ref;
  19145. if (_isArray) {
  19146. if (_i >= _iterator.length) break;
  19147. _ref = _iterator[_i++];
  19148. } else {
  19149. _i = _iterator.next();
  19150. if (_i.done) break;
  19151. _ref = _i.value;
  19152. }
  19153. var declar = _ref;
  19154. firstId = declar.node.id;
  19155. if (declar.node.init) {
  19156. nodes.push(t.expressionStatement(t.assignmentExpression("=", declar.node.id, declar.node.init)));
  19157. }
  19158. for (var name in declar.getBindingIdentifiers()) {
  19159. state.emit(t.identifier(name), name);
  19160. }
  19161. }
  19162. if (path.parentPath.isFor({ left: path.node })) {
  19163. path.replaceWith(firstId);
  19164. } else {
  19165. path.replaceWithMultiple(nodes);
  19166. }
  19167. }
  19168. };
  19169. module.exports = exports["default"];
  19170. /***/ }),
  19171. /* 191 */
  19172. /***/ (function(module, exports, __webpack_require__) {
  19173. "use strict";
  19174. exports.__esModule = true;
  19175. exports.default = function (callee, thisNode, args) {
  19176. if (args.length === 1 && t.isSpreadElement(args[0]) && t.isIdentifier(args[0].argument, { name: "arguments" })) {
  19177. return t.callExpression(t.memberExpression(callee, t.identifier("apply")), [thisNode, args[0].argument]);
  19178. } else {
  19179. return t.callExpression(t.memberExpression(callee, t.identifier("call")), [thisNode].concat(args));
  19180. }
  19181. };
  19182. var _babelTypes = __webpack_require__(1);
  19183. var t = _interopRequireWildcard(_babelTypes);
  19184. function _interopRequireWildcard(obj) {
  19185. if (obj && obj.__esModule) {
  19186. return obj;
  19187. } else {
  19188. var newObj = {};if (obj != null) {
  19189. for (var key in obj) {
  19190. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  19191. }
  19192. }newObj.default = obj;return newObj;
  19193. }
  19194. }
  19195. module.exports = exports["default"];
  19196. /***/ }),
  19197. /* 192 */
  19198. /***/ (function(module, exports, __webpack_require__) {
  19199. "use strict";
  19200. exports.__esModule = true;
  19201. exports.is = is;
  19202. exports.pullFlag = pullFlag;
  19203. var _pull = __webpack_require__(277);
  19204. var _pull2 = _interopRequireDefault(_pull);
  19205. var _babelTypes = __webpack_require__(1);
  19206. var t = _interopRequireWildcard(_babelTypes);
  19207. function _interopRequireWildcard(obj) {
  19208. if (obj && obj.__esModule) {
  19209. return obj;
  19210. } else {
  19211. var newObj = {};if (obj != null) {
  19212. for (var key in obj) {
  19213. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  19214. }
  19215. }newObj.default = obj;return newObj;
  19216. }
  19217. }
  19218. function _interopRequireDefault(obj) {
  19219. return obj && obj.__esModule ? obj : { default: obj };
  19220. }
  19221. function is(node, flag) {
  19222. return t.isRegExpLiteral(node) && node.flags.indexOf(flag) >= 0;
  19223. }
  19224. function pullFlag(node, flag) {
  19225. var flags = node.flags.split("");
  19226. if (node.flags.indexOf(flag) < 0) return;
  19227. (0, _pull2.default)(flags, flag);
  19228. node.flags = flags.join("");
  19229. }
  19230. /***/ }),
  19231. /* 193 */
  19232. /***/ (function(module, exports, __webpack_require__) {
  19233. "use strict";
  19234. exports.__esModule = true;
  19235. var _classCallCheck2 = __webpack_require__(3);
  19236. var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
  19237. var _symbol = __webpack_require__(10);
  19238. var _symbol2 = _interopRequireDefault(_symbol);
  19239. var _babelHelperOptimiseCallExpression = __webpack_require__(191);
  19240. var _babelHelperOptimiseCallExpression2 = _interopRequireDefault(_babelHelperOptimiseCallExpression);
  19241. var _babelMessages = __webpack_require__(20);
  19242. var messages = _interopRequireWildcard(_babelMessages);
  19243. var _babelTypes = __webpack_require__(1);
  19244. var t = _interopRequireWildcard(_babelTypes);
  19245. function _interopRequireWildcard(obj) {
  19246. if (obj && obj.__esModule) {
  19247. return obj;
  19248. } else {
  19249. var newObj = {};if (obj != null) {
  19250. for (var key in obj) {
  19251. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  19252. }
  19253. }newObj.default = obj;return newObj;
  19254. }
  19255. }
  19256. function _interopRequireDefault(obj) {
  19257. return obj && obj.__esModule ? obj : { default: obj };
  19258. }
  19259. var HARDCORE_THIS_REF = (0, _symbol2.default)();
  19260. function isIllegalBareSuper(node, parent) {
  19261. if (!t.isSuper(node)) return false;
  19262. if (t.isMemberExpression(parent, { computed: false })) return false;
  19263. if (t.isCallExpression(parent, { callee: node })) return false;
  19264. return true;
  19265. }
  19266. function isMemberExpressionSuper(node) {
  19267. return t.isMemberExpression(node) && t.isSuper(node.object);
  19268. }
  19269. function getPrototypeOfExpression(objectRef, isStatic) {
  19270. var targetRef = isStatic ? objectRef : t.memberExpression(objectRef, t.identifier("prototype"));
  19271. return t.logicalExpression("||", t.memberExpression(targetRef, t.identifier("__proto__")), t.callExpression(t.memberExpression(t.identifier("Object"), t.identifier("getPrototypeOf")), [targetRef]));
  19272. }
  19273. var visitor = {
  19274. Function: function Function(path) {
  19275. if (!path.inShadow("this")) {
  19276. path.skip();
  19277. }
  19278. },
  19279. ReturnStatement: function ReturnStatement(path, state) {
  19280. if (!path.inShadow("this")) {
  19281. state.returns.push(path);
  19282. }
  19283. },
  19284. ThisExpression: function ThisExpression(path, state) {
  19285. if (!path.node[HARDCORE_THIS_REF]) {
  19286. state.thises.push(path);
  19287. }
  19288. },
  19289. enter: function enter(path, state) {
  19290. var callback = state.specHandle;
  19291. if (state.isLoose) callback = state.looseHandle;
  19292. var isBareSuper = path.isCallExpression() && path.get("callee").isSuper();
  19293. var result = callback.call(state, path);
  19294. if (result) {
  19295. state.hasSuper = true;
  19296. }
  19297. if (isBareSuper) {
  19298. state.bareSupers.push(path);
  19299. }
  19300. if (result === true) {
  19301. path.requeue();
  19302. }
  19303. if (result !== true && result) {
  19304. if (Array.isArray(result)) {
  19305. path.replaceWithMultiple(result);
  19306. } else {
  19307. path.replaceWith(result);
  19308. }
  19309. }
  19310. }
  19311. };
  19312. var ReplaceSupers = function () {
  19313. function ReplaceSupers(opts) {
  19314. var inClass = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  19315. (0, _classCallCheck3.default)(this, ReplaceSupers);
  19316. this.forceSuperMemoisation = opts.forceSuperMemoisation;
  19317. this.methodPath = opts.methodPath;
  19318. this.methodNode = opts.methodNode;
  19319. this.superRef = opts.superRef;
  19320. this.isStatic = opts.isStatic;
  19321. this.hasSuper = false;
  19322. this.inClass = inClass;
  19323. this.isLoose = opts.isLoose;
  19324. this.scope = this.methodPath.scope;
  19325. this.file = opts.file;
  19326. this.opts = opts;
  19327. this.bareSupers = [];
  19328. this.returns = [];
  19329. this.thises = [];
  19330. }
  19331. ReplaceSupers.prototype.getObjectRef = function getObjectRef() {
  19332. return this.opts.objectRef || this.opts.getObjectRef();
  19333. };
  19334. ReplaceSupers.prototype.setSuperProperty = function setSuperProperty(property, value, isComputed) {
  19335. return t.callExpression(this.file.addHelper("set"), [getPrototypeOfExpression(this.getObjectRef(), this.isStatic), isComputed ? property : t.stringLiteral(property.name), value, t.thisExpression()]);
  19336. };
  19337. ReplaceSupers.prototype.getSuperProperty = function getSuperProperty(property, isComputed) {
  19338. return t.callExpression(this.file.addHelper("get"), [getPrototypeOfExpression(this.getObjectRef(), this.isStatic), isComputed ? property : t.stringLiteral(property.name), t.thisExpression()]);
  19339. };
  19340. ReplaceSupers.prototype.replace = function replace() {
  19341. this.methodPath.traverse(visitor, this);
  19342. };
  19343. ReplaceSupers.prototype.getLooseSuperProperty = function getLooseSuperProperty(id, parent) {
  19344. var methodNode = this.methodNode;
  19345. var superRef = this.superRef || t.identifier("Function");
  19346. if (parent.property === id) {
  19347. return;
  19348. } else if (t.isCallExpression(parent, { callee: id })) {
  19349. return;
  19350. } else if (t.isMemberExpression(parent) && !methodNode.static) {
  19351. return t.memberExpression(superRef, t.identifier("prototype"));
  19352. } else {
  19353. return superRef;
  19354. }
  19355. };
  19356. ReplaceSupers.prototype.looseHandle = function looseHandle(path) {
  19357. var node = path.node;
  19358. if (path.isSuper()) {
  19359. return this.getLooseSuperProperty(node, path.parent);
  19360. } else if (path.isCallExpression()) {
  19361. var callee = node.callee;
  19362. if (!t.isMemberExpression(callee)) return;
  19363. if (!t.isSuper(callee.object)) return;
  19364. t.appendToMemberExpression(callee, t.identifier("call"));
  19365. node.arguments.unshift(t.thisExpression());
  19366. return true;
  19367. }
  19368. };
  19369. ReplaceSupers.prototype.specHandleAssignmentExpression = function specHandleAssignmentExpression(ref, path, node) {
  19370. if (node.operator === "=") {
  19371. return this.setSuperProperty(node.left.property, node.right, node.left.computed);
  19372. } else {
  19373. ref = ref || path.scope.generateUidIdentifier("ref");
  19374. return [t.variableDeclaration("var", [t.variableDeclarator(ref, node.left)]), t.expressionStatement(t.assignmentExpression("=", node.left, t.binaryExpression(node.operator[0], ref, node.right)))];
  19375. }
  19376. };
  19377. ReplaceSupers.prototype.specHandle = function specHandle(path) {
  19378. var property = void 0;
  19379. var computed = void 0;
  19380. var args = void 0;
  19381. var parent = path.parent;
  19382. var node = path.node;
  19383. if (isIllegalBareSuper(node, parent)) {
  19384. throw path.buildCodeFrameError(messages.get("classesIllegalBareSuper"));
  19385. }
  19386. if (t.isCallExpression(node)) {
  19387. var callee = node.callee;
  19388. if (t.isSuper(callee)) {
  19389. return;
  19390. } else if (isMemberExpressionSuper(callee)) {
  19391. property = callee.property;
  19392. computed = callee.computed;
  19393. args = node.arguments;
  19394. }
  19395. } else if (t.isMemberExpression(node) && t.isSuper(node.object)) {
  19396. property = node.property;
  19397. computed = node.computed;
  19398. } else if (t.isUpdateExpression(node) && isMemberExpressionSuper(node.argument)) {
  19399. var binary = t.binaryExpression(node.operator[0], node.argument, t.numericLiteral(1));
  19400. if (node.prefix) {
  19401. return this.specHandleAssignmentExpression(null, path, binary);
  19402. } else {
  19403. var ref = path.scope.generateUidIdentifier("ref");
  19404. return this.specHandleAssignmentExpression(ref, path, binary).concat(t.expressionStatement(ref));
  19405. }
  19406. } else if (t.isAssignmentExpression(node) && isMemberExpressionSuper(node.left)) {
  19407. return this.specHandleAssignmentExpression(null, path, node);
  19408. }
  19409. if (!property) return;
  19410. var superProperty = this.getSuperProperty(property, computed);
  19411. if (args) {
  19412. return this.optimiseCall(superProperty, args);
  19413. } else {
  19414. return superProperty;
  19415. }
  19416. };
  19417. ReplaceSupers.prototype.optimiseCall = function optimiseCall(callee, args) {
  19418. var thisNode = t.thisExpression();
  19419. thisNode[HARDCORE_THIS_REF] = true;
  19420. return (0, _babelHelperOptimiseCallExpression2.default)(callee, thisNode, args);
  19421. };
  19422. return ReplaceSupers;
  19423. }();
  19424. exports.default = ReplaceSupers;
  19425. module.exports = exports["default"];
  19426. /***/ }),
  19427. /* 194 */
  19428. /***/ (function(module, exports, __webpack_require__) {
  19429. "use strict";
  19430. exports.__esModule = true;
  19431. exports.list = undefined;
  19432. var _keys = __webpack_require__(14);
  19433. var _keys2 = _interopRequireDefault(_keys);
  19434. exports.get = get;
  19435. var _helpers = __webpack_require__(321);
  19436. var _helpers2 = _interopRequireDefault(_helpers);
  19437. function _interopRequireDefault(obj) {
  19438. return obj && obj.__esModule ? obj : { default: obj };
  19439. }
  19440. function get(name) {
  19441. var fn = _helpers2.default[name];
  19442. if (!fn) throw new ReferenceError("Unknown helper " + name);
  19443. return fn().expression;
  19444. }
  19445. var list = exports.list = (0, _keys2.default)(_helpers2.default).map(function (name) {
  19446. return name.replace(/^_/, "");
  19447. }).filter(function (name) {
  19448. return name !== "__esModule";
  19449. });
  19450. exports.default = get;
  19451. /***/ }),
  19452. /* 195 */
  19453. /***/ (function(module, exports) {
  19454. "use strict";
  19455. exports.__esModule = true;
  19456. exports.default = function () {
  19457. return {
  19458. manipulateOptions: function manipulateOptions(opts, parserOpts) {
  19459. parserOpts.plugins.push("asyncGenerators");
  19460. }
  19461. };
  19462. };
  19463. module.exports = exports["default"];
  19464. /***/ }),
  19465. /* 196 */
  19466. /***/ (function(module, exports) {
  19467. "use strict";
  19468. exports.__esModule = true;
  19469. exports.default = function () {
  19470. return {
  19471. manipulateOptions: function manipulateOptions(opts, parserOpts) {
  19472. parserOpts.plugins.push("classConstructorCall");
  19473. }
  19474. };
  19475. };
  19476. module.exports = exports["default"];
  19477. /***/ }),
  19478. /* 197 */
  19479. /***/ (function(module, exports) {
  19480. "use strict";
  19481. exports.__esModule = true;
  19482. exports.default = function () {
  19483. return {
  19484. manipulateOptions: function manipulateOptions(opts, parserOpts) {
  19485. parserOpts.plugins.push("classProperties");
  19486. }
  19487. };
  19488. };
  19489. module.exports = exports["default"];
  19490. /***/ }),
  19491. /* 198 */
  19492. /***/ (function(module, exports) {
  19493. "use strict";
  19494. exports.__esModule = true;
  19495. exports.default = function () {
  19496. return {
  19497. manipulateOptions: function manipulateOptions(opts, parserOpts) {
  19498. parserOpts.plugins.push("doExpressions");
  19499. }
  19500. };
  19501. };
  19502. module.exports = exports["default"];
  19503. /***/ }),
  19504. /* 199 */
  19505. /***/ (function(module, exports) {
  19506. "use strict";
  19507. exports.__esModule = true;
  19508. exports.default = function () {
  19509. return {
  19510. manipulateOptions: function manipulateOptions(opts, parserOpts) {
  19511. parserOpts.plugins.push("exponentiationOperator");
  19512. }
  19513. };
  19514. };
  19515. module.exports = exports["default"];
  19516. /***/ }),
  19517. /* 200 */
  19518. /***/ (function(module, exports) {
  19519. "use strict";
  19520. exports.__esModule = true;
  19521. exports.default = function () {
  19522. return {
  19523. manipulateOptions: function manipulateOptions(opts, parserOpts) {
  19524. parserOpts.plugins.push("exportExtensions");
  19525. }
  19526. };
  19527. };
  19528. module.exports = exports["default"];
  19529. /***/ }),
  19530. /* 201 */
  19531. /***/ (function(module, exports) {
  19532. "use strict";
  19533. exports.__esModule = true;
  19534. exports.default = function () {
  19535. return {
  19536. manipulateOptions: function manipulateOptions(opts, parserOpts) {
  19537. parserOpts.plugins.push("functionBind");
  19538. }
  19539. };
  19540. };
  19541. module.exports = exports["default"];
  19542. /***/ }),
  19543. /* 202 */
  19544. /***/ (function(module, exports) {
  19545. "use strict";
  19546. exports.__esModule = true;
  19547. exports.default = function () {
  19548. return {
  19549. manipulateOptions: function manipulateOptions(opts, parserOpts) {
  19550. parserOpts.plugins.push("objectRestSpread");
  19551. }
  19552. };
  19553. };
  19554. module.exports = exports["default"];
  19555. /***/ }),
  19556. /* 203 */
  19557. /***/ (function(module, exports, __webpack_require__) {
  19558. "use strict";
  19559. exports.__esModule = true;
  19560. var _getIterator2 = __webpack_require__(2);
  19561. var _getIterator3 = _interopRequireDefault(_getIterator2);
  19562. var _symbol = __webpack_require__(10);
  19563. var _symbol2 = _interopRequireDefault(_symbol);
  19564. exports.default = function (_ref) {
  19565. var t = _ref.types;
  19566. var ALREADY_VISITED = (0, _symbol2.default)();
  19567. function findConstructorCall(path) {
  19568. var methods = path.get("body.body");
  19569. for (var _iterator = methods, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
  19570. var _ref2;
  19571. if (_isArray) {
  19572. if (_i >= _iterator.length) break;
  19573. _ref2 = _iterator[_i++];
  19574. } else {
  19575. _i = _iterator.next();
  19576. if (_i.done) break;
  19577. _ref2 = _i.value;
  19578. }
  19579. var method = _ref2;
  19580. if (method.node.kind === "constructorCall") {
  19581. return method;
  19582. }
  19583. }
  19584. return null;
  19585. }
  19586. function handleClassWithCall(constructorCall, classPath) {
  19587. var _classPath = classPath,
  19588. node = _classPath.node;
  19589. var ref = node.id || classPath.scope.generateUidIdentifier("class");
  19590. if (classPath.parentPath.isExportDefaultDeclaration()) {
  19591. classPath = classPath.parentPath;
  19592. classPath.insertAfter(t.exportDefaultDeclaration(ref));
  19593. }
  19594. classPath.replaceWithMultiple(buildWrapper({
  19595. CLASS_REF: classPath.scope.generateUidIdentifier(ref.name),
  19596. CALL_REF: classPath.scope.generateUidIdentifier(ref.name + "Call"),
  19597. CALL: t.functionExpression(null, constructorCall.node.params, constructorCall.node.body),
  19598. CLASS: t.toExpression(node),
  19599. WRAPPER_REF: ref
  19600. }));
  19601. constructorCall.remove();
  19602. }
  19603. return {
  19604. inherits: __webpack_require__(196),
  19605. visitor: {
  19606. Class: function Class(path) {
  19607. if (path.node[ALREADY_VISITED]) return;
  19608. path.node[ALREADY_VISITED] = true;
  19609. var constructorCall = findConstructorCall(path);
  19610. if (constructorCall) {
  19611. handleClassWithCall(constructorCall, path);
  19612. } else {
  19613. return;
  19614. }
  19615. }
  19616. }
  19617. };
  19618. };
  19619. var _babelTemplate = __webpack_require__(4);
  19620. var _babelTemplate2 = _interopRequireDefault(_babelTemplate);
  19621. function _interopRequireDefault(obj) {
  19622. return obj && obj.__esModule ? obj : { default: obj };
  19623. }
  19624. var buildWrapper = (0, _babelTemplate2.default)("\n let CLASS_REF = CLASS;\n var CALL_REF = CALL;\n var WRAPPER_REF = function (...args) {\n if (this instanceof WRAPPER_REF) {\n return Reflect.construct(CLASS_REF, args);\n } else {\n return CALL_REF.apply(this, args);\n }\n };\n WRAPPER_REF.__proto__ = CLASS_REF;\n WRAPPER_REF;\n");
  19625. module.exports = exports["default"];
  19626. /***/ }),
  19627. /* 204 */
  19628. /***/ (function(module, exports, __webpack_require__) {
  19629. "use strict";
  19630. exports.__esModule = true;
  19631. var _getIterator2 = __webpack_require__(2);
  19632. var _getIterator3 = _interopRequireDefault(_getIterator2);
  19633. exports.default = function (_ref) {
  19634. var t = _ref.types;
  19635. var findBareSupers = {
  19636. Super: function Super(path) {
  19637. if (path.parentPath.isCallExpression({ callee: path.node })) {
  19638. this.push(path.parentPath);
  19639. }
  19640. }
  19641. };
  19642. var referenceVisitor = {
  19643. ReferencedIdentifier: function ReferencedIdentifier(path) {
  19644. if (this.scope.hasOwnBinding(path.node.name)) {
  19645. this.collision = true;
  19646. path.skip();
  19647. }
  19648. }
  19649. };
  19650. var buildObjectDefineProperty = (0, _babelTemplate2.default)("\n Object.defineProperty(REF, KEY, {\n // configurable is false by default\n enumerable: true,\n writable: true,\n value: VALUE\n });\n ");
  19651. var buildClassPropertySpec = function buildClassPropertySpec(ref, _ref2) {
  19652. var key = _ref2.key,
  19653. value = _ref2.value,
  19654. computed = _ref2.computed;
  19655. return buildObjectDefineProperty({
  19656. REF: ref,
  19657. KEY: t.isIdentifier(key) && !computed ? t.stringLiteral(key.name) : key,
  19658. VALUE: value ? value : t.identifier("undefined")
  19659. });
  19660. };
  19661. var buildClassPropertyNonSpec = function buildClassPropertyNonSpec(ref, _ref3) {
  19662. var key = _ref3.key,
  19663. value = _ref3.value,
  19664. computed = _ref3.computed;
  19665. return t.expressionStatement(t.assignmentExpression("=", t.memberExpression(ref, key, computed || t.isLiteral(key)), value));
  19666. };
  19667. return {
  19668. inherits: __webpack_require__(197),
  19669. visitor: {
  19670. Class: function Class(path, state) {
  19671. var buildClassProperty = state.opts.spec ? buildClassPropertySpec : buildClassPropertyNonSpec;
  19672. var isDerived = !!path.node.superClass;
  19673. var constructor = void 0;
  19674. var props = [];
  19675. var body = path.get("body");
  19676. for (var _iterator = body.get("body"), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
  19677. var _ref4;
  19678. if (_isArray) {
  19679. if (_i >= _iterator.length) break;
  19680. _ref4 = _iterator[_i++];
  19681. } else {
  19682. _i = _iterator.next();
  19683. if (_i.done) break;
  19684. _ref4 = _i.value;
  19685. }
  19686. var _path = _ref4;
  19687. if (_path.isClassProperty()) {
  19688. props.push(_path);
  19689. } else if (_path.isClassMethod({ kind: "constructor" })) {
  19690. constructor = _path;
  19691. }
  19692. }
  19693. if (!props.length) return;
  19694. var nodes = [];
  19695. var ref = void 0;
  19696. if (path.isClassExpression() || !path.node.id) {
  19697. (0, _babelHelperFunctionName2.default)(path);
  19698. ref = path.scope.generateUidIdentifier("class");
  19699. } else {
  19700. ref = path.node.id;
  19701. }
  19702. var instanceBody = [];
  19703. for (var _iterator2 = props, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) {
  19704. var _ref5;
  19705. if (_isArray2) {
  19706. if (_i2 >= _iterator2.length) break;
  19707. _ref5 = _iterator2[_i2++];
  19708. } else {
  19709. _i2 = _iterator2.next();
  19710. if (_i2.done) break;
  19711. _ref5 = _i2.value;
  19712. }
  19713. var _prop = _ref5;
  19714. var propNode = _prop.node;
  19715. if (propNode.decorators && propNode.decorators.length > 0) continue;
  19716. if (!state.opts.spec && !propNode.value) continue;
  19717. var isStatic = propNode.static;
  19718. if (isStatic) {
  19719. nodes.push(buildClassProperty(ref, propNode));
  19720. } else {
  19721. if (!propNode.value) continue;
  19722. instanceBody.push(buildClassProperty(t.thisExpression(), propNode));
  19723. }
  19724. }
  19725. if (instanceBody.length) {
  19726. if (!constructor) {
  19727. var newConstructor = t.classMethod("constructor", t.identifier("constructor"), [], t.blockStatement([]));
  19728. if (isDerived) {
  19729. newConstructor.params = [t.restElement(t.identifier("args"))];
  19730. newConstructor.body.body.push(t.returnStatement(t.callExpression(t.super(), [t.spreadElement(t.identifier("args"))])));
  19731. }
  19732. var _body$unshiftContaine = body.unshiftContainer("body", newConstructor);
  19733. constructor = _body$unshiftContaine[0];
  19734. }
  19735. var collisionState = {
  19736. collision: false,
  19737. scope: constructor.scope
  19738. };
  19739. for (var _iterator3 = props, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) {
  19740. var _ref6;
  19741. if (_isArray3) {
  19742. if (_i3 >= _iterator3.length) break;
  19743. _ref6 = _iterator3[_i3++];
  19744. } else {
  19745. _i3 = _iterator3.next();
  19746. if (_i3.done) break;
  19747. _ref6 = _i3.value;
  19748. }
  19749. var prop = _ref6;
  19750. prop.traverse(referenceVisitor, collisionState);
  19751. if (collisionState.collision) break;
  19752. }
  19753. if (collisionState.collision) {
  19754. var initialisePropsRef = path.scope.generateUidIdentifier("initialiseProps");
  19755. nodes.push(t.variableDeclaration("var", [t.variableDeclarator(initialisePropsRef, t.functionExpression(null, [], t.blockStatement(instanceBody)))]));
  19756. instanceBody = [t.expressionStatement(t.callExpression(t.memberExpression(initialisePropsRef, t.identifier("call")), [t.thisExpression()]))];
  19757. }
  19758. if (isDerived) {
  19759. var bareSupers = [];
  19760. constructor.traverse(findBareSupers, bareSupers);
  19761. for (var _iterator4 = bareSupers, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, _getIterator3.default)(_iterator4);;) {
  19762. var _ref7;
  19763. if (_isArray4) {
  19764. if (_i4 >= _iterator4.length) break;
  19765. _ref7 = _iterator4[_i4++];
  19766. } else {
  19767. _i4 = _iterator4.next();
  19768. if (_i4.done) break;
  19769. _ref7 = _i4.value;
  19770. }
  19771. var bareSuper = _ref7;
  19772. bareSuper.insertAfter(instanceBody);
  19773. }
  19774. } else {
  19775. constructor.get("body").unshiftContainer("body", instanceBody);
  19776. }
  19777. }
  19778. for (var _iterator5 = props, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, _getIterator3.default)(_iterator5);;) {
  19779. var _ref8;
  19780. if (_isArray5) {
  19781. if (_i5 >= _iterator5.length) break;
  19782. _ref8 = _iterator5[_i5++];
  19783. } else {
  19784. _i5 = _iterator5.next();
  19785. if (_i5.done) break;
  19786. _ref8 = _i5.value;
  19787. }
  19788. var _prop2 = _ref8;
  19789. _prop2.remove();
  19790. }
  19791. if (!nodes.length) return;
  19792. if (path.isClassExpression()) {
  19793. path.scope.push({ id: ref });
  19794. path.replaceWith(t.assignmentExpression("=", ref, path.node));
  19795. } else {
  19796. if (!path.node.id) {
  19797. path.node.id = ref;
  19798. }
  19799. if (path.parentPath.isExportDeclaration()) {
  19800. path = path.parentPath;
  19801. }
  19802. }
  19803. path.insertAfter(nodes);
  19804. },
  19805. ArrowFunctionExpression: function ArrowFunctionExpression(path) {
  19806. var classExp = path.get("body");
  19807. if (!classExp.isClassExpression()) return;
  19808. var body = classExp.get("body");
  19809. var members = body.get("body");
  19810. if (members.some(function (member) {
  19811. return member.isClassProperty();
  19812. })) {
  19813. path.ensureBlock();
  19814. }
  19815. }
  19816. }
  19817. };
  19818. };
  19819. var _babelHelperFunctionName = __webpack_require__(40);
  19820. var _babelHelperFunctionName2 = _interopRequireDefault(_babelHelperFunctionName);
  19821. var _babelTemplate = __webpack_require__(4);
  19822. var _babelTemplate2 = _interopRequireDefault(_babelTemplate);
  19823. function _interopRequireDefault(obj) {
  19824. return obj && obj.__esModule ? obj : { default: obj };
  19825. }
  19826. module.exports = exports["default"];
  19827. /***/ }),
  19828. /* 205 */
  19829. /***/ (function(module, exports, __webpack_require__) {
  19830. "use strict";
  19831. exports.__esModule = true;
  19832. var _create = __webpack_require__(9);
  19833. var _create2 = _interopRequireDefault(_create);
  19834. var _getIterator2 = __webpack_require__(2);
  19835. var _getIterator3 = _interopRequireDefault(_getIterator2);
  19836. exports.default = function (_ref) {
  19837. var t = _ref.types;
  19838. function cleanDecorators(decorators) {
  19839. return decorators.reverse().map(function (dec) {
  19840. return dec.expression;
  19841. });
  19842. }
  19843. function transformClass(path, ref, state) {
  19844. var nodes = [];
  19845. state;
  19846. var classDecorators = path.node.decorators;
  19847. if (classDecorators) {
  19848. path.node.decorators = null;
  19849. classDecorators = cleanDecorators(classDecorators);
  19850. for (var _iterator = classDecorators, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
  19851. var _ref2;
  19852. if (_isArray) {
  19853. if (_i >= _iterator.length) break;
  19854. _ref2 = _iterator[_i++];
  19855. } else {
  19856. _i = _iterator.next();
  19857. if (_i.done) break;
  19858. _ref2 = _i.value;
  19859. }
  19860. var decorator = _ref2;
  19861. nodes.push(buildClassDecorator({
  19862. CLASS_REF: ref,
  19863. DECORATOR: decorator
  19864. }));
  19865. }
  19866. }
  19867. var map = (0, _create2.default)(null);
  19868. for (var _iterator2 = path.get("body.body"), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) {
  19869. var _ref3;
  19870. if (_isArray2) {
  19871. if (_i2 >= _iterator2.length) break;
  19872. _ref3 = _iterator2[_i2++];
  19873. } else {
  19874. _i2 = _iterator2.next();
  19875. if (_i2.done) break;
  19876. _ref3 = _i2.value;
  19877. }
  19878. var method = _ref3;
  19879. var decorators = method.node.decorators;
  19880. if (!decorators) continue;
  19881. var _alias = t.toKeyAlias(method.node);
  19882. map[_alias] = map[_alias] || [];
  19883. map[_alias].push(method.node);
  19884. method.remove();
  19885. }
  19886. for (var alias in map) {
  19887. var items = map[alias];
  19888. items;
  19889. }
  19890. return nodes;
  19891. }
  19892. function hasDecorators(path) {
  19893. if (path.isClass()) {
  19894. if (path.node.decorators) return true;
  19895. for (var _iterator3 = path.node.body.body, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) {
  19896. var _ref4;
  19897. if (_isArray3) {
  19898. if (_i3 >= _iterator3.length) break;
  19899. _ref4 = _iterator3[_i3++];
  19900. } else {
  19901. _i3 = _iterator3.next();
  19902. if (_i3.done) break;
  19903. _ref4 = _i3.value;
  19904. }
  19905. var method = _ref4;
  19906. if (method.decorators) {
  19907. return true;
  19908. }
  19909. }
  19910. } else if (path.isObjectExpression()) {
  19911. for (var _iterator4 = path.node.properties, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, _getIterator3.default)(_iterator4);;) {
  19912. var _ref5;
  19913. if (_isArray4) {
  19914. if (_i4 >= _iterator4.length) break;
  19915. _ref5 = _iterator4[_i4++];
  19916. } else {
  19917. _i4 = _iterator4.next();
  19918. if (_i4.done) break;
  19919. _ref5 = _i4.value;
  19920. }
  19921. var prop = _ref5;
  19922. if (prop.decorators) {
  19923. return true;
  19924. }
  19925. }
  19926. }
  19927. return false;
  19928. }
  19929. function doError(path) {
  19930. throw path.buildCodeFrameError("Decorators are not officially supported yet in 6.x pending a proposal update.\nHowever, if you need to use them you can install the legacy decorators transform with:\n\nnpm install babel-plugin-transform-decorators-legacy --save-dev\n\nand add the following line to your .babelrc file:\n\n{\n \"plugins\": [\"transform-decorators-legacy\"]\n}\n\nThe repo url is: https://github.com/loganfsmyth/babel-plugin-transform-decorators-legacy.\n ");
  19931. }
  19932. return {
  19933. inherits: __webpack_require__(125),
  19934. visitor: {
  19935. ClassExpression: function ClassExpression(path) {
  19936. if (!hasDecorators(path)) return;
  19937. doError(path);
  19938. (0, _babelHelperExplodeClass2.default)(path);
  19939. var ref = path.scope.generateDeclaredUidIdentifier("ref");
  19940. var nodes = [];
  19941. nodes.push(t.assignmentExpression("=", ref, path.node));
  19942. nodes = nodes.concat(transformClass(path, ref, this));
  19943. nodes.push(ref);
  19944. path.replaceWith(t.sequenceExpression(nodes));
  19945. },
  19946. ClassDeclaration: function ClassDeclaration(path) {
  19947. if (!hasDecorators(path)) return;
  19948. doError(path);
  19949. (0, _babelHelperExplodeClass2.default)(path);
  19950. var ref = path.node.id;
  19951. var nodes = [];
  19952. nodes = nodes.concat(transformClass(path, ref, this).map(function (expr) {
  19953. return t.expressionStatement(expr);
  19954. }));
  19955. nodes.push(t.expressionStatement(ref));
  19956. path.insertAfter(nodes);
  19957. },
  19958. ObjectExpression: function ObjectExpression(path) {
  19959. if (!hasDecorators(path)) return;
  19960. doError(path);
  19961. }
  19962. }
  19963. };
  19964. };
  19965. var _babelTemplate = __webpack_require__(4);
  19966. var _babelTemplate2 = _interopRequireDefault(_babelTemplate);
  19967. var _babelHelperExplodeClass = __webpack_require__(319);
  19968. var _babelHelperExplodeClass2 = _interopRequireDefault(_babelHelperExplodeClass);
  19969. function _interopRequireDefault(obj) {
  19970. return obj && obj.__esModule ? obj : { default: obj };
  19971. }
  19972. var buildClassDecorator = (0, _babelTemplate2.default)("\n CLASS_REF = DECORATOR(CLASS_REF) || CLASS_REF;\n");
  19973. module.exports = exports["default"];
  19974. /***/ }),
  19975. /* 206 */
  19976. /***/ (function(module, exports, __webpack_require__) {
  19977. "use strict";
  19978. exports.__esModule = true;
  19979. exports.default = function () {
  19980. return {
  19981. inherits: __webpack_require__(198),
  19982. visitor: {
  19983. DoExpression: function DoExpression(path) {
  19984. var body = path.node.body.body;
  19985. if (body.length) {
  19986. path.replaceWithMultiple(body);
  19987. } else {
  19988. path.replaceWith(path.scope.buildUndefinedNode());
  19989. }
  19990. }
  19991. }
  19992. };
  19993. };
  19994. module.exports = exports["default"];
  19995. /***/ }),
  19996. /* 207 */
  19997. /***/ (function(module, exports, __webpack_require__) {
  19998. "use strict";
  19999. exports.__esModule = true;
  20000. var _getIterator2 = __webpack_require__(2);
  20001. var _getIterator3 = _interopRequireDefault(_getIterator2);
  20002. var _classCallCheck2 = __webpack_require__(3);
  20003. var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
  20004. var _babelTraverse = __webpack_require__(7);
  20005. var _babelHelperReplaceSupers = __webpack_require__(193);
  20006. var _babelHelperReplaceSupers2 = _interopRequireDefault(_babelHelperReplaceSupers);
  20007. var _babelHelperOptimiseCallExpression = __webpack_require__(191);
  20008. var _babelHelperOptimiseCallExpression2 = _interopRequireDefault(_babelHelperOptimiseCallExpression);
  20009. var _babelHelperDefineMap = __webpack_require__(188);
  20010. var defineMap = _interopRequireWildcard(_babelHelperDefineMap);
  20011. var _babelTemplate = __webpack_require__(4);
  20012. var _babelTemplate2 = _interopRequireDefault(_babelTemplate);
  20013. var _babelTypes = __webpack_require__(1);
  20014. var t = _interopRequireWildcard(_babelTypes);
  20015. function _interopRequireWildcard(obj) {
  20016. if (obj && obj.__esModule) {
  20017. return obj;
  20018. } else {
  20019. var newObj = {};if (obj != null) {
  20020. for (var key in obj) {
  20021. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  20022. }
  20023. }newObj.default = obj;return newObj;
  20024. }
  20025. }
  20026. function _interopRequireDefault(obj) {
  20027. return obj && obj.__esModule ? obj : { default: obj };
  20028. }
  20029. var buildDerivedConstructor = (0, _babelTemplate2.default)("\n (function () {\n super(...arguments);\n })\n");
  20030. var noMethodVisitor = {
  20031. "FunctionExpression|FunctionDeclaration": function FunctionExpressionFunctionDeclaration(path) {
  20032. if (!path.is("shadow")) {
  20033. path.skip();
  20034. }
  20035. },
  20036. Method: function Method(path) {
  20037. path.skip();
  20038. }
  20039. };
  20040. var verifyConstructorVisitor = _babelTraverse.visitors.merge([noMethodVisitor, {
  20041. Super: function Super(path) {
  20042. if (this.isDerived && !this.hasBareSuper && !path.parentPath.isCallExpression({ callee: path.node })) {
  20043. throw path.buildCodeFrameError("'super.*' is not allowed before super()");
  20044. }
  20045. },
  20046. CallExpression: {
  20047. exit: function exit(path) {
  20048. if (path.get("callee").isSuper()) {
  20049. this.hasBareSuper = true;
  20050. if (!this.isDerived) {
  20051. throw path.buildCodeFrameError("super() is only allowed in a derived constructor");
  20052. }
  20053. }
  20054. }
  20055. },
  20056. ThisExpression: function ThisExpression(path) {
  20057. if (this.isDerived && !this.hasBareSuper) {
  20058. if (!path.inShadow("this")) {
  20059. throw path.buildCodeFrameError("'this' is not allowed before super()");
  20060. }
  20061. }
  20062. }
  20063. }]);
  20064. var findThisesVisitor = _babelTraverse.visitors.merge([noMethodVisitor, {
  20065. ThisExpression: function ThisExpression(path) {
  20066. this.superThises.push(path);
  20067. }
  20068. }]);
  20069. var ClassTransformer = function () {
  20070. function ClassTransformer(path, file) {
  20071. (0, _classCallCheck3.default)(this, ClassTransformer);
  20072. this.parent = path.parent;
  20073. this.scope = path.scope;
  20074. this.node = path.node;
  20075. this.path = path;
  20076. this.file = file;
  20077. this.clearDescriptors();
  20078. this.instancePropBody = [];
  20079. this.instancePropRefs = {};
  20080. this.staticPropBody = [];
  20081. this.body = [];
  20082. this.bareSuperAfter = [];
  20083. this.bareSupers = [];
  20084. this.pushedConstructor = false;
  20085. this.pushedInherits = false;
  20086. this.isLoose = false;
  20087. this.superThises = [];
  20088. this.classId = this.node.id;
  20089. this.classRef = this.node.id ? t.identifier(this.node.id.name) : this.scope.generateUidIdentifier("class");
  20090. this.superName = this.node.superClass || t.identifier("Function");
  20091. this.isDerived = !!this.node.superClass;
  20092. }
  20093. ClassTransformer.prototype.run = function run() {
  20094. var _this = this;
  20095. var superName = this.superName;
  20096. var file = this.file;
  20097. var body = this.body;
  20098. var constructorBody = this.constructorBody = t.blockStatement([]);
  20099. this.constructor = this.buildConstructor();
  20100. var closureParams = [];
  20101. var closureArgs = [];
  20102. if (this.isDerived) {
  20103. closureArgs.push(superName);
  20104. superName = this.scope.generateUidIdentifierBasedOnNode(superName);
  20105. closureParams.push(superName);
  20106. this.superName = superName;
  20107. }
  20108. this.buildBody();
  20109. constructorBody.body.unshift(t.expressionStatement(t.callExpression(file.addHelper("classCallCheck"), [t.thisExpression(), this.classRef])));
  20110. body = body.concat(this.staticPropBody.map(function (fn) {
  20111. return fn(_this.classRef);
  20112. }));
  20113. if (this.classId) {
  20114. if (body.length === 1) return t.toExpression(body[0]);
  20115. }
  20116. body.push(t.returnStatement(this.classRef));
  20117. var container = t.functionExpression(null, closureParams, t.blockStatement(body));
  20118. container.shadow = true;
  20119. return t.callExpression(container, closureArgs);
  20120. };
  20121. ClassTransformer.prototype.buildConstructor = function buildConstructor() {
  20122. var func = t.functionDeclaration(this.classRef, [], this.constructorBody);
  20123. t.inherits(func, this.node);
  20124. return func;
  20125. };
  20126. ClassTransformer.prototype.pushToMap = function pushToMap(node, enumerable) {
  20127. var kind = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "value";
  20128. var scope = arguments[3];
  20129. var mutatorMap = void 0;
  20130. if (node.static) {
  20131. this.hasStaticDescriptors = true;
  20132. mutatorMap = this.staticMutatorMap;
  20133. } else {
  20134. this.hasInstanceDescriptors = true;
  20135. mutatorMap = this.instanceMutatorMap;
  20136. }
  20137. var map = defineMap.push(mutatorMap, node, kind, this.file, scope);
  20138. if (enumerable) {
  20139. map.enumerable = t.booleanLiteral(true);
  20140. }
  20141. return map;
  20142. };
  20143. ClassTransformer.prototype.constructorMeMaybe = function constructorMeMaybe() {
  20144. var hasConstructor = false;
  20145. var paths = this.path.get("body.body");
  20146. for (var _iterator = paths, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
  20147. var _ref;
  20148. if (_isArray) {
  20149. if (_i >= _iterator.length) break;
  20150. _ref = _iterator[_i++];
  20151. } else {
  20152. _i = _iterator.next();
  20153. if (_i.done) break;
  20154. _ref = _i.value;
  20155. }
  20156. var path = _ref;
  20157. hasConstructor = path.equals("kind", "constructor");
  20158. if (hasConstructor) break;
  20159. }
  20160. if (hasConstructor) return;
  20161. var params = void 0,
  20162. body = void 0;
  20163. if (this.isDerived) {
  20164. var _constructor = buildDerivedConstructor().expression;
  20165. params = _constructor.params;
  20166. body = _constructor.body;
  20167. } else {
  20168. params = [];
  20169. body = t.blockStatement([]);
  20170. }
  20171. this.path.get("body").unshiftContainer("body", t.classMethod("constructor", t.identifier("constructor"), params, body));
  20172. };
  20173. ClassTransformer.prototype.buildBody = function buildBody() {
  20174. this.constructorMeMaybe();
  20175. this.pushBody();
  20176. this.verifyConstructor();
  20177. if (this.userConstructor) {
  20178. var constructorBody = this.constructorBody;
  20179. constructorBody.body = constructorBody.body.concat(this.userConstructor.body.body);
  20180. t.inherits(this.constructor, this.userConstructor);
  20181. t.inherits(constructorBody, this.userConstructor.body);
  20182. }
  20183. this.pushDescriptors();
  20184. };
  20185. ClassTransformer.prototype.pushBody = function pushBody() {
  20186. var classBodyPaths = this.path.get("body.body");
  20187. for (var _iterator2 = classBodyPaths, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) {
  20188. var _ref2;
  20189. if (_isArray2) {
  20190. if (_i2 >= _iterator2.length) break;
  20191. _ref2 = _iterator2[_i2++];
  20192. } else {
  20193. _i2 = _iterator2.next();
  20194. if (_i2.done) break;
  20195. _ref2 = _i2.value;
  20196. }
  20197. var path = _ref2;
  20198. var node = path.node;
  20199. if (path.isClassProperty()) {
  20200. throw path.buildCodeFrameError("Missing class properties transform.");
  20201. }
  20202. if (node.decorators) {
  20203. throw path.buildCodeFrameError("Method has decorators, put the decorator plugin before the classes one.");
  20204. }
  20205. if (t.isClassMethod(node)) {
  20206. var isConstructor = node.kind === "constructor";
  20207. if (isConstructor) {
  20208. path.traverse(verifyConstructorVisitor, this);
  20209. if (!this.hasBareSuper && this.isDerived) {
  20210. throw path.buildCodeFrameError("missing super() call in constructor");
  20211. }
  20212. }
  20213. var replaceSupers = new _babelHelperReplaceSupers2.default({
  20214. forceSuperMemoisation: isConstructor,
  20215. methodPath: path,
  20216. methodNode: node,
  20217. objectRef: this.classRef,
  20218. superRef: this.superName,
  20219. isStatic: node.static,
  20220. isLoose: this.isLoose,
  20221. scope: this.scope,
  20222. file: this.file
  20223. }, true);
  20224. replaceSupers.replace();
  20225. if (isConstructor) {
  20226. this.pushConstructor(replaceSupers, node, path);
  20227. } else {
  20228. this.pushMethod(node, path);
  20229. }
  20230. }
  20231. }
  20232. };
  20233. ClassTransformer.prototype.clearDescriptors = function clearDescriptors() {
  20234. this.hasInstanceDescriptors = false;
  20235. this.hasStaticDescriptors = false;
  20236. this.instanceMutatorMap = {};
  20237. this.staticMutatorMap = {};
  20238. };
  20239. ClassTransformer.prototype.pushDescriptors = function pushDescriptors() {
  20240. this.pushInherits();
  20241. var body = this.body;
  20242. var instanceProps = void 0;
  20243. var staticProps = void 0;
  20244. if (this.hasInstanceDescriptors) {
  20245. instanceProps = defineMap.toClassObject(this.instanceMutatorMap);
  20246. }
  20247. if (this.hasStaticDescriptors) {
  20248. staticProps = defineMap.toClassObject(this.staticMutatorMap);
  20249. }
  20250. if (instanceProps || staticProps) {
  20251. if (instanceProps) instanceProps = defineMap.toComputedObjectFromClass(instanceProps);
  20252. if (staticProps) staticProps = defineMap.toComputedObjectFromClass(staticProps);
  20253. var nullNode = t.nullLiteral();
  20254. var args = [this.classRef, nullNode, nullNode, nullNode, nullNode];
  20255. if (instanceProps) args[1] = instanceProps;
  20256. if (staticProps) args[2] = staticProps;
  20257. if (this.instanceInitializersId) {
  20258. args[3] = this.instanceInitializersId;
  20259. body.unshift(this.buildObjectAssignment(this.instanceInitializersId));
  20260. }
  20261. if (this.staticInitializersId) {
  20262. args[4] = this.staticInitializersId;
  20263. body.unshift(this.buildObjectAssignment(this.staticInitializersId));
  20264. }
  20265. var lastNonNullIndex = 0;
  20266. for (var i = 0; i < args.length; i++) {
  20267. if (args[i] !== nullNode) lastNonNullIndex = i;
  20268. }
  20269. args = args.slice(0, lastNonNullIndex + 1);
  20270. body.push(t.expressionStatement(t.callExpression(this.file.addHelper("createClass"), args)));
  20271. }
  20272. this.clearDescriptors();
  20273. };
  20274. ClassTransformer.prototype.buildObjectAssignment = function buildObjectAssignment(id) {
  20275. return t.variableDeclaration("var", [t.variableDeclarator(id, t.objectExpression([]))]);
  20276. };
  20277. ClassTransformer.prototype.wrapSuperCall = function wrapSuperCall(bareSuper, superRef, thisRef, body) {
  20278. var bareSuperNode = bareSuper.node;
  20279. if (this.isLoose) {
  20280. bareSuperNode.arguments.unshift(t.thisExpression());
  20281. if (bareSuperNode.arguments.length === 2 && t.isSpreadElement(bareSuperNode.arguments[1]) && t.isIdentifier(bareSuperNode.arguments[1].argument, { name: "arguments" })) {
  20282. bareSuperNode.arguments[1] = bareSuperNode.arguments[1].argument;
  20283. bareSuperNode.callee = t.memberExpression(superRef, t.identifier("apply"));
  20284. } else {
  20285. bareSuperNode.callee = t.memberExpression(superRef, t.identifier("call"));
  20286. }
  20287. } else {
  20288. bareSuperNode = (0, _babelHelperOptimiseCallExpression2.default)(t.logicalExpression("||", t.memberExpression(this.classRef, t.identifier("__proto__")), t.callExpression(t.memberExpression(t.identifier("Object"), t.identifier("getPrototypeOf")), [this.classRef])), t.thisExpression(), bareSuperNode.arguments);
  20289. }
  20290. var call = t.callExpression(this.file.addHelper("possibleConstructorReturn"), [t.thisExpression(), bareSuperNode]);
  20291. var bareSuperAfter = this.bareSuperAfter.map(function (fn) {
  20292. return fn(thisRef);
  20293. });
  20294. if (bareSuper.parentPath.isExpressionStatement() && bareSuper.parentPath.container === body.node.body && body.node.body.length - 1 === bareSuper.parentPath.key) {
  20295. if (this.superThises.length || bareSuperAfter.length) {
  20296. bareSuper.scope.push({ id: thisRef });
  20297. call = t.assignmentExpression("=", thisRef, call);
  20298. }
  20299. if (bareSuperAfter.length) {
  20300. call = t.toSequenceExpression([call].concat(bareSuperAfter, [thisRef]));
  20301. }
  20302. bareSuper.parentPath.replaceWith(t.returnStatement(call));
  20303. } else {
  20304. bareSuper.replaceWithMultiple([t.variableDeclaration("var", [t.variableDeclarator(thisRef, call)])].concat(bareSuperAfter, [t.expressionStatement(thisRef)]));
  20305. }
  20306. };
  20307. ClassTransformer.prototype.verifyConstructor = function verifyConstructor() {
  20308. var _this2 = this;
  20309. if (!this.isDerived) return;
  20310. var path = this.userConstructorPath;
  20311. var body = path.get("body");
  20312. path.traverse(findThisesVisitor, this);
  20313. var guaranteedSuperBeforeFinish = !!this.bareSupers.length;
  20314. var superRef = this.superName || t.identifier("Function");
  20315. var thisRef = path.scope.generateUidIdentifier("this");
  20316. for (var _iterator3 = this.bareSupers, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) {
  20317. var _ref3;
  20318. if (_isArray3) {
  20319. if (_i3 >= _iterator3.length) break;
  20320. _ref3 = _iterator3[_i3++];
  20321. } else {
  20322. _i3 = _iterator3.next();
  20323. if (_i3.done) break;
  20324. _ref3 = _i3.value;
  20325. }
  20326. var bareSuper = _ref3;
  20327. this.wrapSuperCall(bareSuper, superRef, thisRef, body);
  20328. if (guaranteedSuperBeforeFinish) {
  20329. bareSuper.find(function (parentPath) {
  20330. if (parentPath === path) {
  20331. return true;
  20332. }
  20333. if (parentPath.isLoop() || parentPath.isConditional()) {
  20334. guaranteedSuperBeforeFinish = false;
  20335. return true;
  20336. }
  20337. });
  20338. }
  20339. }
  20340. for (var _iterator4 = this.superThises, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, _getIterator3.default)(_iterator4);;) {
  20341. var _ref4;
  20342. if (_isArray4) {
  20343. if (_i4 >= _iterator4.length) break;
  20344. _ref4 = _iterator4[_i4++];
  20345. } else {
  20346. _i4 = _iterator4.next();
  20347. if (_i4.done) break;
  20348. _ref4 = _i4.value;
  20349. }
  20350. var thisPath = _ref4;
  20351. thisPath.replaceWith(thisRef);
  20352. }
  20353. var wrapReturn = function wrapReturn(returnArg) {
  20354. return t.callExpression(_this2.file.addHelper("possibleConstructorReturn"), [thisRef].concat(returnArg || []));
  20355. };
  20356. var bodyPaths = body.get("body");
  20357. if (bodyPaths.length && !bodyPaths.pop().isReturnStatement()) {
  20358. body.pushContainer("body", t.returnStatement(guaranteedSuperBeforeFinish ? thisRef : wrapReturn()));
  20359. }
  20360. for (var _iterator5 = this.superReturns, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, _getIterator3.default)(_iterator5);;) {
  20361. var _ref5;
  20362. if (_isArray5) {
  20363. if (_i5 >= _iterator5.length) break;
  20364. _ref5 = _iterator5[_i5++];
  20365. } else {
  20366. _i5 = _iterator5.next();
  20367. if (_i5.done) break;
  20368. _ref5 = _i5.value;
  20369. }
  20370. var returnPath = _ref5;
  20371. if (returnPath.node.argument) {
  20372. var ref = returnPath.scope.generateDeclaredUidIdentifier("ret");
  20373. returnPath.get("argument").replaceWithMultiple([t.assignmentExpression("=", ref, returnPath.node.argument), wrapReturn(ref)]);
  20374. } else {
  20375. returnPath.get("argument").replaceWith(wrapReturn());
  20376. }
  20377. }
  20378. };
  20379. ClassTransformer.prototype.pushMethod = function pushMethod(node, path) {
  20380. var scope = path ? path.scope : this.scope;
  20381. if (node.kind === "method") {
  20382. if (this._processMethod(node, scope)) return;
  20383. }
  20384. this.pushToMap(node, false, null, scope);
  20385. };
  20386. ClassTransformer.prototype._processMethod = function _processMethod() {
  20387. return false;
  20388. };
  20389. ClassTransformer.prototype.pushConstructor = function pushConstructor(replaceSupers, method, path) {
  20390. this.bareSupers = replaceSupers.bareSupers;
  20391. this.superReturns = replaceSupers.returns;
  20392. if (path.scope.hasOwnBinding(this.classRef.name)) {
  20393. path.scope.rename(this.classRef.name);
  20394. }
  20395. var construct = this.constructor;
  20396. this.userConstructorPath = path;
  20397. this.userConstructor = method;
  20398. this.hasConstructor = true;
  20399. t.inheritsComments(construct, method);
  20400. construct._ignoreUserWhitespace = true;
  20401. construct.params = method.params;
  20402. t.inherits(construct.body, method.body);
  20403. construct.body.directives = method.body.directives;
  20404. this._pushConstructor();
  20405. };
  20406. ClassTransformer.prototype._pushConstructor = function _pushConstructor() {
  20407. if (this.pushedConstructor) return;
  20408. this.pushedConstructor = true;
  20409. if (this.hasInstanceDescriptors || this.hasStaticDescriptors) {
  20410. this.pushDescriptors();
  20411. }
  20412. this.body.push(this.constructor);
  20413. this.pushInherits();
  20414. };
  20415. ClassTransformer.prototype.pushInherits = function pushInherits() {
  20416. if (!this.isDerived || this.pushedInherits) return;
  20417. this.pushedInherits = true;
  20418. this.body.unshift(t.expressionStatement(t.callExpression(this.file.addHelper("inherits"), [this.classRef, this.superName])));
  20419. };
  20420. return ClassTransformer;
  20421. }();
  20422. exports.default = ClassTransformer;
  20423. module.exports = exports["default"];
  20424. /***/ }),
  20425. /* 208 */
  20426. /***/ (function(module, exports, __webpack_require__) {
  20427. "use strict";
  20428. exports.__esModule = true;
  20429. var _create = __webpack_require__(9);
  20430. var _create2 = _interopRequireDefault(_create);
  20431. var _getIterator2 = __webpack_require__(2);
  20432. var _getIterator3 = _interopRequireDefault(_getIterator2);
  20433. var _symbol = __webpack_require__(10);
  20434. var _symbol2 = _interopRequireDefault(_symbol);
  20435. exports.default = function (_ref) {
  20436. var t = _ref.types;
  20437. var IGNORE_REASSIGNMENT_SYMBOL = (0, _symbol2.default)();
  20438. var reassignmentVisitor = {
  20439. "AssignmentExpression|UpdateExpression": function AssignmentExpressionUpdateExpression(path) {
  20440. if (path.node[IGNORE_REASSIGNMENT_SYMBOL]) return;
  20441. path.node[IGNORE_REASSIGNMENT_SYMBOL] = true;
  20442. var arg = path.get(path.isAssignmentExpression() ? "left" : "argument");
  20443. if (!arg.isIdentifier()) return;
  20444. var name = arg.node.name;
  20445. if (this.scope.getBinding(name) !== path.scope.getBinding(name)) return;
  20446. var exportedNames = this.exports[name];
  20447. if (!exportedNames) return;
  20448. var node = path.node;
  20449. var isPostUpdateExpression = path.isUpdateExpression() && !node.prefix;
  20450. if (isPostUpdateExpression) {
  20451. if (node.operator === "++") node = t.binaryExpression("+", node.argument, t.numericLiteral(1));else if (node.operator === "--") node = t.binaryExpression("-", node.argument, t.numericLiteral(1));else isPostUpdateExpression = false;
  20452. }
  20453. for (var _iterator = exportedNames, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
  20454. var _ref2;
  20455. if (_isArray) {
  20456. if (_i >= _iterator.length) break;
  20457. _ref2 = _iterator[_i++];
  20458. } else {
  20459. _i = _iterator.next();
  20460. if (_i.done) break;
  20461. _ref2 = _i.value;
  20462. }
  20463. var exportedName = _ref2;
  20464. node = this.buildCall(exportedName, node).expression;
  20465. }
  20466. if (isPostUpdateExpression) node = t.sequenceExpression([node, path.node]);
  20467. path.replaceWith(node);
  20468. }
  20469. };
  20470. return {
  20471. visitor: {
  20472. CallExpression: function CallExpression(path, state) {
  20473. if (path.node.callee.type === TYPE_IMPORT) {
  20474. var contextIdent = state.contextIdent;
  20475. path.replaceWith(t.callExpression(t.memberExpression(contextIdent, t.identifier("import")), path.node.arguments));
  20476. }
  20477. },
  20478. ReferencedIdentifier: function ReferencedIdentifier(path, state) {
  20479. if (path.node.name == "__moduleName" && !path.scope.hasBinding("__moduleName")) {
  20480. path.replaceWith(t.memberExpression(state.contextIdent, t.identifier("id")));
  20481. }
  20482. },
  20483. Program: {
  20484. enter: function enter(path, state) {
  20485. state.contextIdent = path.scope.generateUidIdentifier("context");
  20486. },
  20487. exit: function exit(path, state) {
  20488. var exportIdent = path.scope.generateUidIdentifier("export");
  20489. var contextIdent = state.contextIdent;
  20490. var exportNames = (0, _create2.default)(null);
  20491. var modules = [];
  20492. var beforeBody = [];
  20493. var setters = [];
  20494. var sources = [];
  20495. var variableIds = [];
  20496. var removedPaths = [];
  20497. function addExportName(key, val) {
  20498. exportNames[key] = exportNames[key] || [];
  20499. exportNames[key].push(val);
  20500. }
  20501. function pushModule(source, key, specifiers) {
  20502. var module = void 0;
  20503. modules.forEach(function (m) {
  20504. if (m.key === source) {
  20505. module = m;
  20506. }
  20507. });
  20508. if (!module) {
  20509. modules.push(module = { key: source, imports: [], exports: [] });
  20510. }
  20511. module[key] = module[key].concat(specifiers);
  20512. }
  20513. function buildExportCall(name, val) {
  20514. return t.expressionStatement(t.callExpression(exportIdent, [t.stringLiteral(name), val]));
  20515. }
  20516. var body = path.get("body");
  20517. var canHoist = true;
  20518. for (var _iterator2 = body, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) {
  20519. var _ref3;
  20520. if (_isArray2) {
  20521. if (_i2 >= _iterator2.length) break;
  20522. _ref3 = _iterator2[_i2++];
  20523. } else {
  20524. _i2 = _iterator2.next();
  20525. if (_i2.done) break;
  20526. _ref3 = _i2.value;
  20527. }
  20528. var _path = _ref3;
  20529. if (_path.isExportDeclaration()) _path = _path.get("declaration");
  20530. if (_path.isVariableDeclaration() && _path.node.kind !== "var") {
  20531. canHoist = false;
  20532. break;
  20533. }
  20534. }
  20535. for (var _iterator3 = body, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) {
  20536. var _ref4;
  20537. if (_isArray3) {
  20538. if (_i3 >= _iterator3.length) break;
  20539. _ref4 = _iterator3[_i3++];
  20540. } else {
  20541. _i3 = _iterator3.next();
  20542. if (_i3.done) break;
  20543. _ref4 = _i3.value;
  20544. }
  20545. var _path2 = _ref4;
  20546. if (canHoist && _path2.isFunctionDeclaration()) {
  20547. beforeBody.push(_path2.node);
  20548. removedPaths.push(_path2);
  20549. } else if (_path2.isImportDeclaration()) {
  20550. var source = _path2.node.source.value;
  20551. pushModule(source, "imports", _path2.node.specifiers);
  20552. for (var name in _path2.getBindingIdentifiers()) {
  20553. _path2.scope.removeBinding(name);
  20554. variableIds.push(t.identifier(name));
  20555. }
  20556. _path2.remove();
  20557. } else if (_path2.isExportAllDeclaration()) {
  20558. pushModule(_path2.node.source.value, "exports", _path2.node);
  20559. _path2.remove();
  20560. } else if (_path2.isExportDefaultDeclaration()) {
  20561. var declar = _path2.get("declaration");
  20562. if (declar.isClassDeclaration() || declar.isFunctionDeclaration()) {
  20563. var id = declar.node.id;
  20564. var nodes = [];
  20565. if (id) {
  20566. nodes.push(declar.node);
  20567. nodes.push(buildExportCall("default", id));
  20568. addExportName(id.name, "default");
  20569. } else {
  20570. nodes.push(buildExportCall("default", t.toExpression(declar.node)));
  20571. }
  20572. if (!canHoist || declar.isClassDeclaration()) {
  20573. _path2.replaceWithMultiple(nodes);
  20574. } else {
  20575. beforeBody = beforeBody.concat(nodes);
  20576. removedPaths.push(_path2);
  20577. }
  20578. } else {
  20579. _path2.replaceWith(buildExportCall("default", declar.node));
  20580. }
  20581. } else if (_path2.isExportNamedDeclaration()) {
  20582. var _declar = _path2.get("declaration");
  20583. if (_declar.node) {
  20584. _path2.replaceWith(_declar);
  20585. var _nodes = [];
  20586. var bindingIdentifiers = void 0;
  20587. if (_path2.isFunction()) {
  20588. var node = _declar.node;
  20589. var _name = node.id.name;
  20590. if (canHoist) {
  20591. addExportName(_name, _name);
  20592. beforeBody.push(node);
  20593. beforeBody.push(buildExportCall(_name, node.id));
  20594. removedPaths.push(_path2);
  20595. } else {
  20596. var _bindingIdentifiers;
  20597. bindingIdentifiers = (_bindingIdentifiers = {}, _bindingIdentifiers[_name] = node.id, _bindingIdentifiers);
  20598. }
  20599. } else {
  20600. bindingIdentifiers = _declar.getBindingIdentifiers();
  20601. }
  20602. for (var _name2 in bindingIdentifiers) {
  20603. addExportName(_name2, _name2);
  20604. _nodes.push(buildExportCall(_name2, t.identifier(_name2)));
  20605. }
  20606. _path2.insertAfter(_nodes);
  20607. } else {
  20608. var specifiers = _path2.node.specifiers;
  20609. if (specifiers && specifiers.length) {
  20610. if (_path2.node.source) {
  20611. pushModule(_path2.node.source.value, "exports", specifiers);
  20612. _path2.remove();
  20613. } else {
  20614. var _nodes2 = [];
  20615. for (var _iterator7 = specifiers, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : (0, _getIterator3.default)(_iterator7);;) {
  20616. var _ref8;
  20617. if (_isArray7) {
  20618. if (_i7 >= _iterator7.length) break;
  20619. _ref8 = _iterator7[_i7++];
  20620. } else {
  20621. _i7 = _iterator7.next();
  20622. if (_i7.done) break;
  20623. _ref8 = _i7.value;
  20624. }
  20625. var specifier = _ref8;
  20626. _nodes2.push(buildExportCall(specifier.exported.name, specifier.local));
  20627. addExportName(specifier.local.name, specifier.exported.name);
  20628. }
  20629. _path2.replaceWithMultiple(_nodes2);
  20630. }
  20631. }
  20632. }
  20633. }
  20634. }
  20635. modules.forEach(function (specifiers) {
  20636. var setterBody = [];
  20637. var target = path.scope.generateUidIdentifier(specifiers.key);
  20638. for (var _iterator4 = specifiers.imports, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, _getIterator3.default)(_iterator4);;) {
  20639. var _ref5;
  20640. if (_isArray4) {
  20641. if (_i4 >= _iterator4.length) break;
  20642. _ref5 = _iterator4[_i4++];
  20643. } else {
  20644. _i4 = _iterator4.next();
  20645. if (_i4.done) break;
  20646. _ref5 = _i4.value;
  20647. }
  20648. var specifier = _ref5;
  20649. if (t.isImportNamespaceSpecifier(specifier)) {
  20650. setterBody.push(t.expressionStatement(t.assignmentExpression("=", specifier.local, target)));
  20651. } else if (t.isImportDefaultSpecifier(specifier)) {
  20652. specifier = t.importSpecifier(specifier.local, t.identifier("default"));
  20653. }
  20654. if (t.isImportSpecifier(specifier)) {
  20655. setterBody.push(t.expressionStatement(t.assignmentExpression("=", specifier.local, t.memberExpression(target, specifier.imported))));
  20656. }
  20657. }
  20658. if (specifiers.exports.length) {
  20659. var exportObjRef = path.scope.generateUidIdentifier("exportObj");
  20660. setterBody.push(t.variableDeclaration("var", [t.variableDeclarator(exportObjRef, t.objectExpression([]))]));
  20661. for (var _iterator5 = specifiers.exports, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, _getIterator3.default)(_iterator5);;) {
  20662. var _ref6;
  20663. if (_isArray5) {
  20664. if (_i5 >= _iterator5.length) break;
  20665. _ref6 = _iterator5[_i5++];
  20666. } else {
  20667. _i5 = _iterator5.next();
  20668. if (_i5.done) break;
  20669. _ref6 = _i5.value;
  20670. }
  20671. var node = _ref6;
  20672. if (t.isExportAllDeclaration(node)) {
  20673. setterBody.push(buildExportAll({
  20674. KEY: path.scope.generateUidIdentifier("key"),
  20675. EXPORT_OBJ: exportObjRef,
  20676. TARGET: target
  20677. }));
  20678. } else if (t.isExportSpecifier(node)) {
  20679. setterBody.push(t.expressionStatement(t.assignmentExpression("=", t.memberExpression(exportObjRef, node.exported), t.memberExpression(target, node.local))));
  20680. } else {}
  20681. }
  20682. setterBody.push(t.expressionStatement(t.callExpression(exportIdent, [exportObjRef])));
  20683. }
  20684. sources.push(t.stringLiteral(specifiers.key));
  20685. setters.push(t.functionExpression(null, [target], t.blockStatement(setterBody)));
  20686. });
  20687. var moduleName = this.getModuleName();
  20688. if (moduleName) moduleName = t.stringLiteral(moduleName);
  20689. if (canHoist) {
  20690. (0, _babelHelperHoistVariables2.default)(path, function (id) {
  20691. return variableIds.push(id);
  20692. });
  20693. }
  20694. if (variableIds.length) {
  20695. beforeBody.unshift(t.variableDeclaration("var", variableIds.map(function (id) {
  20696. return t.variableDeclarator(id);
  20697. })));
  20698. }
  20699. path.traverse(reassignmentVisitor, {
  20700. exports: exportNames,
  20701. buildCall: buildExportCall,
  20702. scope: path.scope
  20703. });
  20704. for (var _iterator6 = removedPaths, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, _getIterator3.default)(_iterator6);;) {
  20705. var _ref7;
  20706. if (_isArray6) {
  20707. if (_i6 >= _iterator6.length) break;
  20708. _ref7 = _iterator6[_i6++];
  20709. } else {
  20710. _i6 = _iterator6.next();
  20711. if (_i6.done) break;
  20712. _ref7 = _i6.value;
  20713. }
  20714. var _path3 = _ref7;
  20715. _path3.remove();
  20716. }
  20717. path.node.body = [buildTemplate({
  20718. SYSTEM_REGISTER: t.memberExpression(t.identifier(state.opts.systemGlobal || "System"), t.identifier("register")),
  20719. BEFORE_BODY: beforeBody,
  20720. MODULE_NAME: moduleName,
  20721. SETTERS: setters,
  20722. SOURCES: sources,
  20723. BODY: path.node.body,
  20724. EXPORT_IDENTIFIER: exportIdent,
  20725. CONTEXT_IDENTIFIER: contextIdent
  20726. })];
  20727. }
  20728. }
  20729. }
  20730. };
  20731. };
  20732. var _babelHelperHoistVariables = __webpack_require__(190);
  20733. var _babelHelperHoistVariables2 = _interopRequireDefault(_babelHelperHoistVariables);
  20734. var _babelTemplate = __webpack_require__(4);
  20735. var _babelTemplate2 = _interopRequireDefault(_babelTemplate);
  20736. function _interopRequireDefault(obj) {
  20737. return obj && obj.__esModule ? obj : { default: obj };
  20738. }
  20739. var buildTemplate = (0, _babelTemplate2.default)("\n SYSTEM_REGISTER(MODULE_NAME, [SOURCES], function (EXPORT_IDENTIFIER, CONTEXT_IDENTIFIER) {\n \"use strict\";\n BEFORE_BODY;\n return {\n setters: [SETTERS],\n execute: function () {\n BODY;\n }\n };\n });\n");
  20740. var buildExportAll = (0, _babelTemplate2.default)("\n for (var KEY in TARGET) {\n if (KEY !== \"default\" && KEY !== \"__esModule\") EXPORT_OBJ[KEY] = TARGET[KEY];\n }\n");
  20741. var TYPE_IMPORT = "Import";
  20742. module.exports = exports["default"];
  20743. /***/ }),
  20744. /* 209 */
  20745. /***/ (function(module, exports, __webpack_require__) {
  20746. "use strict";
  20747. exports.__esModule = true;
  20748. exports.default = function (_ref) {
  20749. var t = _ref.types;
  20750. function isValidDefine(path) {
  20751. if (!path.isExpressionStatement()) return;
  20752. var expr = path.get("expression");
  20753. if (!expr.isCallExpression()) return false;
  20754. if (!expr.get("callee").isIdentifier({ name: "define" })) return false;
  20755. var args = expr.get("arguments");
  20756. if (args.length === 3 && !args.shift().isStringLiteral()) return false;
  20757. if (args.length !== 2) return false;
  20758. if (!args.shift().isArrayExpression()) return false;
  20759. if (!args.shift().isFunctionExpression()) return false;
  20760. return true;
  20761. }
  20762. return {
  20763. inherits: __webpack_require__(131),
  20764. visitor: {
  20765. Program: {
  20766. exit: function exit(path, state) {
  20767. var last = path.get("body").pop();
  20768. if (!isValidDefine(last)) return;
  20769. var call = last.node.expression;
  20770. var args = call.arguments;
  20771. var moduleName = args.length === 3 ? args.shift() : null;
  20772. var amdArgs = call.arguments[0];
  20773. var func = call.arguments[1];
  20774. var browserGlobals = state.opts.globals || {};
  20775. var commonArgs = amdArgs.elements.map(function (arg) {
  20776. if (arg.value === "module" || arg.value === "exports") {
  20777. return t.identifier(arg.value);
  20778. } else {
  20779. return t.callExpression(t.identifier("require"), [arg]);
  20780. }
  20781. });
  20782. var browserArgs = amdArgs.elements.map(function (arg) {
  20783. if (arg.value === "module") {
  20784. return t.identifier("mod");
  20785. } else if (arg.value === "exports") {
  20786. return t.memberExpression(t.identifier("mod"), t.identifier("exports"));
  20787. } else {
  20788. var memberExpression = void 0;
  20789. if (state.opts.exactGlobals) {
  20790. var globalRef = browserGlobals[arg.value];
  20791. if (globalRef) {
  20792. memberExpression = globalRef.split(".").reduce(function (accum, curr) {
  20793. return t.memberExpression(accum, t.identifier(curr));
  20794. }, t.identifier("global"));
  20795. } else {
  20796. memberExpression = t.memberExpression(t.identifier("global"), t.identifier(t.toIdentifier(arg.value)));
  20797. }
  20798. } else {
  20799. var requireName = (0, _path.basename)(arg.value, (0, _path.extname)(arg.value));
  20800. var globalName = browserGlobals[requireName] || requireName;
  20801. memberExpression = t.memberExpression(t.identifier("global"), t.identifier(t.toIdentifier(globalName)));
  20802. }
  20803. return memberExpression;
  20804. }
  20805. });
  20806. var moduleNameOrBasename = moduleName ? moduleName.value : this.file.opts.basename;
  20807. var globalToAssign = t.memberExpression(t.identifier("global"), t.identifier(t.toIdentifier(moduleNameOrBasename)));
  20808. var prerequisiteAssignments = null;
  20809. if (state.opts.exactGlobals) {
  20810. var globalName = browserGlobals[moduleNameOrBasename];
  20811. if (globalName) {
  20812. prerequisiteAssignments = [];
  20813. var members = globalName.split(".");
  20814. globalToAssign = members.slice(1).reduce(function (accum, curr) {
  20815. prerequisiteAssignments.push(buildPrerequisiteAssignment({ GLOBAL_REFERENCE: accum }));
  20816. return t.memberExpression(accum, t.identifier(curr));
  20817. }, t.memberExpression(t.identifier("global"), t.identifier(members[0])));
  20818. }
  20819. }
  20820. var globalExport = buildGlobalExport({
  20821. BROWSER_ARGUMENTS: browserArgs,
  20822. PREREQUISITE_ASSIGNMENTS: prerequisiteAssignments,
  20823. GLOBAL_TO_ASSIGN: globalToAssign
  20824. });
  20825. last.replaceWith(buildWrapper({
  20826. MODULE_NAME: moduleName,
  20827. AMD_ARGUMENTS: amdArgs,
  20828. COMMON_ARGUMENTS: commonArgs,
  20829. GLOBAL_EXPORT: globalExport,
  20830. FUNC: func
  20831. }));
  20832. }
  20833. }
  20834. }
  20835. };
  20836. };
  20837. var _path = __webpack_require__(19);
  20838. var _babelTemplate = __webpack_require__(4);
  20839. var _babelTemplate2 = _interopRequireDefault(_babelTemplate);
  20840. function _interopRequireDefault(obj) {
  20841. return obj && obj.__esModule ? obj : { default: obj };
  20842. }
  20843. var buildPrerequisiteAssignment = (0, _babelTemplate2.default)("\n GLOBAL_REFERENCE = GLOBAL_REFERENCE || {}\n");
  20844. var buildGlobalExport = (0, _babelTemplate2.default)("\n var mod = { exports: {} };\n factory(BROWSER_ARGUMENTS);\n PREREQUISITE_ASSIGNMENTS\n GLOBAL_TO_ASSIGN = mod.exports;\n");
  20845. var buildWrapper = (0, _babelTemplate2.default)("\n (function (global, factory) {\n if (typeof define === \"function\" && define.amd) {\n define(MODULE_NAME, AMD_ARGUMENTS, factory);\n } else if (typeof exports !== \"undefined\") {\n factory(COMMON_ARGUMENTS);\n } else {\n GLOBAL_EXPORT\n }\n })(this, FUNC);\n");
  20846. module.exports = exports["default"];
  20847. /***/ }),
  20848. /* 210 */
  20849. /***/ (function(module, exports, __webpack_require__) {
  20850. "use strict";
  20851. exports.__esModule = true;
  20852. exports.default = function (_ref) {
  20853. var t = _ref.types;
  20854. function build(node, nodes, scope) {
  20855. var first = node.specifiers[0];
  20856. if (!t.isExportNamespaceSpecifier(first) && !t.isExportDefaultSpecifier(first)) return;
  20857. var specifier = node.specifiers.shift();
  20858. var uid = scope.generateUidIdentifier(specifier.exported.name);
  20859. var newSpecifier = void 0;
  20860. if (t.isExportNamespaceSpecifier(specifier)) {
  20861. newSpecifier = t.importNamespaceSpecifier(uid);
  20862. } else {
  20863. newSpecifier = t.importDefaultSpecifier(uid);
  20864. }
  20865. nodes.push(t.importDeclaration([newSpecifier], node.source));
  20866. nodes.push(t.exportNamedDeclaration(null, [t.exportSpecifier(uid, specifier.exported)]));
  20867. build(node, nodes, scope);
  20868. }
  20869. return {
  20870. inherits: __webpack_require__(200),
  20871. visitor: {
  20872. ExportNamedDeclaration: function ExportNamedDeclaration(path) {
  20873. var node = path.node,
  20874. scope = path.scope;
  20875. var nodes = [];
  20876. build(node, nodes, scope);
  20877. if (!nodes.length) return;
  20878. if (node.specifiers.length >= 1) {
  20879. nodes.push(node);
  20880. }
  20881. path.replaceWithMultiple(nodes);
  20882. }
  20883. }
  20884. };
  20885. };
  20886. module.exports = exports["default"];
  20887. /***/ }),
  20888. /* 211 */
  20889. /***/ (function(module, exports, __webpack_require__) {
  20890. "use strict";
  20891. exports.__esModule = true;
  20892. var _getIterator2 = __webpack_require__(2);
  20893. var _getIterator3 = _interopRequireDefault(_getIterator2);
  20894. exports.default = function (_ref) {
  20895. var t = _ref.types;
  20896. var FLOW_DIRECTIVE = "@flow";
  20897. return {
  20898. inherits: __webpack_require__(126),
  20899. visitor: {
  20900. Program: function Program(path, _ref2) {
  20901. var comments = _ref2.file.ast.comments;
  20902. for (var _iterator = comments, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
  20903. var _ref3;
  20904. if (_isArray) {
  20905. if (_i >= _iterator.length) break;
  20906. _ref3 = _iterator[_i++];
  20907. } else {
  20908. _i = _iterator.next();
  20909. if (_i.done) break;
  20910. _ref3 = _i.value;
  20911. }
  20912. var comment = _ref3;
  20913. if (comment.value.indexOf(FLOW_DIRECTIVE) >= 0) {
  20914. comment.value = comment.value.replace(FLOW_DIRECTIVE, "");
  20915. if (!comment.value.replace(/\*/g, "").trim()) comment.ignore = true;
  20916. }
  20917. }
  20918. },
  20919. Flow: function Flow(path) {
  20920. path.remove();
  20921. },
  20922. ClassProperty: function ClassProperty(path) {
  20923. path.node.variance = null;
  20924. path.node.typeAnnotation = null;
  20925. if (!path.node.value) path.remove();
  20926. },
  20927. Class: function Class(path) {
  20928. path.node.implements = null;
  20929. path.get("body.body").forEach(function (child) {
  20930. if (child.isClassProperty()) {
  20931. child.node.typeAnnotation = null;
  20932. if (!child.node.value) child.remove();
  20933. }
  20934. });
  20935. },
  20936. AssignmentPattern: function AssignmentPattern(_ref4) {
  20937. var node = _ref4.node;
  20938. node.left.optional = false;
  20939. },
  20940. Function: function Function(_ref5) {
  20941. var node = _ref5.node;
  20942. for (var i = 0; i < node.params.length; i++) {
  20943. var param = node.params[i];
  20944. param.optional = false;
  20945. }
  20946. },
  20947. TypeCastExpression: function TypeCastExpression(path) {
  20948. var node = path.node;
  20949. do {
  20950. node = node.expression;
  20951. } while (t.isTypeCastExpression(node));
  20952. path.replaceWith(node);
  20953. }
  20954. }
  20955. };
  20956. };
  20957. function _interopRequireDefault(obj) {
  20958. return obj && obj.__esModule ? obj : { default: obj };
  20959. }
  20960. module.exports = exports["default"];
  20961. /***/ }),
  20962. /* 212 */
  20963. /***/ (function(module, exports, __webpack_require__) {
  20964. "use strict";
  20965. exports.__esModule = true;
  20966. exports.default = function (_ref) {
  20967. var t = _ref.types;
  20968. function getTempId(scope) {
  20969. var id = scope.path.getData("functionBind");
  20970. if (id) return id;
  20971. id = scope.generateDeclaredUidIdentifier("context");
  20972. return scope.path.setData("functionBind", id);
  20973. }
  20974. function getStaticContext(bind, scope) {
  20975. var object = bind.object || bind.callee.object;
  20976. return scope.isStatic(object) && object;
  20977. }
  20978. function inferBindContext(bind, scope) {
  20979. var staticContext = getStaticContext(bind, scope);
  20980. if (staticContext) return staticContext;
  20981. var tempId = getTempId(scope);
  20982. if (bind.object) {
  20983. bind.callee = t.sequenceExpression([t.assignmentExpression("=", tempId, bind.object), bind.callee]);
  20984. } else {
  20985. bind.callee.object = t.assignmentExpression("=", tempId, bind.callee.object);
  20986. }
  20987. return tempId;
  20988. }
  20989. return {
  20990. inherits: __webpack_require__(201),
  20991. visitor: {
  20992. CallExpression: function CallExpression(_ref2) {
  20993. var node = _ref2.node,
  20994. scope = _ref2.scope;
  20995. var bind = node.callee;
  20996. if (!t.isBindExpression(bind)) return;
  20997. var context = inferBindContext(bind, scope);
  20998. node.callee = t.memberExpression(bind.callee, t.identifier("call"));
  20999. node.arguments.unshift(context);
  21000. },
  21001. BindExpression: function BindExpression(path) {
  21002. var node = path.node,
  21003. scope = path.scope;
  21004. var context = inferBindContext(node, scope);
  21005. path.replaceWith(t.callExpression(t.memberExpression(node.callee, t.identifier("bind")), [context]));
  21006. }
  21007. }
  21008. };
  21009. };
  21010. module.exports = exports["default"];
  21011. /***/ }),
  21012. /* 213 */
  21013. /***/ (function(module, exports, __webpack_require__) {
  21014. "use strict";
  21015. exports.__esModule = true;
  21016. var _getIterator2 = __webpack_require__(2);
  21017. var _getIterator3 = _interopRequireDefault(_getIterator2);
  21018. exports.default = function (_ref) {
  21019. var t = _ref.types;
  21020. function hasRestProperty(path) {
  21021. var foundRestProperty = false;
  21022. path.traverse({
  21023. RestProperty: function RestProperty() {
  21024. foundRestProperty = true;
  21025. path.stop();
  21026. }
  21027. });
  21028. return foundRestProperty;
  21029. }
  21030. function hasSpread(node) {
  21031. for (var _iterator = node.properties, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
  21032. var _ref2;
  21033. if (_isArray) {
  21034. if (_i >= _iterator.length) break;
  21035. _ref2 = _iterator[_i++];
  21036. } else {
  21037. _i = _iterator.next();
  21038. if (_i.done) break;
  21039. _ref2 = _i.value;
  21040. }
  21041. var prop = _ref2;
  21042. if (t.isSpreadProperty(prop)) {
  21043. return true;
  21044. }
  21045. }
  21046. return false;
  21047. }
  21048. function createObjectSpread(file, props, objRef) {
  21049. var restProperty = props.pop();
  21050. var keys = [];
  21051. for (var _iterator2 = props, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) {
  21052. var _ref3;
  21053. if (_isArray2) {
  21054. if (_i2 >= _iterator2.length) break;
  21055. _ref3 = _iterator2[_i2++];
  21056. } else {
  21057. _i2 = _iterator2.next();
  21058. if (_i2.done) break;
  21059. _ref3 = _i2.value;
  21060. }
  21061. var prop = _ref3;
  21062. var key = prop.key;
  21063. if (t.isIdentifier(key) && !prop.computed) {
  21064. key = t.stringLiteral(prop.key.name);
  21065. }
  21066. keys.push(key);
  21067. }
  21068. return [restProperty.argument, t.callExpression(file.addHelper("objectWithoutProperties"), [objRef, t.arrayExpression(keys)])];
  21069. }
  21070. function replaceRestProperty(parentPath, paramPath, i, numParams) {
  21071. if (paramPath.isAssignmentPattern()) {
  21072. replaceRestProperty(parentPath, paramPath.get("left"), i, numParams);
  21073. return;
  21074. }
  21075. if (paramPath.isObjectPattern() && hasRestProperty(paramPath)) {
  21076. var uid = parentPath.scope.generateUidIdentifier("ref");
  21077. var declar = t.variableDeclaration("let", [t.variableDeclarator(paramPath.node, uid)]);
  21078. declar._blockHoist = i ? numParams - i : 1;
  21079. parentPath.ensureBlock();
  21080. parentPath.get("body").unshiftContainer("body", declar);
  21081. paramPath.replaceWith(uid);
  21082. }
  21083. }
  21084. return {
  21085. inherits: __webpack_require__(202),
  21086. visitor: {
  21087. Function: function Function(path) {
  21088. var params = path.get("params");
  21089. for (var i = 0; i < params.length; i++) {
  21090. replaceRestProperty(params[i].parentPath, params[i], i, params.length);
  21091. }
  21092. },
  21093. VariableDeclarator: function VariableDeclarator(path, file) {
  21094. if (!path.get("id").isObjectPattern()) {
  21095. return;
  21096. }
  21097. var insertionPath = path;
  21098. path.get("id").traverse({
  21099. RestProperty: function RestProperty(path) {
  21100. if (this.originalPath.node.id.properties.length > 1 && !t.isIdentifier(this.originalPath.node.init)) {
  21101. var initRef = path.scope.generateUidIdentifierBasedOnNode(this.originalPath.node.init, "ref");
  21102. this.originalPath.insertBefore(t.variableDeclarator(initRef, this.originalPath.node.init));
  21103. this.originalPath.replaceWith(t.variableDeclarator(this.originalPath.node.id, initRef));
  21104. return;
  21105. }
  21106. var ref = this.originalPath.node.init;
  21107. var refPropertyPath = [];
  21108. path.findParent(function (path) {
  21109. if (path.isObjectProperty()) {
  21110. refPropertyPath.unshift(path.node.key.name);
  21111. } else if (path.isVariableDeclarator()) {
  21112. return true;
  21113. }
  21114. });
  21115. if (refPropertyPath.length) {
  21116. refPropertyPath.forEach(function (prop) {
  21117. ref = t.memberExpression(ref, t.identifier(prop));
  21118. });
  21119. }
  21120. var _createObjectSpread = createObjectSpread(file, path.parentPath.node.properties, ref),
  21121. argument = _createObjectSpread[0],
  21122. callExpression = _createObjectSpread[1];
  21123. insertionPath.insertAfter(t.variableDeclarator(argument, callExpression));
  21124. insertionPath = insertionPath.getSibling(insertionPath.key + 1);
  21125. if (path.parentPath.node.properties.length === 0) {
  21126. path.findParent(function (path) {
  21127. return path.isObjectProperty() || path.isVariableDeclarator();
  21128. }).remove();
  21129. }
  21130. }
  21131. }, {
  21132. originalPath: path
  21133. });
  21134. },
  21135. ExportNamedDeclaration: function ExportNamedDeclaration(path) {
  21136. var declaration = path.get("declaration");
  21137. if (!declaration.isVariableDeclaration()) return;
  21138. if (!hasRestProperty(declaration)) return;
  21139. var specifiers = [];
  21140. for (var name in path.getOuterBindingIdentifiers(path)) {
  21141. var id = t.identifier(name);
  21142. specifiers.push(t.exportSpecifier(id, id));
  21143. }
  21144. path.replaceWith(declaration.node);
  21145. path.insertAfter(t.exportNamedDeclaration(null, specifiers));
  21146. },
  21147. CatchClause: function CatchClause(path) {
  21148. var paramPath = path.get("param");
  21149. replaceRestProperty(paramPath.parentPath, paramPath);
  21150. },
  21151. AssignmentExpression: function AssignmentExpression(path, file) {
  21152. var leftPath = path.get("left");
  21153. if (leftPath.isObjectPattern() && hasRestProperty(leftPath)) {
  21154. var nodes = [];
  21155. var ref = void 0;
  21156. if (path.isCompletionRecord() || path.parentPath.isExpressionStatement()) {
  21157. ref = path.scope.generateUidIdentifierBasedOnNode(path.node.right, "ref");
  21158. nodes.push(t.variableDeclaration("var", [t.variableDeclarator(ref, path.node.right)]));
  21159. }
  21160. var _createObjectSpread2 = createObjectSpread(file, path.node.left.properties, ref),
  21161. argument = _createObjectSpread2[0],
  21162. callExpression = _createObjectSpread2[1];
  21163. var nodeWithoutSpread = t.clone(path.node);
  21164. nodeWithoutSpread.right = ref;
  21165. nodes.push(t.expressionStatement(nodeWithoutSpread));
  21166. nodes.push(t.toStatement(t.assignmentExpression("=", argument, callExpression)));
  21167. if (ref) {
  21168. nodes.push(t.expressionStatement(ref));
  21169. }
  21170. path.replaceWithMultiple(nodes);
  21171. }
  21172. },
  21173. ForXStatement: function ForXStatement(path) {
  21174. var node = path.node,
  21175. scope = path.scope;
  21176. var leftPath = path.get("left");
  21177. var left = node.left;
  21178. if (t.isObjectPattern(left) && hasRestProperty(leftPath)) {
  21179. var temp = scope.generateUidIdentifier("ref");
  21180. node.left = t.variableDeclaration("var", [t.variableDeclarator(temp)]);
  21181. path.ensureBlock();
  21182. node.body.body.unshift(t.variableDeclaration("var", [t.variableDeclarator(left, temp)]));
  21183. return;
  21184. }
  21185. if (!t.isVariableDeclaration(left)) return;
  21186. var pattern = left.declarations[0].id;
  21187. if (!t.isObjectPattern(pattern)) return;
  21188. var key = scope.generateUidIdentifier("ref");
  21189. node.left = t.variableDeclaration(left.kind, [t.variableDeclarator(key, null)]);
  21190. path.ensureBlock();
  21191. node.body.body.unshift(t.variableDeclaration(node.left.kind, [t.variableDeclarator(pattern, key)]));
  21192. },
  21193. ObjectExpression: function ObjectExpression(path, file) {
  21194. if (!hasSpread(path.node)) return;
  21195. var useBuiltIns = file.opts.useBuiltIns || false;
  21196. if (typeof useBuiltIns !== "boolean") {
  21197. throw new Error("transform-object-rest-spread currently only accepts a boolean " + "option for useBuiltIns (defaults to false)");
  21198. }
  21199. var args = [];
  21200. var props = [];
  21201. function push() {
  21202. if (!props.length) return;
  21203. args.push(t.objectExpression(props));
  21204. props = [];
  21205. }
  21206. for (var _iterator3 = path.node.properties, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) {
  21207. var _ref4;
  21208. if (_isArray3) {
  21209. if (_i3 >= _iterator3.length) break;
  21210. _ref4 = _iterator3[_i3++];
  21211. } else {
  21212. _i3 = _iterator3.next();
  21213. if (_i3.done) break;
  21214. _ref4 = _i3.value;
  21215. }
  21216. var prop = _ref4;
  21217. if (t.isSpreadProperty(prop)) {
  21218. push();
  21219. args.push(prop.argument);
  21220. } else {
  21221. props.push(prop);
  21222. }
  21223. }
  21224. push();
  21225. if (!t.isObjectExpression(args[0])) {
  21226. args.unshift(t.objectExpression([]));
  21227. }
  21228. var helper = useBuiltIns ? t.memberExpression(t.identifier("Object"), t.identifier("assign")) : file.addHelper("extends");
  21229. path.replaceWith(t.callExpression(helper, args));
  21230. }
  21231. }
  21232. };
  21233. };
  21234. function _interopRequireDefault(obj) {
  21235. return obj && obj.__esModule ? obj : { default: obj };
  21236. }
  21237. module.exports = exports["default"];
  21238. /***/ }),
  21239. /* 214 */
  21240. /***/ (function(module, exports, __webpack_require__) {
  21241. "use strict";
  21242. exports.__esModule = true;
  21243. exports.default = function (_ref) {
  21244. var t = _ref.types;
  21245. function addDisplayName(id, call) {
  21246. var props = call.arguments[0].properties;
  21247. var safe = true;
  21248. for (var i = 0; i < props.length; i++) {
  21249. var prop = props[i];
  21250. var key = t.toComputedKey(prop);
  21251. if (t.isLiteral(key, { value: "displayName" })) {
  21252. safe = false;
  21253. break;
  21254. }
  21255. }
  21256. if (safe) {
  21257. props.unshift(t.objectProperty(t.identifier("displayName"), t.stringLiteral(id)));
  21258. }
  21259. }
  21260. var isCreateClassCallExpression = t.buildMatchMemberExpression("React.createClass");
  21261. var isCreateClassAddon = function isCreateClassAddon(callee) {
  21262. return callee.name === "createReactClass";
  21263. };
  21264. function isCreateClass(node) {
  21265. if (!node || !t.isCallExpression(node)) return false;
  21266. if (!isCreateClassCallExpression(node.callee) && !isCreateClassAddon(node.callee)) return false;
  21267. var args = node.arguments;
  21268. if (args.length !== 1) return false;
  21269. var first = args[0];
  21270. if (!t.isObjectExpression(first)) return false;
  21271. return true;
  21272. }
  21273. return {
  21274. visitor: {
  21275. ExportDefaultDeclaration: function ExportDefaultDeclaration(_ref2, state) {
  21276. var node = _ref2.node;
  21277. if (isCreateClass(node.declaration)) {
  21278. var displayName = state.file.opts.basename;
  21279. if (displayName === "index") {
  21280. displayName = _path2.default.basename(_path2.default.dirname(state.file.opts.filename));
  21281. }
  21282. addDisplayName(displayName, node.declaration);
  21283. }
  21284. },
  21285. CallExpression: function CallExpression(path) {
  21286. var node = path.node;
  21287. if (!isCreateClass(node)) return;
  21288. var id = void 0;
  21289. path.find(function (path) {
  21290. if (path.isAssignmentExpression()) {
  21291. id = path.node.left;
  21292. } else if (path.isObjectProperty()) {
  21293. id = path.node.key;
  21294. } else if (path.isVariableDeclarator()) {
  21295. id = path.node.id;
  21296. } else if (path.isStatement()) {
  21297. return true;
  21298. }
  21299. if (id) return true;
  21300. });
  21301. if (!id) return;
  21302. if (t.isMemberExpression(id)) {
  21303. id = id.property;
  21304. }
  21305. if (t.isIdentifier(id)) {
  21306. addDisplayName(id.name, node);
  21307. }
  21308. }
  21309. }
  21310. };
  21311. };
  21312. var _path = __webpack_require__(19);
  21313. var _path2 = _interopRequireDefault(_path);
  21314. function _interopRequireDefault(obj) {
  21315. return obj && obj.__esModule ? obj : { default: obj };
  21316. }
  21317. module.exports = exports["default"];
  21318. /***/ }),
  21319. /* 215 */
  21320. /***/ (function(module, exports, __webpack_require__) {
  21321. "use strict";
  21322. exports.__esModule = true;
  21323. var _getIterator2 = __webpack_require__(2);
  21324. var _getIterator3 = _interopRequireDefault(_getIterator2);
  21325. exports.default = function (_ref) {
  21326. var t = _ref.types;
  21327. var JSX_ANNOTATION_REGEX = /\*?\s*@jsx\s+([^\s]+)/;
  21328. var visitor = (0, _babelHelperBuilderReactJsx2.default)({
  21329. pre: function pre(state) {
  21330. var tagName = state.tagName;
  21331. var args = state.args;
  21332. if (t.react.isCompatTag(tagName)) {
  21333. args.push(t.stringLiteral(tagName));
  21334. } else {
  21335. args.push(state.tagExpr);
  21336. }
  21337. },
  21338. post: function post(state, pass) {
  21339. state.callee = pass.get("jsxIdentifier")();
  21340. }
  21341. });
  21342. visitor.Program = function (path, state) {
  21343. var file = state.file;
  21344. var id = state.opts.pragma || "React.createElement";
  21345. for (var _iterator = file.ast.comments, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
  21346. var _ref2;
  21347. if (_isArray) {
  21348. if (_i >= _iterator.length) break;
  21349. _ref2 = _iterator[_i++];
  21350. } else {
  21351. _i = _iterator.next();
  21352. if (_i.done) break;
  21353. _ref2 = _i.value;
  21354. }
  21355. var comment = _ref2;
  21356. var matches = JSX_ANNOTATION_REGEX.exec(comment.value);
  21357. if (matches) {
  21358. id = matches[1];
  21359. if (id === "React.DOM") {
  21360. throw file.buildCodeFrameError(comment, "The @jsx React.DOM pragma has been deprecated as of React 0.12");
  21361. } else {
  21362. break;
  21363. }
  21364. }
  21365. }
  21366. state.set("jsxIdentifier", function () {
  21367. return id.split(".").map(function (name) {
  21368. return t.identifier(name);
  21369. }).reduce(function (object, property) {
  21370. return t.memberExpression(object, property);
  21371. });
  21372. });
  21373. };
  21374. return {
  21375. inherits: _babelPluginSyntaxJsx2.default,
  21376. visitor: visitor
  21377. };
  21378. };
  21379. var _babelPluginSyntaxJsx = __webpack_require__(127);
  21380. var _babelPluginSyntaxJsx2 = _interopRequireDefault(_babelPluginSyntaxJsx);
  21381. var _babelHelperBuilderReactJsx = __webpack_require__(351);
  21382. var _babelHelperBuilderReactJsx2 = _interopRequireDefault(_babelHelperBuilderReactJsx);
  21383. function _interopRequireDefault(obj) {
  21384. return obj && obj.__esModule ? obj : { default: obj };
  21385. }
  21386. module.exports = exports["default"];
  21387. /***/ }),
  21388. /* 216 */
  21389. /***/ (function(module, exports, __webpack_require__) {
  21390. "use strict";
  21391. exports.__esModule = true;
  21392. var _getIterator2 = __webpack_require__(2);
  21393. var _getIterator3 = _interopRequireDefault(_getIterator2);
  21394. exports.default = function () {
  21395. return {
  21396. visitor: {
  21397. Program: function Program(path, state) {
  21398. if (state.opts.strict === false || state.opts.strictMode === false) return;
  21399. var node = path.node;
  21400. for (var _iterator = node.directives, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
  21401. var _ref;
  21402. if (_isArray) {
  21403. if (_i >= _iterator.length) break;
  21404. _ref = _iterator[_i++];
  21405. } else {
  21406. _i = _iterator.next();
  21407. if (_i.done) break;
  21408. _ref = _i.value;
  21409. }
  21410. var directive = _ref;
  21411. if (directive.value.value === "use strict") return;
  21412. }
  21413. path.unshiftContainer("directives", t.directive(t.directiveLiteral("use strict")));
  21414. }
  21415. }
  21416. };
  21417. };
  21418. var _babelTypes = __webpack_require__(1);
  21419. var t = _interopRequireWildcard(_babelTypes);
  21420. function _interopRequireWildcard(obj) {
  21421. if (obj && obj.__esModule) {
  21422. return obj;
  21423. } else {
  21424. var newObj = {};if (obj != null) {
  21425. for (var key in obj) {
  21426. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  21427. }
  21428. }newObj.default = obj;return newObj;
  21429. }
  21430. }
  21431. function _interopRequireDefault(obj) {
  21432. return obj && obj.__esModule ? obj : { default: obj };
  21433. }
  21434. module.exports = exports["default"];
  21435. /***/ }),
  21436. /* 217 */
  21437. /***/ (function(module, exports, __webpack_require__) {
  21438. "use strict";
  21439. exports.__esModule = true;
  21440. var _babelPluginTransformEs2015TemplateLiterals = __webpack_require__(83);
  21441. var _babelPluginTransformEs2015TemplateLiterals2 = _interopRequireDefault(_babelPluginTransformEs2015TemplateLiterals);
  21442. var _babelPluginTransformEs2015Literals = __webpack_require__(76);
  21443. var _babelPluginTransformEs2015Literals2 = _interopRequireDefault(_babelPluginTransformEs2015Literals);
  21444. var _babelPluginTransformEs2015FunctionName = __webpack_require__(75);
  21445. var _babelPluginTransformEs2015FunctionName2 = _interopRequireDefault(_babelPluginTransformEs2015FunctionName);
  21446. var _babelPluginTransformEs2015ArrowFunctions = __webpack_require__(68);
  21447. var _babelPluginTransformEs2015ArrowFunctions2 = _interopRequireDefault(_babelPluginTransformEs2015ArrowFunctions);
  21448. var _babelPluginTransformEs2015BlockScopedFunctions = __webpack_require__(69);
  21449. var _babelPluginTransformEs2015BlockScopedFunctions2 = _interopRequireDefault(_babelPluginTransformEs2015BlockScopedFunctions);
  21450. var _babelPluginTransformEs2015Classes = __webpack_require__(71);
  21451. var _babelPluginTransformEs2015Classes2 = _interopRequireDefault(_babelPluginTransformEs2015Classes);
  21452. var _babelPluginTransformEs2015ObjectSuper = __webpack_require__(78);
  21453. var _babelPluginTransformEs2015ObjectSuper2 = _interopRequireDefault(_babelPluginTransformEs2015ObjectSuper);
  21454. var _babelPluginTransformEs2015ShorthandProperties = __webpack_require__(80);
  21455. var _babelPluginTransformEs2015ShorthandProperties2 = _interopRequireDefault(_babelPluginTransformEs2015ShorthandProperties);
  21456. var _babelPluginTransformEs2015DuplicateKeys = __webpack_require__(130);
  21457. var _babelPluginTransformEs2015DuplicateKeys2 = _interopRequireDefault(_babelPluginTransformEs2015DuplicateKeys);
  21458. var _babelPluginTransformEs2015ComputedProperties = __webpack_require__(72);
  21459. var _babelPluginTransformEs2015ComputedProperties2 = _interopRequireDefault(_babelPluginTransformEs2015ComputedProperties);
  21460. var _babelPluginTransformEs2015ForOf = __webpack_require__(74);
  21461. var _babelPluginTransformEs2015ForOf2 = _interopRequireDefault(_babelPluginTransformEs2015ForOf);
  21462. var _babelPluginTransformEs2015StickyRegex = __webpack_require__(82);
  21463. var _babelPluginTransformEs2015StickyRegex2 = _interopRequireDefault(_babelPluginTransformEs2015StickyRegex);
  21464. var _babelPluginTransformEs2015UnicodeRegex = __webpack_require__(85);
  21465. var _babelPluginTransformEs2015UnicodeRegex2 = _interopRequireDefault(_babelPluginTransformEs2015UnicodeRegex);
  21466. var _babelPluginCheckEs2015Constants = __webpack_require__(66);
  21467. var _babelPluginCheckEs2015Constants2 = _interopRequireDefault(_babelPluginCheckEs2015Constants);
  21468. var _babelPluginTransformEs2015Spread = __webpack_require__(81);
  21469. var _babelPluginTransformEs2015Spread2 = _interopRequireDefault(_babelPluginTransformEs2015Spread);
  21470. var _babelPluginTransformEs2015Parameters = __webpack_require__(79);
  21471. var _babelPluginTransformEs2015Parameters2 = _interopRequireDefault(_babelPluginTransformEs2015Parameters);
  21472. var _babelPluginTransformEs2015Destructuring = __webpack_require__(73);
  21473. var _babelPluginTransformEs2015Destructuring2 = _interopRequireDefault(_babelPluginTransformEs2015Destructuring);
  21474. var _babelPluginTransformEs2015BlockScoping = __webpack_require__(70);
  21475. var _babelPluginTransformEs2015BlockScoping2 = _interopRequireDefault(_babelPluginTransformEs2015BlockScoping);
  21476. var _babelPluginTransformEs2015TypeofSymbol = __webpack_require__(84);
  21477. var _babelPluginTransformEs2015TypeofSymbol2 = _interopRequireDefault(_babelPluginTransformEs2015TypeofSymbol);
  21478. var _babelPluginTransformEs2015ModulesCommonjs = __webpack_require__(77);
  21479. var _babelPluginTransformEs2015ModulesCommonjs2 = _interopRequireDefault(_babelPluginTransformEs2015ModulesCommonjs);
  21480. var _babelPluginTransformEs2015ModulesSystemjs = __webpack_require__(208);
  21481. var _babelPluginTransformEs2015ModulesSystemjs2 = _interopRequireDefault(_babelPluginTransformEs2015ModulesSystemjs);
  21482. var _babelPluginTransformEs2015ModulesAmd = __webpack_require__(131);
  21483. var _babelPluginTransformEs2015ModulesAmd2 = _interopRequireDefault(_babelPluginTransformEs2015ModulesAmd);
  21484. var _babelPluginTransformEs2015ModulesUmd = __webpack_require__(209);
  21485. var _babelPluginTransformEs2015ModulesUmd2 = _interopRequireDefault(_babelPluginTransformEs2015ModulesUmd);
  21486. var _babelPluginTransformRegenerator = __webpack_require__(86);
  21487. var _babelPluginTransformRegenerator2 = _interopRequireDefault(_babelPluginTransformRegenerator);
  21488. function _interopRequireDefault(obj) {
  21489. return obj && obj.__esModule ? obj : { default: obj };
  21490. }
  21491. function preset(context) {
  21492. var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  21493. var moduleTypes = ["commonjs", "amd", "umd", "systemjs"];
  21494. var loose = false;
  21495. var modules = "commonjs";
  21496. var spec = false;
  21497. if (opts !== undefined) {
  21498. if (opts.loose !== undefined) loose = opts.loose;
  21499. if (opts.modules !== undefined) modules = opts.modules;
  21500. if (opts.spec !== undefined) spec = opts.spec;
  21501. }
  21502. if (typeof loose !== "boolean") throw new Error("Preset es2015 'loose' option must be a boolean.");
  21503. if (typeof spec !== "boolean") throw new Error("Preset es2015 'spec' option must be a boolean.");
  21504. if (modules !== false && moduleTypes.indexOf(modules) === -1) {
  21505. throw new Error("Preset es2015 'modules' option must be 'false' to indicate no modules\n" + "or a module type which be be one of: 'commonjs' (default), 'amd', 'umd', 'systemjs'");
  21506. }
  21507. var optsLoose = { loose: loose };
  21508. return {
  21509. plugins: [[_babelPluginTransformEs2015TemplateLiterals2.default, { loose: loose, spec: spec }], _babelPluginTransformEs2015Literals2.default, _babelPluginTransformEs2015FunctionName2.default, [_babelPluginTransformEs2015ArrowFunctions2.default, { spec: spec }], _babelPluginTransformEs2015BlockScopedFunctions2.default, [_babelPluginTransformEs2015Classes2.default, optsLoose], _babelPluginTransformEs2015ObjectSuper2.default, _babelPluginTransformEs2015ShorthandProperties2.default, _babelPluginTransformEs2015DuplicateKeys2.default, [_babelPluginTransformEs2015ComputedProperties2.default, optsLoose], [_babelPluginTransformEs2015ForOf2.default, optsLoose], _babelPluginTransformEs2015StickyRegex2.default, _babelPluginTransformEs2015UnicodeRegex2.default, _babelPluginCheckEs2015Constants2.default, [_babelPluginTransformEs2015Spread2.default, optsLoose], _babelPluginTransformEs2015Parameters2.default, [_babelPluginTransformEs2015Destructuring2.default, optsLoose], _babelPluginTransformEs2015BlockScoping2.default, _babelPluginTransformEs2015TypeofSymbol2.default, modules === "commonjs" && [_babelPluginTransformEs2015ModulesCommonjs2.default, optsLoose], modules === "systemjs" && [_babelPluginTransformEs2015ModulesSystemjs2.default, optsLoose], modules === "amd" && [_babelPluginTransformEs2015ModulesAmd2.default, optsLoose], modules === "umd" && [_babelPluginTransformEs2015ModulesUmd2.default, optsLoose], [_babelPluginTransformRegenerator2.default, { async: false, asyncGenerators: false }]].filter(Boolean) };
  21510. }
  21511. var oldConfig = preset({});
  21512. exports.default = oldConfig;
  21513. Object.defineProperty(oldConfig, "buildPreset", {
  21514. configurable: true,
  21515. writable: true,
  21516. enumerable: false,
  21517. value: preset
  21518. });
  21519. module.exports = exports["default"];
  21520. /***/ }),
  21521. /* 218 */
  21522. /***/ (function(module, exports, __webpack_require__) {
  21523. "use strict";
  21524. exports.__esModule = true;
  21525. var _babelPluginTransformExponentiationOperator = __webpack_require__(132);
  21526. var _babelPluginTransformExponentiationOperator2 = _interopRequireDefault(_babelPluginTransformExponentiationOperator);
  21527. function _interopRequireDefault(obj) {
  21528. return obj && obj.__esModule ? obj : { default: obj };
  21529. }
  21530. exports.default = {
  21531. plugins: [_babelPluginTransformExponentiationOperator2.default]
  21532. };
  21533. module.exports = exports["default"];
  21534. /***/ }),
  21535. /* 219 */
  21536. /***/ (function(module, exports, __webpack_require__) {
  21537. "use strict";
  21538. exports.__esModule = true;
  21539. var _babelPluginSyntaxTrailingFunctionCommas = __webpack_require__(128);
  21540. var _babelPluginSyntaxTrailingFunctionCommas2 = _interopRequireDefault(_babelPluginSyntaxTrailingFunctionCommas);
  21541. var _babelPluginTransformAsyncToGenerator = __webpack_require__(129);
  21542. var _babelPluginTransformAsyncToGenerator2 = _interopRequireDefault(_babelPluginTransformAsyncToGenerator);
  21543. function _interopRequireDefault(obj) {
  21544. return obj && obj.__esModule ? obj : { default: obj };
  21545. }
  21546. exports.default = {
  21547. plugins: [_babelPluginSyntaxTrailingFunctionCommas2.default, _babelPluginTransformAsyncToGenerator2.default]
  21548. };
  21549. module.exports = exports["default"];
  21550. /***/ }),
  21551. /* 220 */
  21552. /***/ (function(module, exports, __webpack_require__) {
  21553. "use strict";
  21554. exports.__esModule = true;
  21555. var _babelPresetStage = __webpack_require__(221);
  21556. var _babelPresetStage2 = _interopRequireDefault(_babelPresetStage);
  21557. var _babelPluginTransformClassConstructorCall = __webpack_require__(203);
  21558. var _babelPluginTransformClassConstructorCall2 = _interopRequireDefault(_babelPluginTransformClassConstructorCall);
  21559. var _babelPluginTransformExportExtensions = __webpack_require__(210);
  21560. var _babelPluginTransformExportExtensions2 = _interopRequireDefault(_babelPluginTransformExportExtensions);
  21561. function _interopRequireDefault(obj) {
  21562. return obj && obj.__esModule ? obj : { default: obj };
  21563. }
  21564. exports.default = {
  21565. presets: [_babelPresetStage2.default],
  21566. plugins: [_babelPluginTransformClassConstructorCall2.default, _babelPluginTransformExportExtensions2.default]
  21567. };
  21568. module.exports = exports["default"];
  21569. /***/ }),
  21570. /* 221 */
  21571. /***/ (function(module, exports, __webpack_require__) {
  21572. "use strict";
  21573. exports.__esModule = true;
  21574. var _babelPresetStage = __webpack_require__(222);
  21575. var _babelPresetStage2 = _interopRequireDefault(_babelPresetStage);
  21576. var _babelPluginTransformClassProperties = __webpack_require__(204);
  21577. var _babelPluginTransformClassProperties2 = _interopRequireDefault(_babelPluginTransformClassProperties);
  21578. var _babelPluginTransformDecorators = __webpack_require__(205);
  21579. var _babelPluginTransformDecorators2 = _interopRequireDefault(_babelPluginTransformDecorators);
  21580. var _babelPluginSyntaxDynamicImport = __webpack_require__(324);
  21581. var _babelPluginSyntaxDynamicImport2 = _interopRequireDefault(_babelPluginSyntaxDynamicImport);
  21582. function _interopRequireDefault(obj) {
  21583. return obj && obj.__esModule ? obj : { default: obj };
  21584. }
  21585. exports.default = {
  21586. presets: [_babelPresetStage2.default],
  21587. plugins: [_babelPluginSyntaxDynamicImport2.default, _babelPluginTransformClassProperties2.default, _babelPluginTransformDecorators2.default]
  21588. };
  21589. module.exports = exports["default"];
  21590. /***/ }),
  21591. /* 222 */
  21592. /***/ (function(module, exports, __webpack_require__) {
  21593. "use strict";
  21594. exports.__esModule = true;
  21595. var _babelPluginSyntaxTrailingFunctionCommas = __webpack_require__(128);
  21596. var _babelPluginSyntaxTrailingFunctionCommas2 = _interopRequireDefault(_babelPluginSyntaxTrailingFunctionCommas);
  21597. var _babelPluginTransformAsyncToGenerator = __webpack_require__(129);
  21598. var _babelPluginTransformAsyncToGenerator2 = _interopRequireDefault(_babelPluginTransformAsyncToGenerator);
  21599. var _babelPluginTransformExponentiationOperator = __webpack_require__(132);
  21600. var _babelPluginTransformExponentiationOperator2 = _interopRequireDefault(_babelPluginTransformExponentiationOperator);
  21601. var _babelPluginTransformObjectRestSpread = __webpack_require__(213);
  21602. var _babelPluginTransformObjectRestSpread2 = _interopRequireDefault(_babelPluginTransformObjectRestSpread);
  21603. var _babelPluginTransformAsyncGeneratorFunctions = __webpack_require__(327);
  21604. var _babelPluginTransformAsyncGeneratorFunctions2 = _interopRequireDefault(_babelPluginTransformAsyncGeneratorFunctions);
  21605. function _interopRequireDefault(obj) {
  21606. return obj && obj.__esModule ? obj : { default: obj };
  21607. }
  21608. exports.default = {
  21609. plugins: [_babelPluginSyntaxTrailingFunctionCommas2.default, _babelPluginTransformAsyncToGenerator2.default, _babelPluginTransformExponentiationOperator2.default, _babelPluginTransformAsyncGeneratorFunctions2.default, _babelPluginTransformObjectRestSpread2.default]
  21610. };
  21611. module.exports = exports["default"];
  21612. /***/ }),
  21613. /* 223 */
  21614. /***/ (function(module, exports, __webpack_require__) {
  21615. "use strict";
  21616. exports.__esModule = true;
  21617. var _classCallCheck2 = __webpack_require__(3);
  21618. var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
  21619. function _interopRequireDefault(obj) {
  21620. return obj && obj.__esModule ? obj : { default: obj };
  21621. }
  21622. var Hub = function Hub(file, options) {
  21623. (0, _classCallCheck3.default)(this, Hub);
  21624. this.file = file;
  21625. this.options = options;
  21626. };
  21627. exports.default = Hub;
  21628. module.exports = exports["default"];
  21629. /***/ }),
  21630. /* 224 */
  21631. /***/ (function(module, exports, __webpack_require__) {
  21632. "use strict";
  21633. exports.__esModule = true;
  21634. exports.Flow = exports.Pure = exports.Generated = exports.User = exports.Var = exports.BlockScoped = exports.Referenced = exports.Scope = exports.Expression = exports.Statement = exports.BindingIdentifier = exports.ReferencedMemberExpression = exports.ReferencedIdentifier = undefined;
  21635. var _babelTypes = __webpack_require__(1);
  21636. var t = _interopRequireWildcard(_babelTypes);
  21637. function _interopRequireWildcard(obj) {
  21638. if (obj && obj.__esModule) {
  21639. return obj;
  21640. } else {
  21641. var newObj = {};if (obj != null) {
  21642. for (var key in obj) {
  21643. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  21644. }
  21645. }newObj.default = obj;return newObj;
  21646. }
  21647. }
  21648. var ReferencedIdentifier = exports.ReferencedIdentifier = {
  21649. types: ["Identifier", "JSXIdentifier"],
  21650. checkPath: function checkPath(_ref, opts) {
  21651. var node = _ref.node,
  21652. parent = _ref.parent;
  21653. if (!t.isIdentifier(node, opts) && !t.isJSXMemberExpression(parent, opts)) {
  21654. if (t.isJSXIdentifier(node, opts)) {
  21655. if (_babelTypes.react.isCompatTag(node.name)) return false;
  21656. } else {
  21657. return false;
  21658. }
  21659. }
  21660. return t.isReferenced(node, parent);
  21661. }
  21662. };
  21663. var ReferencedMemberExpression = exports.ReferencedMemberExpression = {
  21664. types: ["MemberExpression"],
  21665. checkPath: function checkPath(_ref2) {
  21666. var node = _ref2.node,
  21667. parent = _ref2.parent;
  21668. return t.isMemberExpression(node) && t.isReferenced(node, parent);
  21669. }
  21670. };
  21671. var BindingIdentifier = exports.BindingIdentifier = {
  21672. types: ["Identifier"],
  21673. checkPath: function checkPath(_ref3) {
  21674. var node = _ref3.node,
  21675. parent = _ref3.parent;
  21676. return t.isIdentifier(node) && t.isBinding(node, parent);
  21677. }
  21678. };
  21679. var Statement = exports.Statement = {
  21680. types: ["Statement"],
  21681. checkPath: function checkPath(_ref4) {
  21682. var node = _ref4.node,
  21683. parent = _ref4.parent;
  21684. if (t.isStatement(node)) {
  21685. if (t.isVariableDeclaration(node)) {
  21686. if (t.isForXStatement(parent, { left: node })) return false;
  21687. if (t.isForStatement(parent, { init: node })) return false;
  21688. }
  21689. return true;
  21690. } else {
  21691. return false;
  21692. }
  21693. }
  21694. };
  21695. var Expression = exports.Expression = {
  21696. types: ["Expression"],
  21697. checkPath: function checkPath(path) {
  21698. if (path.isIdentifier()) {
  21699. return path.isReferencedIdentifier();
  21700. } else {
  21701. return t.isExpression(path.node);
  21702. }
  21703. }
  21704. };
  21705. var Scope = exports.Scope = {
  21706. types: ["Scopable"],
  21707. checkPath: function checkPath(path) {
  21708. return t.isScope(path.node, path.parent);
  21709. }
  21710. };
  21711. var Referenced = exports.Referenced = {
  21712. checkPath: function checkPath(path) {
  21713. return t.isReferenced(path.node, path.parent);
  21714. }
  21715. };
  21716. var BlockScoped = exports.BlockScoped = {
  21717. checkPath: function checkPath(path) {
  21718. return t.isBlockScoped(path.node);
  21719. }
  21720. };
  21721. var Var = exports.Var = {
  21722. types: ["VariableDeclaration"],
  21723. checkPath: function checkPath(path) {
  21724. return t.isVar(path.node);
  21725. }
  21726. };
  21727. var User = exports.User = {
  21728. checkPath: function checkPath(path) {
  21729. return path.node && !!path.node.loc;
  21730. }
  21731. };
  21732. var Generated = exports.Generated = {
  21733. checkPath: function checkPath(path) {
  21734. return !path.isUser();
  21735. }
  21736. };
  21737. var Pure = exports.Pure = {
  21738. checkPath: function checkPath(path, opts) {
  21739. return path.scope.isPure(path.node, opts);
  21740. }
  21741. };
  21742. var Flow = exports.Flow = {
  21743. types: ["Flow", "ImportDeclaration", "ExportDeclaration", "ImportSpecifier"],
  21744. checkPath: function checkPath(_ref5) {
  21745. var node = _ref5.node;
  21746. if (t.isFlow(node)) {
  21747. return true;
  21748. } else if (t.isImportDeclaration(node)) {
  21749. return node.importKind === "type" || node.importKind === "typeof";
  21750. } else if (t.isExportDeclaration(node)) {
  21751. return node.exportKind === "type";
  21752. } else if (t.isImportSpecifier(node)) {
  21753. return node.importKind === "type" || node.importKind === "typeof";
  21754. } else {
  21755. return false;
  21756. }
  21757. }
  21758. };
  21759. /***/ }),
  21760. /* 225 */
  21761. /***/ (function(module, exports, __webpack_require__) {
  21762. "use strict";
  21763. exports.__esModule = true;
  21764. var _classCallCheck2 = __webpack_require__(3);
  21765. var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
  21766. function _interopRequireDefault(obj) {
  21767. return obj && obj.__esModule ? obj : { default: obj };
  21768. }
  21769. var Binding = function () {
  21770. function Binding(_ref) {
  21771. var existing = _ref.existing,
  21772. identifier = _ref.identifier,
  21773. scope = _ref.scope,
  21774. path = _ref.path,
  21775. kind = _ref.kind;
  21776. (0, _classCallCheck3.default)(this, Binding);
  21777. this.identifier = identifier;
  21778. this.scope = scope;
  21779. this.path = path;
  21780. this.kind = kind;
  21781. this.constantViolations = [];
  21782. this.constant = true;
  21783. this.referencePaths = [];
  21784. this.referenced = false;
  21785. this.references = 0;
  21786. this.clearValue();
  21787. if (existing) {
  21788. this.constantViolations = [].concat(existing.path, existing.constantViolations, this.constantViolations);
  21789. }
  21790. }
  21791. Binding.prototype.deoptValue = function deoptValue() {
  21792. this.clearValue();
  21793. this.hasDeoptedValue = true;
  21794. };
  21795. Binding.prototype.setValue = function setValue(value) {
  21796. if (this.hasDeoptedValue) return;
  21797. this.hasValue = true;
  21798. this.value = value;
  21799. };
  21800. Binding.prototype.clearValue = function clearValue() {
  21801. this.hasDeoptedValue = false;
  21802. this.hasValue = false;
  21803. this.value = null;
  21804. };
  21805. Binding.prototype.reassign = function reassign(path) {
  21806. this.constant = false;
  21807. if (this.constantViolations.indexOf(path) !== -1) {
  21808. return;
  21809. }
  21810. this.constantViolations.push(path);
  21811. };
  21812. Binding.prototype.reference = function reference(path) {
  21813. if (this.referencePaths.indexOf(path) !== -1) {
  21814. return;
  21815. }
  21816. this.referenced = true;
  21817. this.references++;
  21818. this.referencePaths.push(path);
  21819. };
  21820. Binding.prototype.dereference = function dereference() {
  21821. this.references--;
  21822. this.referenced = !!this.references;
  21823. };
  21824. return Binding;
  21825. }();
  21826. exports.default = Binding;
  21827. module.exports = exports["default"];
  21828. /***/ }),
  21829. /* 226 */
  21830. /***/ (function(module, exports, __webpack_require__) {
  21831. "use strict";
  21832. exports.__esModule = true;
  21833. var _create = __webpack_require__(9);
  21834. var _create2 = _interopRequireDefault(_create);
  21835. exports.getBindingIdentifiers = getBindingIdentifiers;
  21836. exports.getOuterBindingIdentifiers = getOuterBindingIdentifiers;
  21837. var _index = __webpack_require__(1);
  21838. var t = _interopRequireWildcard(_index);
  21839. function _interopRequireWildcard(obj) {
  21840. if (obj && obj.__esModule) {
  21841. return obj;
  21842. } else {
  21843. var newObj = {};if (obj != null) {
  21844. for (var key in obj) {
  21845. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  21846. }
  21847. }newObj.default = obj;return newObj;
  21848. }
  21849. }
  21850. function _interopRequireDefault(obj) {
  21851. return obj && obj.__esModule ? obj : { default: obj };
  21852. }
  21853. function getBindingIdentifiers(node, duplicates, outerOnly) {
  21854. var search = [].concat(node);
  21855. var ids = (0, _create2.default)(null);
  21856. while (search.length) {
  21857. var id = search.shift();
  21858. if (!id) continue;
  21859. var keys = t.getBindingIdentifiers.keys[id.type];
  21860. if (t.isIdentifier(id)) {
  21861. if (duplicates) {
  21862. var _ids = ids[id.name] = ids[id.name] || [];
  21863. _ids.push(id);
  21864. } else {
  21865. ids[id.name] = id;
  21866. }
  21867. continue;
  21868. }
  21869. if (t.isExportDeclaration(id)) {
  21870. if (t.isDeclaration(id.declaration)) {
  21871. search.push(id.declaration);
  21872. }
  21873. continue;
  21874. }
  21875. if (outerOnly) {
  21876. if (t.isFunctionDeclaration(id)) {
  21877. search.push(id.id);
  21878. continue;
  21879. }
  21880. if (t.isFunctionExpression(id)) {
  21881. continue;
  21882. }
  21883. }
  21884. if (keys) {
  21885. for (var i = 0; i < keys.length; i++) {
  21886. var key = keys[i];
  21887. if (id[key]) {
  21888. search = search.concat(id[key]);
  21889. }
  21890. }
  21891. }
  21892. }
  21893. return ids;
  21894. }
  21895. getBindingIdentifiers.keys = {
  21896. DeclareClass: ["id"],
  21897. DeclareFunction: ["id"],
  21898. DeclareModule: ["id"],
  21899. DeclareVariable: ["id"],
  21900. InterfaceDeclaration: ["id"],
  21901. TypeAlias: ["id"],
  21902. OpaqueType: ["id"],
  21903. CatchClause: ["param"],
  21904. LabeledStatement: ["label"],
  21905. UnaryExpression: ["argument"],
  21906. AssignmentExpression: ["left"],
  21907. ImportSpecifier: ["local"],
  21908. ImportNamespaceSpecifier: ["local"],
  21909. ImportDefaultSpecifier: ["local"],
  21910. ImportDeclaration: ["specifiers"],
  21911. ExportSpecifier: ["exported"],
  21912. ExportNamespaceSpecifier: ["exported"],
  21913. ExportDefaultSpecifier: ["exported"],
  21914. FunctionDeclaration: ["id", "params"],
  21915. FunctionExpression: ["id", "params"],
  21916. ClassDeclaration: ["id"],
  21917. ClassExpression: ["id"],
  21918. RestElement: ["argument"],
  21919. UpdateExpression: ["argument"],
  21920. RestProperty: ["argument"],
  21921. ObjectProperty: ["value"],
  21922. AssignmentPattern: ["left"],
  21923. ArrayPattern: ["elements"],
  21924. ObjectPattern: ["properties"],
  21925. VariableDeclaration: ["declarations"],
  21926. VariableDeclarator: ["id"]
  21927. };
  21928. function getOuterBindingIdentifiers(node, duplicates) {
  21929. return getBindingIdentifiers(node, duplicates, true);
  21930. }
  21931. /***/ }),
  21932. /* 227 */
  21933. /***/ (function(module, exports) {
  21934. 'use strict';
  21935. module.exports = function (it) {
  21936. if (typeof it != 'function') throw TypeError(it + ' is not a function!');
  21937. return it;
  21938. };
  21939. /***/ }),
  21940. /* 228 */
  21941. /***/ (function(module, exports, __webpack_require__) {
  21942. 'use strict';
  21943. // getting tag from 19.1.3.6 Object.prototype.toString()
  21944. var cof = __webpack_require__(138);
  21945. var TAG = __webpack_require__(13)('toStringTag');
  21946. // ES3 wrong here
  21947. var ARG = cof(function () {
  21948. return arguments;
  21949. }()) == 'Arguments';
  21950. // fallback for IE11 Script Access Denied error
  21951. var tryGet = function tryGet(it, key) {
  21952. try {
  21953. return it[key];
  21954. } catch (e) {/* empty */}
  21955. };
  21956. module.exports = function (it) {
  21957. var O, T, B;
  21958. return it === undefined ? 'Undefined' : it === null ? 'Null'
  21959. // @@toStringTag case
  21960. : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T
  21961. // builtinTag case
  21962. : ARG ? cof(O)
  21963. // ES3 arguments fallback
  21964. : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;
  21965. };
  21966. /***/ }),
  21967. /* 229 */
  21968. /***/ (function(module, exports, __webpack_require__) {
  21969. 'use strict';
  21970. var redefineAll = __webpack_require__(146);
  21971. var getWeak = __webpack_require__(57).getWeak;
  21972. var anObject = __webpack_require__(21);
  21973. var isObject = __webpack_require__(16);
  21974. var anInstance = __webpack_require__(136);
  21975. var forOf = __webpack_require__(55);
  21976. var createArrayMethod = __webpack_require__(137);
  21977. var $has = __webpack_require__(28);
  21978. var validate = __webpack_require__(58);
  21979. var arrayFind = createArrayMethod(5);
  21980. var arrayFindIndex = createArrayMethod(6);
  21981. var id = 0;
  21982. // fallback for uncaught frozen keys
  21983. var uncaughtFrozenStore = function uncaughtFrozenStore(that) {
  21984. return that._l || (that._l = new UncaughtFrozenStore());
  21985. };
  21986. var UncaughtFrozenStore = function UncaughtFrozenStore() {
  21987. this.a = [];
  21988. };
  21989. var findUncaughtFrozen = function findUncaughtFrozen(store, key) {
  21990. return arrayFind(store.a, function (it) {
  21991. return it[0] === key;
  21992. });
  21993. };
  21994. UncaughtFrozenStore.prototype = {
  21995. get: function get(key) {
  21996. var entry = findUncaughtFrozen(this, key);
  21997. if (entry) return entry[1];
  21998. },
  21999. has: function has(key) {
  22000. return !!findUncaughtFrozen(this, key);
  22001. },
  22002. set: function set(key, value) {
  22003. var entry = findUncaughtFrozen(this, key);
  22004. if (entry) entry[1] = value;else this.a.push([key, value]);
  22005. },
  22006. 'delete': function _delete(key) {
  22007. var index = arrayFindIndex(this.a, function (it) {
  22008. return it[0] === key;
  22009. });
  22010. if (~index) this.a.splice(index, 1);
  22011. return !!~index;
  22012. }
  22013. };
  22014. module.exports = {
  22015. getConstructor: function getConstructor(wrapper, NAME, IS_MAP, ADDER) {
  22016. var C = wrapper(function (that, iterable) {
  22017. anInstance(that, C, NAME, '_i');
  22018. that._t = NAME; // collection type
  22019. that._i = id++; // collection id
  22020. that._l = undefined; // leak store for uncaught frozen objects
  22021. if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);
  22022. });
  22023. redefineAll(C.prototype, {
  22024. // 23.3.3.2 WeakMap.prototype.delete(key)
  22025. // 23.4.3.3 WeakSet.prototype.delete(value)
  22026. 'delete': function _delete(key) {
  22027. if (!isObject(key)) return false;
  22028. var data = getWeak(key);
  22029. if (data === true) return uncaughtFrozenStore(validate(this, NAME))['delete'](key);
  22030. return data && $has(data, this._i) && delete data[this._i];
  22031. },
  22032. // 23.3.3.4 WeakMap.prototype.has(key)
  22033. // 23.4.3.4 WeakSet.prototype.has(value)
  22034. has: function has(key) {
  22035. if (!isObject(key)) return false;
  22036. var data = getWeak(key);
  22037. if (data === true) return uncaughtFrozenStore(validate(this, NAME)).has(key);
  22038. return data && $has(data, this._i);
  22039. }
  22040. });
  22041. return C;
  22042. },
  22043. def: function def(that, key, value) {
  22044. var data = getWeak(anObject(key), true);
  22045. if (data === true) uncaughtFrozenStore(that).set(key, value);else data[that._i] = value;
  22046. return that;
  22047. },
  22048. ufstore: uncaughtFrozenStore
  22049. };
  22050. /***/ }),
  22051. /* 230 */
  22052. /***/ (function(module, exports, __webpack_require__) {
  22053. 'use strict';
  22054. var isObject = __webpack_require__(16);
  22055. var document = __webpack_require__(15).document;
  22056. // typeof document.createElement is 'object' in old IE
  22057. var is = isObject(document) && isObject(document.createElement);
  22058. module.exports = function (it) {
  22059. return is ? document.createElement(it) : {};
  22060. };
  22061. /***/ }),
  22062. /* 231 */
  22063. /***/ (function(module, exports, __webpack_require__) {
  22064. 'use strict';
  22065. module.exports = !__webpack_require__(22) && !__webpack_require__(27)(function () {
  22066. return Object.defineProperty(__webpack_require__(230)('div'), 'a', { get: function get() {
  22067. return 7;
  22068. } }).a != 7;
  22069. });
  22070. /***/ }),
  22071. /* 232 */
  22072. /***/ (function(module, exports, __webpack_require__) {
  22073. 'use strict';
  22074. // 7.2.2 IsArray(argument)
  22075. var cof = __webpack_require__(138);
  22076. module.exports = Array.isArray || function isArray(arg) {
  22077. return cof(arg) == 'Array';
  22078. };
  22079. /***/ }),
  22080. /* 233 */
  22081. /***/ (function(module, exports) {
  22082. "use strict";
  22083. module.exports = function (done, value) {
  22084. return { value: value, done: !!done };
  22085. };
  22086. /***/ }),
  22087. /* 234 */
  22088. /***/ (function(module, exports, __webpack_require__) {
  22089. 'use strict';
  22090. // 19.1.2.1 Object.assign(target, source, ...)
  22091. var getKeys = __webpack_require__(44);
  22092. var gOPS = __webpack_require__(145);
  22093. var pIE = __webpack_require__(91);
  22094. var toObject = __webpack_require__(94);
  22095. var IObject = __webpack_require__(142);
  22096. var $assign = Object.assign;
  22097. // should work with symbols and should have deterministic property order (V8 bug)
  22098. module.exports = !$assign || __webpack_require__(27)(function () {
  22099. var A = {};
  22100. var B = {};
  22101. // eslint-disable-next-line no-undef
  22102. var S = Symbol();
  22103. var K = 'abcdefghijklmnopqrst';
  22104. A[S] = 7;
  22105. K.split('').forEach(function (k) {
  22106. B[k] = k;
  22107. });
  22108. return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;
  22109. }) ? function assign(target, source) {
  22110. // eslint-disable-line no-unused-vars
  22111. var T = toObject(target);
  22112. var aLen = arguments.length;
  22113. var index = 1;
  22114. var getSymbols = gOPS.f;
  22115. var isEnum = pIE.f;
  22116. while (aLen > index) {
  22117. var S = IObject(arguments[index++]);
  22118. var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S);
  22119. var length = keys.length;
  22120. var j = 0;
  22121. var key;
  22122. while (length > j) {
  22123. if (isEnum.call(S, key = keys[j++])) T[key] = S[key];
  22124. }
  22125. }return T;
  22126. } : $assign;
  22127. /***/ }),
  22128. /* 235 */
  22129. /***/ (function(module, exports, __webpack_require__) {
  22130. 'use strict';
  22131. var pIE = __webpack_require__(91);
  22132. var createDesc = __webpack_require__(92);
  22133. var toIObject = __webpack_require__(37);
  22134. var toPrimitive = __webpack_require__(154);
  22135. var has = __webpack_require__(28);
  22136. var IE8_DOM_DEFINE = __webpack_require__(231);
  22137. var gOPD = Object.getOwnPropertyDescriptor;
  22138. exports.f = __webpack_require__(22) ? gOPD : function getOwnPropertyDescriptor(O, P) {
  22139. O = toIObject(O);
  22140. P = toPrimitive(P, true);
  22141. if (IE8_DOM_DEFINE) try {
  22142. return gOPD(O, P);
  22143. } catch (e) {/* empty */}
  22144. if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]);
  22145. };
  22146. /***/ }),
  22147. /* 236 */
  22148. /***/ (function(module, exports, __webpack_require__) {
  22149. 'use strict';
  22150. // 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)
  22151. var $keys = __webpack_require__(237);
  22152. var hiddenKeys = __webpack_require__(141).concat('length', 'prototype');
  22153. exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  22154. return $keys(O, hiddenKeys);
  22155. };
  22156. /***/ }),
  22157. /* 237 */
  22158. /***/ (function(module, exports, __webpack_require__) {
  22159. 'use strict';
  22160. var has = __webpack_require__(28);
  22161. var toIObject = __webpack_require__(37);
  22162. var arrayIndexOf = __webpack_require__(420)(false);
  22163. var IE_PROTO = __webpack_require__(150)('IE_PROTO');
  22164. module.exports = function (object, names) {
  22165. var O = toIObject(object);
  22166. var i = 0;
  22167. var result = [];
  22168. var key;
  22169. for (key in O) {
  22170. if (key != IE_PROTO) has(O, key) && result.push(key);
  22171. } // Don't enum bug & hidden keys
  22172. while (names.length > i) {
  22173. if (has(O, key = names[i++])) {
  22174. ~arrayIndexOf(result, key) || result.push(key);
  22175. }
  22176. }return result;
  22177. };
  22178. /***/ }),
  22179. /* 238 */
  22180. /***/ (function(module, exports, __webpack_require__) {
  22181. 'use strict';
  22182. var classof = __webpack_require__(228);
  22183. var ITERATOR = __webpack_require__(13)('iterator');
  22184. var Iterators = __webpack_require__(56);
  22185. module.exports = __webpack_require__(5).getIteratorMethod = function (it) {
  22186. if (it != undefined) return it[ITERATOR] || it['@@iterator'] || Iterators[classof(it)];
  22187. };
  22188. /***/ }),
  22189. /* 239 */
  22190. /***/ (function(module, exports, __webpack_require__) {
  22191. /* WEBPACK VAR INJECTION */(function(process) {'use strict';
  22192. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  22193. /**
  22194. * This is the web browser implementation of `debug()`.
  22195. *
  22196. * Expose `debug()` as the module.
  22197. */
  22198. exports = module.exports = __webpack_require__(458);
  22199. exports.log = log;
  22200. exports.formatArgs = formatArgs;
  22201. exports.save = save;
  22202. exports.load = load;
  22203. exports.useColors = useColors;
  22204. exports.storage = 'undefined' != typeof chrome && 'undefined' != typeof chrome.storage ? chrome.storage.local : localstorage();
  22205. /**
  22206. * Colors.
  22207. */
  22208. exports.colors = ['lightseagreen', 'forestgreen', 'goldenrod', 'dodgerblue', 'darkorchid', 'crimson'];
  22209. /**
  22210. * Currently only WebKit-based Web Inspectors, Firefox >= v31,
  22211. * and the Firebug extension (any Firefox version) are known
  22212. * to support "%c" CSS customizations.
  22213. *
  22214. * TODO: add a `localStorage` variable to explicitly enable/disable colors
  22215. */
  22216. function useColors() {
  22217. // NB: In an Electron preload script, document will be defined but not fully
  22218. // initialized. Since we know we're in Chrome, we'll just detect this case
  22219. // explicitly
  22220. if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {
  22221. return true;
  22222. }
  22223. // is webkit? http://stackoverflow.com/a/16459606/376773
  22224. // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
  22225. return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance ||
  22226. // is firebug? http://stackoverflow.com/a/398120/376773
  22227. typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) ||
  22228. // is firefox >= v31?
  22229. // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
  22230. typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 ||
  22231. // double check webkit in userAgent just in case we are in a worker
  22232. typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
  22233. }
  22234. /**
  22235. * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
  22236. */
  22237. exports.formatters.j = function (v) {
  22238. try {
  22239. return JSON.stringify(v);
  22240. } catch (err) {
  22241. return '[UnexpectedJSONParseError]: ' + err.message;
  22242. }
  22243. };
  22244. /**
  22245. * Colorize log arguments if enabled.
  22246. *
  22247. * @api public
  22248. */
  22249. function formatArgs(args) {
  22250. var useColors = this.useColors;
  22251. args[0] = (useColors ? '%c' : '') + this.namespace + (useColors ? ' %c' : ' ') + args[0] + (useColors ? '%c ' : ' ') + '+' + exports.humanize(this.diff);
  22252. if (!useColors) return;
  22253. var c = 'color: ' + this.color;
  22254. args.splice(1, 0, c, 'color: inherit');
  22255. // the final "%c" is somewhat tricky, because there could be other
  22256. // arguments passed either before or after the %c, so we need to
  22257. // figure out the correct index to insert the CSS into
  22258. var index = 0;
  22259. var lastC = 0;
  22260. args[0].replace(/%[a-zA-Z%]/g, function (match) {
  22261. if ('%%' === match) return;
  22262. index++;
  22263. if ('%c' === match) {
  22264. // we only are interested in the *last* %c
  22265. // (the user may have provided their own)
  22266. lastC = index;
  22267. }
  22268. });
  22269. args.splice(lastC, 0, c);
  22270. }
  22271. /**
  22272. * Invokes `console.log()` when available.
  22273. * No-op when `console.log` is not a "function".
  22274. *
  22275. * @api public
  22276. */
  22277. function log() {
  22278. // this hackery is required for IE8/9, where
  22279. // the `console.log` function doesn't have 'apply'
  22280. return 'object' === (typeof console === 'undefined' ? 'undefined' : _typeof(console)) && console.log && Function.prototype.apply.call(console.log, console, arguments);
  22281. }
  22282. /**
  22283. * Save `namespaces`.
  22284. *
  22285. * @param {String} namespaces
  22286. * @api private
  22287. */
  22288. function save(namespaces) {
  22289. try {
  22290. if (null == namespaces) {
  22291. exports.storage.removeItem('debug');
  22292. } else {
  22293. exports.storage.debug = namespaces;
  22294. }
  22295. } catch (e) {}
  22296. }
  22297. /**
  22298. * Load `namespaces`.
  22299. *
  22300. * @return {String} returns the previously persisted debug modes
  22301. * @api private
  22302. */
  22303. function load() {
  22304. var r;
  22305. try {
  22306. r = exports.storage.debug;
  22307. } catch (e) {}
  22308. // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
  22309. if (!r && typeof process !== 'undefined' && 'env' in process) {
  22310. r = process.env.DEBUG;
  22311. }
  22312. return r;
  22313. }
  22314. /**
  22315. * Enable namespaces listed in `localStorage.debug` initially.
  22316. */
  22317. exports.enable(load());
  22318. /**
  22319. * Localstorage attempts to return the localstorage.
  22320. *
  22321. * This is necessary because safari throws
  22322. * when a user disables cookies/localstorage
  22323. * and you attempt to access it.
  22324. *
  22325. * @return {LocalStorage}
  22326. * @api private
  22327. */
  22328. function localstorage() {
  22329. try {
  22330. return window.localStorage;
  22331. } catch (e) {}
  22332. }
  22333. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(8)))
  22334. /***/ }),
  22335. /* 240 */
  22336. /***/ (function(module, exports) {
  22337. 'use strict';
  22338. /*
  22339. Copyright (C) 2013-2014 Yusuke Suzuki <utatane.tea@gmail.com>
  22340. Copyright (C) 2014 Ivan Nikulin <ifaaan@gmail.com>
  22341. Redistribution and use in source and binary forms, with or without
  22342. modification, are permitted provided that the following conditions are met:
  22343. * Redistributions of source code must retain the above copyright
  22344. notice, this list of conditions and the following disclaimer.
  22345. * Redistributions in binary form must reproduce the above copyright
  22346. notice, this list of conditions and the following disclaimer in the
  22347. documentation and/or other materials provided with the distribution.
  22348. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  22349. AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  22350. IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  22351. ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
  22352. DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  22353. (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  22354. LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  22355. ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  22356. (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  22357. THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  22358. */
  22359. (function () {
  22360. 'use strict';
  22361. var ES6Regex, ES5Regex, NON_ASCII_WHITESPACES, IDENTIFIER_START, IDENTIFIER_PART, ch;
  22362. // See `tools/generate-identifier-regex.js`.
  22363. ES5Regex = {
  22364. // ECMAScript 5.1/Unicode v7.0.0 NonAsciiIdentifierStart:
  22365. NonAsciiIdentifierStart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B2\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,
  22366. // ECMAScript 5.1/Unicode v7.0.0 NonAsciiIdentifierPart:
  22367. NonAsciiIdentifierPart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B2\u08E4-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58\u0C59\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D60-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA69D\uA69F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2D\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/
  22368. };
  22369. ES6Regex = {
  22370. // ECMAScript 6/Unicode v7.0.0 NonAsciiIdentifierStart:
  22371. NonAsciiIdentifierStart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B2\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDE00-\uDE11\uDE13-\uDE2B\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDE00-\uDE2F\uDE44\uDE80-\uDEAA]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF98]|\uD809[\uDC00-\uDC6E]|[\uD80C\uD840-\uD868\uD86A-\uD86C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D]|\uD87E[\uDC00-\uDE1D]/,
  22372. // ECMAScript 6/Unicode v7.0.0 NonAsciiIdentifierPart:
  22373. NonAsciiIdentifierPart: /[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B2\u08E4-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58\u0C59\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D60-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA69D\uA69F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2D\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDD0-\uDDDA\uDE00-\uDE11\uDE13-\uDE37\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF01-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF98]|\uD809[\uDC00-\uDC6E]|[\uD80C\uD840-\uD868\uD86A-\uD86C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/
  22374. };
  22375. function isDecimalDigit(ch) {
  22376. return 0x30 <= ch && ch <= 0x39; // 0..9
  22377. }
  22378. function isHexDigit(ch) {
  22379. return 0x30 <= ch && ch <= 0x39 || // 0..9
  22380. 0x61 <= ch && ch <= 0x66 || // a..f
  22381. 0x41 <= ch && ch <= 0x46; // A..F
  22382. }
  22383. function isOctalDigit(ch) {
  22384. return ch >= 0x30 && ch <= 0x37; // 0..7
  22385. }
  22386. // 7.2 White Space
  22387. NON_ASCII_WHITESPACES = [0x1680, 0x180E, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202F, 0x205F, 0x3000, 0xFEFF];
  22388. function isWhiteSpace(ch) {
  22389. return ch === 0x20 || ch === 0x09 || ch === 0x0B || ch === 0x0C || ch === 0xA0 || ch >= 0x1680 && NON_ASCII_WHITESPACES.indexOf(ch) >= 0;
  22390. }
  22391. // 7.3 Line Terminators
  22392. function isLineTerminator(ch) {
  22393. return ch === 0x0A || ch === 0x0D || ch === 0x2028 || ch === 0x2029;
  22394. }
  22395. // 7.6 Identifier Names and Identifiers
  22396. function fromCodePoint(cp) {
  22397. if (cp <= 0xFFFF) {
  22398. return String.fromCharCode(cp);
  22399. }
  22400. var cu1 = String.fromCharCode(Math.floor((cp - 0x10000) / 0x400) + 0xD800);
  22401. var cu2 = String.fromCharCode((cp - 0x10000) % 0x400 + 0xDC00);
  22402. return cu1 + cu2;
  22403. }
  22404. IDENTIFIER_START = new Array(0x80);
  22405. for (ch = 0; ch < 0x80; ++ch) {
  22406. IDENTIFIER_START[ch] = ch >= 0x61 && ch <= 0x7A || // a..z
  22407. ch >= 0x41 && ch <= 0x5A || // A..Z
  22408. ch === 0x24 || ch === 0x5F; // $ (dollar) and _ (underscore)
  22409. }
  22410. IDENTIFIER_PART = new Array(0x80);
  22411. for (ch = 0; ch < 0x80; ++ch) {
  22412. IDENTIFIER_PART[ch] = ch >= 0x61 && ch <= 0x7A || // a..z
  22413. ch >= 0x41 && ch <= 0x5A || // A..Z
  22414. ch >= 0x30 && ch <= 0x39 || // 0..9
  22415. ch === 0x24 || ch === 0x5F; // $ (dollar) and _ (underscore)
  22416. }
  22417. function isIdentifierStartES5(ch) {
  22418. return ch < 0x80 ? IDENTIFIER_START[ch] : ES5Regex.NonAsciiIdentifierStart.test(fromCodePoint(ch));
  22419. }
  22420. function isIdentifierPartES5(ch) {
  22421. return ch < 0x80 ? IDENTIFIER_PART[ch] : ES5Regex.NonAsciiIdentifierPart.test(fromCodePoint(ch));
  22422. }
  22423. function isIdentifierStartES6(ch) {
  22424. return ch < 0x80 ? IDENTIFIER_START[ch] : ES6Regex.NonAsciiIdentifierStart.test(fromCodePoint(ch));
  22425. }
  22426. function isIdentifierPartES6(ch) {
  22427. return ch < 0x80 ? IDENTIFIER_PART[ch] : ES6Regex.NonAsciiIdentifierPart.test(fromCodePoint(ch));
  22428. }
  22429. module.exports = {
  22430. isDecimalDigit: isDecimalDigit,
  22431. isHexDigit: isHexDigit,
  22432. isOctalDigit: isOctalDigit,
  22433. isWhiteSpace: isWhiteSpace,
  22434. isLineTerminator: isLineTerminator,
  22435. isIdentifierStartES5: isIdentifierStartES5,
  22436. isIdentifierPartES5: isIdentifierPartES5,
  22437. isIdentifierStartES6: isIdentifierStartES6,
  22438. isIdentifierPartES6: isIdentifierPartES6
  22439. };
  22440. })();
  22441. /* vim: set sw=4 ts=4 et tw=80 : */
  22442. /***/ }),
  22443. /* 241 */
  22444. /***/ (function(module, exports, __webpack_require__) {
  22445. 'use strict';
  22446. var getNative = __webpack_require__(38),
  22447. root = __webpack_require__(17);
  22448. /* Built-in method references that are verified to be native. */
  22449. var Set = getNative(root, 'Set');
  22450. module.exports = Set;
  22451. /***/ }),
  22452. /* 242 */
  22453. /***/ (function(module, exports, __webpack_require__) {
  22454. 'use strict';
  22455. var MapCache = __webpack_require__(160),
  22456. setCacheAdd = __webpack_require__(561),
  22457. setCacheHas = __webpack_require__(562);
  22458. /**
  22459. *
  22460. * Creates an array cache object to store unique values.
  22461. *
  22462. * @private
  22463. * @constructor
  22464. * @param {Array} [values] The values to cache.
  22465. */
  22466. function SetCache(values) {
  22467. var index = -1,
  22468. length = values == null ? 0 : values.length;
  22469. this.__data__ = new MapCache();
  22470. while (++index < length) {
  22471. this.add(values[index]);
  22472. }
  22473. }
  22474. // Add methods to `SetCache`.
  22475. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  22476. SetCache.prototype.has = setCacheHas;
  22477. module.exports = SetCache;
  22478. /***/ }),
  22479. /* 243 */
  22480. /***/ (function(module, exports, __webpack_require__) {
  22481. 'use strict';
  22482. var root = __webpack_require__(17);
  22483. /** Built-in value references. */
  22484. var Uint8Array = root.Uint8Array;
  22485. module.exports = Uint8Array;
  22486. /***/ }),
  22487. /* 244 */
  22488. /***/ (function(module, exports) {
  22489. "use strict";
  22490. /**
  22491. * A faster alternative to `Function#apply`, this function invokes `func`
  22492. * with the `this` binding of `thisArg` and the arguments of `args`.
  22493. *
  22494. * @private
  22495. * @param {Function} func The function to invoke.
  22496. * @param {*} thisArg The `this` binding of `func`.
  22497. * @param {Array} args The arguments to invoke `func` with.
  22498. * @returns {*} Returns the result of `func`.
  22499. */
  22500. function apply(func, thisArg, args) {
  22501. switch (args.length) {
  22502. case 0:
  22503. return func.call(thisArg);
  22504. case 1:
  22505. return func.call(thisArg, args[0]);
  22506. case 2:
  22507. return func.call(thisArg, args[0], args[1]);
  22508. case 3:
  22509. return func.call(thisArg, args[0], args[1], args[2]);
  22510. }
  22511. return func.apply(thisArg, args);
  22512. }
  22513. module.exports = apply;
  22514. /***/ }),
  22515. /* 245 */
  22516. /***/ (function(module, exports, __webpack_require__) {
  22517. 'use strict';
  22518. var baseTimes = __webpack_require__(513),
  22519. isArguments = __webpack_require__(112),
  22520. isArray = __webpack_require__(6),
  22521. isBuffer = __webpack_require__(113),
  22522. isIndex = __webpack_require__(171),
  22523. isTypedArray = __webpack_require__(177);
  22524. /** Used for built-in method references. */
  22525. var objectProto = Object.prototype;
  22526. /** Used to check objects for own properties. */
  22527. var hasOwnProperty = objectProto.hasOwnProperty;
  22528. /**
  22529. * Creates an array of the enumerable property names of the array-like `value`.
  22530. *
  22531. * @private
  22532. * @param {*} value The value to query.
  22533. * @param {boolean} inherited Specify returning inherited property names.
  22534. * @returns {Array} Returns the array of property names.
  22535. */
  22536. function arrayLikeKeys(value, inherited) {
  22537. var isArr = isArray(value),
  22538. isArg = !isArr && isArguments(value),
  22539. isBuff = !isArr && !isArg && isBuffer(value),
  22540. isType = !isArr && !isArg && !isBuff && isTypedArray(value),
  22541. skipIndexes = isArr || isArg || isBuff || isType,
  22542. result = skipIndexes ? baseTimes(value.length, String) : [],
  22543. length = result.length;
  22544. for (var key in value) {
  22545. if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && (
  22546. // Safari 9 has enumerable `arguments.length` in strict mode.
  22547. key == 'length' ||
  22548. // Node.js 0.10 has enumerable non-index properties on buffers.
  22549. isBuff && (key == 'offset' || key == 'parent') ||
  22550. // PhantomJS 2 has enumerable non-index properties on typed arrays.
  22551. isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset') ||
  22552. // Skip index properties.
  22553. isIndex(key, length)))) {
  22554. result.push(key);
  22555. }
  22556. }
  22557. return result;
  22558. }
  22559. module.exports = arrayLikeKeys;
  22560. /***/ }),
  22561. /* 246 */
  22562. /***/ (function(module, exports) {
  22563. "use strict";
  22564. /**
  22565. * A specialized version of `_.reduce` for arrays without support for
  22566. * iteratee shorthands.
  22567. *
  22568. * @private
  22569. * @param {Array} [array] The array to iterate over.
  22570. * @param {Function} iteratee The function invoked per iteration.
  22571. * @param {*} [accumulator] The initial value.
  22572. * @param {boolean} [initAccum] Specify using the first element of `array` as
  22573. * the initial value.
  22574. * @returns {*} Returns the accumulated value.
  22575. */
  22576. function arrayReduce(array, iteratee, accumulator, initAccum) {
  22577. var index = -1,
  22578. length = array == null ? 0 : array.length;
  22579. if (initAccum && length) {
  22580. accumulator = array[++index];
  22581. }
  22582. while (++index < length) {
  22583. accumulator = iteratee(accumulator, array[index], index, array);
  22584. }
  22585. return accumulator;
  22586. }
  22587. module.exports = arrayReduce;
  22588. /***/ }),
  22589. /* 247 */
  22590. /***/ (function(module, exports, __webpack_require__) {
  22591. 'use strict';
  22592. var baseAssignValue = __webpack_require__(163),
  22593. eq = __webpack_require__(46);
  22594. /**
  22595. * This function is like `assignValue` except that it doesn't assign
  22596. * `undefined` values.
  22597. *
  22598. * @private
  22599. * @param {Object} object The object to modify.
  22600. * @param {string} key The key of the property to assign.
  22601. * @param {*} value The value to assign.
  22602. */
  22603. function assignMergeValue(object, key, value) {
  22604. if (value !== undefined && !eq(object[key], value) || value === undefined && !(key in object)) {
  22605. baseAssignValue(object, key, value);
  22606. }
  22607. }
  22608. module.exports = assignMergeValue;
  22609. /***/ }),
  22610. /* 248 */
  22611. /***/ (function(module, exports, __webpack_require__) {
  22612. 'use strict';
  22613. var createBaseFor = __webpack_require__(527);
  22614. /**
  22615. * The base implementation of `baseForOwn` which iterates over `object`
  22616. * properties returned by `keysFunc` and invokes `iteratee` for each property.
  22617. * Iteratee functions may exit iteration early by explicitly returning `false`.
  22618. *
  22619. * @private
  22620. * @param {Object} object The object to iterate over.
  22621. * @param {Function} iteratee The function invoked per iteration.
  22622. * @param {Function} keysFunc The function to get the keys of `object`.
  22623. * @returns {Object} Returns `object`.
  22624. */
  22625. var baseFor = createBaseFor();
  22626. module.exports = baseFor;
  22627. /***/ }),
  22628. /* 249 */
  22629. /***/ (function(module, exports, __webpack_require__) {
  22630. 'use strict';
  22631. var castPath = __webpack_require__(255),
  22632. toKey = __webpack_require__(108);
  22633. /**
  22634. * The base implementation of `_.get` without support for default values.
  22635. *
  22636. * @private
  22637. * @param {Object} object The object to query.
  22638. * @param {Array|string} path The path of the property to get.
  22639. * @returns {*} Returns the resolved value.
  22640. */
  22641. function baseGet(object, path) {
  22642. path = castPath(path, object);
  22643. var index = 0,
  22644. length = path.length;
  22645. while (object != null && index < length) {
  22646. object = object[toKey(path[index++])];
  22647. }
  22648. return index && index == length ? object : undefined;
  22649. }
  22650. module.exports = baseGet;
  22651. /***/ }),
  22652. /* 250 */
  22653. /***/ (function(module, exports, __webpack_require__) {
  22654. 'use strict';
  22655. var arrayPush = __webpack_require__(161),
  22656. isArray = __webpack_require__(6);
  22657. /**
  22658. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  22659. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  22660. * symbols of `object`.
  22661. *
  22662. * @private
  22663. * @param {Object} object The object to query.
  22664. * @param {Function} keysFunc The function to get the keys of `object`.
  22665. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  22666. * @returns {Array} Returns the array of property names and symbols.
  22667. */
  22668. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  22669. var result = keysFunc(object);
  22670. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  22671. }
  22672. module.exports = baseGetAllKeys;
  22673. /***/ }),
  22674. /* 251 */
  22675. /***/ (function(module, exports, __webpack_require__) {
  22676. 'use strict';
  22677. var baseIsEqualDeep = __webpack_require__(494),
  22678. isObjectLike = __webpack_require__(25);
  22679. /**
  22680. * The base implementation of `_.isEqual` which supports partial comparisons
  22681. * and tracks traversed objects.
  22682. *
  22683. * @private
  22684. * @param {*} value The value to compare.
  22685. * @param {*} other The other value to compare.
  22686. * @param {boolean} bitmask The bitmask flags.
  22687. * 1 - Unordered comparison
  22688. * 2 - Partial comparison
  22689. * @param {Function} [customizer] The function to customize comparisons.
  22690. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  22691. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  22692. */
  22693. function baseIsEqual(value, other, bitmask, customizer, stack) {
  22694. if (value === other) {
  22695. return true;
  22696. }
  22697. if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) {
  22698. return value !== value && other !== other;
  22699. }
  22700. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  22701. }
  22702. module.exports = baseIsEqual;
  22703. /***/ }),
  22704. /* 252 */
  22705. /***/ (function(module, exports, __webpack_require__) {
  22706. 'use strict';
  22707. var baseEach = __webpack_require__(487),
  22708. isArrayLike = __webpack_require__(24);
  22709. /**
  22710. * The base implementation of `_.map` without support for iteratee shorthands.
  22711. *
  22712. * @private
  22713. * @param {Array|Object} collection The collection to iterate over.
  22714. * @param {Function} iteratee The function invoked per iteration.
  22715. * @returns {Array} Returns the new mapped array.
  22716. */
  22717. function baseMap(collection, iteratee) {
  22718. var index = -1,
  22719. result = isArrayLike(collection) ? Array(collection.length) : [];
  22720. baseEach(collection, function (value, key, collection) {
  22721. result[++index] = iteratee(value, key, collection);
  22722. });
  22723. return result;
  22724. }
  22725. module.exports = baseMap;
  22726. /***/ }),
  22727. /* 253 */
  22728. /***/ (function(module, exports, __webpack_require__) {
  22729. 'use strict';
  22730. var _Symbol = __webpack_require__(45),
  22731. arrayMap = __webpack_require__(60),
  22732. isArray = __webpack_require__(6),
  22733. isSymbol = __webpack_require__(62);
  22734. /** Used as references for various `Number` constants. */
  22735. var INFINITY = 1 / 0;
  22736. /** Used to convert symbols to primitives and strings. */
  22737. var symbolProto = _Symbol ? _Symbol.prototype : undefined,
  22738. symbolToString = symbolProto ? symbolProto.toString : undefined;
  22739. /**
  22740. * The base implementation of `_.toString` which doesn't convert nullish
  22741. * values to empty strings.
  22742. *
  22743. * @private
  22744. * @param {*} value The value to process.
  22745. * @returns {string} Returns the string.
  22746. */
  22747. function baseToString(value) {
  22748. // Exit early for strings to avoid a performance hit in some environments.
  22749. if (typeof value == 'string') {
  22750. return value;
  22751. }
  22752. if (isArray(value)) {
  22753. // Recursively convert values (susceptible to call stack limits).
  22754. return arrayMap(value, baseToString) + '';
  22755. }
  22756. if (isSymbol(value)) {
  22757. return symbolToString ? symbolToString.call(value) : '';
  22758. }
  22759. var result = value + '';
  22760. return result == '0' && 1 / value == -INFINITY ? '-0' : result;
  22761. }
  22762. module.exports = baseToString;
  22763. /***/ }),
  22764. /* 254 */
  22765. /***/ (function(module, exports) {
  22766. "use strict";
  22767. /**
  22768. * Checks if a `cache` value for `key` exists.
  22769. *
  22770. * @private
  22771. * @param {Object} cache The cache to query.
  22772. * @param {string} key The key of the entry to check.
  22773. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  22774. */
  22775. function cacheHas(cache, key) {
  22776. return cache.has(key);
  22777. }
  22778. module.exports = cacheHas;
  22779. /***/ }),
  22780. /* 255 */
  22781. /***/ (function(module, exports, __webpack_require__) {
  22782. 'use strict';
  22783. var isArray = __webpack_require__(6),
  22784. isKey = __webpack_require__(173),
  22785. stringToPath = __webpack_require__(571),
  22786. toString = __webpack_require__(114);
  22787. /**
  22788. * Casts `value` to a path array if it's not one.
  22789. *
  22790. * @private
  22791. * @param {*} value The value to inspect.
  22792. * @param {Object} [object] The object to query keys on.
  22793. * @returns {Array} Returns the cast property path array.
  22794. */
  22795. function castPath(value, object) {
  22796. if (isArray(value)) {
  22797. return value;
  22798. }
  22799. return isKey(value, object) ? [value] : stringToPath(toString(value));
  22800. }
  22801. module.exports = castPath;
  22802. /***/ }),
  22803. /* 256 */
  22804. /***/ (function(module, exports, __webpack_require__) {
  22805. /* WEBPACK VAR INJECTION */(function(module) {'use strict';
  22806. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  22807. var root = __webpack_require__(17);
  22808. /** Detect free variable `exports`. */
  22809. var freeExports = ( false ? 'undefined' : _typeof(exports)) == 'object' && exports && !exports.nodeType && exports;
  22810. /** Detect free variable `module`. */
  22811. var freeModule = freeExports && ( false ? 'undefined' : _typeof(module)) == 'object' && module && !module.nodeType && module;
  22812. /** Detect the popular CommonJS extension `module.exports`. */
  22813. var moduleExports = freeModule && freeModule.exports === freeExports;
  22814. /** Built-in value references. */
  22815. var Buffer = moduleExports ? root.Buffer : undefined,
  22816. allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;
  22817. /**
  22818. * Creates a clone of `buffer`.
  22819. *
  22820. * @private
  22821. * @param {Buffer} buffer The buffer to clone.
  22822. * @param {boolean} [isDeep] Specify a deep clone.
  22823. * @returns {Buffer} Returns the cloned buffer.
  22824. */
  22825. function cloneBuffer(buffer, isDeep) {
  22826. if (isDeep) {
  22827. return buffer.slice();
  22828. }
  22829. var length = buffer.length,
  22830. result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  22831. buffer.copy(result);
  22832. return result;
  22833. }
  22834. module.exports = cloneBuffer;
  22835. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(39)(module)))
  22836. /***/ }),
  22837. /* 257 */
  22838. /***/ (function(module, exports, __webpack_require__) {
  22839. 'use strict';
  22840. var cloneArrayBuffer = __webpack_require__(167);
  22841. /**
  22842. * Creates a clone of `typedArray`.
  22843. *
  22844. * @private
  22845. * @param {Object} typedArray The typed array to clone.
  22846. * @param {boolean} [isDeep] Specify a deep clone.
  22847. * @returns {Object} Returns the cloned typed array.
  22848. */
  22849. function cloneTypedArray(typedArray, isDeep) {
  22850. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  22851. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  22852. }
  22853. module.exports = cloneTypedArray;
  22854. /***/ }),
  22855. /* 258 */
  22856. /***/ (function(module, exports, __webpack_require__) {
  22857. 'use strict';
  22858. var baseIteratee = __webpack_require__(61),
  22859. isArrayLike = __webpack_require__(24),
  22860. keys = __webpack_require__(32);
  22861. /**
  22862. * Creates a `_.find` or `_.findLast` function.
  22863. *
  22864. * @private
  22865. * @param {Function} findIndexFunc The function to find the collection index.
  22866. * @returns {Function} Returns the new find function.
  22867. */
  22868. function createFind(findIndexFunc) {
  22869. return function (collection, predicate, fromIndex) {
  22870. var iterable = Object(collection);
  22871. if (!isArrayLike(collection)) {
  22872. var iteratee = baseIteratee(predicate, 3);
  22873. collection = keys(collection);
  22874. predicate = function predicate(key) {
  22875. return iteratee(iterable[key], key, iterable);
  22876. };
  22877. }
  22878. var index = findIndexFunc(collection, predicate, fromIndex);
  22879. return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
  22880. };
  22881. }
  22882. module.exports = createFind;
  22883. /***/ }),
  22884. /* 259 */
  22885. /***/ (function(module, exports, __webpack_require__) {
  22886. 'use strict';
  22887. var getNative = __webpack_require__(38);
  22888. var defineProperty = function () {
  22889. try {
  22890. var func = getNative(Object, 'defineProperty');
  22891. func({}, '', {});
  22892. return func;
  22893. } catch (e) {}
  22894. }();
  22895. module.exports = defineProperty;
  22896. /***/ }),
  22897. /* 260 */
  22898. /***/ (function(module, exports, __webpack_require__) {
  22899. 'use strict';
  22900. var SetCache = __webpack_require__(242),
  22901. arraySome = __webpack_require__(482),
  22902. cacheHas = __webpack_require__(254);
  22903. /** Used to compose bitmasks for value comparisons. */
  22904. var COMPARE_PARTIAL_FLAG = 1,
  22905. COMPARE_UNORDERED_FLAG = 2;
  22906. /**
  22907. * A specialized version of `baseIsEqualDeep` for arrays with support for
  22908. * partial deep comparisons.
  22909. *
  22910. * @private
  22911. * @param {Array} array The array to compare.
  22912. * @param {Array} other The other array to compare.
  22913. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  22914. * @param {Function} customizer The function to customize comparisons.
  22915. * @param {Function} equalFunc The function to determine equivalents of values.
  22916. * @param {Object} stack Tracks traversed `array` and `other` objects.
  22917. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  22918. */
  22919. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  22920. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  22921. arrLength = array.length,
  22922. othLength = other.length;
  22923. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  22924. return false;
  22925. }
  22926. // Assume cyclic values are equal.
  22927. var stacked = stack.get(array);
  22928. if (stacked && stack.get(other)) {
  22929. return stacked == other;
  22930. }
  22931. var index = -1,
  22932. result = true,
  22933. seen = bitmask & COMPARE_UNORDERED_FLAG ? new SetCache() : undefined;
  22934. stack.set(array, other);
  22935. stack.set(other, array);
  22936. // Ignore non-index properties.
  22937. while (++index < arrLength) {
  22938. var arrValue = array[index],
  22939. othValue = other[index];
  22940. if (customizer) {
  22941. var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack);
  22942. }
  22943. if (compared !== undefined) {
  22944. if (compared) {
  22945. continue;
  22946. }
  22947. result = false;
  22948. break;
  22949. }
  22950. // Recursively compare arrays (susceptible to call stack limits).
  22951. if (seen) {
  22952. if (!arraySome(other, function (othValue, othIndex) {
  22953. if (!cacheHas(seen, othIndex) && (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  22954. return seen.push(othIndex);
  22955. }
  22956. })) {
  22957. result = false;
  22958. break;
  22959. }
  22960. } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  22961. result = false;
  22962. break;
  22963. }
  22964. }
  22965. stack['delete'](array);
  22966. stack['delete'](other);
  22967. return result;
  22968. }
  22969. module.exports = equalArrays;
  22970. /***/ }),
  22971. /* 261 */
  22972. /***/ (function(module, exports) {
  22973. /* WEBPACK VAR INJECTION */(function(global) {'use strict';
  22974. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  22975. /** Detect free variable `global` from Node.js. */
  22976. var freeGlobal = (typeof global === 'undefined' ? 'undefined' : _typeof(global)) == 'object' && global && global.Object === Object && global;
  22977. module.exports = freeGlobal;
  22978. /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
  22979. /***/ }),
  22980. /* 262 */
  22981. /***/ (function(module, exports, __webpack_require__) {
  22982. 'use strict';
  22983. var baseGetAllKeys = __webpack_require__(250),
  22984. getSymbols = __webpack_require__(170),
  22985. keys = __webpack_require__(32);
  22986. /**
  22987. * Creates an array of own enumerable property names and symbols of `object`.
  22988. *
  22989. * @private
  22990. * @param {Object} object The object to query.
  22991. * @returns {Array} Returns the array of property names and symbols.
  22992. */
  22993. function getAllKeys(object) {
  22994. return baseGetAllKeys(object, keys, getSymbols);
  22995. }
  22996. module.exports = getAllKeys;
  22997. /***/ }),
  22998. /* 263 */
  22999. /***/ (function(module, exports, __webpack_require__) {
  23000. 'use strict';
  23001. var arrayPush = __webpack_require__(161),
  23002. getPrototype = __webpack_require__(169),
  23003. getSymbols = __webpack_require__(170),
  23004. stubArray = __webpack_require__(279);
  23005. /* Built-in method references for those with the same name as other `lodash` methods. */
  23006. var nativeGetSymbols = Object.getOwnPropertySymbols;
  23007. /**
  23008. * Creates an array of the own and inherited enumerable symbols of `object`.
  23009. *
  23010. * @private
  23011. * @param {Object} object The object to query.
  23012. * @returns {Array} Returns the array of symbols.
  23013. */
  23014. var getSymbolsIn = !nativeGetSymbols ? stubArray : function (object) {
  23015. var result = [];
  23016. while (object) {
  23017. arrayPush(result, getSymbols(object));
  23018. object = getPrototype(object);
  23019. }
  23020. return result;
  23021. };
  23022. module.exports = getSymbolsIn;
  23023. /***/ }),
  23024. /* 264 */
  23025. /***/ (function(module, exports, __webpack_require__) {
  23026. 'use strict';
  23027. var DataView = __webpack_require__(472),
  23028. Map = __webpack_require__(159),
  23029. Promise = __webpack_require__(474),
  23030. Set = __webpack_require__(241),
  23031. WeakMap = __webpack_require__(475),
  23032. baseGetTag = __webpack_require__(30),
  23033. toSource = __webpack_require__(272);
  23034. /** `Object#toString` result references. */
  23035. var mapTag = '[object Map]',
  23036. objectTag = '[object Object]',
  23037. promiseTag = '[object Promise]',
  23038. setTag = '[object Set]',
  23039. weakMapTag = '[object WeakMap]';
  23040. var dataViewTag = '[object DataView]';
  23041. /** Used to detect maps, sets, and weakmaps. */
  23042. var dataViewCtorString = toSource(DataView),
  23043. mapCtorString = toSource(Map),
  23044. promiseCtorString = toSource(Promise),
  23045. setCtorString = toSource(Set),
  23046. weakMapCtorString = toSource(WeakMap);
  23047. /**
  23048. * Gets the `toStringTag` of `value`.
  23049. *
  23050. * @private
  23051. * @param {*} value The value to query.
  23052. * @returns {string} Returns the `toStringTag`.
  23053. */
  23054. var getTag = baseGetTag;
  23055. // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
  23056. if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map && getTag(new Map()) != mapTag || Promise && getTag(Promise.resolve()) != promiseTag || Set && getTag(new Set()) != setTag || WeakMap && getTag(new WeakMap()) != weakMapTag) {
  23057. getTag = function getTag(value) {
  23058. var result = baseGetTag(value),
  23059. Ctor = result == objectTag ? value.constructor : undefined,
  23060. ctorString = Ctor ? toSource(Ctor) : '';
  23061. if (ctorString) {
  23062. switch (ctorString) {
  23063. case dataViewCtorString:
  23064. return dataViewTag;
  23065. case mapCtorString:
  23066. return mapTag;
  23067. case promiseCtorString:
  23068. return promiseTag;
  23069. case setCtorString:
  23070. return setTag;
  23071. case weakMapCtorString:
  23072. return weakMapTag;
  23073. }
  23074. }
  23075. return result;
  23076. };
  23077. }
  23078. module.exports = getTag;
  23079. /***/ }),
  23080. /* 265 */
  23081. /***/ (function(module, exports, __webpack_require__) {
  23082. 'use strict';
  23083. var castPath = __webpack_require__(255),
  23084. isArguments = __webpack_require__(112),
  23085. isArray = __webpack_require__(6),
  23086. isIndex = __webpack_require__(171),
  23087. isLength = __webpack_require__(176),
  23088. toKey = __webpack_require__(108);
  23089. /**
  23090. * Checks if `path` exists on `object`.
  23091. *
  23092. * @private
  23093. * @param {Object} object The object to query.
  23094. * @param {Array|string} path The path to check.
  23095. * @param {Function} hasFunc The function to check properties.
  23096. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  23097. */
  23098. function hasPath(object, path, hasFunc) {
  23099. path = castPath(path, object);
  23100. var index = -1,
  23101. length = path.length,
  23102. result = false;
  23103. while (++index < length) {
  23104. var key = toKey(path[index]);
  23105. if (!(result = object != null && hasFunc(object, key))) {
  23106. break;
  23107. }
  23108. object = object[key];
  23109. }
  23110. if (result || ++index != length) {
  23111. return result;
  23112. }
  23113. length = object == null ? 0 : object.length;
  23114. return !!length && isLength(length) && isIndex(key, length) && (isArray(object) || isArguments(object));
  23115. }
  23116. module.exports = hasPath;
  23117. /***/ }),
  23118. /* 266 */
  23119. /***/ (function(module, exports, __webpack_require__) {
  23120. 'use strict';
  23121. var baseCreate = __webpack_require__(486),
  23122. getPrototype = __webpack_require__(169),
  23123. isPrototype = __webpack_require__(105);
  23124. /**
  23125. * Initializes an object clone.
  23126. *
  23127. * @private
  23128. * @param {Object} object The object to clone.
  23129. * @returns {Object} Returns the initialized clone.
  23130. */
  23131. function initCloneObject(object) {
  23132. return typeof object.constructor == 'function' && !isPrototype(object) ? baseCreate(getPrototype(object)) : {};
  23133. }
  23134. module.exports = initCloneObject;
  23135. /***/ }),
  23136. /* 267 */
  23137. /***/ (function(module, exports, __webpack_require__) {
  23138. 'use strict';
  23139. var isObject = __webpack_require__(18);
  23140. /**
  23141. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  23142. *
  23143. * @private
  23144. * @param {*} value The value to check.
  23145. * @returns {boolean} Returns `true` if `value` if suitable for strict
  23146. * equality comparisons, else `false`.
  23147. */
  23148. function isStrictComparable(value) {
  23149. return value === value && !isObject(value);
  23150. }
  23151. module.exports = isStrictComparable;
  23152. /***/ }),
  23153. /* 268 */
  23154. /***/ (function(module, exports) {
  23155. "use strict";
  23156. /**
  23157. * Converts `map` to its key-value pairs.
  23158. *
  23159. * @private
  23160. * @param {Object} map The map to convert.
  23161. * @returns {Array} Returns the key-value pairs.
  23162. */
  23163. function mapToArray(map) {
  23164. var index = -1,
  23165. result = Array(map.size);
  23166. map.forEach(function (value, key) {
  23167. result[++index] = [key, value];
  23168. });
  23169. return result;
  23170. }
  23171. module.exports = mapToArray;
  23172. /***/ }),
  23173. /* 269 */
  23174. /***/ (function(module, exports) {
  23175. "use strict";
  23176. /**
  23177. * A specialized version of `matchesProperty` for source values suitable
  23178. * for strict equality comparisons, i.e. `===`.
  23179. *
  23180. * @private
  23181. * @param {string} key The key of the property to get.
  23182. * @param {*} srcValue The value to match.
  23183. * @returns {Function} Returns the new spec function.
  23184. */
  23185. function matchesStrictComparable(key, srcValue) {
  23186. return function (object) {
  23187. if (object == null) {
  23188. return false;
  23189. }
  23190. return object[key] === srcValue && (srcValue !== undefined || key in Object(object));
  23191. };
  23192. }
  23193. module.exports = matchesStrictComparable;
  23194. /***/ }),
  23195. /* 270 */
  23196. /***/ (function(module, exports, __webpack_require__) {
  23197. /* WEBPACK VAR INJECTION */(function(module) {'use strict';
  23198. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  23199. var freeGlobal = __webpack_require__(261);
  23200. /** Detect free variable `exports`. */
  23201. var freeExports = ( false ? 'undefined' : _typeof(exports)) == 'object' && exports && !exports.nodeType && exports;
  23202. /** Detect free variable `module`. */
  23203. var freeModule = freeExports && ( false ? 'undefined' : _typeof(module)) == 'object' && module && !module.nodeType && module;
  23204. /** Detect the popular CommonJS extension `module.exports`. */
  23205. var moduleExports = freeModule && freeModule.exports === freeExports;
  23206. /** Detect free variable `process` from Node.js. */
  23207. var freeProcess = moduleExports && freeGlobal.process;
  23208. /** Used to access faster Node.js helpers. */
  23209. var nodeUtil = function () {
  23210. try {
  23211. return freeProcess && freeProcess.binding && freeProcess.binding('util');
  23212. } catch (e) {}
  23213. }();
  23214. module.exports = nodeUtil;
  23215. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(39)(module)))
  23216. /***/ }),
  23217. /* 271 */
  23218. /***/ (function(module, exports) {
  23219. "use strict";
  23220. /**
  23221. * Creates a unary function that invokes `func` with its argument transformed.
  23222. *
  23223. * @private
  23224. * @param {Function} func The function to wrap.
  23225. * @param {Function} transform The argument transform.
  23226. * @returns {Function} Returns the new function.
  23227. */
  23228. function overArg(func, transform) {
  23229. return function (arg) {
  23230. return func(transform(arg));
  23231. };
  23232. }
  23233. module.exports = overArg;
  23234. /***/ }),
  23235. /* 272 */
  23236. /***/ (function(module, exports) {
  23237. 'use strict';
  23238. /** Used for built-in method references. */
  23239. var funcProto = Function.prototype;
  23240. /** Used to resolve the decompiled source of functions. */
  23241. var funcToString = funcProto.toString;
  23242. /**
  23243. * Converts `func` to its source code.
  23244. *
  23245. * @private
  23246. * @param {Function} func The function to convert.
  23247. * @returns {string} Returns the source code.
  23248. */
  23249. function toSource(func) {
  23250. if (func != null) {
  23251. try {
  23252. return funcToString.call(func);
  23253. } catch (e) {}
  23254. try {
  23255. return func + '';
  23256. } catch (e) {}
  23257. }
  23258. return '';
  23259. }
  23260. module.exports = toSource;
  23261. /***/ }),
  23262. /* 273 */
  23263. /***/ (function(module, exports, __webpack_require__) {
  23264. 'use strict';
  23265. var apply = __webpack_require__(244),
  23266. assignInWith = __webpack_require__(573),
  23267. baseRest = __webpack_require__(101),
  23268. customDefaultsAssignIn = __webpack_require__(529);
  23269. /**
  23270. * Assigns own and inherited enumerable string keyed properties of source
  23271. * objects to the destination object for all destination properties that
  23272. * resolve to `undefined`. Source objects are applied from left to right.
  23273. * Once a property is set, additional values of the same property are ignored.
  23274. *
  23275. * **Note:** This method mutates `object`.
  23276. *
  23277. * @static
  23278. * @since 0.1.0
  23279. * @memberOf _
  23280. * @category Object
  23281. * @param {Object} object The destination object.
  23282. * @param {...Object} [sources] The source objects.
  23283. * @returns {Object} Returns `object`.
  23284. * @see _.defaultsDeep
  23285. * @example
  23286. *
  23287. * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  23288. * // => { 'a': 1, 'b': 2 }
  23289. */
  23290. var defaults = baseRest(function (args) {
  23291. args.push(undefined, customDefaultsAssignIn);
  23292. return apply(assignInWith, undefined, args);
  23293. });
  23294. module.exports = defaults;
  23295. /***/ }),
  23296. /* 274 */
  23297. /***/ (function(module, exports, __webpack_require__) {
  23298. 'use strict';
  23299. var baseHas = __webpack_require__(490),
  23300. hasPath = __webpack_require__(265);
  23301. /**
  23302. * Checks if `path` is a direct property of `object`.
  23303. *
  23304. * @static
  23305. * @since 0.1.0
  23306. * @memberOf _
  23307. * @category Object
  23308. * @param {Object} object The object to query.
  23309. * @param {Array|string} path The path to check.
  23310. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  23311. * @example
  23312. *
  23313. * var object = { 'a': { 'b': 2 } };
  23314. * var other = _.create({ 'a': _.create({ 'b': 2 }) });
  23315. *
  23316. * _.has(object, 'a');
  23317. * // => true
  23318. *
  23319. * _.has(object, 'a.b');
  23320. * // => true
  23321. *
  23322. * _.has(object, ['a', 'b']);
  23323. * // => true
  23324. *
  23325. * _.has(other, 'a');
  23326. * // => false
  23327. */
  23328. function has(object, path) {
  23329. return object != null && hasPath(object, path, baseHas);
  23330. }
  23331. module.exports = has;
  23332. /***/ }),
  23333. /* 275 */
  23334. /***/ (function(module, exports, __webpack_require__) {
  23335. 'use strict';
  23336. var baseGetTag = __webpack_require__(30),
  23337. getPrototype = __webpack_require__(169),
  23338. isObjectLike = __webpack_require__(25);
  23339. /** `Object#toString` result references. */
  23340. var objectTag = '[object Object]';
  23341. /** Used for built-in method references. */
  23342. var funcProto = Function.prototype,
  23343. objectProto = Object.prototype;
  23344. /** Used to resolve the decompiled source of functions. */
  23345. var funcToString = funcProto.toString;
  23346. /** Used to check objects for own properties. */
  23347. var hasOwnProperty = objectProto.hasOwnProperty;
  23348. /** Used to infer the `Object` constructor. */
  23349. var objectCtorString = funcToString.call(Object);
  23350. /**
  23351. * Checks if `value` is a plain object, that is, an object created by the
  23352. * `Object` constructor or one with a `[[Prototype]]` of `null`.
  23353. *
  23354. * @static
  23355. * @memberOf _
  23356. * @since 0.8.0
  23357. * @category Lang
  23358. * @param {*} value The value to check.
  23359. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
  23360. * @example
  23361. *
  23362. * function Foo() {
  23363. * this.a = 1;
  23364. * }
  23365. *
  23366. * _.isPlainObject(new Foo);
  23367. * // => false
  23368. *
  23369. * _.isPlainObject([1, 2, 3]);
  23370. * // => false
  23371. *
  23372. * _.isPlainObject({ 'x': 0, 'y': 0 });
  23373. * // => true
  23374. *
  23375. * _.isPlainObject(Object.create(null));
  23376. * // => true
  23377. */
  23378. function isPlainObject(value) {
  23379. if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
  23380. return false;
  23381. }
  23382. var proto = getPrototype(value);
  23383. if (proto === null) {
  23384. return true;
  23385. }
  23386. var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  23387. return typeof Ctor == 'function' && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString;
  23388. }
  23389. module.exports = isPlainObject;
  23390. /***/ }),
  23391. /* 276 */
  23392. /***/ (function(module, exports, __webpack_require__) {
  23393. 'use strict';
  23394. var baseIsRegExp = __webpack_require__(498),
  23395. baseUnary = __webpack_require__(102),
  23396. nodeUtil = __webpack_require__(270);
  23397. /* Node.js helper references. */
  23398. var nodeIsRegExp = nodeUtil && nodeUtil.isRegExp;
  23399. /**
  23400. * Checks if `value` is classified as a `RegExp` object.
  23401. *
  23402. * @static
  23403. * @memberOf _
  23404. * @since 0.1.0
  23405. * @category Lang
  23406. * @param {*} value The value to check.
  23407. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  23408. * @example
  23409. *
  23410. * _.isRegExp(/abc/);
  23411. * // => true
  23412. *
  23413. * _.isRegExp('/abc/');
  23414. * // => false
  23415. */
  23416. var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
  23417. module.exports = isRegExp;
  23418. /***/ }),
  23419. /* 277 */
  23420. /***/ (function(module, exports, __webpack_require__) {
  23421. 'use strict';
  23422. var baseRest = __webpack_require__(101),
  23423. pullAll = __webpack_require__(593);
  23424. /**
  23425. * Removes all given values from `array` using
  23426. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  23427. * for equality comparisons.
  23428. *
  23429. * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
  23430. * to remove elements from an array by predicate.
  23431. *
  23432. * @static
  23433. * @memberOf _
  23434. * @since 2.0.0
  23435. * @category Array
  23436. * @param {Array} array The array to modify.
  23437. * @param {...*} [values] The values to remove.
  23438. * @returns {Array} Returns `array`.
  23439. * @example
  23440. *
  23441. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  23442. *
  23443. * _.pull(array, 'a', 'c');
  23444. * console.log(array);
  23445. * // => ['b', 'b']
  23446. */
  23447. var pull = baseRest(pullAll);
  23448. module.exports = pull;
  23449. /***/ }),
  23450. /* 278 */
  23451. /***/ (function(module, exports, __webpack_require__) {
  23452. 'use strict';
  23453. var baseRepeat = __webpack_require__(510),
  23454. isIterateeCall = __webpack_require__(172),
  23455. toInteger = __webpack_require__(48),
  23456. toString = __webpack_require__(114);
  23457. /**
  23458. * Repeats the given string `n` times.
  23459. *
  23460. * @static
  23461. * @memberOf _
  23462. * @since 3.0.0
  23463. * @category String
  23464. * @param {string} [string=''] The string to repeat.
  23465. * @param {number} [n=1] The number of times to repeat the string.
  23466. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  23467. * @returns {string} Returns the repeated string.
  23468. * @example
  23469. *
  23470. * _.repeat('*', 3);
  23471. * // => '***'
  23472. *
  23473. * _.repeat('abc', 2);
  23474. * // => 'abcabc'
  23475. *
  23476. * _.repeat('abc', 0);
  23477. * // => ''
  23478. */
  23479. function repeat(string, n, guard) {
  23480. if (guard ? isIterateeCall(string, n, guard) : n === undefined) {
  23481. n = 1;
  23482. } else {
  23483. n = toInteger(n);
  23484. }
  23485. return baseRepeat(toString(string), n);
  23486. }
  23487. module.exports = repeat;
  23488. /***/ }),
  23489. /* 279 */
  23490. /***/ (function(module, exports) {
  23491. "use strict";
  23492. /**
  23493. * This method returns a new empty array.
  23494. *
  23495. * @static
  23496. * @memberOf _
  23497. * @since 4.13.0
  23498. * @category Util
  23499. * @returns {Array} Returns the new empty array.
  23500. * @example
  23501. *
  23502. * var arrays = _.times(2, _.stubArray);
  23503. *
  23504. * console.log(arrays);
  23505. * // => [[], []]
  23506. *
  23507. * console.log(arrays[0] === arrays[1]);
  23508. * // => false
  23509. */
  23510. function stubArray() {
  23511. return [];
  23512. }
  23513. module.exports = stubArray;
  23514. /***/ }),
  23515. /* 280 */
  23516. /***/ (function(module, exports, __webpack_require__) {
  23517. 'use strict';
  23518. var baseValues = __webpack_require__(515),
  23519. keys = __webpack_require__(32);
  23520. /**
  23521. * Creates an array of the own enumerable string keyed property values of `object`.
  23522. *
  23523. * **Note:** Non-object values are coerced to objects.
  23524. *
  23525. * @static
  23526. * @since 0.1.0
  23527. * @memberOf _
  23528. * @category Object
  23529. * @param {Object} object The object to query.
  23530. * @returns {Array} Returns the array of property values.
  23531. * @example
  23532. *
  23533. * function Foo() {
  23534. * this.a = 1;
  23535. * this.b = 2;
  23536. * }
  23537. *
  23538. * Foo.prototype.c = 3;
  23539. *
  23540. * _.values(new Foo);
  23541. * // => [1, 2] (iteration order is not guaranteed)
  23542. *
  23543. * _.values('hi');
  23544. * // => ['h', 'i']
  23545. */
  23546. function values(object) {
  23547. return object == null ? [] : baseValues(object, keys(object));
  23548. }
  23549. module.exports = values;
  23550. /***/ }),
  23551. /* 281 */
  23552. /***/ (function(module, exports) {
  23553. "use strict";
  23554. var originalObject = Object;
  23555. var originalDefProp = Object.defineProperty;
  23556. var originalCreate = Object.create;
  23557. function defProp(obj, name, value) {
  23558. if (originalDefProp) try {
  23559. originalDefProp.call(originalObject, obj, name, { value: value });
  23560. } catch (definePropertyIsBrokenInIE8) {
  23561. obj[name] = value;
  23562. } else {
  23563. obj[name] = value;
  23564. }
  23565. }
  23566. // For functions that will be invoked using .call or .apply, we need to
  23567. // define those methods on the function objects themselves, rather than
  23568. // inheriting them from Function.prototype, so that a malicious or clumsy
  23569. // third party cannot interfere with the functionality of this module by
  23570. // redefining Function.prototype.call or .apply.
  23571. function makeSafeToCall(fun) {
  23572. if (fun) {
  23573. defProp(fun, "call", fun.call);
  23574. defProp(fun, "apply", fun.apply);
  23575. }
  23576. return fun;
  23577. }
  23578. makeSafeToCall(originalDefProp);
  23579. makeSafeToCall(originalCreate);
  23580. var hasOwn = makeSafeToCall(Object.prototype.hasOwnProperty);
  23581. var numToStr = makeSafeToCall(Number.prototype.toString);
  23582. var strSlice = makeSafeToCall(String.prototype.slice);
  23583. var cloner = function cloner() {};
  23584. function create(prototype) {
  23585. if (originalCreate) {
  23586. return originalCreate.call(originalObject, prototype);
  23587. }
  23588. cloner.prototype = prototype || null;
  23589. return new cloner();
  23590. }
  23591. var rand = Math.random;
  23592. var uniqueKeys = create(null);
  23593. function makeUniqueKey() {
  23594. // Collisions are highly unlikely, but this module is in the business of
  23595. // making guarantees rather than safe bets.
  23596. do {
  23597. var uniqueKey = internString(strSlice.call(numToStr.call(rand(), 36), 2));
  23598. } while (hasOwn.call(uniqueKeys, uniqueKey));
  23599. return uniqueKeys[uniqueKey] = uniqueKey;
  23600. }
  23601. function internString(str) {
  23602. var obj = {};
  23603. obj[str] = true;
  23604. return Object.keys(obj)[0];
  23605. }
  23606. // External users might find this function useful, but it is not necessary
  23607. // for the typical use of this module.
  23608. exports.makeUniqueKey = makeUniqueKey;
  23609. // Object.getOwnPropertyNames is the only way to enumerate non-enumerable
  23610. // properties, so if we wrap it to ignore our secret keys, there should be
  23611. // no way (except guessing) to access those properties.
  23612. var originalGetOPNs = Object.getOwnPropertyNames;
  23613. Object.getOwnPropertyNames = function getOwnPropertyNames(object) {
  23614. for (var names = originalGetOPNs(object), src = 0, dst = 0, len = names.length; src < len; ++src) {
  23615. if (!hasOwn.call(uniqueKeys, names[src])) {
  23616. if (src > dst) {
  23617. names[dst] = names[src];
  23618. }
  23619. ++dst;
  23620. }
  23621. }
  23622. names.length = dst;
  23623. return names;
  23624. };
  23625. function defaultCreatorFn(object) {
  23626. return create(null);
  23627. }
  23628. function makeAccessor(secretCreatorFn) {
  23629. var brand = makeUniqueKey();
  23630. var passkey = create(null);
  23631. secretCreatorFn = secretCreatorFn || defaultCreatorFn;
  23632. function register(object) {
  23633. var secret; // Created lazily.
  23634. function vault(key, forget) {
  23635. // Only code that has access to the passkey can retrieve (or forget)
  23636. // the secret object.
  23637. if (key === passkey) {
  23638. return forget ? secret = null : secret || (secret = secretCreatorFn(object));
  23639. }
  23640. }
  23641. defProp(object, brand, vault);
  23642. }
  23643. function accessor(object) {
  23644. if (!hasOwn.call(object, brand)) register(object);
  23645. return object[brand](passkey);
  23646. }
  23647. accessor.forget = function (object) {
  23648. if (hasOwn.call(object, brand)) object[brand](passkey, true);
  23649. };
  23650. return accessor;
  23651. }
  23652. exports.makeAccessor = makeAccessor;
  23653. /***/ }),
  23654. /* 282 */
  23655. /***/ (function(module, exports, __webpack_require__) {
  23656. var __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(module, global) {'use strict';
  23657. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  23658. /*! https://mths.be/regenerate v1.3.2 by @mathias | MIT license */
  23659. ;(function (root) {
  23660. // Detect free variables `exports`.
  23661. var freeExports = ( false ? 'undefined' : _typeof(exports)) == 'object' && exports;
  23662. // Detect free variable `module`.
  23663. var freeModule = ( false ? 'undefined' : _typeof(module)) == 'object' && module && module.exports == freeExports && module;
  23664. // Detect free variable `global`, from Node.js/io.js or Browserified code,
  23665. // and use it as `root`.
  23666. var freeGlobal = (typeof global === 'undefined' ? 'undefined' : _typeof(global)) == 'object' && global;
  23667. if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) {
  23668. root = freeGlobal;
  23669. }
  23670. /*--------------------------------------------------------------------------*/
  23671. var ERRORS = {
  23672. 'rangeOrder': 'A range\u2019s `stop` value must be greater than or equal ' + 'to the `start` value.',
  23673. 'codePointRange': 'Invalid code point value. Code points range from ' + 'U+000000 to U+10FFFF.'
  23674. };
  23675. // https://mathiasbynens.be/notes/javascript-encoding#surrogate-pairs
  23676. var HIGH_SURROGATE_MIN = 0xD800;
  23677. var HIGH_SURROGATE_MAX = 0xDBFF;
  23678. var LOW_SURROGATE_MIN = 0xDC00;
  23679. var LOW_SURROGATE_MAX = 0xDFFF;
  23680. // In Regenerate output, `\0` is never preceded by `\` because we sort by
  23681. // code point value, so let’s keep this regular expression simple.
  23682. var regexNull = /\\x00([^0123456789]|$)/g;
  23683. var object = {};
  23684. var hasOwnProperty = object.hasOwnProperty;
  23685. var extend = function extend(destination, source) {
  23686. var key;
  23687. for (key in source) {
  23688. if (hasOwnProperty.call(source, key)) {
  23689. destination[key] = source[key];
  23690. }
  23691. }
  23692. return destination;
  23693. };
  23694. var forEach = function forEach(array, callback) {
  23695. var index = -1;
  23696. var length = array.length;
  23697. while (++index < length) {
  23698. callback(array[index], index);
  23699. }
  23700. };
  23701. var toString = object.toString;
  23702. var isArray = function isArray(value) {
  23703. return toString.call(value) == '[object Array]';
  23704. };
  23705. var isNumber = function isNumber(value) {
  23706. return typeof value == 'number' || toString.call(value) == '[object Number]';
  23707. };
  23708. // This assumes that `number` is a positive integer that `toString()`s nicely
  23709. // (which is the case for all code point values).
  23710. var zeroes = '0000';
  23711. var pad = function pad(number, totalCharacters) {
  23712. var string = String(number);
  23713. return string.length < totalCharacters ? (zeroes + string).slice(-totalCharacters) : string;
  23714. };
  23715. var hex = function hex(number) {
  23716. return Number(number).toString(16).toUpperCase();
  23717. };
  23718. var slice = [].slice;
  23719. /*--------------------------------------------------------------------------*/
  23720. var dataFromCodePoints = function dataFromCodePoints(codePoints) {
  23721. var index = -1;
  23722. var length = codePoints.length;
  23723. var max = length - 1;
  23724. var result = [];
  23725. var isStart = true;
  23726. var tmp;
  23727. var previous = 0;
  23728. while (++index < length) {
  23729. tmp = codePoints[index];
  23730. if (isStart) {
  23731. result.push(tmp);
  23732. previous = tmp;
  23733. isStart = false;
  23734. } else {
  23735. if (tmp == previous + 1) {
  23736. if (index != max) {
  23737. previous = tmp;
  23738. continue;
  23739. } else {
  23740. isStart = true;
  23741. result.push(tmp + 1);
  23742. }
  23743. } else {
  23744. // End the previous range and start a new one.
  23745. result.push(previous + 1, tmp);
  23746. previous = tmp;
  23747. }
  23748. }
  23749. }
  23750. if (!isStart) {
  23751. result.push(tmp + 1);
  23752. }
  23753. return result;
  23754. };
  23755. var dataRemove = function dataRemove(data, codePoint) {
  23756. // Iterate over the data per `(start, end)` pair.
  23757. var index = 0;
  23758. var start;
  23759. var end;
  23760. var length = data.length;
  23761. while (index < length) {
  23762. start = data[index];
  23763. end = data[index + 1];
  23764. if (codePoint >= start && codePoint < end) {
  23765. // Modify this pair.
  23766. if (codePoint == start) {
  23767. if (end == start + 1) {
  23768. // Just remove `start` and `end`.
  23769. data.splice(index, 2);
  23770. return data;
  23771. } else {
  23772. // Just replace `start` with a new value.
  23773. data[index] = codePoint + 1;
  23774. return data;
  23775. }
  23776. } else if (codePoint == end - 1) {
  23777. // Just replace `end` with a new value.
  23778. data[index + 1] = codePoint;
  23779. return data;
  23780. } else {
  23781. // Replace `[start, end]` with `[startA, endA, startB, endB]`.
  23782. data.splice(index, 2, start, codePoint, codePoint + 1, end);
  23783. return data;
  23784. }
  23785. }
  23786. index += 2;
  23787. }
  23788. return data;
  23789. };
  23790. var dataRemoveRange = function dataRemoveRange(data, rangeStart, rangeEnd) {
  23791. if (rangeEnd < rangeStart) {
  23792. throw Error(ERRORS.rangeOrder);
  23793. }
  23794. // Iterate over the data per `(start, end)` pair.
  23795. var index = 0;
  23796. var start;
  23797. var end;
  23798. while (index < data.length) {
  23799. start = data[index];
  23800. end = data[index + 1] - 1; // Note: the `- 1` makes `end` inclusive.
  23801. // Exit as soon as no more matching pairs can be found.
  23802. if (start > rangeEnd) {
  23803. return data;
  23804. }
  23805. // Check if this range pair is equal to, or forms a subset of, the range
  23806. // to be removed.
  23807. // E.g. we have `[0, 11, 40, 51]` and want to remove 0-10 → `[40, 51]`.
  23808. // E.g. we have `[40, 51]` and want to remove 0-100 → `[]`.
  23809. if (rangeStart <= start && rangeEnd >= end) {
  23810. // Remove this pair.
  23811. data.splice(index, 2);
  23812. continue;
  23813. }
  23814. // Check if both `rangeStart` and `rangeEnd` are within the bounds of
  23815. // this pair.
  23816. // E.g. we have `[0, 11]` and want to remove 4-6 → `[0, 4, 7, 11]`.
  23817. if (rangeStart >= start && rangeEnd < end) {
  23818. if (rangeStart == start) {
  23819. // Replace `[start, end]` with `[startB, endB]`.
  23820. data[index] = rangeEnd + 1;
  23821. data[index + 1] = end + 1;
  23822. return data;
  23823. }
  23824. // Replace `[start, end]` with `[startA, endA, startB, endB]`.
  23825. data.splice(index, 2, start, rangeStart, rangeEnd + 1, end + 1);
  23826. return data;
  23827. }
  23828. // Check if only `rangeStart` is within the bounds of this pair.
  23829. // E.g. we have `[0, 11]` and want to remove 4-20 → `[0, 4]`.
  23830. if (rangeStart >= start && rangeStart <= end) {
  23831. // Replace `end` with `rangeStart`.
  23832. data[index + 1] = rangeStart;
  23833. // Note: we cannot `return` just yet, in case any following pairs still
  23834. // contain matching code points.
  23835. // E.g. we have `[0, 11, 14, 31]` and want to remove 4-20
  23836. // → `[0, 4, 21, 31]`.
  23837. }
  23838. // Check if only `rangeEnd` is within the bounds of this pair.
  23839. // E.g. we have `[14, 31]` and want to remove 4-20 → `[21, 31]`.
  23840. else if (rangeEnd >= start && rangeEnd <= end) {
  23841. // Just replace `start`.
  23842. data[index] = rangeEnd + 1;
  23843. return data;
  23844. }
  23845. index += 2;
  23846. }
  23847. return data;
  23848. };
  23849. var dataAdd = function dataAdd(data, codePoint) {
  23850. // Iterate over the data per `(start, end)` pair.
  23851. var index = 0;
  23852. var start;
  23853. var end;
  23854. var lastIndex = null;
  23855. var length = data.length;
  23856. if (codePoint < 0x0 || codePoint > 0x10FFFF) {
  23857. throw RangeError(ERRORS.codePointRange);
  23858. }
  23859. while (index < length) {
  23860. start = data[index];
  23861. end = data[index + 1];
  23862. // Check if the code point is already in the set.
  23863. if (codePoint >= start && codePoint < end) {
  23864. return data;
  23865. }
  23866. if (codePoint == start - 1) {
  23867. // Just replace `start` with a new value.
  23868. data[index] = codePoint;
  23869. return data;
  23870. }
  23871. // At this point, if `start` is `greater` than `codePoint`, insert a new
  23872. // `[start, end]` pair before the current pair, or after the current pair
  23873. // if there is a known `lastIndex`.
  23874. if (start > codePoint) {
  23875. data.splice(lastIndex != null ? lastIndex + 2 : 0, 0, codePoint, codePoint + 1);
  23876. return data;
  23877. }
  23878. if (codePoint == end) {
  23879. // Check if adding this code point causes two separate ranges to become
  23880. // a single range, e.g. `dataAdd([0, 4, 5, 10], 4)` → `[0, 10]`.
  23881. if (codePoint + 1 == data[index + 2]) {
  23882. data.splice(index, 4, start, data[index + 3]);
  23883. return data;
  23884. }
  23885. // Else, just replace `end` with a new value.
  23886. data[index + 1] = codePoint + 1;
  23887. return data;
  23888. }
  23889. lastIndex = index;
  23890. index += 2;
  23891. }
  23892. // The loop has finished; add the new pair to the end of the data set.
  23893. data.push(codePoint, codePoint + 1);
  23894. return data;
  23895. };
  23896. var dataAddData = function dataAddData(dataA, dataB) {
  23897. // Iterate over the data per `(start, end)` pair.
  23898. var index = 0;
  23899. var start;
  23900. var end;
  23901. var data = dataA.slice();
  23902. var length = dataB.length;
  23903. while (index < length) {
  23904. start = dataB[index];
  23905. end = dataB[index + 1] - 1;
  23906. if (start == end) {
  23907. data = dataAdd(data, start);
  23908. } else {
  23909. data = dataAddRange(data, start, end);
  23910. }
  23911. index += 2;
  23912. }
  23913. return data;
  23914. };
  23915. var dataRemoveData = function dataRemoveData(dataA, dataB) {
  23916. // Iterate over the data per `(start, end)` pair.
  23917. var index = 0;
  23918. var start;
  23919. var end;
  23920. var data = dataA.slice();
  23921. var length = dataB.length;
  23922. while (index < length) {
  23923. start = dataB[index];
  23924. end = dataB[index + 1] - 1;
  23925. if (start == end) {
  23926. data = dataRemove(data, start);
  23927. } else {
  23928. data = dataRemoveRange(data, start, end);
  23929. }
  23930. index += 2;
  23931. }
  23932. return data;
  23933. };
  23934. var dataAddRange = function dataAddRange(data, rangeStart, rangeEnd) {
  23935. if (rangeEnd < rangeStart) {
  23936. throw Error(ERRORS.rangeOrder);
  23937. }
  23938. if (rangeStart < 0x0 || rangeStart > 0x10FFFF || rangeEnd < 0x0 || rangeEnd > 0x10FFFF) {
  23939. throw RangeError(ERRORS.codePointRange);
  23940. }
  23941. // Iterate over the data per `(start, end)` pair.
  23942. var index = 0;
  23943. var start;
  23944. var end;
  23945. var added = false;
  23946. var length = data.length;
  23947. while (index < length) {
  23948. start = data[index];
  23949. end = data[index + 1];
  23950. if (added) {
  23951. // The range has already been added to the set; at this point, we just
  23952. // need to get rid of the following ranges in case they overlap.
  23953. // Check if this range can be combined with the previous range.
  23954. if (start == rangeEnd + 1) {
  23955. data.splice(index - 1, 2);
  23956. return data;
  23957. }
  23958. // Exit as soon as no more possibly overlapping pairs can be found.
  23959. if (start > rangeEnd) {
  23960. return data;
  23961. }
  23962. // E.g. `[0, 11, 12, 16]` and we’ve added 5-15, so we now have
  23963. // `[0, 16, 12, 16]`. Remove the `12,16` part, as it lies within the
  23964. // `0,16` range that was previously added.
  23965. if (start >= rangeStart && start <= rangeEnd) {
  23966. // `start` lies within the range that was previously added.
  23967. if (end > rangeStart && end - 1 <= rangeEnd) {
  23968. // `end` lies within the range that was previously added as well,
  23969. // so remove this pair.
  23970. data.splice(index, 2);
  23971. index -= 2;
  23972. // Note: we cannot `return` just yet, as there may still be other
  23973. // overlapping pairs.
  23974. } else {
  23975. // `start` lies within the range that was previously added, but
  23976. // `end` doesn’t. E.g. `[0, 11, 12, 31]` and we’ve added 5-15, so
  23977. // now we have `[0, 16, 12, 31]`. This must be written as `[0, 31]`.
  23978. // Remove the previously added `end` and the current `start`.
  23979. data.splice(index - 1, 2);
  23980. index -= 2;
  23981. }
  23982. // Note: we cannot return yet.
  23983. }
  23984. } else if (start == rangeEnd + 1) {
  23985. data[index] = rangeStart;
  23986. return data;
  23987. }
  23988. // Check if a new pair must be inserted *before* the current one.
  23989. else if (start > rangeEnd) {
  23990. data.splice(index, 0, rangeStart, rangeEnd + 1);
  23991. return data;
  23992. } else if (rangeStart >= start && rangeStart < end && rangeEnd + 1 <= end) {
  23993. // The new range lies entirely within an existing range pair. No action
  23994. // needed.
  23995. return data;
  23996. } else if (
  23997. // E.g. `[0, 11]` and you add 5-15 → `[0, 16]`.
  23998. rangeStart >= start && rangeStart < end ||
  23999. // E.g. `[0, 3]` and you add 3-6 → `[0, 7]`.
  24000. end == rangeStart) {
  24001. // Replace `end` with the new value.
  24002. data[index + 1] = rangeEnd + 1;
  24003. // Make sure the next range pair doesn’t overlap, e.g. `[0, 11, 12, 14]`
  24004. // and you add 5-15 → `[0, 16]`, i.e. remove the `12,14` part.
  24005. added = true;
  24006. // Note: we cannot `return` just yet.
  24007. } else if (rangeStart <= start && rangeEnd + 1 >= end) {
  24008. // The new range is a superset of the old range.
  24009. data[index] = rangeStart;
  24010. data[index + 1] = rangeEnd + 1;
  24011. added = true;
  24012. }
  24013. index += 2;
  24014. }
  24015. // The loop has finished without doing anything; add the new pair to the end
  24016. // of the data set.
  24017. if (!added) {
  24018. data.push(rangeStart, rangeEnd + 1);
  24019. }
  24020. return data;
  24021. };
  24022. var dataContains = function dataContains(data, codePoint) {
  24023. var index = 0;
  24024. var length = data.length;
  24025. // Exit early if `codePoint` is not within `data`’s overall range.
  24026. var start = data[index];
  24027. var end = data[length - 1];
  24028. if (length >= 2) {
  24029. if (codePoint < start || codePoint > end) {
  24030. return false;
  24031. }
  24032. }
  24033. // Iterate over the data per `(start, end)` pair.
  24034. while (index < length) {
  24035. start = data[index];
  24036. end = data[index + 1];
  24037. if (codePoint >= start && codePoint < end) {
  24038. return true;
  24039. }
  24040. index += 2;
  24041. }
  24042. return false;
  24043. };
  24044. var dataIntersection = function dataIntersection(data, codePoints) {
  24045. var index = 0;
  24046. var length = codePoints.length;
  24047. var codePoint;
  24048. var result = [];
  24049. while (index < length) {
  24050. codePoint = codePoints[index];
  24051. if (dataContains(data, codePoint)) {
  24052. result.push(codePoint);
  24053. }
  24054. ++index;
  24055. }
  24056. return dataFromCodePoints(result);
  24057. };
  24058. var dataIsEmpty = function dataIsEmpty(data) {
  24059. return !data.length;
  24060. };
  24061. var dataIsSingleton = function dataIsSingleton(data) {
  24062. // Check if the set only represents a single code point.
  24063. return data.length == 2 && data[0] + 1 == data[1];
  24064. };
  24065. var dataToArray = function dataToArray(data) {
  24066. // Iterate over the data per `(start, end)` pair.
  24067. var index = 0;
  24068. var start;
  24069. var end;
  24070. var result = [];
  24071. var length = data.length;
  24072. while (index < length) {
  24073. start = data[index];
  24074. end = data[index + 1];
  24075. while (start < end) {
  24076. result.push(start);
  24077. ++start;
  24078. }
  24079. index += 2;
  24080. }
  24081. return result;
  24082. };
  24083. /*--------------------------------------------------------------------------*/
  24084. // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
  24085. var floor = Math.floor;
  24086. var highSurrogate = function highSurrogate(codePoint) {
  24087. return parseInt(floor((codePoint - 0x10000) / 0x400) + HIGH_SURROGATE_MIN, 10);
  24088. };
  24089. var lowSurrogate = function lowSurrogate(codePoint) {
  24090. return parseInt((codePoint - 0x10000) % 0x400 + LOW_SURROGATE_MIN, 10);
  24091. };
  24092. var stringFromCharCode = String.fromCharCode;
  24093. var codePointToString = function codePointToString(codePoint) {
  24094. var string;
  24095. // https://mathiasbynens.be/notes/javascript-escapes#single
  24096. // Note: the `\b` escape sequence for U+0008 BACKSPACE in strings has a
  24097. // different meaning in regular expressions (word boundary), so it cannot
  24098. // be used here.
  24099. if (codePoint == 0x09) {
  24100. string = '\\t';
  24101. }
  24102. // Note: IE < 9 treats `'\v'` as `'v'`, so avoid using it.
  24103. // else if (codePoint == 0x0B) {
  24104. // string = '\\v';
  24105. // }
  24106. else if (codePoint == 0x0A) {
  24107. string = '\\n';
  24108. } else if (codePoint == 0x0C) {
  24109. string = '\\f';
  24110. } else if (codePoint == 0x0D) {
  24111. string = '\\r';
  24112. } else if (codePoint == 0x5C) {
  24113. string = '\\\\';
  24114. } else if (codePoint == 0x24 || codePoint >= 0x28 && codePoint <= 0x2B || codePoint == 0x2D || codePoint == 0x2E || codePoint == 0x3F || codePoint >= 0x5B && codePoint <= 0x5E || codePoint >= 0x7B && codePoint <= 0x7D) {
  24115. // The code point maps to an unsafe printable ASCII character;
  24116. // backslash-escape it. Here’s the list of those symbols:
  24117. //
  24118. // $()*+-.?[\]^{|}
  24119. //
  24120. // See #7 for more info.
  24121. string = '\\' + stringFromCharCode(codePoint);
  24122. } else if (codePoint >= 0x20 && codePoint <= 0x7E) {
  24123. // The code point maps to one of these printable ASCII symbols
  24124. // (including the space character):
  24125. //
  24126. // !"#%&',/0123456789:;<=>@ABCDEFGHIJKLMNO
  24127. // PQRSTUVWXYZ_`abcdefghijklmnopqrstuvwxyz~
  24128. //
  24129. // These can safely be used directly.
  24130. string = stringFromCharCode(codePoint);
  24131. } else if (codePoint <= 0xFF) {
  24132. // https://mathiasbynens.be/notes/javascript-escapes#hexadecimal
  24133. string = '\\x' + pad(hex(codePoint), 2);
  24134. } else {
  24135. // `codePoint <= 0xFFFF` holds true.
  24136. // https://mathiasbynens.be/notes/javascript-escapes#unicode
  24137. string = '\\u' + pad(hex(codePoint), 4);
  24138. }
  24139. // There’s no need to account for astral symbols / surrogate pairs here,
  24140. // since `codePointToString` is private and only used for BMP code points.
  24141. // But if that’s what you need, just add an `else` block with this code:
  24142. //
  24143. // string = '\\u' + pad(hex(highSurrogate(codePoint)), 4)
  24144. // + '\\u' + pad(hex(lowSurrogate(codePoint)), 4);
  24145. return string;
  24146. };
  24147. var codePointToStringUnicode = function codePointToStringUnicode(codePoint) {
  24148. if (codePoint <= 0xFFFF) {
  24149. return codePointToString(codePoint);
  24150. }
  24151. return '\\u{' + codePoint.toString(16).toUpperCase() + '}';
  24152. };
  24153. var symbolToCodePoint = function symbolToCodePoint(symbol) {
  24154. var length = symbol.length;
  24155. var first = symbol.charCodeAt(0);
  24156. var second;
  24157. if (first >= HIGH_SURROGATE_MIN && first <= HIGH_SURROGATE_MAX && length > 1 // There is a next code unit.
  24158. ) {
  24159. // `first` is a high surrogate, and there is a next character. Assume
  24160. // it’s a low surrogate (else it’s invalid usage of Regenerate anyway).
  24161. second = symbol.charCodeAt(1);
  24162. // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
  24163. return (first - HIGH_SURROGATE_MIN) * 0x400 + second - LOW_SURROGATE_MIN + 0x10000;
  24164. }
  24165. return first;
  24166. };
  24167. var createBMPCharacterClasses = function createBMPCharacterClasses(data) {
  24168. // Iterate over the data per `(start, end)` pair.
  24169. var result = '';
  24170. var index = 0;
  24171. var start;
  24172. var end;
  24173. var length = data.length;
  24174. if (dataIsSingleton(data)) {
  24175. return codePointToString(data[0]);
  24176. }
  24177. while (index < length) {
  24178. start = data[index];
  24179. end = data[index + 1] - 1; // Note: the `- 1` makes `end` inclusive.
  24180. if (start == end) {
  24181. result += codePointToString(start);
  24182. } else if (start + 1 == end) {
  24183. result += codePointToString(start) + codePointToString(end);
  24184. } else {
  24185. result += codePointToString(start) + '-' + codePointToString(end);
  24186. }
  24187. index += 2;
  24188. }
  24189. return '[' + result + ']';
  24190. };
  24191. var createUnicodeCharacterClasses = function createUnicodeCharacterClasses(data) {
  24192. // Iterate over the data per `(start, end)` pair.
  24193. var result = '';
  24194. var index = 0;
  24195. var start;
  24196. var end;
  24197. var length = data.length;
  24198. if (dataIsSingleton(data)) {
  24199. return codePointToStringUnicode(data[0]);
  24200. }
  24201. while (index < length) {
  24202. start = data[index];
  24203. end = data[index + 1] - 1; // Note: the `- 1` makes `end` inclusive.
  24204. if (start == end) {
  24205. result += codePointToStringUnicode(start);
  24206. } else if (start + 1 == end) {
  24207. result += codePointToStringUnicode(start) + codePointToStringUnicode(end);
  24208. } else {
  24209. result += codePointToStringUnicode(start) + '-' + codePointToStringUnicode(end);
  24210. }
  24211. index += 2;
  24212. }
  24213. return '[' + result + ']';
  24214. };
  24215. var splitAtBMP = function splitAtBMP(data) {
  24216. // Iterate over the data per `(start, end)` pair.
  24217. var loneHighSurrogates = [];
  24218. var loneLowSurrogates = [];
  24219. var bmp = [];
  24220. var astral = [];
  24221. var index = 0;
  24222. var start;
  24223. var end;
  24224. var length = data.length;
  24225. while (index < length) {
  24226. start = data[index];
  24227. end = data[index + 1] - 1; // Note: the `- 1` makes `end` inclusive.
  24228. if (start < HIGH_SURROGATE_MIN) {
  24229. // The range starts and ends before the high surrogate range.
  24230. // E.g. (0, 0x10).
  24231. if (end < HIGH_SURROGATE_MIN) {
  24232. bmp.push(start, end + 1);
  24233. }
  24234. // The range starts before the high surrogate range and ends within it.
  24235. // E.g. (0, 0xD855).
  24236. if (end >= HIGH_SURROGATE_MIN && end <= HIGH_SURROGATE_MAX) {
  24237. bmp.push(start, HIGH_SURROGATE_MIN);
  24238. loneHighSurrogates.push(HIGH_SURROGATE_MIN, end + 1);
  24239. }
  24240. // The range starts before the high surrogate range and ends in the low
  24241. // surrogate range. E.g. (0, 0xDCFF).
  24242. if (end >= LOW_SURROGATE_MIN && end <= LOW_SURROGATE_MAX) {
  24243. bmp.push(start, HIGH_SURROGATE_MIN);
  24244. loneHighSurrogates.push(HIGH_SURROGATE_MIN, HIGH_SURROGATE_MAX + 1);
  24245. loneLowSurrogates.push(LOW_SURROGATE_MIN, end + 1);
  24246. }
  24247. // The range starts before the high surrogate range and ends after the
  24248. // low surrogate range. E.g. (0, 0x10FFFF).
  24249. if (end > LOW_SURROGATE_MAX) {
  24250. bmp.push(start, HIGH_SURROGATE_MIN);
  24251. loneHighSurrogates.push(HIGH_SURROGATE_MIN, HIGH_SURROGATE_MAX + 1);
  24252. loneLowSurrogates.push(LOW_SURROGATE_MIN, LOW_SURROGATE_MAX + 1);
  24253. if (end <= 0xFFFF) {
  24254. bmp.push(LOW_SURROGATE_MAX + 1, end + 1);
  24255. } else {
  24256. bmp.push(LOW_SURROGATE_MAX + 1, 0xFFFF + 1);
  24257. astral.push(0xFFFF + 1, end + 1);
  24258. }
  24259. }
  24260. } else if (start >= HIGH_SURROGATE_MIN && start <= HIGH_SURROGATE_MAX) {
  24261. // The range starts and ends in the high surrogate range.
  24262. // E.g. (0xD855, 0xD866).
  24263. if (end >= HIGH_SURROGATE_MIN && end <= HIGH_SURROGATE_MAX) {
  24264. loneHighSurrogates.push(start, end + 1);
  24265. }
  24266. // The range starts in the high surrogate range and ends in the low
  24267. // surrogate range. E.g. (0xD855, 0xDCFF).
  24268. if (end >= LOW_SURROGATE_MIN && end <= LOW_SURROGATE_MAX) {
  24269. loneHighSurrogates.push(start, HIGH_SURROGATE_MAX + 1);
  24270. loneLowSurrogates.push(LOW_SURROGATE_MIN, end + 1);
  24271. }
  24272. // The range starts in the high surrogate range and ends after the low
  24273. // surrogate range. E.g. (0xD855, 0x10FFFF).
  24274. if (end > LOW_SURROGATE_MAX) {
  24275. loneHighSurrogates.push(start, HIGH_SURROGATE_MAX + 1);
  24276. loneLowSurrogates.push(LOW_SURROGATE_MIN, LOW_SURROGATE_MAX + 1);
  24277. if (end <= 0xFFFF) {
  24278. bmp.push(LOW_SURROGATE_MAX + 1, end + 1);
  24279. } else {
  24280. bmp.push(LOW_SURROGATE_MAX + 1, 0xFFFF + 1);
  24281. astral.push(0xFFFF + 1, end + 1);
  24282. }
  24283. }
  24284. } else if (start >= LOW_SURROGATE_MIN && start <= LOW_SURROGATE_MAX) {
  24285. // The range starts and ends in the low surrogate range.
  24286. // E.g. (0xDCFF, 0xDDFF).
  24287. if (end >= LOW_SURROGATE_MIN && end <= LOW_SURROGATE_MAX) {
  24288. loneLowSurrogates.push(start, end + 1);
  24289. }
  24290. // The range starts in the low surrogate range and ends after the low
  24291. // surrogate range. E.g. (0xDCFF, 0x10FFFF).
  24292. if (end > LOW_SURROGATE_MAX) {
  24293. loneLowSurrogates.push(start, LOW_SURROGATE_MAX + 1);
  24294. if (end <= 0xFFFF) {
  24295. bmp.push(LOW_SURROGATE_MAX + 1, end + 1);
  24296. } else {
  24297. bmp.push(LOW_SURROGATE_MAX + 1, 0xFFFF + 1);
  24298. astral.push(0xFFFF + 1, end + 1);
  24299. }
  24300. }
  24301. } else if (start > LOW_SURROGATE_MAX && start <= 0xFFFF) {
  24302. // The range starts and ends after the low surrogate range.
  24303. // E.g. (0xFFAA, 0x10FFFF).
  24304. if (end <= 0xFFFF) {
  24305. bmp.push(start, end + 1);
  24306. } else {
  24307. bmp.push(start, 0xFFFF + 1);
  24308. astral.push(0xFFFF + 1, end + 1);
  24309. }
  24310. } else {
  24311. // The range starts and ends in the astral range.
  24312. astral.push(start, end + 1);
  24313. }
  24314. index += 2;
  24315. }
  24316. return {
  24317. 'loneHighSurrogates': loneHighSurrogates,
  24318. 'loneLowSurrogates': loneLowSurrogates,
  24319. 'bmp': bmp,
  24320. 'astral': astral
  24321. };
  24322. };
  24323. var optimizeSurrogateMappings = function optimizeSurrogateMappings(surrogateMappings) {
  24324. var result = [];
  24325. var tmpLow = [];
  24326. var addLow = false;
  24327. var mapping;
  24328. var nextMapping;
  24329. var highSurrogates;
  24330. var lowSurrogates;
  24331. var nextHighSurrogates;
  24332. var nextLowSurrogates;
  24333. var index = -1;
  24334. var length = surrogateMappings.length;
  24335. while (++index < length) {
  24336. mapping = surrogateMappings[index];
  24337. nextMapping = surrogateMappings[index + 1];
  24338. if (!nextMapping) {
  24339. result.push(mapping);
  24340. continue;
  24341. }
  24342. highSurrogates = mapping[0];
  24343. lowSurrogates = mapping[1];
  24344. nextHighSurrogates = nextMapping[0];
  24345. nextLowSurrogates = nextMapping[1];
  24346. // Check for identical high surrogate ranges.
  24347. tmpLow = lowSurrogates;
  24348. while (nextHighSurrogates && highSurrogates[0] == nextHighSurrogates[0] && highSurrogates[1] == nextHighSurrogates[1]) {
  24349. // Merge with the next item.
  24350. if (dataIsSingleton(nextLowSurrogates)) {
  24351. tmpLow = dataAdd(tmpLow, nextLowSurrogates[0]);
  24352. } else {
  24353. tmpLow = dataAddRange(tmpLow, nextLowSurrogates[0], nextLowSurrogates[1] - 1);
  24354. }
  24355. ++index;
  24356. mapping = surrogateMappings[index];
  24357. highSurrogates = mapping[0];
  24358. lowSurrogates = mapping[1];
  24359. nextMapping = surrogateMappings[index + 1];
  24360. nextHighSurrogates = nextMapping && nextMapping[0];
  24361. nextLowSurrogates = nextMapping && nextMapping[1];
  24362. addLow = true;
  24363. }
  24364. result.push([highSurrogates, addLow ? tmpLow : lowSurrogates]);
  24365. addLow = false;
  24366. }
  24367. return optimizeByLowSurrogates(result);
  24368. };
  24369. var optimizeByLowSurrogates = function optimizeByLowSurrogates(surrogateMappings) {
  24370. if (surrogateMappings.length == 1) {
  24371. return surrogateMappings;
  24372. }
  24373. var index = -1;
  24374. var innerIndex = -1;
  24375. while (++index < surrogateMappings.length) {
  24376. var mapping = surrogateMappings[index];
  24377. var lowSurrogates = mapping[1];
  24378. var lowSurrogateStart = lowSurrogates[0];
  24379. var lowSurrogateEnd = lowSurrogates[1];
  24380. innerIndex = index; // Note: the loop starts at the next index.
  24381. while (++innerIndex < surrogateMappings.length) {
  24382. var otherMapping = surrogateMappings[innerIndex];
  24383. var otherLowSurrogates = otherMapping[1];
  24384. var otherLowSurrogateStart = otherLowSurrogates[0];
  24385. var otherLowSurrogateEnd = otherLowSurrogates[1];
  24386. if (lowSurrogateStart == otherLowSurrogateStart && lowSurrogateEnd == otherLowSurrogateEnd) {
  24387. // Add the code points in the other item to this one.
  24388. if (dataIsSingleton(otherMapping[0])) {
  24389. mapping[0] = dataAdd(mapping[0], otherMapping[0][0]);
  24390. } else {
  24391. mapping[0] = dataAddRange(mapping[0], otherMapping[0][0], otherMapping[0][1] - 1);
  24392. }
  24393. // Remove the other, now redundant, item.
  24394. surrogateMappings.splice(innerIndex, 1);
  24395. --innerIndex;
  24396. }
  24397. }
  24398. }
  24399. return surrogateMappings;
  24400. };
  24401. var surrogateSet = function surrogateSet(data) {
  24402. // Exit early if `data` is an empty set.
  24403. if (!data.length) {
  24404. return [];
  24405. }
  24406. // Iterate over the data per `(start, end)` pair.
  24407. var index = 0;
  24408. var start;
  24409. var end;
  24410. var startHigh;
  24411. var startLow;
  24412. var endHigh;
  24413. var endLow;
  24414. var surrogateMappings = [];
  24415. var length = data.length;
  24416. while (index < length) {
  24417. start = data[index];
  24418. end = data[index + 1] - 1;
  24419. startHigh = highSurrogate(start);
  24420. startLow = lowSurrogate(start);
  24421. endHigh = highSurrogate(end);
  24422. endLow = lowSurrogate(end);
  24423. var startsWithLowestLowSurrogate = startLow == LOW_SURROGATE_MIN;
  24424. var endsWithHighestLowSurrogate = endLow == LOW_SURROGATE_MAX;
  24425. var complete = false;
  24426. // Append the previous high-surrogate-to-low-surrogate mappings.
  24427. // Step 1: `(startHigh, startLow)` to `(startHigh, LOW_SURROGATE_MAX)`.
  24428. if (startHigh == endHigh || startsWithLowestLowSurrogate && endsWithHighestLowSurrogate) {
  24429. surrogateMappings.push([[startHigh, endHigh + 1], [startLow, endLow + 1]]);
  24430. complete = true;
  24431. } else {
  24432. surrogateMappings.push([[startHigh, startHigh + 1], [startLow, LOW_SURROGATE_MAX + 1]]);
  24433. }
  24434. // Step 2: `(startHigh + 1, LOW_SURROGATE_MIN)` to
  24435. // `(endHigh - 1, LOW_SURROGATE_MAX)`.
  24436. if (!complete && startHigh + 1 < endHigh) {
  24437. if (endsWithHighestLowSurrogate) {
  24438. // Combine step 2 and step 3.
  24439. surrogateMappings.push([[startHigh + 1, endHigh + 1], [LOW_SURROGATE_MIN, endLow + 1]]);
  24440. complete = true;
  24441. } else {
  24442. surrogateMappings.push([[startHigh + 1, endHigh], [LOW_SURROGATE_MIN, LOW_SURROGATE_MAX + 1]]);
  24443. }
  24444. }
  24445. // Step 3. `(endHigh, LOW_SURROGATE_MIN)` to `(endHigh, endLow)`.
  24446. if (!complete) {
  24447. surrogateMappings.push([[endHigh, endHigh + 1], [LOW_SURROGATE_MIN, endLow + 1]]);
  24448. }
  24449. index += 2;
  24450. }
  24451. // The format of `surrogateMappings` is as follows:
  24452. //
  24453. // [ surrogateMapping1, surrogateMapping2 ]
  24454. //
  24455. // i.e.:
  24456. //
  24457. // [
  24458. // [ highSurrogates1, lowSurrogates1 ],
  24459. // [ highSurrogates2, lowSurrogates2 ]
  24460. // ]
  24461. return optimizeSurrogateMappings(surrogateMappings);
  24462. };
  24463. var createSurrogateCharacterClasses = function createSurrogateCharacterClasses(surrogateMappings) {
  24464. var result = [];
  24465. forEach(surrogateMappings, function (surrogateMapping) {
  24466. var highSurrogates = surrogateMapping[0];
  24467. var lowSurrogates = surrogateMapping[1];
  24468. result.push(createBMPCharacterClasses(highSurrogates) + createBMPCharacterClasses(lowSurrogates));
  24469. });
  24470. return result.join('|');
  24471. };
  24472. var createCharacterClassesFromData = function createCharacterClassesFromData(data, bmpOnly, hasUnicodeFlag) {
  24473. if (hasUnicodeFlag) {
  24474. return createUnicodeCharacterClasses(data);
  24475. }
  24476. var result = [];
  24477. var parts = splitAtBMP(data);
  24478. var loneHighSurrogates = parts.loneHighSurrogates;
  24479. var loneLowSurrogates = parts.loneLowSurrogates;
  24480. var bmp = parts.bmp;
  24481. var astral = parts.astral;
  24482. var hasLoneHighSurrogates = !dataIsEmpty(loneHighSurrogates);
  24483. var hasLoneLowSurrogates = !dataIsEmpty(loneLowSurrogates);
  24484. var surrogateMappings = surrogateSet(astral);
  24485. if (bmpOnly) {
  24486. bmp = dataAddData(bmp, loneHighSurrogates);
  24487. hasLoneHighSurrogates = false;
  24488. bmp = dataAddData(bmp, loneLowSurrogates);
  24489. hasLoneLowSurrogates = false;
  24490. }
  24491. if (!dataIsEmpty(bmp)) {
  24492. // The data set contains BMP code points that are not high surrogates
  24493. // needed for astral code points in the set.
  24494. result.push(createBMPCharacterClasses(bmp));
  24495. }
  24496. if (surrogateMappings.length) {
  24497. // The data set contains astral code points; append character classes
  24498. // based on their surrogate pairs.
  24499. result.push(createSurrogateCharacterClasses(surrogateMappings));
  24500. }
  24501. // https://gist.github.com/mathiasbynens/bbe7f870208abcfec860
  24502. if (hasLoneHighSurrogates) {
  24503. result.push(createBMPCharacterClasses(loneHighSurrogates) +
  24504. // Make sure the high surrogates aren’t part of a surrogate pair.
  24505. '(?![\\uDC00-\\uDFFF])');
  24506. }
  24507. if (hasLoneLowSurrogates) {
  24508. result.push(
  24509. // It is not possible to accurately assert the low surrogates aren’t
  24510. // part of a surrogate pair, since JavaScript regular expressions do
  24511. // not support lookbehind.
  24512. '(?:[^\\uD800-\\uDBFF]|^)' + createBMPCharacterClasses(loneLowSurrogates));
  24513. }
  24514. return result.join('|');
  24515. };
  24516. /*--------------------------------------------------------------------------*/
  24517. // `regenerate` can be used as a constructor (and new methods can be added to
  24518. // its prototype) but also as a regular function, the latter of which is the
  24519. // documented and most common usage. For that reason, it’s not capitalized.
  24520. var regenerate = function regenerate(value) {
  24521. if (arguments.length > 1) {
  24522. value = slice.call(arguments);
  24523. }
  24524. if (this instanceof regenerate) {
  24525. this.data = [];
  24526. return value ? this.add(value) : this;
  24527. }
  24528. return new regenerate().add(value);
  24529. };
  24530. regenerate.version = '1.3.2';
  24531. var proto = regenerate.prototype;
  24532. extend(proto, {
  24533. 'add': function add(value) {
  24534. var $this = this;
  24535. if (value == null) {
  24536. return $this;
  24537. }
  24538. if (value instanceof regenerate) {
  24539. // Allow passing other Regenerate instances.
  24540. $this.data = dataAddData($this.data, value.data);
  24541. return $this;
  24542. }
  24543. if (arguments.length > 1) {
  24544. value = slice.call(arguments);
  24545. }
  24546. if (isArray(value)) {
  24547. forEach(value, function (item) {
  24548. $this.add(item);
  24549. });
  24550. return $this;
  24551. }
  24552. $this.data = dataAdd($this.data, isNumber(value) ? value : symbolToCodePoint(value));
  24553. return $this;
  24554. },
  24555. 'remove': function remove(value) {
  24556. var $this = this;
  24557. if (value == null) {
  24558. return $this;
  24559. }
  24560. if (value instanceof regenerate) {
  24561. // Allow passing other Regenerate instances.
  24562. $this.data = dataRemoveData($this.data, value.data);
  24563. return $this;
  24564. }
  24565. if (arguments.length > 1) {
  24566. value = slice.call(arguments);
  24567. }
  24568. if (isArray(value)) {
  24569. forEach(value, function (item) {
  24570. $this.remove(item);
  24571. });
  24572. return $this;
  24573. }
  24574. $this.data = dataRemove($this.data, isNumber(value) ? value : symbolToCodePoint(value));
  24575. return $this;
  24576. },
  24577. 'addRange': function addRange(start, end) {
  24578. var $this = this;
  24579. $this.data = dataAddRange($this.data, isNumber(start) ? start : symbolToCodePoint(start), isNumber(end) ? end : symbolToCodePoint(end));
  24580. return $this;
  24581. },
  24582. 'removeRange': function removeRange(start, end) {
  24583. var $this = this;
  24584. var startCodePoint = isNumber(start) ? start : symbolToCodePoint(start);
  24585. var endCodePoint = isNumber(end) ? end : symbolToCodePoint(end);
  24586. $this.data = dataRemoveRange($this.data, startCodePoint, endCodePoint);
  24587. return $this;
  24588. },
  24589. 'intersection': function intersection(argument) {
  24590. var $this = this;
  24591. // Allow passing other Regenerate instances.
  24592. // TODO: Optimize this by writing and using `dataIntersectionData()`.
  24593. var array = argument instanceof regenerate ? dataToArray(argument.data) : argument;
  24594. $this.data = dataIntersection($this.data, array);
  24595. return $this;
  24596. },
  24597. 'contains': function contains(codePoint) {
  24598. return dataContains(this.data, isNumber(codePoint) ? codePoint : symbolToCodePoint(codePoint));
  24599. },
  24600. 'clone': function clone() {
  24601. var set = new regenerate();
  24602. set.data = this.data.slice(0);
  24603. return set;
  24604. },
  24605. 'toString': function toString(options) {
  24606. var result = createCharacterClassesFromData(this.data, options ? options.bmpOnly : false, options ? options.hasUnicodeFlag : false);
  24607. if (!result) {
  24608. // For an empty set, return something that can be inserted `/here/` to
  24609. // form a valid regular expression. Avoid `(?:)` since that matches the
  24610. // empty string.
  24611. return '[]';
  24612. }
  24613. // Use `\0` instead of `\x00` where possible.
  24614. return result.replace(regexNull, '\\0$1');
  24615. },
  24616. 'toRegExp': function toRegExp(flags) {
  24617. var pattern = this.toString(flags && flags.indexOf('u') != -1 ? { 'hasUnicodeFlag': true } : null);
  24618. return RegExp(pattern, flags || '');
  24619. },
  24620. 'valueOf': function valueOf() {
  24621. // Note: `valueOf` is aliased as `toArray`.
  24622. return dataToArray(this.data);
  24623. }
  24624. });
  24625. proto.toArray = proto.valueOf;
  24626. // Some AMD build optimizers, like r.js, check for specific condition patterns
  24627. // like the following:
  24628. if ("function" == 'function' && _typeof(__webpack_require__(49)) == 'object' && __webpack_require__(49)) {
  24629. !(__WEBPACK_AMD_DEFINE_RESULT__ = function () {
  24630. return regenerate;
  24631. }.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  24632. } else if (freeExports && !freeExports.nodeType) {
  24633. if (freeModule) {
  24634. // in Node.js, io.js, or RingoJS v0.8.0+
  24635. freeModule.exports = regenerate;
  24636. } else {
  24637. // in Narwhal or RingoJS v0.7.0-
  24638. freeExports.regenerate = regenerate;
  24639. }
  24640. } else {
  24641. // in Rhino or a web browser
  24642. root.regenerate = regenerate;
  24643. }
  24644. })(undefined);
  24645. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(39)(module), (function() { return this; }())))
  24646. /***/ }),
  24647. /* 283 */
  24648. /***/ (function(module, exports, __webpack_require__) {
  24649. "use strict";
  24650. var _stringify = __webpack_require__(35);
  24651. var _stringify2 = _interopRequireDefault(_stringify);
  24652. var _assert = __webpack_require__(64);
  24653. var _assert2 = _interopRequireDefault(_assert);
  24654. var _babelTypes = __webpack_require__(1);
  24655. var t = _interopRequireWildcard(_babelTypes);
  24656. var _leap = __webpack_require__(607);
  24657. var leap = _interopRequireWildcard(_leap);
  24658. var _meta = __webpack_require__(608);
  24659. var meta = _interopRequireWildcard(_meta);
  24660. var _util = __webpack_require__(116);
  24661. var util = _interopRequireWildcard(_util);
  24662. function _interopRequireWildcard(obj) {
  24663. if (obj && obj.__esModule) {
  24664. return obj;
  24665. } else {
  24666. var newObj = {};if (obj != null) {
  24667. for (var key in obj) {
  24668. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  24669. }
  24670. }newObj.default = obj;return newObj;
  24671. }
  24672. }
  24673. function _interopRequireDefault(obj) {
  24674. return obj && obj.__esModule ? obj : { default: obj };
  24675. }
  24676. var hasOwn = Object.prototype.hasOwnProperty; /**
  24677. * Copyright (c) 2014, Facebook, Inc.
  24678. * All rights reserved.
  24679. *
  24680. * This source code is licensed under the BSD-style license found in the
  24681. * https://raw.github.com/facebook/regenerator/master/LICENSE file. An
  24682. * additional grant of patent rights can be found in the PATENTS file in
  24683. * the same directory.
  24684. */
  24685. function Emitter(contextId) {
  24686. _assert2.default.ok(this instanceof Emitter);
  24687. t.assertIdentifier(contextId);
  24688. // Used to generate unique temporary names.
  24689. this.nextTempId = 0;
  24690. // In order to make sure the context object does not collide with
  24691. // anything in the local scope, we might have to rename it, so we
  24692. // refer to it symbolically instead of just assuming that it will be
  24693. // called "context".
  24694. this.contextId = contextId;
  24695. // An append-only list of Statements that grows each time this.emit is
  24696. // called.
  24697. this.listing = [];
  24698. // A sparse array whose keys correspond to locations in this.listing
  24699. // that have been marked as branch/jump targets.
  24700. this.marked = [true];
  24701. // The last location will be marked when this.getDispatchLoop is
  24702. // called.
  24703. this.finalLoc = loc();
  24704. // A list of all leap.TryEntry statements emitted.
  24705. this.tryEntries = [];
  24706. // Each time we evaluate the body of a loop, we tell this.leapManager
  24707. // to enter a nested loop context that determines the meaning of break
  24708. // and continue statements therein.
  24709. this.leapManager = new leap.LeapManager(this);
  24710. }
  24711. var Ep = Emitter.prototype;
  24712. exports.Emitter = Emitter;
  24713. // Offsets into this.listing that could be used as targets for branches or
  24714. // jumps are represented as numeric Literal nodes. This representation has
  24715. // the amazingly convenient benefit of allowing the exact value of the
  24716. // location to be determined at any time, even after generating code that
  24717. // refers to the location.
  24718. function loc() {
  24719. return t.numericLiteral(-1);
  24720. }
  24721. // Sets the exact value of the given location to the offset of the next
  24722. // Statement emitted.
  24723. Ep.mark = function (loc) {
  24724. t.assertLiteral(loc);
  24725. var index = this.listing.length;
  24726. if (loc.value === -1) {
  24727. loc.value = index;
  24728. } else {
  24729. // Locations can be marked redundantly, but their values cannot change
  24730. // once set the first time.
  24731. _assert2.default.strictEqual(loc.value, index);
  24732. }
  24733. this.marked[index] = true;
  24734. return loc;
  24735. };
  24736. Ep.emit = function (node) {
  24737. if (t.isExpression(node)) {
  24738. node = t.expressionStatement(node);
  24739. }
  24740. t.assertStatement(node);
  24741. this.listing.push(node);
  24742. };
  24743. // Shorthand for emitting assignment statements. This will come in handy
  24744. // for assignments to temporary variables.
  24745. Ep.emitAssign = function (lhs, rhs) {
  24746. this.emit(this.assign(lhs, rhs));
  24747. return lhs;
  24748. };
  24749. // Shorthand for an assignment statement.
  24750. Ep.assign = function (lhs, rhs) {
  24751. return t.expressionStatement(t.assignmentExpression("=", lhs, rhs));
  24752. };
  24753. // Convenience function for generating expressions like context.next,
  24754. // context.sent, and context.rval.
  24755. Ep.contextProperty = function (name, computed) {
  24756. return t.memberExpression(this.contextId, computed ? t.stringLiteral(name) : t.identifier(name), !!computed);
  24757. };
  24758. // Shorthand for setting context.rval and jumping to `context.stop()`.
  24759. Ep.stop = function (rval) {
  24760. if (rval) {
  24761. this.setReturnValue(rval);
  24762. }
  24763. this.jump(this.finalLoc);
  24764. };
  24765. Ep.setReturnValue = function (valuePath) {
  24766. t.assertExpression(valuePath.value);
  24767. this.emitAssign(this.contextProperty("rval"), this.explodeExpression(valuePath));
  24768. };
  24769. Ep.clearPendingException = function (tryLoc, assignee) {
  24770. t.assertLiteral(tryLoc);
  24771. var catchCall = t.callExpression(this.contextProperty("catch", true), [tryLoc]);
  24772. if (assignee) {
  24773. this.emitAssign(assignee, catchCall);
  24774. } else {
  24775. this.emit(catchCall);
  24776. }
  24777. };
  24778. // Emits code for an unconditional jump to the given location, even if the
  24779. // exact value of the location is not yet known.
  24780. Ep.jump = function (toLoc) {
  24781. this.emitAssign(this.contextProperty("next"), toLoc);
  24782. this.emit(t.breakStatement());
  24783. };
  24784. // Conditional jump.
  24785. Ep.jumpIf = function (test, toLoc) {
  24786. t.assertExpression(test);
  24787. t.assertLiteral(toLoc);
  24788. this.emit(t.ifStatement(test, t.blockStatement([this.assign(this.contextProperty("next"), toLoc), t.breakStatement()])));
  24789. };
  24790. // Conditional jump, with the condition negated.
  24791. Ep.jumpIfNot = function (test, toLoc) {
  24792. t.assertExpression(test);
  24793. t.assertLiteral(toLoc);
  24794. var negatedTest = void 0;
  24795. if (t.isUnaryExpression(test) && test.operator === "!") {
  24796. // Avoid double negation.
  24797. negatedTest = test.argument;
  24798. } else {
  24799. negatedTest = t.unaryExpression("!", test);
  24800. }
  24801. this.emit(t.ifStatement(negatedTest, t.blockStatement([this.assign(this.contextProperty("next"), toLoc), t.breakStatement()])));
  24802. };
  24803. // Returns a unique MemberExpression that can be used to store and
  24804. // retrieve temporary values. Since the object of the member expression is
  24805. // the context object, which is presumed to coexist peacefully with all
  24806. // other local variables, and since we just increment `nextTempId`
  24807. // monotonically, uniqueness is assured.
  24808. Ep.makeTempVar = function () {
  24809. return this.contextProperty("t" + this.nextTempId++);
  24810. };
  24811. Ep.getContextFunction = function (id) {
  24812. return t.functionExpression(id || null /*Anonymous*/
  24813. , [this.contextId], t.blockStatement([this.getDispatchLoop()]), false, // Not a generator anymore!
  24814. false // Nor an expression.
  24815. );
  24816. };
  24817. // Turns this.listing into a loop of the form
  24818. //
  24819. // while (1) switch (context.next) {
  24820. // case 0:
  24821. // ...
  24822. // case n:
  24823. // return context.stop();
  24824. // }
  24825. //
  24826. // Each marked location in this.listing will correspond to one generated
  24827. // case statement.
  24828. Ep.getDispatchLoop = function () {
  24829. var self = this;
  24830. var cases = [];
  24831. var current = void 0;
  24832. // If we encounter a break, continue, or return statement in a switch
  24833. // case, we can skip the rest of the statements until the next case.
  24834. var alreadyEnded = false;
  24835. self.listing.forEach(function (stmt, i) {
  24836. if (self.marked.hasOwnProperty(i)) {
  24837. cases.push(t.switchCase(t.numericLiteral(i), current = []));
  24838. alreadyEnded = false;
  24839. }
  24840. if (!alreadyEnded) {
  24841. current.push(stmt);
  24842. if (t.isCompletionStatement(stmt)) alreadyEnded = true;
  24843. }
  24844. });
  24845. // Now that we know how many statements there will be in this.listing,
  24846. // we can finally resolve this.finalLoc.value.
  24847. this.finalLoc.value = this.listing.length;
  24848. cases.push(t.switchCase(this.finalLoc, [
  24849. // Intentionally fall through to the "end" case...
  24850. ]),
  24851. // So that the runtime can jump to the final location without having
  24852. // to know its offset, we provide the "end" case as a synonym.
  24853. t.switchCase(t.stringLiteral("end"), [
  24854. // This will check/clear both context.thrown and context.rval.
  24855. t.returnStatement(t.callExpression(this.contextProperty("stop"), []))]));
  24856. return t.whileStatement(t.numericLiteral(1), t.switchStatement(t.assignmentExpression("=", this.contextProperty("prev"), this.contextProperty("next")), cases));
  24857. };
  24858. Ep.getTryLocsList = function () {
  24859. if (this.tryEntries.length === 0) {
  24860. // To avoid adding a needless [] to the majority of runtime.wrap
  24861. // argument lists, force the caller to handle this case specially.
  24862. return null;
  24863. }
  24864. var lastLocValue = 0;
  24865. return t.arrayExpression(this.tryEntries.map(function (tryEntry) {
  24866. var thisLocValue = tryEntry.firstLoc.value;
  24867. _assert2.default.ok(thisLocValue >= lastLocValue, "try entries out of order");
  24868. lastLocValue = thisLocValue;
  24869. var ce = tryEntry.catchEntry;
  24870. var fe = tryEntry.finallyEntry;
  24871. var locs = [tryEntry.firstLoc,
  24872. // The null here makes a hole in the array.
  24873. ce ? ce.firstLoc : null];
  24874. if (fe) {
  24875. locs[2] = fe.firstLoc;
  24876. locs[3] = fe.afterLoc;
  24877. }
  24878. return t.arrayExpression(locs);
  24879. }));
  24880. };
  24881. // All side effects must be realized in order.
  24882. // If any subexpression harbors a leap, all subexpressions must be
  24883. // neutered of side effects.
  24884. // No destructive modification of AST nodes.
  24885. Ep.explode = function (path, ignoreResult) {
  24886. var node = path.node;
  24887. var self = this;
  24888. t.assertNode(node);
  24889. if (t.isDeclaration(node)) throw getDeclError(node);
  24890. if (t.isStatement(node)) return self.explodeStatement(path);
  24891. if (t.isExpression(node)) return self.explodeExpression(path, ignoreResult);
  24892. switch (node.type) {
  24893. case "Program":
  24894. return path.get("body").map(self.explodeStatement, self);
  24895. case "VariableDeclarator":
  24896. throw getDeclError(node);
  24897. // These node types should be handled by their parent nodes
  24898. // (ObjectExpression, SwitchStatement, and TryStatement, respectively).
  24899. case "Property":
  24900. case "SwitchCase":
  24901. case "CatchClause":
  24902. throw new Error(node.type + " nodes should be handled by their parents");
  24903. default:
  24904. throw new Error("unknown Node of type " + (0, _stringify2.default)(node.type));
  24905. }
  24906. };
  24907. function getDeclError(node) {
  24908. return new Error("all declarations should have been transformed into " + "assignments before the Exploder began its work: " + (0, _stringify2.default)(node));
  24909. }
  24910. Ep.explodeStatement = function (path, labelId) {
  24911. var stmt = path.node;
  24912. var self = this;
  24913. var before = void 0,
  24914. after = void 0,
  24915. head = void 0;
  24916. t.assertStatement(stmt);
  24917. if (labelId) {
  24918. t.assertIdentifier(labelId);
  24919. } else {
  24920. labelId = null;
  24921. }
  24922. // Explode BlockStatement nodes even if they do not contain a yield,
  24923. // because we don't want or need the curly braces.
  24924. if (t.isBlockStatement(stmt)) {
  24925. path.get("body").forEach(function (path) {
  24926. self.explodeStatement(path);
  24927. });
  24928. return;
  24929. }
  24930. if (!meta.containsLeap(stmt)) {
  24931. // Technically we should be able to avoid emitting the statement
  24932. // altogether if !meta.hasSideEffects(stmt), but that leads to
  24933. // confusing generated code (for instance, `while (true) {}` just
  24934. // disappears) and is probably a more appropriate job for a dedicated
  24935. // dead code elimination pass.
  24936. self.emit(stmt);
  24937. return;
  24938. }
  24939. switch (stmt.type) {
  24940. case "ExpressionStatement":
  24941. self.explodeExpression(path.get("expression"), true);
  24942. break;
  24943. case "LabeledStatement":
  24944. after = loc();
  24945. // Did you know you can break from any labeled block statement or
  24946. // control structure? Well, you can! Note: when a labeled loop is
  24947. // encountered, the leap.LabeledEntry created here will immediately
  24948. // enclose a leap.LoopEntry on the leap manager's stack, and both
  24949. // entries will have the same label. Though this works just fine, it
  24950. // may seem a bit redundant. In theory, we could check here to
  24951. // determine if stmt knows how to handle its own label; for example,
  24952. // stmt happens to be a WhileStatement and so we know it's going to
  24953. // establish its own LoopEntry when we explode it (below). Then this
  24954. // LabeledEntry would be unnecessary. Alternatively, we might be
  24955. // tempted not to pass stmt.label down into self.explodeStatement,
  24956. // because we've handled the label here, but that's a mistake because
  24957. // labeled loops may contain labeled continue statements, which is not
  24958. // something we can handle in this generic case. All in all, I think a
  24959. // little redundancy greatly simplifies the logic of this case, since
  24960. // it's clear that we handle all possible LabeledStatements correctly
  24961. // here, regardless of whether they interact with the leap manager
  24962. // themselves. Also remember that labels and break/continue-to-label
  24963. // statements are rare, and all of this logic happens at transform
  24964. // time, so it has no additional runtime cost.
  24965. self.leapManager.withEntry(new leap.LabeledEntry(after, stmt.label), function () {
  24966. self.explodeStatement(path.get("body"), stmt.label);
  24967. });
  24968. self.mark(after);
  24969. break;
  24970. case "WhileStatement":
  24971. before = loc();
  24972. after = loc();
  24973. self.mark(before);
  24974. self.jumpIfNot(self.explodeExpression(path.get("test")), after);
  24975. self.leapManager.withEntry(new leap.LoopEntry(after, before, labelId), function () {
  24976. self.explodeStatement(path.get("body"));
  24977. });
  24978. self.jump(before);
  24979. self.mark(after);
  24980. break;
  24981. case "DoWhileStatement":
  24982. var first = loc();
  24983. var test = loc();
  24984. after = loc();
  24985. self.mark(first);
  24986. self.leapManager.withEntry(new leap.LoopEntry(after, test, labelId), function () {
  24987. self.explode(path.get("body"));
  24988. });
  24989. self.mark(test);
  24990. self.jumpIf(self.explodeExpression(path.get("test")), first);
  24991. self.mark(after);
  24992. break;
  24993. case "ForStatement":
  24994. head = loc();
  24995. var update = loc();
  24996. after = loc();
  24997. if (stmt.init) {
  24998. // We pass true here to indicate that if stmt.init is an expression
  24999. // then we do not care about its result.
  25000. self.explode(path.get("init"), true);
  25001. }
  25002. self.mark(head);
  25003. if (stmt.test) {
  25004. self.jumpIfNot(self.explodeExpression(path.get("test")), after);
  25005. } else {
  25006. // No test means continue unconditionally.
  25007. }
  25008. self.leapManager.withEntry(new leap.LoopEntry(after, update, labelId), function () {
  25009. self.explodeStatement(path.get("body"));
  25010. });
  25011. self.mark(update);
  25012. if (stmt.update) {
  25013. // We pass true here to indicate that if stmt.update is an
  25014. // expression then we do not care about its result.
  25015. self.explode(path.get("update"), true);
  25016. }
  25017. self.jump(head);
  25018. self.mark(after);
  25019. break;
  25020. case "TypeCastExpression":
  25021. return self.explodeExpression(path.get("expression"));
  25022. case "ForInStatement":
  25023. head = loc();
  25024. after = loc();
  25025. var keyIterNextFn = self.makeTempVar();
  25026. self.emitAssign(keyIterNextFn, t.callExpression(util.runtimeProperty("keys"), [self.explodeExpression(path.get("right"))]));
  25027. self.mark(head);
  25028. var keyInfoTmpVar = self.makeTempVar();
  25029. self.jumpIf(t.memberExpression(t.assignmentExpression("=", keyInfoTmpVar, t.callExpression(keyIterNextFn, [])), t.identifier("done"), false), after);
  25030. self.emitAssign(stmt.left, t.memberExpression(keyInfoTmpVar, t.identifier("value"), false));
  25031. self.leapManager.withEntry(new leap.LoopEntry(after, head, labelId), function () {
  25032. self.explodeStatement(path.get("body"));
  25033. });
  25034. self.jump(head);
  25035. self.mark(after);
  25036. break;
  25037. case "BreakStatement":
  25038. self.emitAbruptCompletion({
  25039. type: "break",
  25040. target: self.leapManager.getBreakLoc(stmt.label)
  25041. });
  25042. break;
  25043. case "ContinueStatement":
  25044. self.emitAbruptCompletion({
  25045. type: "continue",
  25046. target: self.leapManager.getContinueLoc(stmt.label)
  25047. });
  25048. break;
  25049. case "SwitchStatement":
  25050. // Always save the discriminant into a temporary variable in case the
  25051. // test expressions overwrite values like context.sent.
  25052. var disc = self.emitAssign(self.makeTempVar(), self.explodeExpression(path.get("discriminant")));
  25053. after = loc();
  25054. var defaultLoc = loc();
  25055. var condition = defaultLoc;
  25056. var caseLocs = [];
  25057. // If there are no cases, .cases might be undefined.
  25058. var cases = stmt.cases || [];
  25059. for (var i = cases.length - 1; i >= 0; --i) {
  25060. var c = cases[i];
  25061. t.assertSwitchCase(c);
  25062. if (c.test) {
  25063. condition = t.conditionalExpression(t.binaryExpression("===", disc, c.test), caseLocs[i] = loc(), condition);
  25064. } else {
  25065. caseLocs[i] = defaultLoc;
  25066. }
  25067. }
  25068. var discriminant = path.get("discriminant");
  25069. util.replaceWithOrRemove(discriminant, condition);
  25070. self.jump(self.explodeExpression(discriminant));
  25071. self.leapManager.withEntry(new leap.SwitchEntry(after), function () {
  25072. path.get("cases").forEach(function (casePath) {
  25073. var i = casePath.key;
  25074. self.mark(caseLocs[i]);
  25075. casePath.get("consequent").forEach(function (path) {
  25076. self.explodeStatement(path);
  25077. });
  25078. });
  25079. });
  25080. self.mark(after);
  25081. if (defaultLoc.value === -1) {
  25082. self.mark(defaultLoc);
  25083. _assert2.default.strictEqual(after.value, defaultLoc.value);
  25084. }
  25085. break;
  25086. case "IfStatement":
  25087. var elseLoc = stmt.alternate && loc();
  25088. after = loc();
  25089. self.jumpIfNot(self.explodeExpression(path.get("test")), elseLoc || after);
  25090. self.explodeStatement(path.get("consequent"));
  25091. if (elseLoc) {
  25092. self.jump(after);
  25093. self.mark(elseLoc);
  25094. self.explodeStatement(path.get("alternate"));
  25095. }
  25096. self.mark(after);
  25097. break;
  25098. case "ReturnStatement":
  25099. self.emitAbruptCompletion({
  25100. type: "return",
  25101. value: self.explodeExpression(path.get("argument"))
  25102. });
  25103. break;
  25104. case "WithStatement":
  25105. throw new Error("WithStatement not supported in generator functions.");
  25106. case "TryStatement":
  25107. after = loc();
  25108. var handler = stmt.handler;
  25109. var catchLoc = handler && loc();
  25110. var catchEntry = catchLoc && new leap.CatchEntry(catchLoc, handler.param);
  25111. var finallyLoc = stmt.finalizer && loc();
  25112. var finallyEntry = finallyLoc && new leap.FinallyEntry(finallyLoc, after);
  25113. var tryEntry = new leap.TryEntry(self.getUnmarkedCurrentLoc(), catchEntry, finallyEntry);
  25114. self.tryEntries.push(tryEntry);
  25115. self.updateContextPrevLoc(tryEntry.firstLoc);
  25116. self.leapManager.withEntry(tryEntry, function () {
  25117. self.explodeStatement(path.get("block"));
  25118. if (catchLoc) {
  25119. if (finallyLoc) {
  25120. // If we have both a catch block and a finally block, then
  25121. // because we emit the catch block first, we need to jump over
  25122. // it to the finally block.
  25123. self.jump(finallyLoc);
  25124. } else {
  25125. // If there is no finally block, then we need to jump over the
  25126. // catch block to the fall-through location.
  25127. self.jump(after);
  25128. }
  25129. self.updateContextPrevLoc(self.mark(catchLoc));
  25130. var bodyPath = path.get("handler.body");
  25131. var safeParam = self.makeTempVar();
  25132. self.clearPendingException(tryEntry.firstLoc, safeParam);
  25133. bodyPath.traverse(catchParamVisitor, {
  25134. safeParam: safeParam,
  25135. catchParamName: handler.param.name
  25136. });
  25137. self.leapManager.withEntry(catchEntry, function () {
  25138. self.explodeStatement(bodyPath);
  25139. });
  25140. }
  25141. if (finallyLoc) {
  25142. self.updateContextPrevLoc(self.mark(finallyLoc));
  25143. self.leapManager.withEntry(finallyEntry, function () {
  25144. self.explodeStatement(path.get("finalizer"));
  25145. });
  25146. self.emit(t.returnStatement(t.callExpression(self.contextProperty("finish"), [finallyEntry.firstLoc])));
  25147. }
  25148. });
  25149. self.mark(after);
  25150. break;
  25151. case "ThrowStatement":
  25152. self.emit(t.throwStatement(self.explodeExpression(path.get("argument"))));
  25153. break;
  25154. default:
  25155. throw new Error("unknown Statement of type " + (0, _stringify2.default)(stmt.type));
  25156. }
  25157. };
  25158. var catchParamVisitor = {
  25159. Identifier: function Identifier(path, state) {
  25160. if (path.node.name === state.catchParamName && util.isReference(path)) {
  25161. util.replaceWithOrRemove(path, state.safeParam);
  25162. }
  25163. },
  25164. Scope: function Scope(path, state) {
  25165. if (path.scope.hasOwnBinding(state.catchParamName)) {
  25166. // Don't descend into nested scopes that shadow the catch
  25167. // parameter with their own declarations.
  25168. path.skip();
  25169. }
  25170. }
  25171. };
  25172. Ep.emitAbruptCompletion = function (record) {
  25173. if (!isValidCompletion(record)) {
  25174. _assert2.default.ok(false, "invalid completion record: " + (0, _stringify2.default)(record));
  25175. }
  25176. _assert2.default.notStrictEqual(record.type, "normal", "normal completions are not abrupt");
  25177. var abruptArgs = [t.stringLiteral(record.type)];
  25178. if (record.type === "break" || record.type === "continue") {
  25179. t.assertLiteral(record.target);
  25180. abruptArgs[1] = record.target;
  25181. } else if (record.type === "return" || record.type === "throw") {
  25182. if (record.value) {
  25183. t.assertExpression(record.value);
  25184. abruptArgs[1] = record.value;
  25185. }
  25186. }
  25187. this.emit(t.returnStatement(t.callExpression(this.contextProperty("abrupt"), abruptArgs)));
  25188. };
  25189. function isValidCompletion(record) {
  25190. var type = record.type;
  25191. if (type === "normal") {
  25192. return !hasOwn.call(record, "target");
  25193. }
  25194. if (type === "break" || type === "continue") {
  25195. return !hasOwn.call(record, "value") && t.isLiteral(record.target);
  25196. }
  25197. if (type === "return" || type === "throw") {
  25198. return hasOwn.call(record, "value") && !hasOwn.call(record, "target");
  25199. }
  25200. return false;
  25201. }
  25202. // Not all offsets into emitter.listing are potential jump targets. For
  25203. // example, execution typically falls into the beginning of a try block
  25204. // without jumping directly there. This method returns the current offset
  25205. // without marking it, so that a switch case will not necessarily be
  25206. // generated for this offset (I say "not necessarily" because the same
  25207. // location might end up being marked in the process of emitting other
  25208. // statements). There's no logical harm in marking such locations as jump
  25209. // targets, but minimizing the number of switch cases keeps the generated
  25210. // code shorter.
  25211. Ep.getUnmarkedCurrentLoc = function () {
  25212. return t.numericLiteral(this.listing.length);
  25213. };
  25214. // The context.prev property takes the value of context.next whenever we
  25215. // evaluate the switch statement discriminant, which is generally good
  25216. // enough for tracking the last location we jumped to, but sometimes
  25217. // context.prev needs to be more precise, such as when we fall
  25218. // successfully out of a try block and into a finally block without
  25219. // jumping. This method exists to update context.prev to the freshest
  25220. // available location. If we were implementing a full interpreter, we
  25221. // would know the location of the current instruction with complete
  25222. // precision at all times, but we don't have that luxury here, as it would
  25223. // be costly and verbose to set context.prev before every statement.
  25224. Ep.updateContextPrevLoc = function (loc) {
  25225. if (loc) {
  25226. t.assertLiteral(loc);
  25227. if (loc.value === -1) {
  25228. // If an uninitialized location literal was passed in, set its value
  25229. // to the current this.listing.length.
  25230. loc.value = this.listing.length;
  25231. } else {
  25232. // Otherwise assert that the location matches the current offset.
  25233. _assert2.default.strictEqual(loc.value, this.listing.length);
  25234. }
  25235. } else {
  25236. loc = this.getUnmarkedCurrentLoc();
  25237. }
  25238. // Make sure context.prev is up to date in case we fell into this try
  25239. // statement without jumping to it. TODO Consider avoiding this
  25240. // assignment when we know control must have jumped here.
  25241. this.emitAssign(this.contextProperty("prev"), loc);
  25242. };
  25243. Ep.explodeExpression = function (path, ignoreResult) {
  25244. var expr = path.node;
  25245. if (expr) {
  25246. t.assertExpression(expr);
  25247. } else {
  25248. return expr;
  25249. }
  25250. var self = this;
  25251. var result = void 0; // Used optionally by several cases below.
  25252. var after = void 0;
  25253. function finish(expr) {
  25254. t.assertExpression(expr);
  25255. if (ignoreResult) {
  25256. self.emit(expr);
  25257. } else {
  25258. return expr;
  25259. }
  25260. }
  25261. // If the expression does not contain a leap, then we either emit the
  25262. // expression as a standalone statement or return it whole.
  25263. if (!meta.containsLeap(expr)) {
  25264. return finish(expr);
  25265. }
  25266. // If any child contains a leap (such as a yield or labeled continue or
  25267. // break statement), then any sibling subexpressions will almost
  25268. // certainly have to be exploded in order to maintain the order of their
  25269. // side effects relative to the leaping child(ren).
  25270. var hasLeapingChildren = meta.containsLeap.onlyChildren(expr);
  25271. // In order to save the rest of explodeExpression from a combinatorial
  25272. // trainwreck of special cases, explodeViaTempVar is responsible for
  25273. // deciding when a subexpression needs to be "exploded," which is my
  25274. // very technical term for emitting the subexpression as an assignment
  25275. // to a temporary variable and the substituting the temporary variable
  25276. // for the original subexpression. Think of exploded view diagrams, not
  25277. // Michael Bay movies. The point of exploding subexpressions is to
  25278. // control the precise order in which the generated code realizes the
  25279. // side effects of those subexpressions.
  25280. function explodeViaTempVar(tempVar, childPath, ignoreChildResult) {
  25281. _assert2.default.ok(!ignoreChildResult || !tempVar, "Ignoring the result of a child expression but forcing it to " + "be assigned to a temporary variable?");
  25282. var result = self.explodeExpression(childPath, ignoreChildResult);
  25283. if (ignoreChildResult) {
  25284. // Side effects already emitted above.
  25285. } else if (tempVar || hasLeapingChildren && !t.isLiteral(result)) {
  25286. // If tempVar was provided, then the result will always be assigned
  25287. // to it, even if the result does not otherwise need to be assigned
  25288. // to a temporary variable. When no tempVar is provided, we have
  25289. // the flexibility to decide whether a temporary variable is really
  25290. // necessary. Unfortunately, in general, a temporary variable is
  25291. // required whenever any child contains a yield expression, since it
  25292. // is difficult to prove (at all, let alone efficiently) whether
  25293. // this result would evaluate to the same value before and after the
  25294. // yield (see #206). One narrow case where we can prove it doesn't
  25295. // matter (and thus we do not need a temporary variable) is when the
  25296. // result in question is a Literal value.
  25297. result = self.emitAssign(tempVar || self.makeTempVar(), result);
  25298. }
  25299. return result;
  25300. }
  25301. // If ignoreResult is true, then we must take full responsibility for
  25302. // emitting the expression with all its side effects, and we should not
  25303. // return a result.
  25304. switch (expr.type) {
  25305. case "MemberExpression":
  25306. return finish(t.memberExpression(self.explodeExpression(path.get("object")), expr.computed ? explodeViaTempVar(null, path.get("property")) : expr.property, expr.computed));
  25307. case "CallExpression":
  25308. var calleePath = path.get("callee");
  25309. var argsPath = path.get("arguments");
  25310. var newCallee = void 0;
  25311. var newArgs = [];
  25312. var hasLeapingArgs = false;
  25313. argsPath.forEach(function (argPath) {
  25314. hasLeapingArgs = hasLeapingArgs || meta.containsLeap(argPath.node);
  25315. });
  25316. if (t.isMemberExpression(calleePath.node)) {
  25317. if (hasLeapingArgs) {
  25318. // If the arguments of the CallExpression contained any yield
  25319. // expressions, then we need to be sure to evaluate the callee
  25320. // before evaluating the arguments, but if the callee was a member
  25321. // expression, then we must be careful that the object of the
  25322. // member expression still gets bound to `this` for the call.
  25323. var newObject = explodeViaTempVar(
  25324. // Assign the exploded callee.object expression to a temporary
  25325. // variable so that we can use it twice without reevaluating it.
  25326. self.makeTempVar(), calleePath.get("object"));
  25327. var newProperty = calleePath.node.computed ? explodeViaTempVar(null, calleePath.get("property")) : calleePath.node.property;
  25328. newArgs.unshift(newObject);
  25329. newCallee = t.memberExpression(t.memberExpression(newObject, newProperty, calleePath.node.computed), t.identifier("call"), false);
  25330. } else {
  25331. newCallee = self.explodeExpression(calleePath);
  25332. }
  25333. } else {
  25334. newCallee = explodeViaTempVar(null, calleePath);
  25335. if (t.isMemberExpression(newCallee)) {
  25336. // If the callee was not previously a MemberExpression, then the
  25337. // CallExpression was "unqualified," meaning its `this` object
  25338. // should be the global object. If the exploded expression has
  25339. // become a MemberExpression (e.g. a context property, probably a
  25340. // temporary variable), then we need to force it to be unqualified
  25341. // by using the (0, object.property)(...) trick; otherwise, it
  25342. // will receive the object of the MemberExpression as its `this`
  25343. // object.
  25344. newCallee = t.sequenceExpression([t.numericLiteral(0), newCallee]);
  25345. }
  25346. }
  25347. argsPath.forEach(function (argPath) {
  25348. newArgs.push(explodeViaTempVar(null, argPath));
  25349. });
  25350. return finish(t.callExpression(newCallee, newArgs));
  25351. case "NewExpression":
  25352. return finish(t.newExpression(explodeViaTempVar(null, path.get("callee")), path.get("arguments").map(function (argPath) {
  25353. return explodeViaTempVar(null, argPath);
  25354. })));
  25355. case "ObjectExpression":
  25356. return finish(t.objectExpression(path.get("properties").map(function (propPath) {
  25357. if (propPath.isObjectProperty()) {
  25358. return t.objectProperty(propPath.node.key, explodeViaTempVar(null, propPath.get("value")), propPath.node.computed);
  25359. } else {
  25360. return propPath.node;
  25361. }
  25362. })));
  25363. case "ArrayExpression":
  25364. return finish(t.arrayExpression(path.get("elements").map(function (elemPath) {
  25365. return explodeViaTempVar(null, elemPath);
  25366. })));
  25367. case "SequenceExpression":
  25368. var lastIndex = expr.expressions.length - 1;
  25369. path.get("expressions").forEach(function (exprPath) {
  25370. if (exprPath.key === lastIndex) {
  25371. result = self.explodeExpression(exprPath, ignoreResult);
  25372. } else {
  25373. self.explodeExpression(exprPath, true);
  25374. }
  25375. });
  25376. return result;
  25377. case "LogicalExpression":
  25378. after = loc();
  25379. if (!ignoreResult) {
  25380. result = self.makeTempVar();
  25381. }
  25382. var left = explodeViaTempVar(result, path.get("left"));
  25383. if (expr.operator === "&&") {
  25384. self.jumpIfNot(left, after);
  25385. } else {
  25386. _assert2.default.strictEqual(expr.operator, "||");
  25387. self.jumpIf(left, after);
  25388. }
  25389. explodeViaTempVar(result, path.get("right"), ignoreResult);
  25390. self.mark(after);
  25391. return result;
  25392. case "ConditionalExpression":
  25393. var elseLoc = loc();
  25394. after = loc();
  25395. var test = self.explodeExpression(path.get("test"));
  25396. self.jumpIfNot(test, elseLoc);
  25397. if (!ignoreResult) {
  25398. result = self.makeTempVar();
  25399. }
  25400. explodeViaTempVar(result, path.get("consequent"), ignoreResult);
  25401. self.jump(after);
  25402. self.mark(elseLoc);
  25403. explodeViaTempVar(result, path.get("alternate"), ignoreResult);
  25404. self.mark(after);
  25405. return result;
  25406. case "UnaryExpression":
  25407. return finish(t.unaryExpression(expr.operator,
  25408. // Can't (and don't need to) break up the syntax of the argument.
  25409. // Think about delete a[b].
  25410. self.explodeExpression(path.get("argument")), !!expr.prefix));
  25411. case "BinaryExpression":
  25412. return finish(t.binaryExpression(expr.operator, explodeViaTempVar(null, path.get("left")), explodeViaTempVar(null, path.get("right"))));
  25413. case "AssignmentExpression":
  25414. return finish(t.assignmentExpression(expr.operator, self.explodeExpression(path.get("left")), self.explodeExpression(path.get("right"))));
  25415. case "UpdateExpression":
  25416. return finish(t.updateExpression(expr.operator, self.explodeExpression(path.get("argument")), expr.prefix));
  25417. case "YieldExpression":
  25418. after = loc();
  25419. var arg = expr.argument && self.explodeExpression(path.get("argument"));
  25420. if (arg && expr.delegate) {
  25421. var _result = self.makeTempVar();
  25422. self.emit(t.returnStatement(t.callExpression(self.contextProperty("delegateYield"), [arg, t.stringLiteral(_result.property.name), after])));
  25423. self.mark(after);
  25424. return _result;
  25425. }
  25426. self.emitAssign(self.contextProperty("next"), after);
  25427. self.emit(t.returnStatement(arg || null));
  25428. self.mark(after);
  25429. return self.contextProperty("sent");
  25430. default:
  25431. throw new Error("unknown Expression of type " + (0, _stringify2.default)(expr.type));
  25432. }
  25433. };
  25434. /***/ }),
  25435. /* 284 */
  25436. /***/ (function(module, exports) {
  25437. 'use strict';
  25438. module.exports = function (str) {
  25439. var isExtendedLengthPath = /^\\\\\?\\/.test(str);
  25440. var hasNonAscii = /[^\x00-\x80]+/.test(str);
  25441. if (isExtendedLengthPath || hasNonAscii) {
  25442. return str;
  25443. }
  25444. return str.replace(/\\/g, '/');
  25445. };
  25446. /***/ }),
  25447. /* 285 */
  25448. /***/ (function(module, exports, __webpack_require__) {
  25449. 'use strict';
  25450. /* -*- Mode: js; js-indent-level: 2; -*- */
  25451. /*
  25452. * Copyright 2011 Mozilla Foundation and contributors
  25453. * Licensed under the New BSD license. See LICENSE or:
  25454. * http://opensource.org/licenses/BSD-3-Clause
  25455. */
  25456. var util = __webpack_require__(63);
  25457. var has = Object.prototype.hasOwnProperty;
  25458. /**
  25459. * A data structure which is a combination of an array and a set. Adding a new
  25460. * member is O(1), testing for membership is O(1), and finding the index of an
  25461. * element is O(1). Removing elements from the set is not supported. Only
  25462. * strings are supported for membership.
  25463. */
  25464. function ArraySet() {
  25465. this._array = [];
  25466. this._set = Object.create(null);
  25467. }
  25468. /**
  25469. * Static method for creating ArraySet instances from an existing array.
  25470. */
  25471. ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {
  25472. var set = new ArraySet();
  25473. for (var i = 0, len = aArray.length; i < len; i++) {
  25474. set.add(aArray[i], aAllowDuplicates);
  25475. }
  25476. return set;
  25477. };
  25478. /**
  25479. * Return how many unique items are in this ArraySet. If duplicates have been
  25480. * added, than those do not count towards the size.
  25481. *
  25482. * @returns Number
  25483. */
  25484. ArraySet.prototype.size = function ArraySet_size() {
  25485. return Object.getOwnPropertyNames(this._set).length;
  25486. };
  25487. /**
  25488. * Add the given string to this set.
  25489. *
  25490. * @param String aStr
  25491. */
  25492. ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {
  25493. var sStr = util.toSetString(aStr);
  25494. var isDuplicate = has.call(this._set, sStr);
  25495. var idx = this._array.length;
  25496. if (!isDuplicate || aAllowDuplicates) {
  25497. this._array.push(aStr);
  25498. }
  25499. if (!isDuplicate) {
  25500. this._set[sStr] = idx;
  25501. }
  25502. };
  25503. /**
  25504. * Is the given string a member of this set?
  25505. *
  25506. * @param String aStr
  25507. */
  25508. ArraySet.prototype.has = function ArraySet_has(aStr) {
  25509. var sStr = util.toSetString(aStr);
  25510. return has.call(this._set, sStr);
  25511. };
  25512. /**
  25513. * What is the index of the given string in the array?
  25514. *
  25515. * @param String aStr
  25516. */
  25517. ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {
  25518. var sStr = util.toSetString(aStr);
  25519. if (has.call(this._set, sStr)) {
  25520. return this._set[sStr];
  25521. }
  25522. throw new Error('"' + aStr + '" is not in the set.');
  25523. };
  25524. /**
  25525. * What is the element at the given index?
  25526. *
  25527. * @param Number aIdx
  25528. */
  25529. ArraySet.prototype.at = function ArraySet_at(aIdx) {
  25530. if (aIdx >= 0 && aIdx < this._array.length) {
  25531. return this._array[aIdx];
  25532. }
  25533. throw new Error('No element indexed by ' + aIdx);
  25534. };
  25535. /**
  25536. * Returns the array representation of this set (which has the proper indices
  25537. * indicated by indexOf). Note that this is a copy of the internal array used
  25538. * for storing the members so that no one can mess with internal state.
  25539. */
  25540. ArraySet.prototype.toArray = function ArraySet_toArray() {
  25541. return this._array.slice();
  25542. };
  25543. exports.ArraySet = ArraySet;
  25544. /***/ }),
  25545. /* 286 */
  25546. /***/ (function(module, exports, __webpack_require__) {
  25547. "use strict";
  25548. /* -*- Mode: js; js-indent-level: 2; -*- */
  25549. /*
  25550. * Copyright 2011 Mozilla Foundation and contributors
  25551. * Licensed under the New BSD license. See LICENSE or:
  25552. * http://opensource.org/licenses/BSD-3-Clause
  25553. *
  25554. * Based on the Base 64 VLQ implementation in Closure Compiler:
  25555. * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java
  25556. *
  25557. * Copyright 2011 The Closure Compiler Authors. All rights reserved.
  25558. * Redistribution and use in source and binary forms, with or without
  25559. * modification, are permitted provided that the following conditions are
  25560. * met:
  25561. *
  25562. * * Redistributions of source code must retain the above copyright
  25563. * notice, this list of conditions and the following disclaimer.
  25564. * * Redistributions in binary form must reproduce the above
  25565. * copyright notice, this list of conditions and the following
  25566. * disclaimer in the documentation and/or other materials provided
  25567. * with the distribution.
  25568. * * Neither the name of Google Inc. nor the names of its
  25569. * contributors may be used to endorse or promote products derived
  25570. * from this software without specific prior written permission.
  25571. *
  25572. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  25573. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  25574. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  25575. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  25576. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  25577. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  25578. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  25579. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  25580. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  25581. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  25582. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  25583. */
  25584. var base64 = __webpack_require__(616);
  25585. // A single base 64 digit can contain 6 bits of data. For the base 64 variable
  25586. // length quantities we use in the source map spec, the first bit is the sign,
  25587. // the next four bits are the actual value, and the 6th bit is the
  25588. // continuation bit. The continuation bit tells us whether there are more
  25589. // digits in this value following this digit.
  25590. //
  25591. // Continuation
  25592. // | Sign
  25593. // | |
  25594. // V V
  25595. // 101011
  25596. var VLQ_BASE_SHIFT = 5;
  25597. // binary: 100000
  25598. var VLQ_BASE = 1 << VLQ_BASE_SHIFT;
  25599. // binary: 011111
  25600. var VLQ_BASE_MASK = VLQ_BASE - 1;
  25601. // binary: 100000
  25602. var VLQ_CONTINUATION_BIT = VLQ_BASE;
  25603. /**
  25604. * Converts from a two-complement value to a value where the sign bit is
  25605. * placed in the least significant bit. For example, as decimals:
  25606. * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary)
  25607. * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)
  25608. */
  25609. function toVLQSigned(aValue) {
  25610. return aValue < 0 ? (-aValue << 1) + 1 : (aValue << 1) + 0;
  25611. }
  25612. /**
  25613. * Converts to a two-complement value from a value where the sign bit is
  25614. * placed in the least significant bit. For example, as decimals:
  25615. * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1
  25616. * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2
  25617. */
  25618. function fromVLQSigned(aValue) {
  25619. var isNegative = (aValue & 1) === 1;
  25620. var shifted = aValue >> 1;
  25621. return isNegative ? -shifted : shifted;
  25622. }
  25623. /**
  25624. * Returns the base 64 VLQ encoded value.
  25625. */
  25626. exports.encode = function base64VLQ_encode(aValue) {
  25627. var encoded = "";
  25628. var digit;
  25629. var vlq = toVLQSigned(aValue);
  25630. do {
  25631. digit = vlq & VLQ_BASE_MASK;
  25632. vlq >>>= VLQ_BASE_SHIFT;
  25633. if (vlq > 0) {
  25634. // There are still more digits in this value, so we must make sure the
  25635. // continuation bit is marked.
  25636. digit |= VLQ_CONTINUATION_BIT;
  25637. }
  25638. encoded += base64.encode(digit);
  25639. } while (vlq > 0);
  25640. return encoded;
  25641. };
  25642. /**
  25643. * Decodes the next base 64 VLQ value from the given string and returns the
  25644. * value and the rest of the string via the out parameter.
  25645. */
  25646. exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {
  25647. var strLen = aStr.length;
  25648. var result = 0;
  25649. var shift = 0;
  25650. var continuation, digit;
  25651. do {
  25652. if (aIndex >= strLen) {
  25653. throw new Error("Expected more digits in base 64 VLQ value.");
  25654. }
  25655. digit = base64.decode(aStr.charCodeAt(aIndex++));
  25656. if (digit === -1) {
  25657. throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1));
  25658. }
  25659. continuation = !!(digit & VLQ_CONTINUATION_BIT);
  25660. digit &= VLQ_BASE_MASK;
  25661. result = result + (digit << shift);
  25662. shift += VLQ_BASE_SHIFT;
  25663. } while (continuation);
  25664. aOutParam.value = fromVLQSigned(result);
  25665. aOutParam.rest = aIndex;
  25666. };
  25667. /***/ }),
  25668. /* 287 */
  25669. /***/ (function(module, exports, __webpack_require__) {
  25670. 'use strict';
  25671. /* -*- Mode: js; js-indent-level: 2; -*- */
  25672. /*
  25673. * Copyright 2011 Mozilla Foundation and contributors
  25674. * Licensed under the New BSD license. See LICENSE or:
  25675. * http://opensource.org/licenses/BSD-3-Clause
  25676. */
  25677. var base64VLQ = __webpack_require__(286);
  25678. var util = __webpack_require__(63);
  25679. var ArraySet = __webpack_require__(285).ArraySet;
  25680. var MappingList = __webpack_require__(618).MappingList;
  25681. /**
  25682. * An instance of the SourceMapGenerator represents a source map which is
  25683. * being built incrementally. You may pass an object with the following
  25684. * properties:
  25685. *
  25686. * - file: The filename of the generated source.
  25687. * - sourceRoot: A root for all relative URLs in this source map.
  25688. */
  25689. function SourceMapGenerator(aArgs) {
  25690. if (!aArgs) {
  25691. aArgs = {};
  25692. }
  25693. this._file = util.getArg(aArgs, 'file', null);
  25694. this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null);
  25695. this._skipValidation = util.getArg(aArgs, 'skipValidation', false);
  25696. this._sources = new ArraySet();
  25697. this._names = new ArraySet();
  25698. this._mappings = new MappingList();
  25699. this._sourcesContents = null;
  25700. }
  25701. SourceMapGenerator.prototype._version = 3;
  25702. /**
  25703. * Creates a new SourceMapGenerator based on a SourceMapConsumer
  25704. *
  25705. * @param aSourceMapConsumer The SourceMap.
  25706. */
  25707. SourceMapGenerator.fromSourceMap = function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) {
  25708. var sourceRoot = aSourceMapConsumer.sourceRoot;
  25709. var generator = new SourceMapGenerator({
  25710. file: aSourceMapConsumer.file,
  25711. sourceRoot: sourceRoot
  25712. });
  25713. aSourceMapConsumer.eachMapping(function (mapping) {
  25714. var newMapping = {
  25715. generated: {
  25716. line: mapping.generatedLine,
  25717. column: mapping.generatedColumn
  25718. }
  25719. };
  25720. if (mapping.source != null) {
  25721. newMapping.source = mapping.source;
  25722. if (sourceRoot != null) {
  25723. newMapping.source = util.relative(sourceRoot, newMapping.source);
  25724. }
  25725. newMapping.original = {
  25726. line: mapping.originalLine,
  25727. column: mapping.originalColumn
  25728. };
  25729. if (mapping.name != null) {
  25730. newMapping.name = mapping.name;
  25731. }
  25732. }
  25733. generator.addMapping(newMapping);
  25734. });
  25735. aSourceMapConsumer.sources.forEach(function (sourceFile) {
  25736. var content = aSourceMapConsumer.sourceContentFor(sourceFile);
  25737. if (content != null) {
  25738. generator.setSourceContent(sourceFile, content);
  25739. }
  25740. });
  25741. return generator;
  25742. };
  25743. /**
  25744. * Add a single mapping from original source line and column to the generated
  25745. * source's line and column for this source map being created. The mapping
  25746. * object should have the following properties:
  25747. *
  25748. * - generated: An object with the generated line and column positions.
  25749. * - original: An object with the original line and column positions.
  25750. * - source: The original source file (relative to the sourceRoot).
  25751. * - name: An optional original token name for this mapping.
  25752. */
  25753. SourceMapGenerator.prototype.addMapping = function SourceMapGenerator_addMapping(aArgs) {
  25754. var generated = util.getArg(aArgs, 'generated');
  25755. var original = util.getArg(aArgs, 'original', null);
  25756. var source = util.getArg(aArgs, 'source', null);
  25757. var name = util.getArg(aArgs, 'name', null);
  25758. if (!this._skipValidation) {
  25759. this._validateMapping(generated, original, source, name);
  25760. }
  25761. if (source != null) {
  25762. source = String(source);
  25763. if (!this._sources.has(source)) {
  25764. this._sources.add(source);
  25765. }
  25766. }
  25767. if (name != null) {
  25768. name = String(name);
  25769. if (!this._names.has(name)) {
  25770. this._names.add(name);
  25771. }
  25772. }
  25773. this._mappings.add({
  25774. generatedLine: generated.line,
  25775. generatedColumn: generated.column,
  25776. originalLine: original != null && original.line,
  25777. originalColumn: original != null && original.column,
  25778. source: source,
  25779. name: name
  25780. });
  25781. };
  25782. /**
  25783. * Set the source content for a source file.
  25784. */
  25785. SourceMapGenerator.prototype.setSourceContent = function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {
  25786. var source = aSourceFile;
  25787. if (this._sourceRoot != null) {
  25788. source = util.relative(this._sourceRoot, source);
  25789. }
  25790. if (aSourceContent != null) {
  25791. // Add the source content to the _sourcesContents map.
  25792. // Create a new _sourcesContents map if the property is null.
  25793. if (!this._sourcesContents) {
  25794. this._sourcesContents = Object.create(null);
  25795. }
  25796. this._sourcesContents[util.toSetString(source)] = aSourceContent;
  25797. } else if (this._sourcesContents) {
  25798. // Remove the source file from the _sourcesContents map.
  25799. // If the _sourcesContents map is empty, set the property to null.
  25800. delete this._sourcesContents[util.toSetString(source)];
  25801. if (Object.keys(this._sourcesContents).length === 0) {
  25802. this._sourcesContents = null;
  25803. }
  25804. }
  25805. };
  25806. /**
  25807. * Applies the mappings of a sub-source-map for a specific source file to the
  25808. * source map being generated. Each mapping to the supplied source file is
  25809. * rewritten using the supplied source map. Note: The resolution for the
  25810. * resulting mappings is the minimium of this map and the supplied map.
  25811. *
  25812. * @param aSourceMapConsumer The source map to be applied.
  25813. * @param aSourceFile Optional. The filename of the source file.
  25814. * If omitted, SourceMapConsumer's file property will be used.
  25815. * @param aSourceMapPath Optional. The dirname of the path to the source map
  25816. * to be applied. If relative, it is relative to the SourceMapConsumer.
  25817. * This parameter is needed when the two source maps aren't in the same
  25818. * directory, and the source map to be applied contains relative source
  25819. * paths. If so, those relative source paths need to be rewritten
  25820. * relative to the SourceMapGenerator.
  25821. */
  25822. SourceMapGenerator.prototype.applySourceMap = function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {
  25823. var sourceFile = aSourceFile;
  25824. // If aSourceFile is omitted, we will use the file property of the SourceMap
  25825. if (aSourceFile == null) {
  25826. if (aSourceMapConsumer.file == null) {
  25827. throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' + 'or the source map\'s "file" property. Both were omitted.');
  25828. }
  25829. sourceFile = aSourceMapConsumer.file;
  25830. }
  25831. var sourceRoot = this._sourceRoot;
  25832. // Make "sourceFile" relative if an absolute Url is passed.
  25833. if (sourceRoot != null) {
  25834. sourceFile = util.relative(sourceRoot, sourceFile);
  25835. }
  25836. // Applying the SourceMap can add and remove items from the sources and
  25837. // the names array.
  25838. var newSources = new ArraySet();
  25839. var newNames = new ArraySet();
  25840. // Find mappings for the "sourceFile"
  25841. this._mappings.unsortedForEach(function (mapping) {
  25842. if (mapping.source === sourceFile && mapping.originalLine != null) {
  25843. // Check if it can be mapped by the source map, then update the mapping.
  25844. var original = aSourceMapConsumer.originalPositionFor({
  25845. line: mapping.originalLine,
  25846. column: mapping.originalColumn
  25847. });
  25848. if (original.source != null) {
  25849. // Copy mapping
  25850. mapping.source = original.source;
  25851. if (aSourceMapPath != null) {
  25852. mapping.source = util.join(aSourceMapPath, mapping.source);
  25853. }
  25854. if (sourceRoot != null) {
  25855. mapping.source = util.relative(sourceRoot, mapping.source);
  25856. }
  25857. mapping.originalLine = original.line;
  25858. mapping.originalColumn = original.column;
  25859. if (original.name != null) {
  25860. mapping.name = original.name;
  25861. }
  25862. }
  25863. }
  25864. var source = mapping.source;
  25865. if (source != null && !newSources.has(source)) {
  25866. newSources.add(source);
  25867. }
  25868. var name = mapping.name;
  25869. if (name != null && !newNames.has(name)) {
  25870. newNames.add(name);
  25871. }
  25872. }, this);
  25873. this._sources = newSources;
  25874. this._names = newNames;
  25875. // Copy sourcesContents of applied map.
  25876. aSourceMapConsumer.sources.forEach(function (sourceFile) {
  25877. var content = aSourceMapConsumer.sourceContentFor(sourceFile);
  25878. if (content != null) {
  25879. if (aSourceMapPath != null) {
  25880. sourceFile = util.join(aSourceMapPath, sourceFile);
  25881. }
  25882. if (sourceRoot != null) {
  25883. sourceFile = util.relative(sourceRoot, sourceFile);
  25884. }
  25885. this.setSourceContent(sourceFile, content);
  25886. }
  25887. }, this);
  25888. };
  25889. /**
  25890. * A mapping can have one of the three levels of data:
  25891. *
  25892. * 1. Just the generated position.
  25893. * 2. The Generated position, original position, and original source.
  25894. * 3. Generated and original position, original source, as well as a name
  25895. * token.
  25896. *
  25897. * To maintain consistency, we validate that any new mapping being added falls
  25898. * in to one of these categories.
  25899. */
  25900. SourceMapGenerator.prototype._validateMapping = function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, aName) {
  25901. if (aGenerated && 'line' in aGenerated && 'column' in aGenerated && aGenerated.line > 0 && aGenerated.column >= 0 && !aOriginal && !aSource && !aName) {
  25902. // Case 1.
  25903. return;
  25904. } else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated && aOriginal && 'line' in aOriginal && 'column' in aOriginal && aGenerated.line > 0 && aGenerated.column >= 0 && aOriginal.line > 0 && aOriginal.column >= 0 && aSource) {
  25905. // Cases 2 and 3.
  25906. return;
  25907. } else {
  25908. throw new Error('Invalid mapping: ' + JSON.stringify({
  25909. generated: aGenerated,
  25910. source: aSource,
  25911. original: aOriginal,
  25912. name: aName
  25913. }));
  25914. }
  25915. };
  25916. /**
  25917. * Serialize the accumulated mappings in to the stream of base 64 VLQs
  25918. * specified by the source map format.
  25919. */
  25920. SourceMapGenerator.prototype._serializeMappings = function SourceMapGenerator_serializeMappings() {
  25921. var previousGeneratedColumn = 0;
  25922. var previousGeneratedLine = 1;
  25923. var previousOriginalColumn = 0;
  25924. var previousOriginalLine = 0;
  25925. var previousName = 0;
  25926. var previousSource = 0;
  25927. var result = '';
  25928. var next;
  25929. var mapping;
  25930. var nameIdx;
  25931. var sourceIdx;
  25932. var mappings = this._mappings.toArray();
  25933. for (var i = 0, len = mappings.length; i < len; i++) {
  25934. mapping = mappings[i];
  25935. next = '';
  25936. if (mapping.generatedLine !== previousGeneratedLine) {
  25937. previousGeneratedColumn = 0;
  25938. while (mapping.generatedLine !== previousGeneratedLine) {
  25939. next += ';';
  25940. previousGeneratedLine++;
  25941. }
  25942. } else {
  25943. if (i > 0) {
  25944. if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) {
  25945. continue;
  25946. }
  25947. next += ',';
  25948. }
  25949. }
  25950. next += base64VLQ.encode(mapping.generatedColumn - previousGeneratedColumn);
  25951. previousGeneratedColumn = mapping.generatedColumn;
  25952. if (mapping.source != null) {
  25953. sourceIdx = this._sources.indexOf(mapping.source);
  25954. next += base64VLQ.encode(sourceIdx - previousSource);
  25955. previousSource = sourceIdx;
  25956. // lines are stored 0-based in SourceMap spec version 3
  25957. next += base64VLQ.encode(mapping.originalLine - 1 - previousOriginalLine);
  25958. previousOriginalLine = mapping.originalLine - 1;
  25959. next += base64VLQ.encode(mapping.originalColumn - previousOriginalColumn);
  25960. previousOriginalColumn = mapping.originalColumn;
  25961. if (mapping.name != null) {
  25962. nameIdx = this._names.indexOf(mapping.name);
  25963. next += base64VLQ.encode(nameIdx - previousName);
  25964. previousName = nameIdx;
  25965. }
  25966. }
  25967. result += next;
  25968. }
  25969. return result;
  25970. };
  25971. SourceMapGenerator.prototype._generateSourcesContent = function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {
  25972. return aSources.map(function (source) {
  25973. if (!this._sourcesContents) {
  25974. return null;
  25975. }
  25976. if (aSourceRoot != null) {
  25977. source = util.relative(aSourceRoot, source);
  25978. }
  25979. var key = util.toSetString(source);
  25980. return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) ? this._sourcesContents[key] : null;
  25981. }, this);
  25982. };
  25983. /**
  25984. * Externalize the source map.
  25985. */
  25986. SourceMapGenerator.prototype.toJSON = function SourceMapGenerator_toJSON() {
  25987. var map = {
  25988. version: this._version,
  25989. sources: this._sources.toArray(),
  25990. names: this._names.toArray(),
  25991. mappings: this._serializeMappings()
  25992. };
  25993. if (this._file != null) {
  25994. map.file = this._file;
  25995. }
  25996. if (this._sourceRoot != null) {
  25997. map.sourceRoot = this._sourceRoot;
  25998. }
  25999. if (this._sourcesContents) {
  26000. map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);
  26001. }
  26002. return map;
  26003. };
  26004. /**
  26005. * Render the source map being generated to a string.
  26006. */
  26007. SourceMapGenerator.prototype.toString = function SourceMapGenerator_toString() {
  26008. return JSON.stringify(this.toJSON());
  26009. };
  26010. exports.SourceMapGenerator = SourceMapGenerator;
  26011. /***/ }),
  26012. /* 288 */
  26013. /***/ (function(module, exports, __webpack_require__) {
  26014. 'use strict';
  26015. /*
  26016. * Copyright 2009-2011 Mozilla Foundation and contributors
  26017. * Licensed under the New BSD license. See LICENSE.txt or:
  26018. * http://opensource.org/licenses/BSD-3-Clause
  26019. */
  26020. exports.SourceMapGenerator = __webpack_require__(287).SourceMapGenerator;
  26021. exports.SourceMapConsumer = __webpack_require__(620).SourceMapConsumer;
  26022. exports.SourceNode = __webpack_require__(621).SourceNode;
  26023. /***/ }),
  26024. /* 289 */
  26025. /***/ (function(module, exports, __webpack_require__) {
  26026. /* WEBPACK VAR INJECTION */(function(module) {'use strict';
  26027. function assembleStyles() {
  26028. var styles = {
  26029. modifiers: {
  26030. reset: [0, 0],
  26031. bold: [1, 22], // 21 isn't widely supported and 22 does the same thing
  26032. dim: [2, 22],
  26033. italic: [3, 23],
  26034. underline: [4, 24],
  26035. inverse: [7, 27],
  26036. hidden: [8, 28],
  26037. strikethrough: [9, 29]
  26038. },
  26039. colors: {
  26040. black: [30, 39],
  26041. red: [31, 39],
  26042. green: [32, 39],
  26043. yellow: [33, 39],
  26044. blue: [34, 39],
  26045. magenta: [35, 39],
  26046. cyan: [36, 39],
  26047. white: [37, 39],
  26048. gray: [90, 39]
  26049. },
  26050. bgColors: {
  26051. bgBlack: [40, 49],
  26052. bgRed: [41, 49],
  26053. bgGreen: [42, 49],
  26054. bgYellow: [43, 49],
  26055. bgBlue: [44, 49],
  26056. bgMagenta: [45, 49],
  26057. bgCyan: [46, 49],
  26058. bgWhite: [47, 49]
  26059. }
  26060. };
  26061. // fix humans
  26062. styles.colors.grey = styles.colors.gray;
  26063. Object.keys(styles).forEach(function (groupName) {
  26064. var group = styles[groupName];
  26065. Object.keys(group).forEach(function (styleName) {
  26066. var style = group[styleName];
  26067. styles[styleName] = group[styleName] = {
  26068. open: '\x1B[' + style[0] + 'm',
  26069. close: '\x1B[' + style[1] + 'm'
  26070. };
  26071. });
  26072. Object.defineProperty(styles, groupName, {
  26073. value: group,
  26074. enumerable: false
  26075. });
  26076. });
  26077. return styles;
  26078. }
  26079. Object.defineProperty(module, 'exports', {
  26080. enumerable: true,
  26081. get: assembleStyles
  26082. });
  26083. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(39)(module)))
  26084. /***/ }),
  26085. /* 290 */
  26086. /***/ (function(module, exports, __webpack_require__) {
  26087. "use strict";
  26088. module.exports = __webpack_require__(182);
  26089. /***/ }),
  26090. /* 291 */
  26091. /***/ (function(module, exports) {
  26092. "use strict";
  26093. exports.__esModule = true;
  26094. exports.default = getPossiblePluginNames;
  26095. function getPossiblePluginNames(pluginName) {
  26096. return ["babel-plugin-" + pluginName, pluginName];
  26097. }
  26098. module.exports = exports["default"];
  26099. /***/ }),
  26100. /* 292 */
  26101. /***/ (function(module, exports) {
  26102. "use strict";
  26103. exports.__esModule = true;
  26104. exports.default = getPossiblePresetNames;
  26105. function getPossiblePresetNames(presetName) {
  26106. var possibleNames = ["babel-preset-" + presetName, presetName];
  26107. var matches = presetName.match(/^(@[^/]+)\/(.+)$/);
  26108. if (matches) {
  26109. var orgName = matches[1],
  26110. presetPath = matches[2];
  26111. possibleNames.push(orgName + "/babel-preset-" + presetPath);
  26112. }
  26113. return possibleNames;
  26114. }
  26115. module.exports = exports["default"];
  26116. /***/ }),
  26117. /* 293 */
  26118. /***/ (function(module, exports, __webpack_require__) {
  26119. "use strict";
  26120. exports.__esModule = true;
  26121. var _getIterator2 = __webpack_require__(2);
  26122. var _getIterator3 = _interopRequireDefault(_getIterator2);
  26123. exports.default = function (dest, src) {
  26124. if (!dest || !src) return;
  26125. return (0, _mergeWith2.default)(dest, src, function (a, b) {
  26126. if (b && Array.isArray(a)) {
  26127. var newArray = b.slice(0);
  26128. for (var _iterator = a, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
  26129. var _ref;
  26130. if (_isArray) {
  26131. if (_i >= _iterator.length) break;
  26132. _ref = _iterator[_i++];
  26133. } else {
  26134. _i = _iterator.next();
  26135. if (_i.done) break;
  26136. _ref = _i.value;
  26137. }
  26138. var item = _ref;
  26139. if (newArray.indexOf(item) < 0) {
  26140. newArray.push(item);
  26141. }
  26142. }
  26143. return newArray;
  26144. }
  26145. });
  26146. };
  26147. var _mergeWith = __webpack_require__(590);
  26148. var _mergeWith2 = _interopRequireDefault(_mergeWith);
  26149. function _interopRequireDefault(obj) {
  26150. return obj && obj.__esModule ? obj : { default: obj };
  26151. }
  26152. module.exports = exports["default"];
  26153. /***/ }),
  26154. /* 294 */
  26155. /***/ (function(module, exports, __webpack_require__) {
  26156. "use strict";
  26157. exports.__esModule = true;
  26158. exports.default = function (ast, comments, tokens) {
  26159. if (ast) {
  26160. if (ast.type === "Program") {
  26161. return t.file(ast, comments || [], tokens || []);
  26162. } else if (ast.type === "File") {
  26163. return ast;
  26164. }
  26165. }
  26166. throw new Error("Not a valid ast?");
  26167. };
  26168. var _babelTypes = __webpack_require__(1);
  26169. var t = _interopRequireWildcard(_babelTypes);
  26170. function _interopRequireWildcard(obj) {
  26171. if (obj && obj.__esModule) {
  26172. return obj;
  26173. } else {
  26174. var newObj = {};if (obj != null) {
  26175. for (var key in obj) {
  26176. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  26177. }
  26178. }newObj.default = obj;return newObj;
  26179. }
  26180. }
  26181. module.exports = exports["default"];
  26182. /***/ }),
  26183. /* 295 */
  26184. /***/ (function(module, exports, __webpack_require__) {
  26185. "use strict";
  26186. exports.__esModule = true;
  26187. exports.default = function (whitelist) {
  26188. var outputType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "global";
  26189. var namespace = t.identifier("babelHelpers");
  26190. var builder = function builder(body) {
  26191. return buildHelpers(body, namespace, whitelist);
  26192. };
  26193. var tree = void 0;
  26194. var build = {
  26195. global: buildGlobal,
  26196. umd: buildUmd,
  26197. var: buildVar
  26198. }[outputType];
  26199. if (build) {
  26200. tree = build(namespace, builder);
  26201. } else {
  26202. throw new Error(messages.get("unsupportedOutputType", outputType));
  26203. }
  26204. return (0, _babelGenerator2.default)(tree).code;
  26205. };
  26206. var _babelHelpers = __webpack_require__(194);
  26207. var helpers = _interopRequireWildcard(_babelHelpers);
  26208. var _babelGenerator = __webpack_require__(186);
  26209. var _babelGenerator2 = _interopRequireDefault(_babelGenerator);
  26210. var _babelMessages = __webpack_require__(20);
  26211. var messages = _interopRequireWildcard(_babelMessages);
  26212. var _babelTemplate = __webpack_require__(4);
  26213. var _babelTemplate2 = _interopRequireDefault(_babelTemplate);
  26214. var _babelTypes = __webpack_require__(1);
  26215. var t = _interopRequireWildcard(_babelTypes);
  26216. function _interopRequireDefault(obj) {
  26217. return obj && obj.__esModule ? obj : { default: obj };
  26218. }
  26219. function _interopRequireWildcard(obj) {
  26220. if (obj && obj.__esModule) {
  26221. return obj;
  26222. } else {
  26223. var newObj = {};if (obj != null) {
  26224. for (var key in obj) {
  26225. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  26226. }
  26227. }newObj.default = obj;return newObj;
  26228. }
  26229. }
  26230. var buildUmdWrapper = (0, _babelTemplate2.default)("\n (function (root, factory) {\n if (typeof define === \"function\" && define.amd) {\n define(AMD_ARGUMENTS, factory);\n } else if (typeof exports === \"object\") {\n factory(COMMON_ARGUMENTS);\n } else {\n factory(BROWSER_ARGUMENTS);\n }\n })(UMD_ROOT, function (FACTORY_PARAMETERS) {\n FACTORY_BODY\n });\n");
  26231. function buildGlobal(namespace, builder) {
  26232. var body = [];
  26233. var container = t.functionExpression(null, [t.identifier("global")], t.blockStatement(body));
  26234. var tree = t.program([t.expressionStatement(t.callExpression(container, [helpers.get("selfGlobal")]))]);
  26235. body.push(t.variableDeclaration("var", [t.variableDeclarator(namespace, t.assignmentExpression("=", t.memberExpression(t.identifier("global"), namespace), t.objectExpression([])))]));
  26236. builder(body);
  26237. return tree;
  26238. }
  26239. function buildUmd(namespace, builder) {
  26240. var body = [];
  26241. body.push(t.variableDeclaration("var", [t.variableDeclarator(namespace, t.identifier("global"))]));
  26242. builder(body);
  26243. return t.program([buildUmdWrapper({
  26244. FACTORY_PARAMETERS: t.identifier("global"),
  26245. BROWSER_ARGUMENTS: t.assignmentExpression("=", t.memberExpression(t.identifier("root"), namespace), t.objectExpression([])),
  26246. COMMON_ARGUMENTS: t.identifier("exports"),
  26247. AMD_ARGUMENTS: t.arrayExpression([t.stringLiteral("exports")]),
  26248. FACTORY_BODY: body,
  26249. UMD_ROOT: t.identifier("this")
  26250. })]);
  26251. }
  26252. function buildVar(namespace, builder) {
  26253. var body = [];
  26254. body.push(t.variableDeclaration("var", [t.variableDeclarator(namespace, t.objectExpression([]))]));
  26255. builder(body);
  26256. body.push(t.expressionStatement(namespace));
  26257. return t.program(body);
  26258. }
  26259. function buildHelpers(body, namespace, whitelist) {
  26260. helpers.list.forEach(function (name) {
  26261. if (whitelist && whitelist.indexOf(name) < 0) return;
  26262. var key = t.identifier(name);
  26263. body.push(t.expressionStatement(t.assignmentExpression("=", t.memberExpression(namespace, key), helpers.get(name))));
  26264. });
  26265. }
  26266. module.exports = exports["default"];
  26267. /***/ }),
  26268. /* 296 */
  26269. /***/ (function(module, exports, __webpack_require__) {
  26270. "use strict";
  26271. exports.__esModule = true;
  26272. var _plugin = __webpack_require__(65);
  26273. var _plugin2 = _interopRequireDefault(_plugin);
  26274. var _sortBy = __webpack_require__(594);
  26275. var _sortBy2 = _interopRequireDefault(_sortBy);
  26276. function _interopRequireDefault(obj) {
  26277. return obj && obj.__esModule ? obj : { default: obj };
  26278. }
  26279. exports.default = new _plugin2.default({
  26280. name: "internal.blockHoist",
  26281. visitor: {
  26282. Block: {
  26283. exit: function exit(_ref) {
  26284. var node = _ref.node;
  26285. var hasChange = false;
  26286. for (var i = 0; i < node.body.length; i++) {
  26287. var bodyNode = node.body[i];
  26288. if (bodyNode && bodyNode._blockHoist != null) {
  26289. hasChange = true;
  26290. break;
  26291. }
  26292. }
  26293. if (!hasChange) return;
  26294. node.body = (0, _sortBy2.default)(node.body, function (bodyNode) {
  26295. var priority = bodyNode && bodyNode._blockHoist;
  26296. if (priority == null) priority = 1;
  26297. if (priority === true) priority = 2;
  26298. return -1 * priority;
  26299. });
  26300. }
  26301. }
  26302. }
  26303. });
  26304. module.exports = exports["default"];
  26305. /***/ }),
  26306. /* 297 */
  26307. /***/ (function(module, exports, __webpack_require__) {
  26308. "use strict";
  26309. exports.__esModule = true;
  26310. var _symbol = __webpack_require__(10);
  26311. var _symbol2 = _interopRequireDefault(_symbol);
  26312. var _plugin = __webpack_require__(65);
  26313. var _plugin2 = _interopRequireDefault(_plugin);
  26314. var _babelTypes = __webpack_require__(1);
  26315. var t = _interopRequireWildcard(_babelTypes);
  26316. function _interopRequireWildcard(obj) {
  26317. if (obj && obj.__esModule) {
  26318. return obj;
  26319. } else {
  26320. var newObj = {};if (obj != null) {
  26321. for (var key in obj) {
  26322. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  26323. }
  26324. }newObj.default = obj;return newObj;
  26325. }
  26326. }
  26327. function _interopRequireDefault(obj) {
  26328. return obj && obj.__esModule ? obj : { default: obj };
  26329. }
  26330. var SUPER_THIS_BOUND = (0, _symbol2.default)("super this bound");
  26331. var superVisitor = {
  26332. CallExpression: function CallExpression(path) {
  26333. if (!path.get("callee").isSuper()) return;
  26334. var node = path.node;
  26335. if (node[SUPER_THIS_BOUND]) return;
  26336. node[SUPER_THIS_BOUND] = true;
  26337. path.replaceWith(t.assignmentExpression("=", this.id, node));
  26338. }
  26339. };
  26340. exports.default = new _plugin2.default({
  26341. name: "internal.shadowFunctions",
  26342. visitor: {
  26343. ThisExpression: function ThisExpression(path) {
  26344. remap(path, "this");
  26345. },
  26346. ReferencedIdentifier: function ReferencedIdentifier(path) {
  26347. if (path.node.name === "arguments") {
  26348. remap(path, "arguments");
  26349. }
  26350. }
  26351. }
  26352. });
  26353. function shouldShadow(path, shadowPath) {
  26354. if (path.is("_forceShadow")) {
  26355. return true;
  26356. } else {
  26357. return shadowPath;
  26358. }
  26359. }
  26360. function remap(path, key) {
  26361. var shadowPath = path.inShadow(key);
  26362. if (!shouldShadow(path, shadowPath)) return;
  26363. var shadowFunction = path.node._shadowedFunctionLiteral;
  26364. var currentFunction = void 0;
  26365. var passedShadowFunction = false;
  26366. var fnPath = path.find(function (innerPath) {
  26367. if (innerPath.parentPath && innerPath.parentPath.isClassProperty() && innerPath.key === "value") {
  26368. return true;
  26369. }
  26370. if (path === innerPath) return false;
  26371. if (innerPath.isProgram() || innerPath.isFunction()) {
  26372. currentFunction = currentFunction || innerPath;
  26373. }
  26374. if (innerPath.isProgram()) {
  26375. passedShadowFunction = true;
  26376. return true;
  26377. } else if (innerPath.isFunction() && !innerPath.isArrowFunctionExpression()) {
  26378. if (shadowFunction) {
  26379. if (innerPath === shadowFunction || innerPath.node === shadowFunction.node) return true;
  26380. } else {
  26381. if (!innerPath.is("shadow")) return true;
  26382. }
  26383. passedShadowFunction = true;
  26384. return false;
  26385. }
  26386. return false;
  26387. });
  26388. if (shadowFunction && fnPath.isProgram() && !shadowFunction.isProgram()) {
  26389. fnPath = path.findParent(function (p) {
  26390. return p.isProgram() || p.isFunction();
  26391. });
  26392. }
  26393. if (fnPath === currentFunction) return;
  26394. if (!passedShadowFunction) return;
  26395. var cached = fnPath.getData(key);
  26396. if (cached) return path.replaceWith(cached);
  26397. var id = path.scope.generateUidIdentifier(key);
  26398. fnPath.setData(key, id);
  26399. var classPath = fnPath.findParent(function (p) {
  26400. return p.isClass();
  26401. });
  26402. var hasSuperClass = !!(classPath && classPath.node && classPath.node.superClass);
  26403. if (key === "this" && fnPath.isMethod({ kind: "constructor" }) && hasSuperClass) {
  26404. fnPath.scope.push({ id: id });
  26405. fnPath.traverse(superVisitor, { id: id });
  26406. } else {
  26407. var init = key === "this" ? t.thisExpression() : t.identifier(key);
  26408. if (shadowFunction) init._shadowedFunctionLiteral = shadowFunction;
  26409. fnPath.scope.push({ id: id, init: init });
  26410. }
  26411. return path.replaceWith(id);
  26412. }
  26413. module.exports = exports["default"];
  26414. /***/ }),
  26415. /* 298 */
  26416. /***/ (function(module, exports, __webpack_require__) {
  26417. "use strict";
  26418. exports.__esModule = true;
  26419. var _classCallCheck2 = __webpack_require__(3);
  26420. var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
  26421. var _normalizeAst = __webpack_require__(294);
  26422. var _normalizeAst2 = _interopRequireDefault(_normalizeAst);
  26423. var _plugin = __webpack_require__(65);
  26424. var _plugin2 = _interopRequireDefault(_plugin);
  26425. var _file = __webpack_require__(50);
  26426. var _file2 = _interopRequireDefault(_file);
  26427. function _interopRequireDefault(obj) {
  26428. return obj && obj.__esModule ? obj : { default: obj };
  26429. }
  26430. var Pipeline = function () {
  26431. function Pipeline() {
  26432. (0, _classCallCheck3.default)(this, Pipeline);
  26433. }
  26434. Pipeline.prototype.lint = function lint(code) {
  26435. var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  26436. opts.code = false;
  26437. opts.mode = "lint";
  26438. return this.transform(code, opts);
  26439. };
  26440. Pipeline.prototype.pretransform = function pretransform(code, opts) {
  26441. var file = new _file2.default(opts, this);
  26442. return file.wrap(code, function () {
  26443. file.addCode(code);
  26444. file.parseCode(code);
  26445. return file;
  26446. });
  26447. };
  26448. Pipeline.prototype.transform = function transform(code, opts) {
  26449. var file = new _file2.default(opts, this);
  26450. return file.wrap(code, function () {
  26451. file.addCode(code);
  26452. file.parseCode(code);
  26453. return file.transform();
  26454. });
  26455. };
  26456. Pipeline.prototype.analyse = function analyse(code) {
  26457. var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  26458. var visitor = arguments[2];
  26459. opts.code = false;
  26460. if (visitor) {
  26461. opts.plugins = opts.plugins || [];
  26462. opts.plugins.push(new _plugin2.default({ visitor: visitor }));
  26463. }
  26464. return this.transform(code, opts).metadata;
  26465. };
  26466. Pipeline.prototype.transformFromAst = function transformFromAst(ast, code, opts) {
  26467. ast = (0, _normalizeAst2.default)(ast);
  26468. var file = new _file2.default(opts, this);
  26469. return file.wrap(code, function () {
  26470. file.addCode(code);
  26471. file.addAst(ast);
  26472. return file.transform();
  26473. });
  26474. };
  26475. return Pipeline;
  26476. }();
  26477. exports.default = Pipeline;
  26478. module.exports = exports["default"];
  26479. /***/ }),
  26480. /* 299 */
  26481. /***/ (function(module, exports, __webpack_require__) {
  26482. "use strict";
  26483. exports.__esModule = true;
  26484. var _classCallCheck2 = __webpack_require__(3);
  26485. var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
  26486. var _possibleConstructorReturn2 = __webpack_require__(42);
  26487. var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
  26488. var _inherits2 = __webpack_require__(41);
  26489. var _inherits3 = _interopRequireDefault(_inherits2);
  26490. var _store = __webpack_require__(119);
  26491. var _store2 = _interopRequireDefault(_store);
  26492. var _file5 = __webpack_require__(50);
  26493. var _file6 = _interopRequireDefault(_file5);
  26494. function _interopRequireDefault(obj) {
  26495. return obj && obj.__esModule ? obj : { default: obj };
  26496. }
  26497. var PluginPass = function (_Store) {
  26498. (0, _inherits3.default)(PluginPass, _Store);
  26499. function PluginPass(file, plugin) {
  26500. var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  26501. (0, _classCallCheck3.default)(this, PluginPass);
  26502. var _this = (0, _possibleConstructorReturn3.default)(this, _Store.call(this));
  26503. _this.plugin = plugin;
  26504. _this.key = plugin.key;
  26505. _this.file = file;
  26506. _this.opts = options;
  26507. return _this;
  26508. }
  26509. PluginPass.prototype.addHelper = function addHelper() {
  26510. var _file;
  26511. return (_file = this.file).addHelper.apply(_file, arguments);
  26512. };
  26513. PluginPass.prototype.addImport = function addImport() {
  26514. var _file2;
  26515. return (_file2 = this.file).addImport.apply(_file2, arguments);
  26516. };
  26517. PluginPass.prototype.getModuleName = function getModuleName() {
  26518. var _file3;
  26519. return (_file3 = this.file).getModuleName.apply(_file3, arguments);
  26520. };
  26521. PluginPass.prototype.buildCodeFrameError = function buildCodeFrameError() {
  26522. var _file4;
  26523. return (_file4 = this.file).buildCodeFrameError.apply(_file4, arguments);
  26524. };
  26525. return PluginPass;
  26526. }(_store2.default);
  26527. exports.default = PluginPass;
  26528. module.exports = exports["default"];
  26529. /***/ }),
  26530. /* 300 */
  26531. /***/ (function(module, exports, __webpack_require__) {
  26532. "use strict";
  26533. exports.__esModule = true;
  26534. var _classCallCheck2 = __webpack_require__(3);
  26535. var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
  26536. var _trimRight = __webpack_require__(625);
  26537. var _trimRight2 = _interopRequireDefault(_trimRight);
  26538. function _interopRequireDefault(obj) {
  26539. return obj && obj.__esModule ? obj : { default: obj };
  26540. }
  26541. var SPACES_RE = /^[ \t]+$/;
  26542. var Buffer = function () {
  26543. function Buffer(map) {
  26544. (0, _classCallCheck3.default)(this, Buffer);
  26545. this._map = null;
  26546. this._buf = [];
  26547. this._last = "";
  26548. this._queue = [];
  26549. this._position = {
  26550. line: 1,
  26551. column: 0
  26552. };
  26553. this._sourcePosition = {
  26554. identifierName: null,
  26555. line: null,
  26556. column: null,
  26557. filename: null
  26558. };
  26559. this._map = map;
  26560. }
  26561. Buffer.prototype.get = function get() {
  26562. this._flush();
  26563. var map = this._map;
  26564. var result = {
  26565. code: (0, _trimRight2.default)(this._buf.join("")),
  26566. map: null,
  26567. rawMappings: map && map.getRawMappings()
  26568. };
  26569. if (map) {
  26570. Object.defineProperty(result, "map", {
  26571. configurable: true,
  26572. enumerable: true,
  26573. get: function get() {
  26574. return this.map = map.get();
  26575. },
  26576. set: function set(value) {
  26577. Object.defineProperty(this, "map", { value: value, writable: true });
  26578. }
  26579. });
  26580. }
  26581. return result;
  26582. };
  26583. Buffer.prototype.append = function append(str) {
  26584. this._flush();
  26585. var _sourcePosition = this._sourcePosition,
  26586. line = _sourcePosition.line,
  26587. column = _sourcePosition.column,
  26588. filename = _sourcePosition.filename,
  26589. identifierName = _sourcePosition.identifierName;
  26590. this._append(str, line, column, identifierName, filename);
  26591. };
  26592. Buffer.prototype.queue = function queue(str) {
  26593. if (str === "\n") while (this._queue.length > 0 && SPACES_RE.test(this._queue[0][0])) {
  26594. this._queue.shift();
  26595. }var _sourcePosition2 = this._sourcePosition,
  26596. line = _sourcePosition2.line,
  26597. column = _sourcePosition2.column,
  26598. filename = _sourcePosition2.filename,
  26599. identifierName = _sourcePosition2.identifierName;
  26600. this._queue.unshift([str, line, column, identifierName, filename]);
  26601. };
  26602. Buffer.prototype._flush = function _flush() {
  26603. var item = void 0;
  26604. while (item = this._queue.pop()) {
  26605. this._append.apply(this, item);
  26606. }
  26607. };
  26608. Buffer.prototype._append = function _append(str, line, column, identifierName, filename) {
  26609. if (this._map && str[0] !== "\n") {
  26610. this._map.mark(this._position.line, this._position.column, line, column, identifierName, filename);
  26611. }
  26612. this._buf.push(str);
  26613. this._last = str[str.length - 1];
  26614. for (var i = 0; i < str.length; i++) {
  26615. if (str[i] === "\n") {
  26616. this._position.line++;
  26617. this._position.column = 0;
  26618. } else {
  26619. this._position.column++;
  26620. }
  26621. }
  26622. };
  26623. Buffer.prototype.removeTrailingNewline = function removeTrailingNewline() {
  26624. if (this._queue.length > 0 && this._queue[0][0] === "\n") this._queue.shift();
  26625. };
  26626. Buffer.prototype.removeLastSemicolon = function removeLastSemicolon() {
  26627. if (this._queue.length > 0 && this._queue[0][0] === ";") this._queue.shift();
  26628. };
  26629. Buffer.prototype.endsWith = function endsWith(suffix) {
  26630. if (suffix.length === 1) {
  26631. var last = void 0;
  26632. if (this._queue.length > 0) {
  26633. var str = this._queue[0][0];
  26634. last = str[str.length - 1];
  26635. } else {
  26636. last = this._last;
  26637. }
  26638. return last === suffix;
  26639. }
  26640. var end = this._last + this._queue.reduce(function (acc, item) {
  26641. return item[0] + acc;
  26642. }, "");
  26643. if (suffix.length <= end.length) {
  26644. return end.slice(-suffix.length) === suffix;
  26645. }
  26646. return false;
  26647. };
  26648. Buffer.prototype.hasContent = function hasContent() {
  26649. return this._queue.length > 0 || !!this._last;
  26650. };
  26651. Buffer.prototype.source = function source(prop, loc) {
  26652. if (prop && !loc) return;
  26653. var pos = loc ? loc[prop] : null;
  26654. this._sourcePosition.identifierName = loc && loc.identifierName || null;
  26655. this._sourcePosition.line = pos ? pos.line : null;
  26656. this._sourcePosition.column = pos ? pos.column : null;
  26657. this._sourcePosition.filename = loc && loc.filename || null;
  26658. };
  26659. Buffer.prototype.withSource = function withSource(prop, loc, cb) {
  26660. if (!this._map) return cb();
  26661. var originalLine = this._sourcePosition.line;
  26662. var originalColumn = this._sourcePosition.column;
  26663. var originalFilename = this._sourcePosition.filename;
  26664. var originalIdentifierName = this._sourcePosition.identifierName;
  26665. this.source(prop, loc);
  26666. cb();
  26667. this._sourcePosition.line = originalLine;
  26668. this._sourcePosition.column = originalColumn;
  26669. this._sourcePosition.filename = originalFilename;
  26670. this._sourcePosition.identifierName = originalIdentifierName;
  26671. };
  26672. Buffer.prototype.getCurrentColumn = function getCurrentColumn() {
  26673. var extra = this._queue.reduce(function (acc, item) {
  26674. return item[0] + acc;
  26675. }, "");
  26676. var lastIndex = extra.lastIndexOf("\n");
  26677. return lastIndex === -1 ? this._position.column + extra.length : extra.length - 1 - lastIndex;
  26678. };
  26679. Buffer.prototype.getCurrentLine = function getCurrentLine() {
  26680. var extra = this._queue.reduce(function (acc, item) {
  26681. return item[0] + acc;
  26682. }, "");
  26683. var count = 0;
  26684. for (var i = 0; i < extra.length; i++) {
  26685. if (extra[i] === "\n") count++;
  26686. }
  26687. return this._position.line + count;
  26688. };
  26689. return Buffer;
  26690. }();
  26691. exports.default = Buffer;
  26692. module.exports = exports["default"];
  26693. /***/ }),
  26694. /* 301 */
  26695. /***/ (function(module, exports, __webpack_require__) {
  26696. "use strict";
  26697. exports.__esModule = true;
  26698. exports.File = File;
  26699. exports.Program = Program;
  26700. exports.BlockStatement = BlockStatement;
  26701. exports.Noop = Noop;
  26702. exports.Directive = Directive;
  26703. var _types = __webpack_require__(123);
  26704. Object.defineProperty(exports, "DirectiveLiteral", {
  26705. enumerable: true,
  26706. get: function get() {
  26707. return _types.StringLiteral;
  26708. }
  26709. });
  26710. function File(node) {
  26711. this.print(node.program, node);
  26712. }
  26713. function Program(node) {
  26714. this.printInnerComments(node, false);
  26715. this.printSequence(node.directives, node);
  26716. if (node.directives && node.directives.length) this.newline();
  26717. this.printSequence(node.body, node);
  26718. }
  26719. function BlockStatement(node) {
  26720. this.token("{");
  26721. this.printInnerComments(node);
  26722. var hasDirectives = node.directives && node.directives.length;
  26723. if (node.body.length || hasDirectives) {
  26724. this.newline();
  26725. this.printSequence(node.directives, node, { indent: true });
  26726. if (hasDirectives) this.newline();
  26727. this.printSequence(node.body, node, { indent: true });
  26728. this.removeTrailingNewline();
  26729. this.source("end", node.loc);
  26730. if (!this.endsWith("\n")) this.newline();
  26731. this.rightBrace();
  26732. } else {
  26733. this.source("end", node.loc);
  26734. this.token("}");
  26735. }
  26736. }
  26737. function Noop() {}
  26738. function Directive(node) {
  26739. this.print(node.value, node);
  26740. this.semicolon();
  26741. }
  26742. /***/ }),
  26743. /* 302 */
  26744. /***/ (function(module, exports) {
  26745. "use strict";
  26746. exports.__esModule = true;
  26747. exports.ClassDeclaration = ClassDeclaration;
  26748. exports.ClassBody = ClassBody;
  26749. exports.ClassProperty = ClassProperty;
  26750. exports.ClassMethod = ClassMethod;
  26751. function ClassDeclaration(node) {
  26752. this.printJoin(node.decorators, node);
  26753. this.word("class");
  26754. if (node.id) {
  26755. this.space();
  26756. this.print(node.id, node);
  26757. }
  26758. this.print(node.typeParameters, node);
  26759. if (node.superClass) {
  26760. this.space();
  26761. this.word("extends");
  26762. this.space();
  26763. this.print(node.superClass, node);
  26764. this.print(node.superTypeParameters, node);
  26765. }
  26766. if (node.implements) {
  26767. this.space();
  26768. this.word("implements");
  26769. this.space();
  26770. this.printList(node.implements, node);
  26771. }
  26772. this.space();
  26773. this.print(node.body, node);
  26774. }
  26775. exports.ClassExpression = ClassDeclaration;
  26776. function ClassBody(node) {
  26777. this.token("{");
  26778. this.printInnerComments(node);
  26779. if (node.body.length === 0) {
  26780. this.token("}");
  26781. } else {
  26782. this.newline();
  26783. this.indent();
  26784. this.printSequence(node.body, node);
  26785. this.dedent();
  26786. if (!this.endsWith("\n")) this.newline();
  26787. this.rightBrace();
  26788. }
  26789. }
  26790. function ClassProperty(node) {
  26791. this.printJoin(node.decorators, node);
  26792. if (node.static) {
  26793. this.word("static");
  26794. this.space();
  26795. }
  26796. if (node.computed) {
  26797. this.token("[");
  26798. this.print(node.key, node);
  26799. this.token("]");
  26800. } else {
  26801. this._variance(node);
  26802. this.print(node.key, node);
  26803. }
  26804. this.print(node.typeAnnotation, node);
  26805. if (node.value) {
  26806. this.space();
  26807. this.token("=");
  26808. this.space();
  26809. this.print(node.value, node);
  26810. }
  26811. this.semicolon();
  26812. }
  26813. function ClassMethod(node) {
  26814. this.printJoin(node.decorators, node);
  26815. if (node.static) {
  26816. this.word("static");
  26817. this.space();
  26818. }
  26819. if (node.kind === "constructorCall") {
  26820. this.word("call");
  26821. this.space();
  26822. }
  26823. this._method(node);
  26824. }
  26825. /***/ }),
  26826. /* 303 */
  26827. /***/ (function(module, exports, __webpack_require__) {
  26828. "use strict";
  26829. exports.__esModule = true;
  26830. exports.LogicalExpression = exports.BinaryExpression = exports.AwaitExpression = exports.YieldExpression = undefined;
  26831. exports.UnaryExpression = UnaryExpression;
  26832. exports.DoExpression = DoExpression;
  26833. exports.ParenthesizedExpression = ParenthesizedExpression;
  26834. exports.UpdateExpression = UpdateExpression;
  26835. exports.ConditionalExpression = ConditionalExpression;
  26836. exports.NewExpression = NewExpression;
  26837. exports.SequenceExpression = SequenceExpression;
  26838. exports.ThisExpression = ThisExpression;
  26839. exports.Super = Super;
  26840. exports.Decorator = Decorator;
  26841. exports.CallExpression = CallExpression;
  26842. exports.Import = Import;
  26843. exports.EmptyStatement = EmptyStatement;
  26844. exports.ExpressionStatement = ExpressionStatement;
  26845. exports.AssignmentPattern = AssignmentPattern;
  26846. exports.AssignmentExpression = AssignmentExpression;
  26847. exports.BindExpression = BindExpression;
  26848. exports.MemberExpression = MemberExpression;
  26849. exports.MetaProperty = MetaProperty;
  26850. var _babelTypes = __webpack_require__(1);
  26851. var t = _interopRequireWildcard(_babelTypes);
  26852. var _node = __webpack_require__(187);
  26853. var n = _interopRequireWildcard(_node);
  26854. function _interopRequireWildcard(obj) {
  26855. if (obj && obj.__esModule) {
  26856. return obj;
  26857. } else {
  26858. var newObj = {};if (obj != null) {
  26859. for (var key in obj) {
  26860. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  26861. }
  26862. }newObj.default = obj;return newObj;
  26863. }
  26864. }
  26865. function UnaryExpression(node) {
  26866. if (node.operator === "void" || node.operator === "delete" || node.operator === "typeof") {
  26867. this.word(node.operator);
  26868. this.space();
  26869. } else {
  26870. this.token(node.operator);
  26871. }
  26872. this.print(node.argument, node);
  26873. }
  26874. function DoExpression(node) {
  26875. this.word("do");
  26876. this.space();
  26877. this.print(node.body, node);
  26878. }
  26879. function ParenthesizedExpression(node) {
  26880. this.token("(");
  26881. this.print(node.expression, node);
  26882. this.token(")");
  26883. }
  26884. function UpdateExpression(node) {
  26885. if (node.prefix) {
  26886. this.token(node.operator);
  26887. this.print(node.argument, node);
  26888. } else {
  26889. this.print(node.argument, node);
  26890. this.token(node.operator);
  26891. }
  26892. }
  26893. function ConditionalExpression(node) {
  26894. this.print(node.test, node);
  26895. this.space();
  26896. this.token("?");
  26897. this.space();
  26898. this.print(node.consequent, node);
  26899. this.space();
  26900. this.token(":");
  26901. this.space();
  26902. this.print(node.alternate, node);
  26903. }
  26904. function NewExpression(node, parent) {
  26905. this.word("new");
  26906. this.space();
  26907. this.print(node.callee, node);
  26908. if (node.arguments.length === 0 && this.format.minified && !t.isCallExpression(parent, { callee: node }) && !t.isMemberExpression(parent) && !t.isNewExpression(parent)) return;
  26909. this.token("(");
  26910. this.printList(node.arguments, node);
  26911. this.token(")");
  26912. }
  26913. function SequenceExpression(node) {
  26914. this.printList(node.expressions, node);
  26915. }
  26916. function ThisExpression() {
  26917. this.word("this");
  26918. }
  26919. function Super() {
  26920. this.word("super");
  26921. }
  26922. function Decorator(node) {
  26923. this.token("@");
  26924. this.print(node.expression, node);
  26925. this.newline();
  26926. }
  26927. function commaSeparatorNewline() {
  26928. this.token(",");
  26929. this.newline();
  26930. if (!this.endsWith("\n")) this.space();
  26931. }
  26932. function CallExpression(node) {
  26933. this.print(node.callee, node);
  26934. this.token("(");
  26935. var isPrettyCall = node._prettyCall;
  26936. var separator = void 0;
  26937. if (isPrettyCall) {
  26938. separator = commaSeparatorNewline;
  26939. this.newline();
  26940. this.indent();
  26941. }
  26942. this.printList(node.arguments, node, { separator: separator });
  26943. if (isPrettyCall) {
  26944. this.newline();
  26945. this.dedent();
  26946. }
  26947. this.token(")");
  26948. }
  26949. function Import() {
  26950. this.word("import");
  26951. }
  26952. function buildYieldAwait(keyword) {
  26953. return function (node) {
  26954. this.word(keyword);
  26955. if (node.delegate) {
  26956. this.token("*");
  26957. }
  26958. if (node.argument) {
  26959. this.space();
  26960. var terminatorState = this.startTerminatorless();
  26961. this.print(node.argument, node);
  26962. this.endTerminatorless(terminatorState);
  26963. }
  26964. };
  26965. }
  26966. var YieldExpression = exports.YieldExpression = buildYieldAwait("yield");
  26967. var AwaitExpression = exports.AwaitExpression = buildYieldAwait("await");
  26968. function EmptyStatement() {
  26969. this.semicolon(true);
  26970. }
  26971. function ExpressionStatement(node) {
  26972. this.print(node.expression, node);
  26973. this.semicolon();
  26974. }
  26975. function AssignmentPattern(node) {
  26976. this.print(node.left, node);
  26977. if (node.left.optional) this.token("?");
  26978. this.print(node.left.typeAnnotation, node);
  26979. this.space();
  26980. this.token("=");
  26981. this.space();
  26982. this.print(node.right, node);
  26983. }
  26984. function AssignmentExpression(node, parent) {
  26985. var parens = this.inForStatementInitCounter && node.operator === "in" && !n.needsParens(node, parent);
  26986. if (parens) {
  26987. this.token("(");
  26988. }
  26989. this.print(node.left, node);
  26990. this.space();
  26991. if (node.operator === "in" || node.operator === "instanceof") {
  26992. this.word(node.operator);
  26993. } else {
  26994. this.token(node.operator);
  26995. }
  26996. this.space();
  26997. this.print(node.right, node);
  26998. if (parens) {
  26999. this.token(")");
  27000. }
  27001. }
  27002. function BindExpression(node) {
  27003. this.print(node.object, node);
  27004. this.token("::");
  27005. this.print(node.callee, node);
  27006. }
  27007. exports.BinaryExpression = AssignmentExpression;
  27008. exports.LogicalExpression = AssignmentExpression;
  27009. function MemberExpression(node) {
  27010. this.print(node.object, node);
  27011. if (!node.computed && t.isMemberExpression(node.property)) {
  27012. throw new TypeError("Got a MemberExpression for MemberExpression property");
  27013. }
  27014. var computed = node.computed;
  27015. if (t.isLiteral(node.property) && typeof node.property.value === "number") {
  27016. computed = true;
  27017. }
  27018. if (computed) {
  27019. this.token("[");
  27020. this.print(node.property, node);
  27021. this.token("]");
  27022. } else {
  27023. this.token(".");
  27024. this.print(node.property, node);
  27025. }
  27026. }
  27027. function MetaProperty(node) {
  27028. this.print(node.meta, node);
  27029. this.token(".");
  27030. this.print(node.property, node);
  27031. }
  27032. /***/ }),
  27033. /* 304 */
  27034. /***/ (function(module, exports, __webpack_require__) {
  27035. "use strict";
  27036. exports.__esModule = true;
  27037. exports.TypeParameterDeclaration = exports.StringLiteralTypeAnnotation = exports.NumericLiteralTypeAnnotation = exports.GenericTypeAnnotation = exports.ClassImplements = undefined;
  27038. exports.AnyTypeAnnotation = AnyTypeAnnotation;
  27039. exports.ArrayTypeAnnotation = ArrayTypeAnnotation;
  27040. exports.BooleanTypeAnnotation = BooleanTypeAnnotation;
  27041. exports.BooleanLiteralTypeAnnotation = BooleanLiteralTypeAnnotation;
  27042. exports.NullLiteralTypeAnnotation = NullLiteralTypeAnnotation;
  27043. exports.DeclareClass = DeclareClass;
  27044. exports.DeclareFunction = DeclareFunction;
  27045. exports.DeclareInterface = DeclareInterface;
  27046. exports.DeclareModule = DeclareModule;
  27047. exports.DeclareModuleExports = DeclareModuleExports;
  27048. exports.DeclareTypeAlias = DeclareTypeAlias;
  27049. exports.DeclareOpaqueType = DeclareOpaqueType;
  27050. exports.DeclareVariable = DeclareVariable;
  27051. exports.DeclareExportDeclaration = DeclareExportDeclaration;
  27052. exports.ExistentialTypeParam = ExistentialTypeParam;
  27053. exports.FunctionTypeAnnotation = FunctionTypeAnnotation;
  27054. exports.FunctionTypeParam = FunctionTypeParam;
  27055. exports.InterfaceExtends = InterfaceExtends;
  27056. exports._interfaceish = _interfaceish;
  27057. exports._variance = _variance;
  27058. exports.InterfaceDeclaration = InterfaceDeclaration;
  27059. exports.IntersectionTypeAnnotation = IntersectionTypeAnnotation;
  27060. exports.MixedTypeAnnotation = MixedTypeAnnotation;
  27061. exports.EmptyTypeAnnotation = EmptyTypeAnnotation;
  27062. exports.NullableTypeAnnotation = NullableTypeAnnotation;
  27063. var _types = __webpack_require__(123);
  27064. Object.defineProperty(exports, "NumericLiteralTypeAnnotation", {
  27065. enumerable: true,
  27066. get: function get() {
  27067. return _types.NumericLiteral;
  27068. }
  27069. });
  27070. Object.defineProperty(exports, "StringLiteralTypeAnnotation", {
  27071. enumerable: true,
  27072. get: function get() {
  27073. return _types.StringLiteral;
  27074. }
  27075. });
  27076. exports.NumberTypeAnnotation = NumberTypeAnnotation;
  27077. exports.StringTypeAnnotation = StringTypeAnnotation;
  27078. exports.ThisTypeAnnotation = ThisTypeAnnotation;
  27079. exports.TupleTypeAnnotation = TupleTypeAnnotation;
  27080. exports.TypeofTypeAnnotation = TypeofTypeAnnotation;
  27081. exports.TypeAlias = TypeAlias;
  27082. exports.OpaqueType = OpaqueType;
  27083. exports.TypeAnnotation = TypeAnnotation;
  27084. exports.TypeParameter = TypeParameter;
  27085. exports.TypeParameterInstantiation = TypeParameterInstantiation;
  27086. exports.ObjectTypeAnnotation = ObjectTypeAnnotation;
  27087. exports.ObjectTypeCallProperty = ObjectTypeCallProperty;
  27088. exports.ObjectTypeIndexer = ObjectTypeIndexer;
  27089. exports.ObjectTypeProperty = ObjectTypeProperty;
  27090. exports.ObjectTypeSpreadProperty = ObjectTypeSpreadProperty;
  27091. exports.QualifiedTypeIdentifier = QualifiedTypeIdentifier;
  27092. exports.UnionTypeAnnotation = UnionTypeAnnotation;
  27093. exports.TypeCastExpression = TypeCastExpression;
  27094. exports.VoidTypeAnnotation = VoidTypeAnnotation;
  27095. var _babelTypes = __webpack_require__(1);
  27096. var t = _interopRequireWildcard(_babelTypes);
  27097. function _interopRequireWildcard(obj) {
  27098. if (obj && obj.__esModule) {
  27099. return obj;
  27100. } else {
  27101. var newObj = {};if (obj != null) {
  27102. for (var key in obj) {
  27103. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  27104. }
  27105. }newObj.default = obj;return newObj;
  27106. }
  27107. }
  27108. function AnyTypeAnnotation() {
  27109. this.word("any");
  27110. }
  27111. function ArrayTypeAnnotation(node) {
  27112. this.print(node.elementType, node);
  27113. this.token("[");
  27114. this.token("]");
  27115. }
  27116. function BooleanTypeAnnotation() {
  27117. this.word("boolean");
  27118. }
  27119. function BooleanLiteralTypeAnnotation(node) {
  27120. this.word(node.value ? "true" : "false");
  27121. }
  27122. function NullLiteralTypeAnnotation() {
  27123. this.word("null");
  27124. }
  27125. function DeclareClass(node, parent) {
  27126. if (!t.isDeclareExportDeclaration(parent)) {
  27127. this.word("declare");
  27128. this.space();
  27129. }
  27130. this.word("class");
  27131. this.space();
  27132. this._interfaceish(node);
  27133. }
  27134. function DeclareFunction(node, parent) {
  27135. if (!t.isDeclareExportDeclaration(parent)) {
  27136. this.word("declare");
  27137. this.space();
  27138. }
  27139. this.word("function");
  27140. this.space();
  27141. this.print(node.id, node);
  27142. this.print(node.id.typeAnnotation.typeAnnotation, node);
  27143. this.semicolon();
  27144. }
  27145. function DeclareInterface(node) {
  27146. this.word("declare");
  27147. this.space();
  27148. this.InterfaceDeclaration(node);
  27149. }
  27150. function DeclareModule(node) {
  27151. this.word("declare");
  27152. this.space();
  27153. this.word("module");
  27154. this.space();
  27155. this.print(node.id, node);
  27156. this.space();
  27157. this.print(node.body, node);
  27158. }
  27159. function DeclareModuleExports(node) {
  27160. this.word("declare");
  27161. this.space();
  27162. this.word("module");
  27163. this.token(".");
  27164. this.word("exports");
  27165. this.print(node.typeAnnotation, node);
  27166. }
  27167. function DeclareTypeAlias(node) {
  27168. this.word("declare");
  27169. this.space();
  27170. this.TypeAlias(node);
  27171. }
  27172. function DeclareOpaqueType(node, parent) {
  27173. if (!t.isDeclareExportDeclaration(parent)) {
  27174. this.word("declare");
  27175. this.space();
  27176. }
  27177. this.OpaqueType(node);
  27178. }
  27179. function DeclareVariable(node, parent) {
  27180. if (!t.isDeclareExportDeclaration(parent)) {
  27181. this.word("declare");
  27182. this.space();
  27183. }
  27184. this.word("var");
  27185. this.space();
  27186. this.print(node.id, node);
  27187. this.print(node.id.typeAnnotation, node);
  27188. this.semicolon();
  27189. }
  27190. function DeclareExportDeclaration(node) {
  27191. this.word("declare");
  27192. this.space();
  27193. this.word("export");
  27194. this.space();
  27195. if (node.default) {
  27196. this.word("default");
  27197. this.space();
  27198. }
  27199. FlowExportDeclaration.apply(this, arguments);
  27200. }
  27201. function FlowExportDeclaration(node) {
  27202. if (node.declaration) {
  27203. var declar = node.declaration;
  27204. this.print(declar, node);
  27205. if (!t.isStatement(declar)) this.semicolon();
  27206. } else {
  27207. this.token("{");
  27208. if (node.specifiers.length) {
  27209. this.space();
  27210. this.printList(node.specifiers, node);
  27211. this.space();
  27212. }
  27213. this.token("}");
  27214. if (node.source) {
  27215. this.space();
  27216. this.word("from");
  27217. this.space();
  27218. this.print(node.source, node);
  27219. }
  27220. this.semicolon();
  27221. }
  27222. }
  27223. function ExistentialTypeParam() {
  27224. this.token("*");
  27225. }
  27226. function FunctionTypeAnnotation(node, parent) {
  27227. this.print(node.typeParameters, node);
  27228. this.token("(");
  27229. this.printList(node.params, node);
  27230. if (node.rest) {
  27231. if (node.params.length) {
  27232. this.token(",");
  27233. this.space();
  27234. }
  27235. this.token("...");
  27236. this.print(node.rest, node);
  27237. }
  27238. this.token(")");
  27239. if (parent.type === "ObjectTypeCallProperty" || parent.type === "DeclareFunction") {
  27240. this.token(":");
  27241. } else {
  27242. this.space();
  27243. this.token("=>");
  27244. }
  27245. this.space();
  27246. this.print(node.returnType, node);
  27247. }
  27248. function FunctionTypeParam(node) {
  27249. this.print(node.name, node);
  27250. if (node.optional) this.token("?");
  27251. this.token(":");
  27252. this.space();
  27253. this.print(node.typeAnnotation, node);
  27254. }
  27255. function InterfaceExtends(node) {
  27256. this.print(node.id, node);
  27257. this.print(node.typeParameters, node);
  27258. }
  27259. exports.ClassImplements = InterfaceExtends;
  27260. exports.GenericTypeAnnotation = InterfaceExtends;
  27261. function _interfaceish(node) {
  27262. this.print(node.id, node);
  27263. this.print(node.typeParameters, node);
  27264. if (node.extends.length) {
  27265. this.space();
  27266. this.word("extends");
  27267. this.space();
  27268. this.printList(node.extends, node);
  27269. }
  27270. if (node.mixins && node.mixins.length) {
  27271. this.space();
  27272. this.word("mixins");
  27273. this.space();
  27274. this.printList(node.mixins, node);
  27275. }
  27276. this.space();
  27277. this.print(node.body, node);
  27278. }
  27279. function _variance(node) {
  27280. if (node.variance === "plus") {
  27281. this.token("+");
  27282. } else if (node.variance === "minus") {
  27283. this.token("-");
  27284. }
  27285. }
  27286. function InterfaceDeclaration(node) {
  27287. this.word("interface");
  27288. this.space();
  27289. this._interfaceish(node);
  27290. }
  27291. function andSeparator() {
  27292. this.space();
  27293. this.token("&");
  27294. this.space();
  27295. }
  27296. function IntersectionTypeAnnotation(node) {
  27297. this.printJoin(node.types, node, { separator: andSeparator });
  27298. }
  27299. function MixedTypeAnnotation() {
  27300. this.word("mixed");
  27301. }
  27302. function EmptyTypeAnnotation() {
  27303. this.word("empty");
  27304. }
  27305. function NullableTypeAnnotation(node) {
  27306. this.token("?");
  27307. this.print(node.typeAnnotation, node);
  27308. }
  27309. function NumberTypeAnnotation() {
  27310. this.word("number");
  27311. }
  27312. function StringTypeAnnotation() {
  27313. this.word("string");
  27314. }
  27315. function ThisTypeAnnotation() {
  27316. this.word("this");
  27317. }
  27318. function TupleTypeAnnotation(node) {
  27319. this.token("[");
  27320. this.printList(node.types, node);
  27321. this.token("]");
  27322. }
  27323. function TypeofTypeAnnotation(node) {
  27324. this.word("typeof");
  27325. this.space();
  27326. this.print(node.argument, node);
  27327. }
  27328. function TypeAlias(node) {
  27329. this.word("type");
  27330. this.space();
  27331. this.print(node.id, node);
  27332. this.print(node.typeParameters, node);
  27333. this.space();
  27334. this.token("=");
  27335. this.space();
  27336. this.print(node.right, node);
  27337. this.semicolon();
  27338. }
  27339. function OpaqueType(node) {
  27340. this.word("opaque");
  27341. this.space();
  27342. this.word("type");
  27343. this.space();
  27344. this.print(node.id, node);
  27345. this.print(node.typeParameters, node);
  27346. if (node.supertype) {
  27347. this.token(":");
  27348. this.space();
  27349. this.print(node.supertype, node);
  27350. }
  27351. if (node.impltype) {
  27352. this.space();
  27353. this.token("=");
  27354. this.space();
  27355. this.print(node.impltype, node);
  27356. }
  27357. this.semicolon();
  27358. }
  27359. function TypeAnnotation(node) {
  27360. this.token(":");
  27361. this.space();
  27362. if (node.optional) this.token("?");
  27363. this.print(node.typeAnnotation, node);
  27364. }
  27365. function TypeParameter(node) {
  27366. this._variance(node);
  27367. this.word(node.name);
  27368. if (node.bound) {
  27369. this.print(node.bound, node);
  27370. }
  27371. if (node.default) {
  27372. this.space();
  27373. this.token("=");
  27374. this.space();
  27375. this.print(node.default, node);
  27376. }
  27377. }
  27378. function TypeParameterInstantiation(node) {
  27379. this.token("<");
  27380. this.printList(node.params, node, {});
  27381. this.token(">");
  27382. }
  27383. exports.TypeParameterDeclaration = TypeParameterInstantiation;
  27384. function ObjectTypeAnnotation(node) {
  27385. var _this = this;
  27386. if (node.exact) {
  27387. this.token("{|");
  27388. } else {
  27389. this.token("{");
  27390. }
  27391. var props = node.properties.concat(node.callProperties, node.indexers);
  27392. if (props.length) {
  27393. this.space();
  27394. this.printJoin(props, node, {
  27395. addNewlines: function addNewlines(leading) {
  27396. if (leading && !props[0]) return 1;
  27397. },
  27398. indent: true,
  27399. statement: true,
  27400. iterator: function iterator() {
  27401. if (props.length !== 1) {
  27402. if (_this.format.flowCommaSeparator) {
  27403. _this.token(",");
  27404. } else {
  27405. _this.semicolon();
  27406. }
  27407. _this.space();
  27408. }
  27409. }
  27410. });
  27411. this.space();
  27412. }
  27413. if (node.exact) {
  27414. this.token("|}");
  27415. } else {
  27416. this.token("}");
  27417. }
  27418. }
  27419. function ObjectTypeCallProperty(node) {
  27420. if (node.static) {
  27421. this.word("static");
  27422. this.space();
  27423. }
  27424. this.print(node.value, node);
  27425. }
  27426. function ObjectTypeIndexer(node) {
  27427. if (node.static) {
  27428. this.word("static");
  27429. this.space();
  27430. }
  27431. this._variance(node);
  27432. this.token("[");
  27433. this.print(node.id, node);
  27434. this.token(":");
  27435. this.space();
  27436. this.print(node.key, node);
  27437. this.token("]");
  27438. this.token(":");
  27439. this.space();
  27440. this.print(node.value, node);
  27441. }
  27442. function ObjectTypeProperty(node) {
  27443. if (node.static) {
  27444. this.word("static");
  27445. this.space();
  27446. }
  27447. this._variance(node);
  27448. this.print(node.key, node);
  27449. if (node.optional) this.token("?");
  27450. this.token(":");
  27451. this.space();
  27452. this.print(node.value, node);
  27453. }
  27454. function ObjectTypeSpreadProperty(node) {
  27455. this.token("...");
  27456. this.print(node.argument, node);
  27457. }
  27458. function QualifiedTypeIdentifier(node) {
  27459. this.print(node.qualification, node);
  27460. this.token(".");
  27461. this.print(node.id, node);
  27462. }
  27463. function orSeparator() {
  27464. this.space();
  27465. this.token("|");
  27466. this.space();
  27467. }
  27468. function UnionTypeAnnotation(node) {
  27469. this.printJoin(node.types, node, { separator: orSeparator });
  27470. }
  27471. function TypeCastExpression(node) {
  27472. this.token("(");
  27473. this.print(node.expression, node);
  27474. this.print(node.typeAnnotation, node);
  27475. this.token(")");
  27476. }
  27477. function VoidTypeAnnotation() {
  27478. this.word("void");
  27479. }
  27480. /***/ }),
  27481. /* 305 */
  27482. /***/ (function(module, exports, __webpack_require__) {
  27483. "use strict";
  27484. exports.__esModule = true;
  27485. var _getIterator2 = __webpack_require__(2);
  27486. var _getIterator3 = _interopRequireDefault(_getIterator2);
  27487. exports.JSXAttribute = JSXAttribute;
  27488. exports.JSXIdentifier = JSXIdentifier;
  27489. exports.JSXNamespacedName = JSXNamespacedName;
  27490. exports.JSXMemberExpression = JSXMemberExpression;
  27491. exports.JSXSpreadAttribute = JSXSpreadAttribute;
  27492. exports.JSXExpressionContainer = JSXExpressionContainer;
  27493. exports.JSXSpreadChild = JSXSpreadChild;
  27494. exports.JSXText = JSXText;
  27495. exports.JSXElement = JSXElement;
  27496. exports.JSXOpeningElement = JSXOpeningElement;
  27497. exports.JSXClosingElement = JSXClosingElement;
  27498. exports.JSXEmptyExpression = JSXEmptyExpression;
  27499. function _interopRequireDefault(obj) {
  27500. return obj && obj.__esModule ? obj : { default: obj };
  27501. }
  27502. function JSXAttribute(node) {
  27503. this.print(node.name, node);
  27504. if (node.value) {
  27505. this.token("=");
  27506. this.print(node.value, node);
  27507. }
  27508. }
  27509. function JSXIdentifier(node) {
  27510. this.word(node.name);
  27511. }
  27512. function JSXNamespacedName(node) {
  27513. this.print(node.namespace, node);
  27514. this.token(":");
  27515. this.print(node.name, node);
  27516. }
  27517. function JSXMemberExpression(node) {
  27518. this.print(node.object, node);
  27519. this.token(".");
  27520. this.print(node.property, node);
  27521. }
  27522. function JSXSpreadAttribute(node) {
  27523. this.token("{");
  27524. this.token("...");
  27525. this.print(node.argument, node);
  27526. this.token("}");
  27527. }
  27528. function JSXExpressionContainer(node) {
  27529. this.token("{");
  27530. this.print(node.expression, node);
  27531. this.token("}");
  27532. }
  27533. function JSXSpreadChild(node) {
  27534. this.token("{");
  27535. this.token("...");
  27536. this.print(node.expression, node);
  27537. this.token("}");
  27538. }
  27539. function JSXText(node) {
  27540. this.token(node.value);
  27541. }
  27542. function JSXElement(node) {
  27543. var open = node.openingElement;
  27544. this.print(open, node);
  27545. if (open.selfClosing) return;
  27546. this.indent();
  27547. for (var _iterator = node.children, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
  27548. var _ref;
  27549. if (_isArray) {
  27550. if (_i >= _iterator.length) break;
  27551. _ref = _iterator[_i++];
  27552. } else {
  27553. _i = _iterator.next();
  27554. if (_i.done) break;
  27555. _ref = _i.value;
  27556. }
  27557. var child = _ref;
  27558. this.print(child, node);
  27559. }
  27560. this.dedent();
  27561. this.print(node.closingElement, node);
  27562. }
  27563. function spaceSeparator() {
  27564. this.space();
  27565. }
  27566. function JSXOpeningElement(node) {
  27567. this.token("<");
  27568. this.print(node.name, node);
  27569. if (node.attributes.length > 0) {
  27570. this.space();
  27571. this.printJoin(node.attributes, node, { separator: spaceSeparator });
  27572. }
  27573. if (node.selfClosing) {
  27574. this.space();
  27575. this.token("/>");
  27576. } else {
  27577. this.token(">");
  27578. }
  27579. }
  27580. function JSXClosingElement(node) {
  27581. this.token("</");
  27582. this.print(node.name, node);
  27583. this.token(">");
  27584. }
  27585. function JSXEmptyExpression() {}
  27586. /***/ }),
  27587. /* 306 */
  27588. /***/ (function(module, exports, __webpack_require__) {
  27589. "use strict";
  27590. exports.__esModule = true;
  27591. exports.FunctionDeclaration = undefined;
  27592. exports._params = _params;
  27593. exports._method = _method;
  27594. exports.FunctionExpression = FunctionExpression;
  27595. exports.ArrowFunctionExpression = ArrowFunctionExpression;
  27596. var _babelTypes = __webpack_require__(1);
  27597. var t = _interopRequireWildcard(_babelTypes);
  27598. function _interopRequireWildcard(obj) {
  27599. if (obj && obj.__esModule) {
  27600. return obj;
  27601. } else {
  27602. var newObj = {};if (obj != null) {
  27603. for (var key in obj) {
  27604. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  27605. }
  27606. }newObj.default = obj;return newObj;
  27607. }
  27608. }
  27609. function _params(node) {
  27610. var _this = this;
  27611. this.print(node.typeParameters, node);
  27612. this.token("(");
  27613. this.printList(node.params, node, {
  27614. iterator: function iterator(node) {
  27615. if (node.optional) _this.token("?");
  27616. _this.print(node.typeAnnotation, node);
  27617. }
  27618. });
  27619. this.token(")");
  27620. if (node.returnType) {
  27621. this.print(node.returnType, node);
  27622. }
  27623. }
  27624. function _method(node) {
  27625. var kind = node.kind;
  27626. var key = node.key;
  27627. if (kind === "method" || kind === "init") {
  27628. if (node.generator) {
  27629. this.token("*");
  27630. }
  27631. }
  27632. if (kind === "get" || kind === "set") {
  27633. this.word(kind);
  27634. this.space();
  27635. }
  27636. if (node.async) {
  27637. this.word("async");
  27638. this.space();
  27639. }
  27640. if (node.computed) {
  27641. this.token("[");
  27642. this.print(key, node);
  27643. this.token("]");
  27644. } else {
  27645. this.print(key, node);
  27646. }
  27647. this._params(node);
  27648. this.space();
  27649. this.print(node.body, node);
  27650. }
  27651. function FunctionExpression(node) {
  27652. if (node.async) {
  27653. this.word("async");
  27654. this.space();
  27655. }
  27656. this.word("function");
  27657. if (node.generator) this.token("*");
  27658. if (node.id) {
  27659. this.space();
  27660. this.print(node.id, node);
  27661. } else {
  27662. this.space();
  27663. }
  27664. this._params(node);
  27665. this.space();
  27666. this.print(node.body, node);
  27667. }
  27668. exports.FunctionDeclaration = FunctionExpression;
  27669. function ArrowFunctionExpression(node) {
  27670. if (node.async) {
  27671. this.word("async");
  27672. this.space();
  27673. }
  27674. var firstParam = node.params[0];
  27675. if (node.params.length === 1 && t.isIdentifier(firstParam) && !hasTypes(node, firstParam)) {
  27676. this.print(firstParam, node);
  27677. } else {
  27678. this._params(node);
  27679. }
  27680. this.space();
  27681. this.token("=>");
  27682. this.space();
  27683. this.print(node.body, node);
  27684. }
  27685. function hasTypes(node, param) {
  27686. return node.typeParameters || node.returnType || param.typeAnnotation || param.optional || param.trailingComments;
  27687. }
  27688. /***/ }),
  27689. /* 307 */
  27690. /***/ (function(module, exports, __webpack_require__) {
  27691. "use strict";
  27692. exports.__esModule = true;
  27693. exports.ImportSpecifier = ImportSpecifier;
  27694. exports.ImportDefaultSpecifier = ImportDefaultSpecifier;
  27695. exports.ExportDefaultSpecifier = ExportDefaultSpecifier;
  27696. exports.ExportSpecifier = ExportSpecifier;
  27697. exports.ExportNamespaceSpecifier = ExportNamespaceSpecifier;
  27698. exports.ExportAllDeclaration = ExportAllDeclaration;
  27699. exports.ExportNamedDeclaration = ExportNamedDeclaration;
  27700. exports.ExportDefaultDeclaration = ExportDefaultDeclaration;
  27701. exports.ImportDeclaration = ImportDeclaration;
  27702. exports.ImportNamespaceSpecifier = ImportNamespaceSpecifier;
  27703. var _babelTypes = __webpack_require__(1);
  27704. var t = _interopRequireWildcard(_babelTypes);
  27705. function _interopRequireWildcard(obj) {
  27706. if (obj && obj.__esModule) {
  27707. return obj;
  27708. } else {
  27709. var newObj = {};if (obj != null) {
  27710. for (var key in obj) {
  27711. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  27712. }
  27713. }newObj.default = obj;return newObj;
  27714. }
  27715. }
  27716. function ImportSpecifier(node) {
  27717. if (node.importKind === "type" || node.importKind === "typeof") {
  27718. this.word(node.importKind);
  27719. this.space();
  27720. }
  27721. this.print(node.imported, node);
  27722. if (node.local && node.local.name !== node.imported.name) {
  27723. this.space();
  27724. this.word("as");
  27725. this.space();
  27726. this.print(node.local, node);
  27727. }
  27728. }
  27729. function ImportDefaultSpecifier(node) {
  27730. this.print(node.local, node);
  27731. }
  27732. function ExportDefaultSpecifier(node) {
  27733. this.print(node.exported, node);
  27734. }
  27735. function ExportSpecifier(node) {
  27736. this.print(node.local, node);
  27737. if (node.exported && node.local.name !== node.exported.name) {
  27738. this.space();
  27739. this.word("as");
  27740. this.space();
  27741. this.print(node.exported, node);
  27742. }
  27743. }
  27744. function ExportNamespaceSpecifier(node) {
  27745. this.token("*");
  27746. this.space();
  27747. this.word("as");
  27748. this.space();
  27749. this.print(node.exported, node);
  27750. }
  27751. function ExportAllDeclaration(node) {
  27752. this.word("export");
  27753. this.space();
  27754. this.token("*");
  27755. this.space();
  27756. this.word("from");
  27757. this.space();
  27758. this.print(node.source, node);
  27759. this.semicolon();
  27760. }
  27761. function ExportNamedDeclaration() {
  27762. this.word("export");
  27763. this.space();
  27764. ExportDeclaration.apply(this, arguments);
  27765. }
  27766. function ExportDefaultDeclaration() {
  27767. this.word("export");
  27768. this.space();
  27769. this.word("default");
  27770. this.space();
  27771. ExportDeclaration.apply(this, arguments);
  27772. }
  27773. function ExportDeclaration(node) {
  27774. if (node.declaration) {
  27775. var declar = node.declaration;
  27776. this.print(declar, node);
  27777. if (!t.isStatement(declar)) this.semicolon();
  27778. } else {
  27779. if (node.exportKind === "type") {
  27780. this.word("type");
  27781. this.space();
  27782. }
  27783. var specifiers = node.specifiers.slice(0);
  27784. var hasSpecial = false;
  27785. while (true) {
  27786. var first = specifiers[0];
  27787. if (t.isExportDefaultSpecifier(first) || t.isExportNamespaceSpecifier(first)) {
  27788. hasSpecial = true;
  27789. this.print(specifiers.shift(), node);
  27790. if (specifiers.length) {
  27791. this.token(",");
  27792. this.space();
  27793. }
  27794. } else {
  27795. break;
  27796. }
  27797. }
  27798. if (specifiers.length || !specifiers.length && !hasSpecial) {
  27799. this.token("{");
  27800. if (specifiers.length) {
  27801. this.space();
  27802. this.printList(specifiers, node);
  27803. this.space();
  27804. }
  27805. this.token("}");
  27806. }
  27807. if (node.source) {
  27808. this.space();
  27809. this.word("from");
  27810. this.space();
  27811. this.print(node.source, node);
  27812. }
  27813. this.semicolon();
  27814. }
  27815. }
  27816. function ImportDeclaration(node) {
  27817. this.word("import");
  27818. this.space();
  27819. if (node.importKind === "type" || node.importKind === "typeof") {
  27820. this.word(node.importKind);
  27821. this.space();
  27822. }
  27823. var specifiers = node.specifiers.slice(0);
  27824. if (specifiers && specifiers.length) {
  27825. while (true) {
  27826. var first = specifiers[0];
  27827. if (t.isImportDefaultSpecifier(first) || t.isImportNamespaceSpecifier(first)) {
  27828. this.print(specifiers.shift(), node);
  27829. if (specifiers.length) {
  27830. this.token(",");
  27831. this.space();
  27832. }
  27833. } else {
  27834. break;
  27835. }
  27836. }
  27837. if (specifiers.length) {
  27838. this.token("{");
  27839. this.space();
  27840. this.printList(specifiers, node);
  27841. this.space();
  27842. this.token("}");
  27843. }
  27844. this.space();
  27845. this.word("from");
  27846. this.space();
  27847. }
  27848. this.print(node.source, node);
  27849. this.semicolon();
  27850. }
  27851. function ImportNamespaceSpecifier(node) {
  27852. this.token("*");
  27853. this.space();
  27854. this.word("as");
  27855. this.space();
  27856. this.print(node.local, node);
  27857. }
  27858. /***/ }),
  27859. /* 308 */
  27860. /***/ (function(module, exports, __webpack_require__) {
  27861. "use strict";
  27862. exports.__esModule = true;
  27863. exports.ThrowStatement = exports.BreakStatement = exports.ReturnStatement = exports.ContinueStatement = exports.ForAwaitStatement = exports.ForOfStatement = exports.ForInStatement = undefined;
  27864. var _getIterator2 = __webpack_require__(2);
  27865. var _getIterator3 = _interopRequireDefault(_getIterator2);
  27866. exports.WithStatement = WithStatement;
  27867. exports.IfStatement = IfStatement;
  27868. exports.ForStatement = ForStatement;
  27869. exports.WhileStatement = WhileStatement;
  27870. exports.DoWhileStatement = DoWhileStatement;
  27871. exports.LabeledStatement = LabeledStatement;
  27872. exports.TryStatement = TryStatement;
  27873. exports.CatchClause = CatchClause;
  27874. exports.SwitchStatement = SwitchStatement;
  27875. exports.SwitchCase = SwitchCase;
  27876. exports.DebuggerStatement = DebuggerStatement;
  27877. exports.VariableDeclaration = VariableDeclaration;
  27878. exports.VariableDeclarator = VariableDeclarator;
  27879. var _babelTypes = __webpack_require__(1);
  27880. var t = _interopRequireWildcard(_babelTypes);
  27881. function _interopRequireWildcard(obj) {
  27882. if (obj && obj.__esModule) {
  27883. return obj;
  27884. } else {
  27885. var newObj = {};if (obj != null) {
  27886. for (var key in obj) {
  27887. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  27888. }
  27889. }newObj.default = obj;return newObj;
  27890. }
  27891. }
  27892. function _interopRequireDefault(obj) {
  27893. return obj && obj.__esModule ? obj : { default: obj };
  27894. }
  27895. function WithStatement(node) {
  27896. this.word("with");
  27897. this.space();
  27898. this.token("(");
  27899. this.print(node.object, node);
  27900. this.token(")");
  27901. this.printBlock(node);
  27902. }
  27903. function IfStatement(node) {
  27904. this.word("if");
  27905. this.space();
  27906. this.token("(");
  27907. this.print(node.test, node);
  27908. this.token(")");
  27909. this.space();
  27910. var needsBlock = node.alternate && t.isIfStatement(getLastStatement(node.consequent));
  27911. if (needsBlock) {
  27912. this.token("{");
  27913. this.newline();
  27914. this.indent();
  27915. }
  27916. this.printAndIndentOnComments(node.consequent, node);
  27917. if (needsBlock) {
  27918. this.dedent();
  27919. this.newline();
  27920. this.token("}");
  27921. }
  27922. if (node.alternate) {
  27923. if (this.endsWith("}")) this.space();
  27924. this.word("else");
  27925. this.space();
  27926. this.printAndIndentOnComments(node.alternate, node);
  27927. }
  27928. }
  27929. function getLastStatement(statement) {
  27930. if (!t.isStatement(statement.body)) return statement;
  27931. return getLastStatement(statement.body);
  27932. }
  27933. function ForStatement(node) {
  27934. this.word("for");
  27935. this.space();
  27936. this.token("(");
  27937. this.inForStatementInitCounter++;
  27938. this.print(node.init, node);
  27939. this.inForStatementInitCounter--;
  27940. this.token(";");
  27941. if (node.test) {
  27942. this.space();
  27943. this.print(node.test, node);
  27944. }
  27945. this.token(";");
  27946. if (node.update) {
  27947. this.space();
  27948. this.print(node.update, node);
  27949. }
  27950. this.token(")");
  27951. this.printBlock(node);
  27952. }
  27953. function WhileStatement(node) {
  27954. this.word("while");
  27955. this.space();
  27956. this.token("(");
  27957. this.print(node.test, node);
  27958. this.token(")");
  27959. this.printBlock(node);
  27960. }
  27961. var buildForXStatement = function buildForXStatement(op) {
  27962. return function (node) {
  27963. this.word("for");
  27964. this.space();
  27965. if (op === "await") {
  27966. this.word("await");
  27967. this.space();
  27968. }
  27969. this.token("(");
  27970. this.print(node.left, node);
  27971. this.space();
  27972. this.word(op === "await" ? "of" : op);
  27973. this.space();
  27974. this.print(node.right, node);
  27975. this.token(")");
  27976. this.printBlock(node);
  27977. };
  27978. };
  27979. var ForInStatement = exports.ForInStatement = buildForXStatement("in");
  27980. var ForOfStatement = exports.ForOfStatement = buildForXStatement("of");
  27981. var ForAwaitStatement = exports.ForAwaitStatement = buildForXStatement("await");
  27982. function DoWhileStatement(node) {
  27983. this.word("do");
  27984. this.space();
  27985. this.print(node.body, node);
  27986. this.space();
  27987. this.word("while");
  27988. this.space();
  27989. this.token("(");
  27990. this.print(node.test, node);
  27991. this.token(")");
  27992. this.semicolon();
  27993. }
  27994. function buildLabelStatement(prefix) {
  27995. var key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "label";
  27996. return function (node) {
  27997. this.word(prefix);
  27998. var label = node[key];
  27999. if (label) {
  28000. this.space();
  28001. var terminatorState = this.startTerminatorless();
  28002. this.print(label, node);
  28003. this.endTerminatorless(terminatorState);
  28004. }
  28005. this.semicolon();
  28006. };
  28007. }
  28008. var ContinueStatement = exports.ContinueStatement = buildLabelStatement("continue");
  28009. var ReturnStatement = exports.ReturnStatement = buildLabelStatement("return", "argument");
  28010. var BreakStatement = exports.BreakStatement = buildLabelStatement("break");
  28011. var ThrowStatement = exports.ThrowStatement = buildLabelStatement("throw", "argument");
  28012. function LabeledStatement(node) {
  28013. this.print(node.label, node);
  28014. this.token(":");
  28015. this.space();
  28016. this.print(node.body, node);
  28017. }
  28018. function TryStatement(node) {
  28019. this.word("try");
  28020. this.space();
  28021. this.print(node.block, node);
  28022. this.space();
  28023. if (node.handlers) {
  28024. this.print(node.handlers[0], node);
  28025. } else {
  28026. this.print(node.handler, node);
  28027. }
  28028. if (node.finalizer) {
  28029. this.space();
  28030. this.word("finally");
  28031. this.space();
  28032. this.print(node.finalizer, node);
  28033. }
  28034. }
  28035. function CatchClause(node) {
  28036. this.word("catch");
  28037. this.space();
  28038. this.token("(");
  28039. this.print(node.param, node);
  28040. this.token(")");
  28041. this.space();
  28042. this.print(node.body, node);
  28043. }
  28044. function SwitchStatement(node) {
  28045. this.word("switch");
  28046. this.space();
  28047. this.token("(");
  28048. this.print(node.discriminant, node);
  28049. this.token(")");
  28050. this.space();
  28051. this.token("{");
  28052. this.printSequence(node.cases, node, {
  28053. indent: true,
  28054. addNewlines: function addNewlines(leading, cas) {
  28055. if (!leading && node.cases[node.cases.length - 1] === cas) return -1;
  28056. }
  28057. });
  28058. this.token("}");
  28059. }
  28060. function SwitchCase(node) {
  28061. if (node.test) {
  28062. this.word("case");
  28063. this.space();
  28064. this.print(node.test, node);
  28065. this.token(":");
  28066. } else {
  28067. this.word("default");
  28068. this.token(":");
  28069. }
  28070. if (node.consequent.length) {
  28071. this.newline();
  28072. this.printSequence(node.consequent, node, { indent: true });
  28073. }
  28074. }
  28075. function DebuggerStatement() {
  28076. this.word("debugger");
  28077. this.semicolon();
  28078. }
  28079. function variableDeclarationIdent() {
  28080. this.token(",");
  28081. this.newline();
  28082. if (this.endsWith("\n")) for (var i = 0; i < 4; i++) {
  28083. this.space(true);
  28084. }
  28085. }
  28086. function constDeclarationIdent() {
  28087. this.token(",");
  28088. this.newline();
  28089. if (this.endsWith("\n")) for (var i = 0; i < 6; i++) {
  28090. this.space(true);
  28091. }
  28092. }
  28093. function VariableDeclaration(node, parent) {
  28094. this.word(node.kind);
  28095. this.space();
  28096. var hasInits = false;
  28097. if (!t.isFor(parent)) {
  28098. for (var _iterator = node.declarations, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
  28099. var _ref;
  28100. if (_isArray) {
  28101. if (_i >= _iterator.length) break;
  28102. _ref = _iterator[_i++];
  28103. } else {
  28104. _i = _iterator.next();
  28105. if (_i.done) break;
  28106. _ref = _i.value;
  28107. }
  28108. var declar = _ref;
  28109. if (declar.init) {
  28110. hasInits = true;
  28111. }
  28112. }
  28113. }
  28114. var separator = void 0;
  28115. if (hasInits) {
  28116. separator = node.kind === "const" ? constDeclarationIdent : variableDeclarationIdent;
  28117. }
  28118. this.printList(node.declarations, node, { separator: separator });
  28119. if (t.isFor(parent)) {
  28120. if (parent.left === node || parent.init === node) return;
  28121. }
  28122. this.semicolon();
  28123. }
  28124. function VariableDeclarator(node) {
  28125. this.print(node.id, node);
  28126. this.print(node.id.typeAnnotation, node);
  28127. if (node.init) {
  28128. this.space();
  28129. this.token("=");
  28130. this.space();
  28131. this.print(node.init, node);
  28132. }
  28133. }
  28134. /***/ }),
  28135. /* 309 */
  28136. /***/ (function(module, exports) {
  28137. "use strict";
  28138. exports.__esModule = true;
  28139. exports.TaggedTemplateExpression = TaggedTemplateExpression;
  28140. exports.TemplateElement = TemplateElement;
  28141. exports.TemplateLiteral = TemplateLiteral;
  28142. function TaggedTemplateExpression(node) {
  28143. this.print(node.tag, node);
  28144. this.print(node.quasi, node);
  28145. }
  28146. function TemplateElement(node, parent) {
  28147. var isFirst = parent.quasis[0] === node;
  28148. var isLast = parent.quasis[parent.quasis.length - 1] === node;
  28149. var value = (isFirst ? "`" : "}") + node.value.raw + (isLast ? "`" : "${");
  28150. this.token(value);
  28151. }
  28152. function TemplateLiteral(node) {
  28153. var quasis = node.quasis;
  28154. for (var i = 0; i < quasis.length; i++) {
  28155. this.print(quasis[i], node);
  28156. if (i + 1 < quasis.length) {
  28157. this.print(node.expressions[i], node);
  28158. }
  28159. }
  28160. }
  28161. /***/ }),
  28162. /* 310 */
  28163. /***/ (function(module, exports, __webpack_require__) {
  28164. "use strict";
  28165. exports.__esModule = true;
  28166. exports.AwaitExpression = exports.FunctionTypeAnnotation = undefined;
  28167. exports.NullableTypeAnnotation = NullableTypeAnnotation;
  28168. exports.UpdateExpression = UpdateExpression;
  28169. exports.ObjectExpression = ObjectExpression;
  28170. exports.DoExpression = DoExpression;
  28171. exports.Binary = Binary;
  28172. exports.BinaryExpression = BinaryExpression;
  28173. exports.SequenceExpression = SequenceExpression;
  28174. exports.YieldExpression = YieldExpression;
  28175. exports.ClassExpression = ClassExpression;
  28176. exports.UnaryLike = UnaryLike;
  28177. exports.FunctionExpression = FunctionExpression;
  28178. exports.ArrowFunctionExpression = ArrowFunctionExpression;
  28179. exports.ConditionalExpression = ConditionalExpression;
  28180. exports.AssignmentExpression = AssignmentExpression;
  28181. var _babelTypes = __webpack_require__(1);
  28182. var t = _interopRequireWildcard(_babelTypes);
  28183. function _interopRequireWildcard(obj) {
  28184. if (obj && obj.__esModule) {
  28185. return obj;
  28186. } else {
  28187. var newObj = {};if (obj != null) {
  28188. for (var key in obj) {
  28189. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  28190. }
  28191. }newObj.default = obj;return newObj;
  28192. }
  28193. }
  28194. var PRECEDENCE = {
  28195. "||": 0,
  28196. "&&": 1,
  28197. "|": 2,
  28198. "^": 3,
  28199. "&": 4,
  28200. "==": 5,
  28201. "===": 5,
  28202. "!=": 5,
  28203. "!==": 5,
  28204. "<": 6,
  28205. ">": 6,
  28206. "<=": 6,
  28207. ">=": 6,
  28208. in: 6,
  28209. instanceof: 6,
  28210. ">>": 7,
  28211. "<<": 7,
  28212. ">>>": 7,
  28213. "+": 8,
  28214. "-": 8,
  28215. "*": 9,
  28216. "/": 9,
  28217. "%": 9,
  28218. "**": 10
  28219. };
  28220. function NullableTypeAnnotation(node, parent) {
  28221. return t.isArrayTypeAnnotation(parent);
  28222. }
  28223. exports.FunctionTypeAnnotation = NullableTypeAnnotation;
  28224. function UpdateExpression(node, parent) {
  28225. return t.isMemberExpression(parent) && parent.object === node;
  28226. }
  28227. function ObjectExpression(node, parent, printStack) {
  28228. return isFirstInStatement(printStack, { considerArrow: true });
  28229. }
  28230. function DoExpression(node, parent, printStack) {
  28231. return isFirstInStatement(printStack);
  28232. }
  28233. function Binary(node, parent) {
  28234. if ((t.isCallExpression(parent) || t.isNewExpression(parent)) && parent.callee === node || t.isUnaryLike(parent) || t.isMemberExpression(parent) && parent.object === node || t.isAwaitExpression(parent)) {
  28235. return true;
  28236. }
  28237. if (t.isBinary(parent)) {
  28238. var parentOp = parent.operator;
  28239. var parentPos = PRECEDENCE[parentOp];
  28240. var nodeOp = node.operator;
  28241. var nodePos = PRECEDENCE[nodeOp];
  28242. if (parentPos === nodePos && parent.right === node && !t.isLogicalExpression(parent) || parentPos > nodePos) {
  28243. return true;
  28244. }
  28245. }
  28246. return false;
  28247. }
  28248. function BinaryExpression(node, parent) {
  28249. return node.operator === "in" && (t.isVariableDeclarator(parent) || t.isFor(parent));
  28250. }
  28251. function SequenceExpression(node, parent) {
  28252. if (t.isForStatement(parent) || t.isThrowStatement(parent) || t.isReturnStatement(parent) || t.isIfStatement(parent) && parent.test === node || t.isWhileStatement(parent) && parent.test === node || t.isForInStatement(parent) && parent.right === node || t.isSwitchStatement(parent) && parent.discriminant === node || t.isExpressionStatement(parent) && parent.expression === node) {
  28253. return false;
  28254. }
  28255. return true;
  28256. }
  28257. function YieldExpression(node, parent) {
  28258. return t.isBinary(parent) || t.isUnaryLike(parent) || t.isCallExpression(parent) || t.isMemberExpression(parent) || t.isNewExpression(parent) || t.isConditionalExpression(parent) && node === parent.test;
  28259. }
  28260. exports.AwaitExpression = YieldExpression;
  28261. function ClassExpression(node, parent, printStack) {
  28262. return isFirstInStatement(printStack, { considerDefaultExports: true });
  28263. }
  28264. function UnaryLike(node, parent) {
  28265. return t.isMemberExpression(parent, { object: node }) || t.isCallExpression(parent, { callee: node }) || t.isNewExpression(parent, { callee: node });
  28266. }
  28267. function FunctionExpression(node, parent, printStack) {
  28268. return isFirstInStatement(printStack, { considerDefaultExports: true });
  28269. }
  28270. function ArrowFunctionExpression(node, parent) {
  28271. if (t.isExportDeclaration(parent) || t.isBinaryExpression(parent) || t.isLogicalExpression(parent) || t.isUnaryExpression(parent) || t.isTaggedTemplateExpression(parent)) {
  28272. return true;
  28273. }
  28274. return UnaryLike(node, parent);
  28275. }
  28276. function ConditionalExpression(node, parent) {
  28277. if (t.isUnaryLike(parent) || t.isBinary(parent) || t.isConditionalExpression(parent, { test: node }) || t.isAwaitExpression(parent)) {
  28278. return true;
  28279. }
  28280. return UnaryLike(node, parent);
  28281. }
  28282. function AssignmentExpression(node) {
  28283. if (t.isObjectPattern(node.left)) {
  28284. return true;
  28285. } else {
  28286. return ConditionalExpression.apply(undefined, arguments);
  28287. }
  28288. }
  28289. function isFirstInStatement(printStack) {
  28290. var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  28291. _ref$considerArrow = _ref.considerArrow,
  28292. considerArrow = _ref$considerArrow === undefined ? false : _ref$considerArrow,
  28293. _ref$considerDefaultE = _ref.considerDefaultExports,
  28294. considerDefaultExports = _ref$considerDefaultE === undefined ? false : _ref$considerDefaultE;
  28295. var i = printStack.length - 1;
  28296. var node = printStack[i];
  28297. i--;
  28298. var parent = printStack[i];
  28299. while (i > 0) {
  28300. if (t.isExpressionStatement(parent, { expression: node }) || t.isTaggedTemplateExpression(parent) || considerDefaultExports && t.isExportDefaultDeclaration(parent, { declaration: node }) || considerArrow && t.isArrowFunctionExpression(parent, { body: node })) {
  28301. return true;
  28302. }
  28303. if (t.isCallExpression(parent, { callee: node }) || t.isSequenceExpression(parent) && parent.expressions[0] === node || t.isMemberExpression(parent, { object: node }) || t.isConditional(parent, { test: node }) || t.isBinary(parent, { left: node }) || t.isAssignmentExpression(parent, { left: node })) {
  28304. node = parent;
  28305. i--;
  28306. parent = printStack[i];
  28307. } else {
  28308. return false;
  28309. }
  28310. }
  28311. return false;
  28312. }
  28313. /***/ }),
  28314. /* 311 */
  28315. /***/ (function(module, exports, __webpack_require__) {
  28316. "use strict";
  28317. var _map = __webpack_require__(588);
  28318. var _map2 = _interopRequireDefault(_map);
  28319. var _babelTypes = __webpack_require__(1);
  28320. var t = _interopRequireWildcard(_babelTypes);
  28321. function _interopRequireWildcard(obj) {
  28322. if (obj && obj.__esModule) {
  28323. return obj;
  28324. } else {
  28325. var newObj = {};if (obj != null) {
  28326. for (var key in obj) {
  28327. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  28328. }
  28329. }newObj.default = obj;return newObj;
  28330. }
  28331. }
  28332. function _interopRequireDefault(obj) {
  28333. return obj && obj.__esModule ? obj : { default: obj };
  28334. }
  28335. function crawl(node) {
  28336. var state = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  28337. if (t.isMemberExpression(node)) {
  28338. crawl(node.object, state);
  28339. if (node.computed) crawl(node.property, state);
  28340. } else if (t.isBinary(node) || t.isAssignmentExpression(node)) {
  28341. crawl(node.left, state);
  28342. crawl(node.right, state);
  28343. } else if (t.isCallExpression(node)) {
  28344. state.hasCall = true;
  28345. crawl(node.callee, state);
  28346. } else if (t.isFunction(node)) {
  28347. state.hasFunction = true;
  28348. } else if (t.isIdentifier(node)) {
  28349. state.hasHelper = state.hasHelper || isHelper(node.callee);
  28350. }
  28351. return state;
  28352. }
  28353. function isHelper(node) {
  28354. if (t.isMemberExpression(node)) {
  28355. return isHelper(node.object) || isHelper(node.property);
  28356. } else if (t.isIdentifier(node)) {
  28357. return node.name === "require" || node.name[0] === "_";
  28358. } else if (t.isCallExpression(node)) {
  28359. return isHelper(node.callee);
  28360. } else if (t.isBinary(node) || t.isAssignmentExpression(node)) {
  28361. return t.isIdentifier(node.left) && isHelper(node.left) || isHelper(node.right);
  28362. } else {
  28363. return false;
  28364. }
  28365. }
  28366. function isType(node) {
  28367. return t.isLiteral(node) || t.isObjectExpression(node) || t.isArrayExpression(node) || t.isIdentifier(node) || t.isMemberExpression(node);
  28368. }
  28369. exports.nodes = {
  28370. AssignmentExpression: function AssignmentExpression(node) {
  28371. var state = crawl(node.right);
  28372. if (state.hasCall && state.hasHelper || state.hasFunction) {
  28373. return {
  28374. before: state.hasFunction,
  28375. after: true
  28376. };
  28377. }
  28378. },
  28379. SwitchCase: function SwitchCase(node, parent) {
  28380. return {
  28381. before: node.consequent.length || parent.cases[0] === node
  28382. };
  28383. },
  28384. LogicalExpression: function LogicalExpression(node) {
  28385. if (t.isFunction(node.left) || t.isFunction(node.right)) {
  28386. return {
  28387. after: true
  28388. };
  28389. }
  28390. },
  28391. Literal: function Literal(node) {
  28392. if (node.value === "use strict") {
  28393. return {
  28394. after: true
  28395. };
  28396. }
  28397. },
  28398. CallExpression: function CallExpression(node) {
  28399. if (t.isFunction(node.callee) || isHelper(node)) {
  28400. return {
  28401. before: true,
  28402. after: true
  28403. };
  28404. }
  28405. },
  28406. VariableDeclaration: function VariableDeclaration(node) {
  28407. for (var i = 0; i < node.declarations.length; i++) {
  28408. var declar = node.declarations[i];
  28409. var enabled = isHelper(declar.id) && !isType(declar.init);
  28410. if (!enabled) {
  28411. var state = crawl(declar.init);
  28412. enabled = isHelper(declar.init) && state.hasCall || state.hasFunction;
  28413. }
  28414. if (enabled) {
  28415. return {
  28416. before: true,
  28417. after: true
  28418. };
  28419. }
  28420. }
  28421. },
  28422. IfStatement: function IfStatement(node) {
  28423. if (t.isBlockStatement(node.consequent)) {
  28424. return {
  28425. before: true,
  28426. after: true
  28427. };
  28428. }
  28429. }
  28430. };
  28431. exports.nodes.ObjectProperty = exports.nodes.ObjectTypeProperty = exports.nodes.ObjectMethod = exports.nodes.SpreadProperty = function (node, parent) {
  28432. if (parent.properties[0] === node) {
  28433. return {
  28434. before: true
  28435. };
  28436. }
  28437. };
  28438. exports.list = {
  28439. VariableDeclaration: function VariableDeclaration(node) {
  28440. return (0, _map2.default)(node.declarations, "init");
  28441. },
  28442. ArrayExpression: function ArrayExpression(node) {
  28443. return node.elements;
  28444. },
  28445. ObjectExpression: function ObjectExpression(node) {
  28446. return node.properties;
  28447. }
  28448. };
  28449. [["Function", true], ["Class", true], ["Loop", true], ["LabeledStatement", true], ["SwitchStatement", true], ["TryStatement", true]].forEach(function (_ref) {
  28450. var type = _ref[0],
  28451. amounts = _ref[1];
  28452. if (typeof amounts === "boolean") {
  28453. amounts = { after: amounts, before: amounts };
  28454. }
  28455. [type].concat(t.FLIPPED_ALIAS_KEYS[type] || []).forEach(function (type) {
  28456. exports.nodes[type] = function () {
  28457. return amounts;
  28458. };
  28459. });
  28460. });
  28461. /***/ }),
  28462. /* 312 */
  28463. /***/ (function(module, exports, __webpack_require__) {
  28464. "use strict";
  28465. exports.__esModule = true;
  28466. var _assign = __webpack_require__(87);
  28467. var _assign2 = _interopRequireDefault(_assign);
  28468. var _getIterator2 = __webpack_require__(2);
  28469. var _getIterator3 = _interopRequireDefault(_getIterator2);
  28470. var _stringify = __webpack_require__(35);
  28471. var _stringify2 = _interopRequireDefault(_stringify);
  28472. var _weakSet = __webpack_require__(365);
  28473. var _weakSet2 = _interopRequireDefault(_weakSet);
  28474. var _classCallCheck2 = __webpack_require__(3);
  28475. var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
  28476. var _find = __webpack_require__(579);
  28477. var _find2 = _interopRequireDefault(_find);
  28478. var _findLast = __webpack_require__(581);
  28479. var _findLast2 = _interopRequireDefault(_findLast);
  28480. var _isInteger = __webpack_require__(586);
  28481. var _isInteger2 = _interopRequireDefault(_isInteger);
  28482. var _repeat = __webpack_require__(278);
  28483. var _repeat2 = _interopRequireDefault(_repeat);
  28484. var _buffer = __webpack_require__(300);
  28485. var _buffer2 = _interopRequireDefault(_buffer);
  28486. var _node = __webpack_require__(187);
  28487. var n = _interopRequireWildcard(_node);
  28488. var _whitespace = __webpack_require__(314);
  28489. var _whitespace2 = _interopRequireDefault(_whitespace);
  28490. var _babelTypes = __webpack_require__(1);
  28491. var t = _interopRequireWildcard(_babelTypes);
  28492. function _interopRequireWildcard(obj) {
  28493. if (obj && obj.__esModule) {
  28494. return obj;
  28495. } else {
  28496. var newObj = {};if (obj != null) {
  28497. for (var key in obj) {
  28498. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  28499. }
  28500. }newObj.default = obj;return newObj;
  28501. }
  28502. }
  28503. function _interopRequireDefault(obj) {
  28504. return obj && obj.__esModule ? obj : { default: obj };
  28505. }
  28506. var SCIENTIFIC_NOTATION = /e/i;
  28507. var ZERO_DECIMAL_INTEGER = /\.0+$/;
  28508. var NON_DECIMAL_LITERAL = /^0[box]/;
  28509. var Printer = function () {
  28510. function Printer(format, map, tokens) {
  28511. (0, _classCallCheck3.default)(this, Printer);
  28512. this.inForStatementInitCounter = 0;
  28513. this._printStack = [];
  28514. this._indent = 0;
  28515. this._insideAux = false;
  28516. this._printedCommentStarts = {};
  28517. this._parenPushNewlineState = null;
  28518. this._printAuxAfterOnNextUserNode = false;
  28519. this._printedComments = new _weakSet2.default();
  28520. this._endsWithInteger = false;
  28521. this._endsWithWord = false;
  28522. this.format = format || {};
  28523. this._buf = new _buffer2.default(map);
  28524. this._whitespace = tokens.length > 0 ? new _whitespace2.default(tokens) : null;
  28525. }
  28526. Printer.prototype.generate = function generate(ast) {
  28527. this.print(ast);
  28528. this._maybeAddAuxComment();
  28529. return this._buf.get();
  28530. };
  28531. Printer.prototype.indent = function indent() {
  28532. if (this.format.compact || this.format.concise) return;
  28533. this._indent++;
  28534. };
  28535. Printer.prototype.dedent = function dedent() {
  28536. if (this.format.compact || this.format.concise) return;
  28537. this._indent--;
  28538. };
  28539. Printer.prototype.semicolon = function semicolon() {
  28540. var force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  28541. this._maybeAddAuxComment();
  28542. this._append(";", !force);
  28543. };
  28544. Printer.prototype.rightBrace = function rightBrace() {
  28545. if (this.format.minified) {
  28546. this._buf.removeLastSemicolon();
  28547. }
  28548. this.token("}");
  28549. };
  28550. Printer.prototype.space = function space() {
  28551. var force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  28552. if (this.format.compact) return;
  28553. if (this._buf.hasContent() && !this.endsWith(" ") && !this.endsWith("\n") || force) {
  28554. this._space();
  28555. }
  28556. };
  28557. Printer.prototype.word = function word(str) {
  28558. if (this._endsWithWord) this._space();
  28559. this._maybeAddAuxComment();
  28560. this._append(str);
  28561. this._endsWithWord = true;
  28562. };
  28563. Printer.prototype.number = function number(str) {
  28564. this.word(str);
  28565. this._endsWithInteger = (0, _isInteger2.default)(+str) && !NON_DECIMAL_LITERAL.test(str) && !SCIENTIFIC_NOTATION.test(str) && !ZERO_DECIMAL_INTEGER.test(str) && str[str.length - 1] !== ".";
  28566. };
  28567. Printer.prototype.token = function token(str) {
  28568. if (str === "--" && this.endsWith("!") || str[0] === "+" && this.endsWith("+") || str[0] === "-" && this.endsWith("-") || str[0] === "." && this._endsWithInteger) {
  28569. this._space();
  28570. }
  28571. this._maybeAddAuxComment();
  28572. this._append(str);
  28573. };
  28574. Printer.prototype.newline = function newline(i) {
  28575. if (this.format.retainLines || this.format.compact) return;
  28576. if (this.format.concise) {
  28577. this.space();
  28578. return;
  28579. }
  28580. if (this.endsWith("\n\n")) return;
  28581. if (typeof i !== "number") i = 1;
  28582. i = Math.min(2, i);
  28583. if (this.endsWith("{\n") || this.endsWith(":\n")) i--;
  28584. if (i <= 0) return;
  28585. for (var j = 0; j < i; j++) {
  28586. this._newline();
  28587. }
  28588. };
  28589. Printer.prototype.endsWith = function endsWith(str) {
  28590. return this._buf.endsWith(str);
  28591. };
  28592. Printer.prototype.removeTrailingNewline = function removeTrailingNewline() {
  28593. this._buf.removeTrailingNewline();
  28594. };
  28595. Printer.prototype.source = function source(prop, loc) {
  28596. this._catchUp(prop, loc);
  28597. this._buf.source(prop, loc);
  28598. };
  28599. Printer.prototype.withSource = function withSource(prop, loc, cb) {
  28600. this._catchUp(prop, loc);
  28601. this._buf.withSource(prop, loc, cb);
  28602. };
  28603. Printer.prototype._space = function _space() {
  28604. this._append(" ", true);
  28605. };
  28606. Printer.prototype._newline = function _newline() {
  28607. this._append("\n", true);
  28608. };
  28609. Printer.prototype._append = function _append(str) {
  28610. var queue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  28611. this._maybeAddParen(str);
  28612. this._maybeIndent(str);
  28613. if (queue) this._buf.queue(str);else this._buf.append(str);
  28614. this._endsWithWord = false;
  28615. this._endsWithInteger = false;
  28616. };
  28617. Printer.prototype._maybeIndent = function _maybeIndent(str) {
  28618. if (this._indent && this.endsWith("\n") && str[0] !== "\n") {
  28619. this._buf.queue(this._getIndent());
  28620. }
  28621. };
  28622. Printer.prototype._maybeAddParen = function _maybeAddParen(str) {
  28623. var parenPushNewlineState = this._parenPushNewlineState;
  28624. if (!parenPushNewlineState) return;
  28625. this._parenPushNewlineState = null;
  28626. var i = void 0;
  28627. for (i = 0; i < str.length && str[i] === " "; i++) {
  28628. continue;
  28629. }if (i === str.length) return;
  28630. var cha = str[i];
  28631. if (cha === "\n" || cha === "/") {
  28632. this.token("(");
  28633. this.indent();
  28634. parenPushNewlineState.printed = true;
  28635. }
  28636. };
  28637. Printer.prototype._catchUp = function _catchUp(prop, loc) {
  28638. if (!this.format.retainLines) return;
  28639. var pos = loc ? loc[prop] : null;
  28640. if (pos && pos.line !== null) {
  28641. var count = pos.line - this._buf.getCurrentLine();
  28642. for (var i = 0; i < count; i++) {
  28643. this._newline();
  28644. }
  28645. }
  28646. };
  28647. Printer.prototype._getIndent = function _getIndent() {
  28648. return (0, _repeat2.default)(this.format.indent.style, this._indent);
  28649. };
  28650. Printer.prototype.startTerminatorless = function startTerminatorless() {
  28651. return this._parenPushNewlineState = {
  28652. printed: false
  28653. };
  28654. };
  28655. Printer.prototype.endTerminatorless = function endTerminatorless(state) {
  28656. if (state.printed) {
  28657. this.dedent();
  28658. this.newline();
  28659. this.token(")");
  28660. }
  28661. };
  28662. Printer.prototype.print = function print(node, parent) {
  28663. var _this = this;
  28664. if (!node) return;
  28665. var oldConcise = this.format.concise;
  28666. if (node._compact) {
  28667. this.format.concise = true;
  28668. }
  28669. var printMethod = this[node.type];
  28670. if (!printMethod) {
  28671. throw new ReferenceError("unknown node of type " + (0, _stringify2.default)(node.type) + " with constructor " + (0, _stringify2.default)(node && node.constructor.name));
  28672. }
  28673. this._printStack.push(node);
  28674. var oldInAux = this._insideAux;
  28675. this._insideAux = !node.loc;
  28676. this._maybeAddAuxComment(this._insideAux && !oldInAux);
  28677. var needsParens = n.needsParens(node, parent, this._printStack);
  28678. if (this.format.retainFunctionParens && node.type === "FunctionExpression" && node.extra && node.extra.parenthesized) {
  28679. needsParens = true;
  28680. }
  28681. if (needsParens) this.token("(");
  28682. this._printLeadingComments(node, parent);
  28683. var loc = t.isProgram(node) || t.isFile(node) ? null : node.loc;
  28684. this.withSource("start", loc, function () {
  28685. _this[node.type](node, parent);
  28686. });
  28687. this._printTrailingComments(node, parent);
  28688. if (needsParens) this.token(")");
  28689. this._printStack.pop();
  28690. this.format.concise = oldConcise;
  28691. this._insideAux = oldInAux;
  28692. };
  28693. Printer.prototype._maybeAddAuxComment = function _maybeAddAuxComment(enteredPositionlessNode) {
  28694. if (enteredPositionlessNode) this._printAuxBeforeComment();
  28695. if (!this._insideAux) this._printAuxAfterComment();
  28696. };
  28697. Printer.prototype._printAuxBeforeComment = function _printAuxBeforeComment() {
  28698. if (this._printAuxAfterOnNextUserNode) return;
  28699. this._printAuxAfterOnNextUserNode = true;
  28700. var comment = this.format.auxiliaryCommentBefore;
  28701. if (comment) {
  28702. this._printComment({
  28703. type: "CommentBlock",
  28704. value: comment
  28705. });
  28706. }
  28707. };
  28708. Printer.prototype._printAuxAfterComment = function _printAuxAfterComment() {
  28709. if (!this._printAuxAfterOnNextUserNode) return;
  28710. this._printAuxAfterOnNextUserNode = false;
  28711. var comment = this.format.auxiliaryCommentAfter;
  28712. if (comment) {
  28713. this._printComment({
  28714. type: "CommentBlock",
  28715. value: comment
  28716. });
  28717. }
  28718. };
  28719. Printer.prototype.getPossibleRaw = function getPossibleRaw(node) {
  28720. var extra = node.extra;
  28721. if (extra && extra.raw != null && extra.rawValue != null && node.value === extra.rawValue) {
  28722. return extra.raw;
  28723. }
  28724. };
  28725. Printer.prototype.printJoin = function printJoin(nodes, parent) {
  28726. var opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  28727. if (!nodes || !nodes.length) return;
  28728. if (opts.indent) this.indent();
  28729. var newlineOpts = {
  28730. addNewlines: opts.addNewlines
  28731. };
  28732. for (var i = 0; i < nodes.length; i++) {
  28733. var node = nodes[i];
  28734. if (!node) continue;
  28735. if (opts.statement) this._printNewline(true, node, parent, newlineOpts);
  28736. this.print(node, parent);
  28737. if (opts.iterator) {
  28738. opts.iterator(node, i);
  28739. }
  28740. if (opts.separator && i < nodes.length - 1) {
  28741. opts.separator.call(this);
  28742. }
  28743. if (opts.statement) this._printNewline(false, node, parent, newlineOpts);
  28744. }
  28745. if (opts.indent) this.dedent();
  28746. };
  28747. Printer.prototype.printAndIndentOnComments = function printAndIndentOnComments(node, parent) {
  28748. var indent = !!node.leadingComments;
  28749. if (indent) this.indent();
  28750. this.print(node, parent);
  28751. if (indent) this.dedent();
  28752. };
  28753. Printer.prototype.printBlock = function printBlock(parent) {
  28754. var node = parent.body;
  28755. if (!t.isEmptyStatement(node)) {
  28756. this.space();
  28757. }
  28758. this.print(node, parent);
  28759. };
  28760. Printer.prototype._printTrailingComments = function _printTrailingComments(node, parent) {
  28761. this._printComments(this._getComments(false, node, parent));
  28762. };
  28763. Printer.prototype._printLeadingComments = function _printLeadingComments(node, parent) {
  28764. this._printComments(this._getComments(true, node, parent));
  28765. };
  28766. Printer.prototype.printInnerComments = function printInnerComments(node) {
  28767. var indent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  28768. if (!node.innerComments) return;
  28769. if (indent) this.indent();
  28770. this._printComments(node.innerComments);
  28771. if (indent) this.dedent();
  28772. };
  28773. Printer.prototype.printSequence = function printSequence(nodes, parent) {
  28774. var opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  28775. opts.statement = true;
  28776. return this.printJoin(nodes, parent, opts);
  28777. };
  28778. Printer.prototype.printList = function printList(items, parent) {
  28779. var opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  28780. if (opts.separator == null) {
  28781. opts.separator = commaSeparator;
  28782. }
  28783. return this.printJoin(items, parent, opts);
  28784. };
  28785. Printer.prototype._printNewline = function _printNewline(leading, node, parent, opts) {
  28786. var _this2 = this;
  28787. if (this.format.retainLines || this.format.compact) return;
  28788. if (this.format.concise) {
  28789. this.space();
  28790. return;
  28791. }
  28792. var lines = 0;
  28793. if (node.start != null && !node._ignoreUserWhitespace && this._whitespace) {
  28794. if (leading) {
  28795. var _comments = node.leadingComments;
  28796. var _comment = _comments && (0, _find2.default)(_comments, function (comment) {
  28797. return !!comment.loc && _this2.format.shouldPrintComment(comment.value);
  28798. });
  28799. lines = this._whitespace.getNewlinesBefore(_comment || node);
  28800. } else {
  28801. var _comments2 = node.trailingComments;
  28802. var _comment2 = _comments2 && (0, _findLast2.default)(_comments2, function (comment) {
  28803. return !!comment.loc && _this2.format.shouldPrintComment(comment.value);
  28804. });
  28805. lines = this._whitespace.getNewlinesAfter(_comment2 || node);
  28806. }
  28807. } else {
  28808. if (!leading) lines++;
  28809. if (opts.addNewlines) lines += opts.addNewlines(leading, node) || 0;
  28810. var needs = n.needsWhitespaceAfter;
  28811. if (leading) needs = n.needsWhitespaceBefore;
  28812. if (needs(node, parent)) lines++;
  28813. if (!this._buf.hasContent()) lines = 0;
  28814. }
  28815. this.newline(lines);
  28816. };
  28817. Printer.prototype._getComments = function _getComments(leading, node) {
  28818. return node && (leading ? node.leadingComments : node.trailingComments) || [];
  28819. };
  28820. Printer.prototype._printComment = function _printComment(comment) {
  28821. var _this3 = this;
  28822. if (!this.format.shouldPrintComment(comment.value)) return;
  28823. if (comment.ignore) return;
  28824. if (this._printedComments.has(comment)) return;
  28825. this._printedComments.add(comment);
  28826. if (comment.start != null) {
  28827. if (this._printedCommentStarts[comment.start]) return;
  28828. this._printedCommentStarts[comment.start] = true;
  28829. }
  28830. this.newline(this._whitespace ? this._whitespace.getNewlinesBefore(comment) : 0);
  28831. if (!this.endsWith("[") && !this.endsWith("{")) this.space();
  28832. var val = comment.type === "CommentLine" ? "//" + comment.value + "\n" : "/*" + comment.value + "*/";
  28833. if (comment.type === "CommentBlock" && this.format.indent.adjustMultilineComment) {
  28834. var offset = comment.loc && comment.loc.start.column;
  28835. if (offset) {
  28836. var newlineRegex = new RegExp("\\n\\s{1," + offset + "}", "g");
  28837. val = val.replace(newlineRegex, "\n");
  28838. }
  28839. var indentSize = Math.max(this._getIndent().length, this._buf.getCurrentColumn());
  28840. val = val.replace(/\n(?!$)/g, "\n" + (0, _repeat2.default)(" ", indentSize));
  28841. }
  28842. this.withSource("start", comment.loc, function () {
  28843. _this3._append(val);
  28844. });
  28845. this.newline((this._whitespace ? this._whitespace.getNewlinesAfter(comment) : 0) + (comment.type === "CommentLine" ? -1 : 0));
  28846. };
  28847. Printer.prototype._printComments = function _printComments(comments) {
  28848. if (!comments || !comments.length) return;
  28849. for (var _iterator = comments, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
  28850. var _ref;
  28851. if (_isArray) {
  28852. if (_i >= _iterator.length) break;
  28853. _ref = _iterator[_i++];
  28854. } else {
  28855. _i = _iterator.next();
  28856. if (_i.done) break;
  28857. _ref = _i.value;
  28858. }
  28859. var _comment3 = _ref;
  28860. this._printComment(_comment3);
  28861. }
  28862. };
  28863. return Printer;
  28864. }();
  28865. exports.default = Printer;
  28866. function commaSeparator() {
  28867. this.token(",");
  28868. this.space();
  28869. }
  28870. var _arr = [__webpack_require__(309), __webpack_require__(303), __webpack_require__(308), __webpack_require__(302), __webpack_require__(306), __webpack_require__(307), __webpack_require__(123), __webpack_require__(304), __webpack_require__(301), __webpack_require__(305)];
  28871. for (var _i2 = 0; _i2 < _arr.length; _i2++) {
  28872. var generator = _arr[_i2];
  28873. (0, _assign2.default)(Printer.prototype, generator);
  28874. }
  28875. module.exports = exports["default"];
  28876. /***/ }),
  28877. /* 313 */
  28878. /***/ (function(module, exports, __webpack_require__) {
  28879. "use strict";
  28880. exports.__esModule = true;
  28881. var _keys = __webpack_require__(14);
  28882. var _keys2 = _interopRequireDefault(_keys);
  28883. var _typeof2 = __webpack_require__(11);
  28884. var _typeof3 = _interopRequireDefault(_typeof2);
  28885. var _classCallCheck2 = __webpack_require__(3);
  28886. var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
  28887. var _sourceMap = __webpack_require__(288);
  28888. var _sourceMap2 = _interopRequireDefault(_sourceMap);
  28889. function _interopRequireDefault(obj) {
  28890. return obj && obj.__esModule ? obj : { default: obj };
  28891. }
  28892. var SourceMap = function () {
  28893. function SourceMap(opts, code) {
  28894. (0, _classCallCheck3.default)(this, SourceMap);
  28895. this._cachedMap = null;
  28896. this._code = code;
  28897. this._opts = opts;
  28898. this._rawMappings = [];
  28899. }
  28900. SourceMap.prototype.get = function get() {
  28901. if (!this._cachedMap) {
  28902. var map = this._cachedMap = new _sourceMap2.default.SourceMapGenerator({
  28903. file: this._opts.sourceMapTarget,
  28904. sourceRoot: this._opts.sourceRoot
  28905. });
  28906. var code = this._code;
  28907. if (typeof code === "string") {
  28908. map.setSourceContent(this._opts.sourceFileName, code);
  28909. } else if ((typeof code === "undefined" ? "undefined" : (0, _typeof3.default)(code)) === "object") {
  28910. (0, _keys2.default)(code).forEach(function (sourceFileName) {
  28911. map.setSourceContent(sourceFileName, code[sourceFileName]);
  28912. });
  28913. }
  28914. this._rawMappings.forEach(map.addMapping, map);
  28915. }
  28916. return this._cachedMap.toJSON();
  28917. };
  28918. SourceMap.prototype.getRawMappings = function getRawMappings() {
  28919. return this._rawMappings.slice();
  28920. };
  28921. SourceMap.prototype.mark = function mark(generatedLine, generatedColumn, line, column, identifierName, filename) {
  28922. if (this._lastGenLine !== generatedLine && line === null) return;
  28923. if (this._lastGenLine === generatedLine && this._lastSourceLine === line && this._lastSourceColumn === column) {
  28924. return;
  28925. }
  28926. this._cachedMap = null;
  28927. this._lastGenLine = generatedLine;
  28928. this._lastSourceLine = line;
  28929. this._lastSourceColumn = column;
  28930. this._rawMappings.push({
  28931. name: identifierName || undefined,
  28932. generated: {
  28933. line: generatedLine,
  28934. column: generatedColumn
  28935. },
  28936. source: line == null ? undefined : filename || this._opts.sourceFileName,
  28937. original: line == null ? undefined : {
  28938. line: line,
  28939. column: column
  28940. }
  28941. });
  28942. };
  28943. return SourceMap;
  28944. }();
  28945. exports.default = SourceMap;
  28946. module.exports = exports["default"];
  28947. /***/ }),
  28948. /* 314 */
  28949. /***/ (function(module, exports, __webpack_require__) {
  28950. "use strict";
  28951. exports.__esModule = true;
  28952. var _classCallCheck2 = __webpack_require__(3);
  28953. var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
  28954. function _interopRequireDefault(obj) {
  28955. return obj && obj.__esModule ? obj : { default: obj };
  28956. }
  28957. var Whitespace = function () {
  28958. function Whitespace(tokens) {
  28959. (0, _classCallCheck3.default)(this, Whitespace);
  28960. this.tokens = tokens;
  28961. this.used = {};
  28962. }
  28963. Whitespace.prototype.getNewlinesBefore = function getNewlinesBefore(node) {
  28964. var startToken = void 0;
  28965. var endToken = void 0;
  28966. var tokens = this.tokens;
  28967. var index = this._findToken(function (token) {
  28968. return token.start - node.start;
  28969. }, 0, tokens.length);
  28970. if (index >= 0) {
  28971. while (index && node.start === tokens[index - 1].start) {
  28972. --index;
  28973. }startToken = tokens[index - 1];
  28974. endToken = tokens[index];
  28975. }
  28976. return this._getNewlinesBetween(startToken, endToken);
  28977. };
  28978. Whitespace.prototype.getNewlinesAfter = function getNewlinesAfter(node) {
  28979. var startToken = void 0;
  28980. var endToken = void 0;
  28981. var tokens = this.tokens;
  28982. var index = this._findToken(function (token) {
  28983. return token.end - node.end;
  28984. }, 0, tokens.length);
  28985. if (index >= 0) {
  28986. while (index && node.end === tokens[index - 1].end) {
  28987. --index;
  28988. }startToken = tokens[index];
  28989. endToken = tokens[index + 1];
  28990. if (endToken.type.label === ",") endToken = tokens[index + 2];
  28991. }
  28992. if (endToken && endToken.type.label === "eof") {
  28993. return 1;
  28994. } else {
  28995. return this._getNewlinesBetween(startToken, endToken);
  28996. }
  28997. };
  28998. Whitespace.prototype._getNewlinesBetween = function _getNewlinesBetween(startToken, endToken) {
  28999. if (!endToken || !endToken.loc) return 0;
  29000. var start = startToken ? startToken.loc.end.line : 1;
  29001. var end = endToken.loc.start.line;
  29002. var lines = 0;
  29003. for (var line = start; line < end; line++) {
  29004. if (typeof this.used[line] === "undefined") {
  29005. this.used[line] = true;
  29006. lines++;
  29007. }
  29008. }
  29009. return lines;
  29010. };
  29011. Whitespace.prototype._findToken = function _findToken(test, start, end) {
  29012. if (start >= end) return -1;
  29013. var middle = start + end >>> 1;
  29014. var match = test(this.tokens[middle]);
  29015. if (match < 0) {
  29016. return this._findToken(test, middle + 1, end);
  29017. } else if (match > 0) {
  29018. return this._findToken(test, start, middle);
  29019. } else if (match === 0) {
  29020. return middle;
  29021. }
  29022. return -1;
  29023. };
  29024. return Whitespace;
  29025. }();
  29026. exports.default = Whitespace;
  29027. module.exports = exports["default"];
  29028. /***/ }),
  29029. /* 315 */
  29030. /***/ (function(module, exports, __webpack_require__) {
  29031. "use strict";
  29032. exports.__esModule = true;
  29033. var _getIterator2 = __webpack_require__(2);
  29034. var _getIterator3 = _interopRequireDefault(_getIterator2);
  29035. exports.default = bindifyDecorators;
  29036. var _babelTypes = __webpack_require__(1);
  29037. var t = _interopRequireWildcard(_babelTypes);
  29038. function _interopRequireWildcard(obj) {
  29039. if (obj && obj.__esModule) {
  29040. return obj;
  29041. } else {
  29042. var newObj = {};if (obj != null) {
  29043. for (var key in obj) {
  29044. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  29045. }
  29046. }newObj.default = obj;return newObj;
  29047. }
  29048. }
  29049. function _interopRequireDefault(obj) {
  29050. return obj && obj.__esModule ? obj : { default: obj };
  29051. }
  29052. function bindifyDecorators(decorators) {
  29053. for (var _iterator = decorators, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
  29054. var _ref;
  29055. if (_isArray) {
  29056. if (_i >= _iterator.length) break;
  29057. _ref = _iterator[_i++];
  29058. } else {
  29059. _i = _iterator.next();
  29060. if (_i.done) break;
  29061. _ref = _i.value;
  29062. }
  29063. var decoratorPath = _ref;
  29064. var decorator = decoratorPath.node;
  29065. var expression = decorator.expression;
  29066. if (!t.isMemberExpression(expression)) continue;
  29067. var temp = decoratorPath.scope.maybeGenerateMemoised(expression.object);
  29068. var ref = void 0;
  29069. var nodes = [];
  29070. if (temp) {
  29071. ref = temp;
  29072. nodes.push(t.assignmentExpression("=", temp, expression.object));
  29073. } else {
  29074. ref = expression.object;
  29075. }
  29076. nodes.push(t.callExpression(t.memberExpression(t.memberExpression(ref, expression.property, expression.computed), t.identifier("bind")), [ref]));
  29077. if (nodes.length === 1) {
  29078. decorator.expression = nodes[0];
  29079. } else {
  29080. decorator.expression = t.sequenceExpression(nodes);
  29081. }
  29082. }
  29083. }
  29084. module.exports = exports["default"];
  29085. /***/ }),
  29086. /* 316 */
  29087. /***/ (function(module, exports, __webpack_require__) {
  29088. "use strict";
  29089. exports.__esModule = true;
  29090. exports.default = function (opts) {
  29091. var visitor = {};
  29092. function isAssignment(node) {
  29093. return node && node.operator === opts.operator + "=";
  29094. }
  29095. function buildAssignment(left, right) {
  29096. return t.assignmentExpression("=", left, right);
  29097. }
  29098. visitor.ExpressionStatement = function (path, file) {
  29099. if (path.isCompletionRecord()) return;
  29100. var expr = path.node.expression;
  29101. if (!isAssignment(expr)) return;
  29102. var nodes = [];
  29103. var exploded = (0, _babelHelperExplodeAssignableExpression2.default)(expr.left, nodes, file, path.scope, true);
  29104. nodes.push(t.expressionStatement(buildAssignment(exploded.ref, opts.build(exploded.uid, expr.right))));
  29105. path.replaceWithMultiple(nodes);
  29106. };
  29107. visitor.AssignmentExpression = function (path, file) {
  29108. var node = path.node,
  29109. scope = path.scope;
  29110. if (!isAssignment(node)) return;
  29111. var nodes = [];
  29112. var exploded = (0, _babelHelperExplodeAssignableExpression2.default)(node.left, nodes, file, scope);
  29113. nodes.push(buildAssignment(exploded.ref, opts.build(exploded.uid, node.right)));
  29114. path.replaceWithMultiple(nodes);
  29115. };
  29116. visitor.BinaryExpression = function (path) {
  29117. var node = path.node;
  29118. if (node.operator === opts.operator) {
  29119. path.replaceWith(opts.build(node.left, node.right));
  29120. }
  29121. };
  29122. return visitor;
  29123. };
  29124. var _babelHelperExplodeAssignableExpression = __webpack_require__(318);
  29125. var _babelHelperExplodeAssignableExpression2 = _interopRequireDefault(_babelHelperExplodeAssignableExpression);
  29126. var _babelTypes = __webpack_require__(1);
  29127. var t = _interopRequireWildcard(_babelTypes);
  29128. function _interopRequireWildcard(obj) {
  29129. if (obj && obj.__esModule) {
  29130. return obj;
  29131. } else {
  29132. var newObj = {};if (obj != null) {
  29133. for (var key in obj) {
  29134. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  29135. }
  29136. }newObj.default = obj;return newObj;
  29137. }
  29138. }
  29139. function _interopRequireDefault(obj) {
  29140. return obj && obj.__esModule ? obj : { default: obj };
  29141. }
  29142. module.exports = exports["default"];
  29143. /***/ }),
  29144. /* 317 */
  29145. /***/ (function(module, exports, __webpack_require__) {
  29146. "use strict";
  29147. exports.__esModule = true;
  29148. exports.default = function (path) {
  29149. var scope = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : path.scope;
  29150. var node = path.node;
  29151. var container = t.functionExpression(null, [], node.body, node.generator, node.async);
  29152. var callee = container;
  29153. var args = [];
  29154. (0, _babelHelperHoistVariables2.default)(path, function (id) {
  29155. return scope.push({ id: id });
  29156. });
  29157. var state = {
  29158. foundThis: false,
  29159. foundArguments: false
  29160. };
  29161. path.traverse(visitor, state);
  29162. if (state.foundArguments) {
  29163. callee = t.memberExpression(container, t.identifier("apply"));
  29164. args = [];
  29165. if (state.foundThis) {
  29166. args.push(t.thisExpression());
  29167. }
  29168. if (state.foundArguments) {
  29169. if (!state.foundThis) args.push(t.nullLiteral());
  29170. args.push(t.identifier("arguments"));
  29171. }
  29172. }
  29173. var call = t.callExpression(callee, args);
  29174. if (node.generator) call = t.yieldExpression(call, true);
  29175. return t.returnStatement(call);
  29176. };
  29177. var _babelHelperHoistVariables = __webpack_require__(190);
  29178. var _babelHelperHoistVariables2 = _interopRequireDefault(_babelHelperHoistVariables);
  29179. var _babelTypes = __webpack_require__(1);
  29180. var t = _interopRequireWildcard(_babelTypes);
  29181. function _interopRequireWildcard(obj) {
  29182. if (obj && obj.__esModule) {
  29183. return obj;
  29184. } else {
  29185. var newObj = {};if (obj != null) {
  29186. for (var key in obj) {
  29187. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  29188. }
  29189. }newObj.default = obj;return newObj;
  29190. }
  29191. }
  29192. function _interopRequireDefault(obj) {
  29193. return obj && obj.__esModule ? obj : { default: obj };
  29194. }
  29195. var visitor = {
  29196. enter: function enter(path, state) {
  29197. if (path.isThisExpression()) {
  29198. state.foundThis = true;
  29199. }
  29200. if (path.isReferencedIdentifier({ name: "arguments" })) {
  29201. state.foundArguments = true;
  29202. }
  29203. },
  29204. Function: function Function(path) {
  29205. path.skip();
  29206. }
  29207. };
  29208. module.exports = exports["default"];
  29209. /***/ }),
  29210. /* 318 */
  29211. /***/ (function(module, exports, __webpack_require__) {
  29212. "use strict";
  29213. exports.__esModule = true;
  29214. exports.default = function (node, nodes, file, scope, allowedSingleIdent) {
  29215. var obj = void 0;
  29216. if (t.isIdentifier(node) && allowedSingleIdent) {
  29217. obj = node;
  29218. } else {
  29219. obj = getObjRef(node, nodes, file, scope);
  29220. }
  29221. var ref = void 0,
  29222. uid = void 0;
  29223. if (t.isIdentifier(node)) {
  29224. ref = node;
  29225. uid = obj;
  29226. } else {
  29227. var prop = getPropRef(node, nodes, file, scope);
  29228. var computed = node.computed || t.isLiteral(prop);
  29229. uid = ref = t.memberExpression(obj, prop, computed);
  29230. }
  29231. return {
  29232. uid: uid,
  29233. ref: ref
  29234. };
  29235. };
  29236. var _babelTypes = __webpack_require__(1);
  29237. var t = _interopRequireWildcard(_babelTypes);
  29238. function _interopRequireWildcard(obj) {
  29239. if (obj && obj.__esModule) {
  29240. return obj;
  29241. } else {
  29242. var newObj = {};if (obj != null) {
  29243. for (var key in obj) {
  29244. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  29245. }
  29246. }newObj.default = obj;return newObj;
  29247. }
  29248. }
  29249. function getObjRef(node, nodes, file, scope) {
  29250. var ref = void 0;
  29251. if (t.isSuper(node)) {
  29252. return node;
  29253. } else if (t.isIdentifier(node)) {
  29254. if (scope.hasBinding(node.name)) {
  29255. return node;
  29256. } else {
  29257. ref = node;
  29258. }
  29259. } else if (t.isMemberExpression(node)) {
  29260. ref = node.object;
  29261. if (t.isSuper(ref) || t.isIdentifier(ref) && scope.hasBinding(ref.name)) {
  29262. return ref;
  29263. }
  29264. } else {
  29265. throw new Error("We can't explode this node type " + node.type);
  29266. }
  29267. var temp = scope.generateUidIdentifierBasedOnNode(ref);
  29268. nodes.push(t.variableDeclaration("var", [t.variableDeclarator(temp, ref)]));
  29269. return temp;
  29270. }
  29271. function getPropRef(node, nodes, file, scope) {
  29272. var prop = node.property;
  29273. var key = t.toComputedKey(node, prop);
  29274. if (t.isLiteral(key) && t.isPureish(key)) return key;
  29275. var temp = scope.generateUidIdentifierBasedOnNode(prop);
  29276. nodes.push(t.variableDeclaration("var", [t.variableDeclarator(temp, prop)]));
  29277. return temp;
  29278. }
  29279. module.exports = exports["default"];
  29280. /***/ }),
  29281. /* 319 */
  29282. /***/ (function(module, exports, __webpack_require__) {
  29283. "use strict";
  29284. exports.__esModule = true;
  29285. var _getIterator2 = __webpack_require__(2);
  29286. var _getIterator3 = _interopRequireDefault(_getIterator2);
  29287. exports.default = function (classPath) {
  29288. classPath.assertClass();
  29289. var memoisedExpressions = [];
  29290. function maybeMemoise(path) {
  29291. if (!path.node || path.isPure()) return;
  29292. var uid = classPath.scope.generateDeclaredUidIdentifier();
  29293. memoisedExpressions.push(t.assignmentExpression("=", uid, path.node));
  29294. path.replaceWith(uid);
  29295. }
  29296. function memoiseDecorators(paths) {
  29297. if (!Array.isArray(paths) || !paths.length) return;
  29298. paths = paths.reverse();
  29299. (0, _babelHelperBindifyDecorators2.default)(paths);
  29300. for (var _iterator = paths, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
  29301. var _ref;
  29302. if (_isArray) {
  29303. if (_i >= _iterator.length) break;
  29304. _ref = _iterator[_i++];
  29305. } else {
  29306. _i = _iterator.next();
  29307. if (_i.done) break;
  29308. _ref = _i.value;
  29309. }
  29310. var path = _ref;
  29311. maybeMemoise(path);
  29312. }
  29313. }
  29314. maybeMemoise(classPath.get("superClass"));
  29315. memoiseDecorators(classPath.get("decorators"), true);
  29316. var methods = classPath.get("body.body");
  29317. for (var _iterator2 = methods, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) {
  29318. var _ref2;
  29319. if (_isArray2) {
  29320. if (_i2 >= _iterator2.length) break;
  29321. _ref2 = _iterator2[_i2++];
  29322. } else {
  29323. _i2 = _iterator2.next();
  29324. if (_i2.done) break;
  29325. _ref2 = _i2.value;
  29326. }
  29327. var methodPath = _ref2;
  29328. if (methodPath.is("computed")) {
  29329. maybeMemoise(methodPath.get("key"));
  29330. }
  29331. if (methodPath.has("decorators")) {
  29332. memoiseDecorators(classPath.get("decorators"));
  29333. }
  29334. }
  29335. if (memoisedExpressions) {
  29336. classPath.insertBefore(memoisedExpressions.map(function (expr) {
  29337. return t.expressionStatement(expr);
  29338. }));
  29339. }
  29340. };
  29341. var _babelHelperBindifyDecorators = __webpack_require__(315);
  29342. var _babelHelperBindifyDecorators2 = _interopRequireDefault(_babelHelperBindifyDecorators);
  29343. var _babelTypes = __webpack_require__(1);
  29344. var t = _interopRequireWildcard(_babelTypes);
  29345. function _interopRequireWildcard(obj) {
  29346. if (obj && obj.__esModule) {
  29347. return obj;
  29348. } else {
  29349. var newObj = {};if (obj != null) {
  29350. for (var key in obj) {
  29351. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  29352. }
  29353. }newObj.default = obj;return newObj;
  29354. }
  29355. }
  29356. function _interopRequireDefault(obj) {
  29357. return obj && obj.__esModule ? obj : { default: obj };
  29358. }
  29359. module.exports = exports["default"];
  29360. /***/ }),
  29361. /* 320 */
  29362. /***/ (function(module, exports, __webpack_require__) {
  29363. "use strict";
  29364. exports.__esModule = true;
  29365. exports.default = function (path, helpers) {
  29366. var node = path.node,
  29367. scope = path.scope,
  29368. parent = path.parent;
  29369. var stepKey = scope.generateUidIdentifier("step");
  29370. var stepValue = scope.generateUidIdentifier("value");
  29371. var left = node.left;
  29372. var declar = void 0;
  29373. if (t.isIdentifier(left) || t.isPattern(left) || t.isMemberExpression(left)) {
  29374. declar = t.expressionStatement(t.assignmentExpression("=", left, stepValue));
  29375. } else if (t.isVariableDeclaration(left)) {
  29376. declar = t.variableDeclaration(left.kind, [t.variableDeclarator(left.declarations[0].id, stepValue)]);
  29377. }
  29378. var template = buildForAwait();
  29379. (0, _babelTraverse2.default)(template, forAwaitVisitor, null, {
  29380. ITERATOR_HAD_ERROR_KEY: scope.generateUidIdentifier("didIteratorError"),
  29381. ITERATOR_COMPLETION: scope.generateUidIdentifier("iteratorNormalCompletion"),
  29382. ITERATOR_ERROR_KEY: scope.generateUidIdentifier("iteratorError"),
  29383. ITERATOR_KEY: scope.generateUidIdentifier("iterator"),
  29384. GET_ITERATOR: helpers.getAsyncIterator,
  29385. OBJECT: node.right,
  29386. STEP_VALUE: stepValue,
  29387. STEP_KEY: stepKey,
  29388. AWAIT: helpers.wrapAwait
  29389. });
  29390. template = template.body.body;
  29391. var isLabeledParent = t.isLabeledStatement(parent);
  29392. var tryBody = template[3].block.body;
  29393. var loop = tryBody[0];
  29394. if (isLabeledParent) {
  29395. tryBody[0] = t.labeledStatement(parent.label, loop);
  29396. }
  29397. return {
  29398. replaceParent: isLabeledParent,
  29399. node: template,
  29400. declar: declar,
  29401. loop: loop
  29402. };
  29403. };
  29404. var _babelTypes = __webpack_require__(1);
  29405. var t = _interopRequireWildcard(_babelTypes);
  29406. var _babelTemplate = __webpack_require__(4);
  29407. var _babelTemplate2 = _interopRequireDefault(_babelTemplate);
  29408. var _babelTraverse = __webpack_require__(7);
  29409. var _babelTraverse2 = _interopRequireDefault(_babelTraverse);
  29410. function _interopRequireDefault(obj) {
  29411. return obj && obj.__esModule ? obj : { default: obj };
  29412. }
  29413. function _interopRequireWildcard(obj) {
  29414. if (obj && obj.__esModule) {
  29415. return obj;
  29416. } else {
  29417. var newObj = {};if (obj != null) {
  29418. for (var key in obj) {
  29419. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  29420. }
  29421. }newObj.default = obj;return newObj;
  29422. }
  29423. }
  29424. var buildForAwait = (0, _babelTemplate2.default)("\n function* wrapper() {\n var ITERATOR_COMPLETION = true;\n var ITERATOR_HAD_ERROR_KEY = false;\n var ITERATOR_ERROR_KEY = undefined;\n try {\n for (\n var ITERATOR_KEY = GET_ITERATOR(OBJECT), STEP_KEY, STEP_VALUE;\n (\n STEP_KEY = yield AWAIT(ITERATOR_KEY.next()),\n ITERATOR_COMPLETION = STEP_KEY.done,\n STEP_VALUE = yield AWAIT(STEP_KEY.value),\n !ITERATOR_COMPLETION\n );\n ITERATOR_COMPLETION = true) {\n }\n } catch (err) {\n ITERATOR_HAD_ERROR_KEY = true;\n ITERATOR_ERROR_KEY = err;\n } finally {\n try {\n if (!ITERATOR_COMPLETION && ITERATOR_KEY.return) {\n yield AWAIT(ITERATOR_KEY.return());\n }\n } finally {\n if (ITERATOR_HAD_ERROR_KEY) {\n throw ITERATOR_ERROR_KEY;\n }\n }\n }\n }\n");
  29425. var forAwaitVisitor = {
  29426. noScope: true,
  29427. Identifier: function Identifier(path, replacements) {
  29428. if (path.node.name in replacements) {
  29429. path.replaceInline(replacements[path.node.name]);
  29430. }
  29431. },
  29432. CallExpression: function CallExpression(path, replacements) {
  29433. var callee = path.node.callee;
  29434. if (t.isIdentifier(callee) && callee.name === "AWAIT" && !replacements.AWAIT) {
  29435. path.replaceWith(path.node.arguments[0]);
  29436. }
  29437. }
  29438. };
  29439. module.exports = exports["default"];
  29440. /***/ }),
  29441. /* 321 */
  29442. /***/ (function(module, exports, __webpack_require__) {
  29443. "use strict";
  29444. exports.__esModule = true;
  29445. var _babelTemplate = __webpack_require__(4);
  29446. var _babelTemplate2 = _interopRequireDefault(_babelTemplate);
  29447. function _interopRequireDefault(obj) {
  29448. return obj && obj.__esModule ? obj : { default: obj };
  29449. }
  29450. var helpers = {};
  29451. exports.default = helpers;
  29452. helpers.typeof = (0, _babelTemplate2.default)("\n (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\")\n ? function (obj) { return typeof obj; }\n : function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype\n ? \"symbol\"\n : typeof obj;\n };\n");
  29453. helpers.jsx = (0, _babelTemplate2.default)("\n (function () {\n var REACT_ELEMENT_TYPE = (typeof Symbol === \"function\" && Symbol.for && Symbol.for(\"react.element\")) || 0xeac7;\n\n return function createRawReactElement (type, props, key, children) {\n var defaultProps = type && type.defaultProps;\n var childrenLength = arguments.length - 3;\n\n if (!props && childrenLength !== 0) {\n // If we're going to assign props.children, we create a new object now\n // to avoid mutating defaultProps.\n props = {};\n }\n if (props && defaultProps) {\n for (var propName in defaultProps) {\n if (props[propName] === void 0) {\n props[propName] = defaultProps[propName];\n }\n }\n } else if (!props) {\n props = defaultProps || {};\n }\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 3];\n }\n props.children = childArray;\n }\n\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key === undefined ? null : '' + key,\n ref: null,\n props: props,\n _owner: null,\n };\n };\n\n })()\n");
  29454. helpers.asyncIterator = (0, _babelTemplate2.default)("\n (function (iterable) {\n if (typeof Symbol === \"function\") {\n if (Symbol.asyncIterator) {\n var method = iterable[Symbol.asyncIterator];\n if (method != null) return method.call(iterable);\n }\n if (Symbol.iterator) {\n return iterable[Symbol.iterator]();\n }\n }\n throw new TypeError(\"Object is not async iterable\");\n })\n");
  29455. helpers.asyncGenerator = (0, _babelTemplate2.default)("\n (function () {\n function AwaitValue(value) {\n this.value = value;\n }\n\n function AsyncGenerator(gen) {\n var front, back;\n\n function send(key, arg) {\n return new Promise(function (resolve, reject) {\n var request = {\n key: key,\n arg: arg,\n resolve: resolve,\n reject: reject,\n next: null\n };\n\n if (back) {\n back = back.next = request;\n } else {\n front = back = request;\n resume(key, arg);\n }\n });\n }\n\n function resume(key, arg) {\n try {\n var result = gen[key](arg)\n var value = result.value;\n if (value instanceof AwaitValue) {\n Promise.resolve(value.value).then(\n function (arg) { resume(\"next\", arg); },\n function (arg) { resume(\"throw\", arg); });\n } else {\n settle(result.done ? \"return\" : \"normal\", result.value);\n }\n } catch (err) {\n settle(\"throw\", err);\n }\n }\n\n function settle(type, value) {\n switch (type) {\n case \"return\":\n front.resolve({ value: value, done: true });\n break;\n case \"throw\":\n front.reject(value);\n break;\n default:\n front.resolve({ value: value, done: false });\n break;\n }\n\n front = front.next;\n if (front) {\n resume(front.key, front.arg);\n } else {\n back = null;\n }\n }\n\n this._invoke = send;\n\n // Hide \"return\" method if generator return is not supported\n if (typeof gen.return !== \"function\") {\n this.return = undefined;\n }\n }\n\n if (typeof Symbol === \"function\" && Symbol.asyncIterator) {\n AsyncGenerator.prototype[Symbol.asyncIterator] = function () { return this; };\n }\n\n AsyncGenerator.prototype.next = function (arg) { return this._invoke(\"next\", arg); };\n AsyncGenerator.prototype.throw = function (arg) { return this._invoke(\"throw\", arg); };\n AsyncGenerator.prototype.return = function (arg) { return this._invoke(\"return\", arg); };\n\n return {\n wrap: function (fn) {\n return function () {\n return new AsyncGenerator(fn.apply(this, arguments));\n };\n },\n await: function (value) {\n return new AwaitValue(value);\n }\n };\n\n })()\n");
  29456. helpers.asyncGeneratorDelegate = (0, _babelTemplate2.default)("\n (function (inner, awaitWrap) {\n var iter = {}, waiting = false;\n\n function pump(key, value) {\n waiting = true;\n value = new Promise(function (resolve) { resolve(inner[key](value)); });\n return { done: false, value: awaitWrap(value) };\n };\n\n if (typeof Symbol === \"function\" && Symbol.iterator) {\n iter[Symbol.iterator] = function () { return this; };\n }\n\n iter.next = function (value) {\n if (waiting) {\n waiting = false;\n return value;\n }\n return pump(\"next\", value);\n };\n\n if (typeof inner.throw === \"function\") {\n iter.throw = function (value) {\n if (waiting) {\n waiting = false;\n throw value;\n }\n return pump(\"throw\", value);\n };\n }\n\n if (typeof inner.return === \"function\") {\n iter.return = function (value) {\n return pump(\"return\", value);\n };\n }\n\n return iter;\n })\n");
  29457. helpers.asyncToGenerator = (0, _babelTemplate2.default)("\n (function (fn) {\n return function () {\n var gen = fn.apply(this, arguments);\n return new Promise(function (resolve, reject) {\n function step(key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n\n if (info.done) {\n resolve(value);\n } else {\n return Promise.resolve(value).then(function (value) {\n step(\"next\", value);\n }, function (err) {\n step(\"throw\", err);\n });\n }\n }\n\n return step(\"next\");\n });\n };\n })\n");
  29458. helpers.classCallCheck = (0, _babelTemplate2.default)("\n (function (instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n });\n");
  29459. helpers.createClass = (0, _babelTemplate2.default)("\n (function() {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i ++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n })()\n");
  29460. helpers.defineEnumerableProperties = (0, _babelTemplate2.default)("\n (function (obj, descs) {\n for (var key in descs) {\n var desc = descs[key];\n desc.configurable = desc.enumerable = true;\n if (\"value\" in desc) desc.writable = true;\n Object.defineProperty(obj, key, desc);\n }\n return obj;\n })\n");
  29461. helpers.defaults = (0, _babelTemplate2.default)("\n (function (obj, defaults) {\n var keys = Object.getOwnPropertyNames(defaults);\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n var value = Object.getOwnPropertyDescriptor(defaults, key);\n if (value && value.configurable && obj[key] === undefined) {\n Object.defineProperty(obj, key, value);\n }\n }\n return obj;\n })\n");
  29462. helpers.defineProperty = (0, _babelTemplate2.default)("\n (function (obj, key, value) {\n // Shortcircuit the slow defineProperty path when possible.\n // We are trying to avoid issues where setters defined on the\n // prototype cause side effects under the fast path of simple\n // assignment. By checking for existence of the property with\n // the in operator, we can optimize most of this overhead away.\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n });\n");
  29463. helpers.extends = (0, _babelTemplate2.default)("\n Object.assign || (function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n })\n");
  29464. helpers.get = (0, _babelTemplate2.default)("\n (function get(object, property, receiver) {\n if (object === null) object = Function.prototype;\n\n var desc = Object.getOwnPropertyDescriptor(object, property);\n\n if (desc === undefined) {\n var parent = Object.getPrototypeOf(object);\n\n if (parent === null) {\n return undefined;\n } else {\n return get(parent, property, receiver);\n }\n } else if (\"value\" in desc) {\n return desc.value;\n } else {\n var getter = desc.get;\n\n if (getter === undefined) {\n return undefined;\n }\n\n return getter.call(receiver);\n }\n });\n");
  29465. helpers.inherits = (0, _babelTemplate2.default)("\n (function (subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass);\n }\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n })\n");
  29466. helpers.instanceof = (0, _babelTemplate2.default)("\n (function (left, right) {\n if (right != null && typeof Symbol !== \"undefined\" && right[Symbol.hasInstance]) {\n return right[Symbol.hasInstance](left);\n } else {\n return left instanceof right;\n }\n });\n");
  29467. helpers.interopRequireDefault = (0, _babelTemplate2.default)("\n (function (obj) {\n return obj && obj.__esModule ? obj : { default: obj };\n })\n");
  29468. helpers.interopRequireWildcard = (0, _babelTemplate2.default)("\n (function (obj) {\n if (obj && obj.__esModule) {\n return obj;\n } else {\n var newObj = {};\n if (obj != null) {\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];\n }\n }\n newObj.default = obj;\n return newObj;\n }\n })\n");
  29469. helpers.newArrowCheck = (0, _babelTemplate2.default)("\n (function (innerThis, boundThis) {\n if (innerThis !== boundThis) {\n throw new TypeError(\"Cannot instantiate an arrow function\");\n }\n });\n");
  29470. helpers.objectDestructuringEmpty = (0, _babelTemplate2.default)("\n (function (obj) {\n if (obj == null) throw new TypeError(\"Cannot destructure undefined\");\n });\n");
  29471. helpers.objectWithoutProperties = (0, _babelTemplate2.default)("\n (function (obj, keys) {\n var target = {};\n for (var i in obj) {\n if (keys.indexOf(i) >= 0) continue;\n if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;\n target[i] = obj[i];\n }\n return target;\n })\n");
  29472. helpers.possibleConstructorReturn = (0, _babelTemplate2.default)("\n (function (self, call) {\n if (!self) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self;\n });\n");
  29473. helpers.selfGlobal = (0, _babelTemplate2.default)("\n typeof global === \"undefined\" ? self : global\n");
  29474. helpers.set = (0, _babelTemplate2.default)("\n (function set(object, property, value, receiver) {\n var desc = Object.getOwnPropertyDescriptor(object, property);\n\n if (desc === undefined) {\n var parent = Object.getPrototypeOf(object);\n\n if (parent !== null) {\n set(parent, property, value, receiver);\n }\n } else if (\"value\" in desc && desc.writable) {\n desc.value = value;\n } else {\n var setter = desc.set;\n\n if (setter !== undefined) {\n setter.call(receiver, value);\n }\n }\n\n return value;\n });\n");
  29475. helpers.slicedToArray = (0, _babelTemplate2.default)("\n (function () {\n // Broken out into a separate function to avoid deoptimizations due to the try/catch for the\n // array iterator case.\n function sliceIterator(arr, i) {\n // this is an expanded form of `for...of` that properly supports abrupt completions of\n // iterators etc. variable names have been minimised to reduce the size of this massive\n // helper. sometimes spec compliancy is annoying :(\n //\n // _n = _iteratorNormalCompletion\n // _d = _didIteratorError\n // _e = _iteratorError\n // _i = _iterator\n // _s = _step\n\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n try {\n for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"]) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n return _arr;\n }\n\n return function (arr, i) {\n if (Array.isArray(arr)) {\n return arr;\n } else if (Symbol.iterator in Object(arr)) {\n return sliceIterator(arr, i);\n } else {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance\");\n }\n };\n })();\n");
  29476. helpers.slicedToArrayLoose = (0, _babelTemplate2.default)("\n (function (arr, i) {\n if (Array.isArray(arr)) {\n return arr;\n } else if (Symbol.iterator in Object(arr)) {\n var _arr = [];\n for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) {\n _arr.push(_step.value);\n if (i && _arr.length === i) break;\n }\n return _arr;\n } else {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance\");\n }\n });\n");
  29477. helpers.taggedTemplateLiteral = (0, _babelTemplate2.default)("\n (function (strings, raw) {\n return Object.freeze(Object.defineProperties(strings, {\n raw: { value: Object.freeze(raw) }\n }));\n });\n");
  29478. helpers.taggedTemplateLiteralLoose = (0, _babelTemplate2.default)("\n (function (strings, raw) {\n strings.raw = raw;\n return strings;\n });\n");
  29479. helpers.temporalRef = (0, _babelTemplate2.default)("\n (function (val, name, undef) {\n if (val === undef) {\n throw new ReferenceError(name + \" is not defined - temporal dead zone\");\n } else {\n return val;\n }\n })\n");
  29480. helpers.temporalUndefined = (0, _babelTemplate2.default)("\n ({})\n");
  29481. helpers.toArray = (0, _babelTemplate2.default)("\n (function (arr) {\n return Array.isArray(arr) ? arr : Array.from(arr);\n });\n");
  29482. helpers.toConsumableArray = (0, _babelTemplate2.default)("\n (function (arr) {\n if (Array.isArray(arr)) {\n for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];\n return arr2;\n } else {\n return Array.from(arr);\n }\n });\n");
  29483. module.exports = exports["default"];
  29484. /***/ }),
  29485. /* 322 */
  29486. /***/ (function(module, exports) {
  29487. "use strict";
  29488. exports.__esModule = true;
  29489. exports.default = function (_ref) {
  29490. var t = _ref.types;
  29491. return {
  29492. pre: function pre(file) {
  29493. file.set("helpersNamespace", t.identifier("babelHelpers"));
  29494. }
  29495. };
  29496. };
  29497. module.exports = exports["default"];
  29498. /***/ }),
  29499. /* 323 */
  29500. /***/ (function(module, exports, __webpack_require__) {
  29501. /**
  29502. * Created at 16/5/18.
  29503. * @Author Ling.
  29504. * @Email i@zeroling.com
  29505. */
  29506. 'use strict';
  29507. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  29508. var babylon = __webpack_require__(89);
  29509. module.exports = function (babel) {
  29510. var t = babel.types;
  29511. // cache for performance
  29512. var parseMap = {};
  29513. return {
  29514. visitor: {
  29515. Identifier: function Identifier(path, state) {
  29516. if (path.parent.type === 'MemberExpression') {
  29517. return;
  29518. }
  29519. if (path.parent.type === 'ClassMethod') {
  29520. return;
  29521. }
  29522. if (path.isPure()) {
  29523. return;
  29524. }
  29525. if (!state.opts.hasOwnProperty(path.node.name)) {
  29526. return;
  29527. }
  29528. var replacementDescriptor = state.opts[path.node.name];
  29529. if (replacementDescriptor === undefined || replacementDescriptor === null) {
  29530. replacementDescriptor = t.identifier(String(replacementDescriptor));
  29531. }
  29532. var type = typeof replacementDescriptor === 'undefined' ? 'undefined' : _typeof(replacementDescriptor);
  29533. if (type === 'string' || type === 'boolean') {
  29534. replacementDescriptor = {
  29535. type: type,
  29536. replacement: replacementDescriptor
  29537. };
  29538. } else if (t.isNode(replacementDescriptor)) {
  29539. replacementDescriptor = {
  29540. type: 'node',
  29541. replacement: replacementDescriptor
  29542. };
  29543. } else if (type === 'object' && replacementDescriptor.type === 'node' && typeof replacementDescriptor.replacement === 'string') {
  29544. replacementDescriptor.replacement = parseMap[replacementDescriptor.replacement] ? parseMap[replacementDescriptor.replacement] : babylon.parseExpression(replacementDescriptor.replacement);
  29545. }
  29546. var replacement = replacementDescriptor.replacement;
  29547. switch (replacementDescriptor.type) {
  29548. case 'boolean':
  29549. path.replaceWith(t.booleanLiteral(replacement));
  29550. break;
  29551. case 'node':
  29552. if (t.isNode(replacement)) {
  29553. path.replaceWith(replacement);
  29554. }
  29555. break;
  29556. default:
  29557. // treat as string
  29558. var str = String(replacement);
  29559. path.replaceWith(t.stringLiteral(str));
  29560. break;
  29561. }
  29562. }
  29563. }
  29564. };
  29565. };
  29566. /***/ }),
  29567. /* 324 */
  29568. /***/ (function(module, exports) {
  29569. "use strict";
  29570. exports.__esModule = true;
  29571. exports.default = function () {
  29572. return {
  29573. manipulateOptions: function manipulateOptions(opts, parserOpts) {
  29574. parserOpts.plugins.push("dynamicImport");
  29575. }
  29576. };
  29577. };
  29578. module.exports = exports["default"];
  29579. /***/ }),
  29580. /* 325 */
  29581. /***/ (function(module, exports) {
  29582. "use strict";
  29583. exports.__esModule = true;
  29584. exports.default = function () {
  29585. return {
  29586. manipulateOptions: function manipulateOptions(opts, parserOpts) {
  29587. parserOpts.plugins.push("functionSent");
  29588. }
  29589. };
  29590. };
  29591. module.exports = exports["default"];
  29592. /***/ }),
  29593. /* 326 */
  29594. /***/ (function(module, exports, __webpack_require__) {
  29595. "use strict";
  29596. exports.__esModule = true;
  29597. exports.default = function () {
  29598. return {
  29599. inherits: __webpack_require__(67)
  29600. };
  29601. };
  29602. module.exports = exports["default"];
  29603. /***/ }),
  29604. /* 327 */
  29605. /***/ (function(module, exports, __webpack_require__) {
  29606. "use strict";
  29607. exports.__esModule = true;
  29608. exports.default = function (_ref) {
  29609. var t = _ref.types;
  29610. var yieldStarVisitor = {
  29611. Function: function Function(path) {
  29612. path.skip();
  29613. },
  29614. YieldExpression: function YieldExpression(_ref2, state) {
  29615. var node = _ref2.node;
  29616. if (!node.delegate) return;
  29617. var callee = state.addHelper("asyncGeneratorDelegate");
  29618. node.argument = t.callExpression(callee, [t.callExpression(state.addHelper("asyncIterator"), [node.argument]), t.memberExpression(state.addHelper("asyncGenerator"), t.identifier("await"))]);
  29619. }
  29620. };
  29621. return {
  29622. inherits: __webpack_require__(195),
  29623. visitor: {
  29624. Function: function Function(path, state) {
  29625. if (!path.node.async || !path.node.generator) return;
  29626. path.traverse(yieldStarVisitor, state);
  29627. (0, _babelHelperRemapAsyncToGenerator2.default)(path, state.file, {
  29628. wrapAsync: t.memberExpression(state.addHelper("asyncGenerator"), t.identifier("wrap")),
  29629. wrapAwait: t.memberExpression(state.addHelper("asyncGenerator"), t.identifier("await"))
  29630. });
  29631. }
  29632. }
  29633. };
  29634. };
  29635. var _babelHelperRemapAsyncToGenerator = __webpack_require__(124);
  29636. var _babelHelperRemapAsyncToGenerator2 = _interopRequireDefault(_babelHelperRemapAsyncToGenerator);
  29637. function _interopRequireDefault(obj) {
  29638. return obj && obj.__esModule ? obj : { default: obj };
  29639. }
  29640. module.exports = exports["default"];
  29641. /***/ }),
  29642. /* 328 */
  29643. /***/ (function(module, exports, __webpack_require__) {
  29644. "use strict";
  29645. exports.__esModule = true;
  29646. exports.default = function () {
  29647. return {
  29648. inherits: __webpack_require__(67),
  29649. visitor: {
  29650. Function: function Function(path, state) {
  29651. if (!path.node.async || path.node.generator) return;
  29652. (0, _babelHelperRemapAsyncToGenerator2.default)(path, state.file, {
  29653. wrapAsync: state.addImport(state.opts.module, state.opts.method)
  29654. });
  29655. }
  29656. }
  29657. };
  29658. };
  29659. var _babelHelperRemapAsyncToGenerator = __webpack_require__(124);
  29660. var _babelHelperRemapAsyncToGenerator2 = _interopRequireDefault(_babelHelperRemapAsyncToGenerator);
  29661. function _interopRequireDefault(obj) {
  29662. return obj && obj.__esModule ? obj : { default: obj };
  29663. }
  29664. module.exports = exports["default"];
  29665. /***/ }),
  29666. /* 329 */
  29667. /***/ (function(module, exports, __webpack_require__) {
  29668. 'use strict';
  29669. Object.defineProperty(exports, "__esModule", {
  29670. value: true
  29671. });
  29672. exports.default = function (_ref) {
  29673. var t = _ref.types;
  29674. /**
  29675. * Add a helper to take an initial descriptor, apply some decorators to it, and optionally
  29676. * define the property.
  29677. */
  29678. function ensureApplyDecoratedDescriptorHelper(path, state) {
  29679. if (!state.applyDecoratedDescriptor) {
  29680. state.applyDecoratedDescriptor = path.scope.generateUidIdentifier('applyDecoratedDescriptor');
  29681. var helper = buildApplyDecoratedDescriptor({
  29682. NAME: state.applyDecoratedDescriptor
  29683. });
  29684. path.scope.getProgramParent().path.unshiftContainer('body', helper);
  29685. }
  29686. return state.applyDecoratedDescriptor;
  29687. }
  29688. /**
  29689. * Add a helper to call as a replacement for class property definition.
  29690. */
  29691. function ensureInitializerDefineProp(path, state) {
  29692. if (!state.initializerDefineProp) {
  29693. state.initializerDefineProp = path.scope.generateUidIdentifier('initDefineProp');
  29694. var helper = buildInitializerDefineProperty({
  29695. NAME: state.initializerDefineProp
  29696. });
  29697. path.scope.getProgramParent().path.unshiftContainer('body', helper);
  29698. }
  29699. return state.initializerDefineProp;
  29700. }
  29701. /**
  29702. * Add a helper that will throw a useful error if the transform fails to detect the class
  29703. * property assignment, so users know something failed.
  29704. */
  29705. function ensureInitializerWarning(path, state) {
  29706. if (!state.initializerWarningHelper) {
  29707. state.initializerWarningHelper = path.scope.generateUidIdentifier('initializerWarningHelper');
  29708. var helper = buildInitializerWarningHelper({
  29709. NAME: state.initializerWarningHelper
  29710. });
  29711. path.scope.getProgramParent().path.unshiftContainer('body', helper);
  29712. }
  29713. return state.initializerWarningHelper;
  29714. }
  29715. /**
  29716. * If the decorator expressions are non-identifiers, hoist them to before the class so we can be sure
  29717. * that they are evaluated in order.
  29718. */
  29719. function applyEnsureOrdering(path) {
  29720. // TODO: This should probably also hoist computed properties.
  29721. var decorators = (path.isClass() ? [path].concat(path.get('body.body')) : path.get('properties')).reduce(function (acc, prop) {
  29722. return acc.concat(prop.node.decorators || []);
  29723. }, []);
  29724. var identDecorators = decorators.filter(function (decorator) {
  29725. return !t.isIdentifier(decorator.expression);
  29726. });
  29727. if (identDecorators.length === 0) return;
  29728. return t.sequenceExpression(identDecorators.map(function (decorator) {
  29729. var expression = decorator.expression;
  29730. var id = decorator.expression = path.scope.generateDeclaredUidIdentifier('dec');
  29731. return t.assignmentExpression('=', id, expression);
  29732. }).concat([path.node]));
  29733. }
  29734. /**
  29735. * Given a class expression with class-level decorators, create a new expression
  29736. * with the proper decorated behavior.
  29737. */
  29738. function applyClassDecorators(classPath, state) {
  29739. var decorators = classPath.node.decorators || [];
  29740. classPath.node.decorators = null;
  29741. if (decorators.length === 0) return;
  29742. var name = classPath.scope.generateDeclaredUidIdentifier('class');
  29743. return decorators.map(function (dec) {
  29744. return dec.expression;
  29745. }).reverse().reduce(function (acc, decorator) {
  29746. return buildClassDecorator({
  29747. CLASS_REF: name,
  29748. DECORATOR: decorator,
  29749. INNER: acc
  29750. }).expression;
  29751. }, classPath.node);
  29752. }
  29753. /**
  29754. * Given a class expression with method-level decorators, create a new expression
  29755. * with the proper decorated behavior.
  29756. */
  29757. function applyMethodDecorators(path, state) {
  29758. var hasMethodDecorators = path.node.body.body.some(function (node) {
  29759. return (node.decorators || []).length > 0;
  29760. });
  29761. if (!hasMethodDecorators) return;
  29762. return applyTargetDecorators(path, state, path.node.body.body);
  29763. }
  29764. /**
  29765. * Given an object expression with property decorators, create a new expression
  29766. * with the proper decorated behavior.
  29767. */
  29768. function applyObjectDecorators(path, state) {
  29769. var hasMethodDecorators = path.node.properties.some(function (node) {
  29770. return (node.decorators || []).length > 0;
  29771. });
  29772. if (!hasMethodDecorators) return;
  29773. return applyTargetDecorators(path, state, path.node.properties);
  29774. }
  29775. /**
  29776. * A helper to pull out property decorators into a sequence expression.
  29777. */
  29778. function applyTargetDecorators(path, state, decoratedProps) {
  29779. var descName = path.scope.generateDeclaredUidIdentifier('desc');
  29780. var valueTemp = path.scope.generateDeclaredUidIdentifier('value');
  29781. var name = path.scope.generateDeclaredUidIdentifier(path.isClass() ? 'class' : 'obj');
  29782. var exprs = decoratedProps.reduce(function (acc, node) {
  29783. var decorators = node.decorators || [];
  29784. node.decorators = null;
  29785. if (decorators.length === 0) return acc;
  29786. if (node.computed) {
  29787. throw path.buildCodeFrameError('Computed method/property decorators are not yet supported.');
  29788. }
  29789. var property = t.isLiteral(node.key) ? node.key : t.stringLiteral(node.key.name);
  29790. var target = path.isClass() && !node.static ? buildClassPrototype({
  29791. CLASS_REF: name
  29792. }).expression : name;
  29793. if (t.isClassProperty(node, { static: false })) {
  29794. var descriptor = path.scope.generateDeclaredUidIdentifier('descriptor');
  29795. var initializer = node.value ? t.functionExpression(null, [], t.blockStatement([t.returnStatement(node.value)])) : t.nullLiteral();
  29796. node.value = t.callExpression(ensureInitializerWarning(path, state), [descriptor, t.thisExpression()]);
  29797. acc = acc.concat([t.assignmentExpression('=', descriptor, t.callExpression(ensureApplyDecoratedDescriptorHelper(path, state), [target, property, t.arrayExpression(decorators.map(function (dec) {
  29798. return dec.expression;
  29799. })), t.objectExpression([t.objectProperty(t.identifier('enumerable'), t.booleanLiteral(true)), t.objectProperty(t.identifier('initializer'), initializer)])]))]);
  29800. } else {
  29801. acc = acc.concat(t.callExpression(ensureApplyDecoratedDescriptorHelper(path, state), [target, property, t.arrayExpression(decorators.map(function (dec) {
  29802. return dec.expression;
  29803. })), t.isObjectProperty(node) || t.isClassProperty(node, { static: true }) ? buildGetObjectInitializer({
  29804. TEMP: path.scope.generateDeclaredUidIdentifier('init'),
  29805. TARGET: target,
  29806. PROPERTY: property
  29807. }).expression : buildGetDescriptor({
  29808. TARGET: target,
  29809. PROPERTY: property
  29810. }).expression, target]));
  29811. }
  29812. return acc;
  29813. }, []);
  29814. return t.sequenceExpression([t.assignmentExpression('=', name, path.node), t.sequenceExpression(exprs), name]);
  29815. }
  29816. return {
  29817. inherits: __webpack_require__(125),
  29818. visitor: {
  29819. ExportDefaultDeclaration: function ExportDefaultDeclaration(path) {
  29820. if (!path.get("declaration").isClassDeclaration()) return;
  29821. var node = path.node;
  29822. var ref = node.declaration.id || path.scope.generateUidIdentifier("default");
  29823. node.declaration.id = ref;
  29824. // Split the class declaration and the export into two separate statements.
  29825. path.replaceWith(node.declaration);
  29826. path.insertAfter(t.exportNamedDeclaration(null, [t.exportSpecifier(ref, t.identifier('default'))]));
  29827. },
  29828. ClassDeclaration: function ClassDeclaration(path) {
  29829. var node = path.node;
  29830. var ref = node.id || path.scope.generateUidIdentifier("class");
  29831. path.replaceWith(t.variableDeclaration("let", [t.variableDeclarator(ref, t.toExpression(node))]));
  29832. },
  29833. ClassExpression: function ClassExpression(path, state) {
  29834. // Create a replacement for the class node if there is one. We do one pass to replace classes with
  29835. // class decorators, and a second pass to process method decorators.
  29836. var decoratedClass = applyEnsureOrdering(path) || applyClassDecorators(path, state) || applyMethodDecorators(path, state);
  29837. if (decoratedClass) path.replaceWith(decoratedClass);
  29838. },
  29839. ObjectExpression: function ObjectExpression(path, state) {
  29840. var decoratedObject = applyEnsureOrdering(path) || applyObjectDecorators(path, state);
  29841. if (decoratedObject) path.replaceWith(decoratedObject);
  29842. },
  29843. AssignmentExpression: function AssignmentExpression(path, state) {
  29844. if (!state.initializerWarningHelper) return;
  29845. if (!path.get('left').isMemberExpression()) return;
  29846. if (!path.get('left.property').isIdentifier()) return;
  29847. if (!path.get('right').isCallExpression()) return;
  29848. if (!path.get('right.callee').isIdentifier({ name: state.initializerWarningHelper.name })) return;
  29849. path.replaceWith(t.callExpression(ensureInitializerDefineProp(path, state), [path.get('left.object').node, t.stringLiteral(path.get('left.property').node.name), path.get('right.arguments')[0].node, path.get('right.arguments')[1].node]));
  29850. }
  29851. }
  29852. };
  29853. };
  29854. var _babelTemplate = __webpack_require__(4);
  29855. var _babelTemplate2 = _interopRequireDefault(_babelTemplate);
  29856. function _interopRequireDefault(obj) {
  29857. return obj && obj.__esModule ? obj : { default: obj };
  29858. }
  29859. var buildClassDecorator = (0, _babelTemplate2.default)('\n DECORATOR(CLASS_REF = INNER) || CLASS_REF;\n');
  29860. var buildClassPrototype = (0, _babelTemplate2.default)('\n CLASS_REF.prototype;\n');
  29861. var buildGetDescriptor = (0, _babelTemplate2.default)('\n Object.getOwnPropertyDescriptor(TARGET, PROPERTY);\n');
  29862. var buildGetObjectInitializer = (0, _babelTemplate2.default)('\n (TEMP = Object.getOwnPropertyDescriptor(TARGET, PROPERTY), (TEMP = TEMP ? TEMP.value : undefined), {\n enumerable: true,\n configurable: true,\n writable: true,\n initializer: function(){\n return TEMP;\n }\n })\n');
  29863. var buildInitializerWarningHelper = (0, _babelTemplate2.default)('\n function NAME(descriptor, context){\n throw new Error(\'Decorating class property failed. Please ensure that transform-class-properties is enabled.\');\n }\n');
  29864. var buildInitializerDefineProperty = (0, _babelTemplate2.default)('\n function NAME(target, property, descriptor, context){\n if (!descriptor) return;\n\n Object.defineProperty(target, property, {\n enumerable: descriptor.enumerable,\n configurable: descriptor.configurable,\n writable: descriptor.writable,\n value: descriptor.initializer ? descriptor.initializer.call(context) : void 0,\n });\n }\n');
  29865. var buildApplyDecoratedDescriptor = (0, _babelTemplate2.default)('\n function NAME(target, property, decorators, descriptor, context){\n var desc = {};\n Object[\'ke\' + \'ys\'](descriptor).forEach(function(key){\n desc[key] = descriptor[key];\n });\n desc.enumerable = !!desc.enumerable;\n desc.configurable = !!desc.configurable;\n if (\'value\' in desc || desc.initializer){\n desc.writable = true;\n }\n\n desc = decorators.slice().reverse().reduce(function(desc, decorator){\n return decorator(target, property, desc) || desc;\n }, desc);\n\n if (context && desc.initializer !== void 0){\n desc.value = desc.initializer ? desc.initializer.call(context) : void 0;\n desc.initializer = undefined;\n }\n\n if (desc.initializer === void 0){\n // This is a hack to avoid this being processed by \'transform-runtime\'.\n // See issue #9.\n Object[\'define\' + \'Property\'](target, property, desc);\n desc = null;\n }\n\n return desc;\n }\n');
  29866. ;
  29867. /***/ }),
  29868. /* 330 */
  29869. /***/ (function(module, exports, __webpack_require__) {
  29870. "use strict";
  29871. exports.__esModule = true;
  29872. exports.visitor = undefined;
  29873. var _babelTypes = __webpack_require__(1);
  29874. var t = _interopRequireWildcard(_babelTypes);
  29875. function _interopRequireWildcard(obj) {
  29876. if (obj && obj.__esModule) {
  29877. return obj;
  29878. } else {
  29879. var newObj = {};if (obj != null) {
  29880. for (var key in obj) {
  29881. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  29882. }
  29883. }newObj.default = obj;return newObj;
  29884. }
  29885. }
  29886. function getTDZStatus(refPath, bindingPath) {
  29887. var executionStatus = bindingPath._guessExecutionStatusRelativeTo(refPath);
  29888. if (executionStatus === "before") {
  29889. return "inside";
  29890. } else if (executionStatus === "after") {
  29891. return "outside";
  29892. } else {
  29893. return "maybe";
  29894. }
  29895. }
  29896. function buildTDZAssert(node, file) {
  29897. return t.callExpression(file.addHelper("temporalRef"), [node, t.stringLiteral(node.name), file.addHelper("temporalUndefined")]);
  29898. }
  29899. function isReference(node, scope, state) {
  29900. var declared = state.letReferences[node.name];
  29901. if (!declared) return false;
  29902. return scope.getBindingIdentifier(node.name) === declared;
  29903. }
  29904. var visitor = exports.visitor = {
  29905. ReferencedIdentifier: function ReferencedIdentifier(path, state) {
  29906. if (!this.file.opts.tdz) return;
  29907. var node = path.node,
  29908. parent = path.parent,
  29909. scope = path.scope;
  29910. if (path.parentPath.isFor({ left: node })) return;
  29911. if (!isReference(node, scope, state)) return;
  29912. var bindingPath = scope.getBinding(node.name).path;
  29913. var status = getTDZStatus(path, bindingPath);
  29914. if (status === "inside") return;
  29915. if (status === "maybe") {
  29916. var assert = buildTDZAssert(node, state.file);
  29917. bindingPath.parent._tdzThis = true;
  29918. path.skip();
  29919. if (path.parentPath.isUpdateExpression()) {
  29920. if (parent._ignoreBlockScopingTDZ) return;
  29921. path.parentPath.replaceWith(t.sequenceExpression([assert, parent]));
  29922. } else {
  29923. path.replaceWith(assert);
  29924. }
  29925. } else if (status === "outside") {
  29926. path.replaceWith(t.throwStatement(t.inherits(t.newExpression(t.identifier("ReferenceError"), [t.stringLiteral(node.name + " is not defined - temporal dead zone")]), node)));
  29927. }
  29928. },
  29929. AssignmentExpression: {
  29930. exit: function exit(path, state) {
  29931. if (!this.file.opts.tdz) return;
  29932. var node = path.node;
  29933. if (node._ignoreBlockScopingTDZ) return;
  29934. var nodes = [];
  29935. var ids = path.getBindingIdentifiers();
  29936. for (var name in ids) {
  29937. var id = ids[name];
  29938. if (isReference(id, path.scope, state)) {
  29939. nodes.push(buildTDZAssert(id, state.file));
  29940. }
  29941. }
  29942. if (nodes.length) {
  29943. node._ignoreBlockScopingTDZ = true;
  29944. nodes.push(node);
  29945. path.replaceWithMultiple(nodes.map(t.expressionStatement));
  29946. }
  29947. }
  29948. }
  29949. };
  29950. /***/ }),
  29951. /* 331 */
  29952. /***/ (function(module, exports, __webpack_require__) {
  29953. "use strict";
  29954. exports.__esModule = true;
  29955. var _classCallCheck2 = __webpack_require__(3);
  29956. var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
  29957. var _possibleConstructorReturn2 = __webpack_require__(42);
  29958. var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
  29959. var _inherits2 = __webpack_require__(41);
  29960. var _inherits3 = _interopRequireDefault(_inherits2);
  29961. var _babelHelperFunctionName = __webpack_require__(40);
  29962. var _babelHelperFunctionName2 = _interopRequireDefault(_babelHelperFunctionName);
  29963. var _vanilla = __webpack_require__(207);
  29964. var _vanilla2 = _interopRequireDefault(_vanilla);
  29965. var _babelTypes = __webpack_require__(1);
  29966. var t = _interopRequireWildcard(_babelTypes);
  29967. function _interopRequireWildcard(obj) {
  29968. if (obj && obj.__esModule) {
  29969. return obj;
  29970. } else {
  29971. var newObj = {};if (obj != null) {
  29972. for (var key in obj) {
  29973. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  29974. }
  29975. }newObj.default = obj;return newObj;
  29976. }
  29977. }
  29978. function _interopRequireDefault(obj) {
  29979. return obj && obj.__esModule ? obj : { default: obj };
  29980. }
  29981. var LooseClassTransformer = function (_VanillaTransformer) {
  29982. (0, _inherits3.default)(LooseClassTransformer, _VanillaTransformer);
  29983. function LooseClassTransformer() {
  29984. (0, _classCallCheck3.default)(this, LooseClassTransformer);
  29985. var _this = (0, _possibleConstructorReturn3.default)(this, _VanillaTransformer.apply(this, arguments));
  29986. _this.isLoose = true;
  29987. return _this;
  29988. }
  29989. LooseClassTransformer.prototype._processMethod = function _processMethod(node, scope) {
  29990. if (!node.decorators) {
  29991. var classRef = this.classRef;
  29992. if (!node.static) classRef = t.memberExpression(classRef, t.identifier("prototype"));
  29993. var methodName = t.memberExpression(classRef, node.key, node.computed || t.isLiteral(node.key));
  29994. var func = t.functionExpression(null, node.params, node.body, node.generator, node.async);
  29995. func.returnType = node.returnType;
  29996. var key = t.toComputedKey(node, node.key);
  29997. if (t.isStringLiteral(key)) {
  29998. func = (0, _babelHelperFunctionName2.default)({
  29999. node: func,
  30000. id: key,
  30001. scope: scope
  30002. });
  30003. }
  30004. var expr = t.expressionStatement(t.assignmentExpression("=", methodName, func));
  30005. t.inheritsComments(expr, node);
  30006. this.body.push(expr);
  30007. return true;
  30008. }
  30009. };
  30010. return LooseClassTransformer;
  30011. }(_vanilla2.default);
  30012. exports.default = LooseClassTransformer;
  30013. module.exports = exports["default"];
  30014. /***/ }),
  30015. /* 332 */
  30016. /***/ (function(module, exports) {
  30017. "use strict";
  30018. exports.__esModule = true;
  30019. exports.default = function (_ref) {
  30020. var t = _ref.types;
  30021. return {
  30022. visitor: {
  30023. BinaryExpression: function BinaryExpression(path) {
  30024. var node = path.node;
  30025. if (node.operator === "instanceof") {
  30026. path.replaceWith(t.callExpression(this.addHelper("instanceof"), [node.left, node.right]));
  30027. }
  30028. }
  30029. }
  30030. };
  30031. };
  30032. module.exports = exports["default"];
  30033. /***/ }),
  30034. /* 333 */
  30035. /***/ (function(module, exports, __webpack_require__) {
  30036. "use strict";
  30037. exports.__esModule = true;
  30038. exports.visitor = undefined;
  30039. var _getIterator2 = __webpack_require__(2);
  30040. var _getIterator3 = _interopRequireDefault(_getIterator2);
  30041. var _babelHelperGetFunctionArity = __webpack_require__(189);
  30042. var _babelHelperGetFunctionArity2 = _interopRequireDefault(_babelHelperGetFunctionArity);
  30043. var _babelHelperCallDelegate = __webpack_require__(317);
  30044. var _babelHelperCallDelegate2 = _interopRequireDefault(_babelHelperCallDelegate);
  30045. var _babelTemplate = __webpack_require__(4);
  30046. var _babelTemplate2 = _interopRequireDefault(_babelTemplate);
  30047. var _babelTypes = __webpack_require__(1);
  30048. var t = _interopRequireWildcard(_babelTypes);
  30049. function _interopRequireWildcard(obj) {
  30050. if (obj && obj.__esModule) {
  30051. return obj;
  30052. } else {
  30053. var newObj = {};if (obj != null) {
  30054. for (var key in obj) {
  30055. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  30056. }
  30057. }newObj.default = obj;return newObj;
  30058. }
  30059. }
  30060. function _interopRequireDefault(obj) {
  30061. return obj && obj.__esModule ? obj : { default: obj };
  30062. }
  30063. var buildDefaultParam = (0, _babelTemplate2.default)("\n let VARIABLE_NAME =\n ARGUMENTS.length > ARGUMENT_KEY && ARGUMENTS[ARGUMENT_KEY] !== undefined ?\n ARGUMENTS[ARGUMENT_KEY]\n :\n DEFAULT_VALUE;\n");
  30064. var buildCutOff = (0, _babelTemplate2.default)("\n let $0 = $1[$2];\n");
  30065. function hasDefaults(node) {
  30066. for (var _iterator = node.params, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
  30067. var _ref;
  30068. if (_isArray) {
  30069. if (_i >= _iterator.length) break;
  30070. _ref = _iterator[_i++];
  30071. } else {
  30072. _i = _iterator.next();
  30073. if (_i.done) break;
  30074. _ref = _i.value;
  30075. }
  30076. var param = _ref;
  30077. if (!t.isIdentifier(param)) return true;
  30078. }
  30079. return false;
  30080. }
  30081. function isSafeBinding(scope, node) {
  30082. if (!scope.hasOwnBinding(node.name)) return true;
  30083. var _scope$getOwnBinding = scope.getOwnBinding(node.name),
  30084. kind = _scope$getOwnBinding.kind;
  30085. return kind === "param" || kind === "local";
  30086. }
  30087. var iifeVisitor = {
  30088. ReferencedIdentifier: function ReferencedIdentifier(path, state) {
  30089. var scope = path.scope,
  30090. node = path.node;
  30091. if (node.name === "eval" || !isSafeBinding(scope, node)) {
  30092. state.iife = true;
  30093. path.stop();
  30094. }
  30095. },
  30096. Scope: function Scope(path) {
  30097. path.skip();
  30098. }
  30099. };
  30100. var visitor = exports.visitor = {
  30101. Function: function Function(path) {
  30102. var node = path.node,
  30103. scope = path.scope;
  30104. if (!hasDefaults(node)) return;
  30105. path.ensureBlock();
  30106. var state = {
  30107. iife: false,
  30108. scope: scope
  30109. };
  30110. var body = [];
  30111. var argsIdentifier = t.identifier("arguments");
  30112. argsIdentifier._shadowedFunctionLiteral = path;
  30113. function pushDefNode(left, right, i) {
  30114. var defNode = buildDefaultParam({
  30115. VARIABLE_NAME: left,
  30116. DEFAULT_VALUE: right,
  30117. ARGUMENT_KEY: t.numericLiteral(i),
  30118. ARGUMENTS: argsIdentifier
  30119. });
  30120. defNode._blockHoist = node.params.length - i;
  30121. body.push(defNode);
  30122. }
  30123. var lastNonDefaultParam = (0, _babelHelperGetFunctionArity2.default)(node);
  30124. var params = path.get("params");
  30125. for (var i = 0; i < params.length; i++) {
  30126. var param = params[i];
  30127. if (!param.isAssignmentPattern()) {
  30128. if (!state.iife && !param.isIdentifier()) {
  30129. param.traverse(iifeVisitor, state);
  30130. }
  30131. continue;
  30132. }
  30133. var left = param.get("left");
  30134. var right = param.get("right");
  30135. if (i >= lastNonDefaultParam || left.isPattern()) {
  30136. var placeholder = scope.generateUidIdentifier("x");
  30137. placeholder._isDefaultPlaceholder = true;
  30138. node.params[i] = placeholder;
  30139. } else {
  30140. node.params[i] = left.node;
  30141. }
  30142. if (!state.iife) {
  30143. if (right.isIdentifier() && !isSafeBinding(scope, right.node)) {
  30144. state.iife = true;
  30145. } else {
  30146. right.traverse(iifeVisitor, state);
  30147. }
  30148. }
  30149. pushDefNode(left.node, right.node, i);
  30150. }
  30151. for (var _i2 = lastNonDefaultParam + 1; _i2 < node.params.length; _i2++) {
  30152. var _param = node.params[_i2];
  30153. if (_param._isDefaultPlaceholder) continue;
  30154. var declar = buildCutOff(_param, argsIdentifier, t.numericLiteral(_i2));
  30155. declar._blockHoist = node.params.length - _i2;
  30156. body.push(declar);
  30157. }
  30158. node.params = node.params.slice(0, lastNonDefaultParam);
  30159. if (state.iife) {
  30160. body.push((0, _babelHelperCallDelegate2.default)(path, scope));
  30161. path.set("body", t.blockStatement(body));
  30162. } else {
  30163. path.get("body").unshiftContainer("body", body);
  30164. }
  30165. }
  30166. };
  30167. /***/ }),
  30168. /* 334 */
  30169. /***/ (function(module, exports, __webpack_require__) {
  30170. "use strict";
  30171. exports.__esModule = true;
  30172. exports.visitor = undefined;
  30173. var _babelTypes = __webpack_require__(1);
  30174. var t = _interopRequireWildcard(_babelTypes);
  30175. function _interopRequireWildcard(obj) {
  30176. if (obj && obj.__esModule) {
  30177. return obj;
  30178. } else {
  30179. var newObj = {};if (obj != null) {
  30180. for (var key in obj) {
  30181. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  30182. }
  30183. }newObj.default = obj;return newObj;
  30184. }
  30185. }
  30186. var visitor = exports.visitor = {
  30187. Function: function Function(path) {
  30188. var params = path.get("params");
  30189. var hoistTweak = t.isRestElement(params[params.length - 1]) ? 1 : 0;
  30190. var outputParamsLength = params.length - hoistTweak;
  30191. for (var i = 0; i < outputParamsLength; i++) {
  30192. var param = params[i];
  30193. if (param.isArrayPattern() || param.isObjectPattern()) {
  30194. var uid = path.scope.generateUidIdentifier("ref");
  30195. var declar = t.variableDeclaration("let", [t.variableDeclarator(param.node, uid)]);
  30196. declar._blockHoist = outputParamsLength - i;
  30197. path.ensureBlock();
  30198. path.get("body").unshiftContainer("body", declar);
  30199. param.replaceWith(uid);
  30200. }
  30201. }
  30202. }
  30203. };
  30204. /***/ }),
  30205. /* 335 */
  30206. /***/ (function(module, exports, __webpack_require__) {
  30207. "use strict";
  30208. exports.__esModule = true;
  30209. exports.visitor = undefined;
  30210. var _getIterator2 = __webpack_require__(2);
  30211. var _getIterator3 = _interopRequireDefault(_getIterator2);
  30212. var _babelTemplate = __webpack_require__(4);
  30213. var _babelTemplate2 = _interopRequireDefault(_babelTemplate);
  30214. var _babelTypes = __webpack_require__(1);
  30215. var t = _interopRequireWildcard(_babelTypes);
  30216. function _interopRequireWildcard(obj) {
  30217. if (obj && obj.__esModule) {
  30218. return obj;
  30219. } else {
  30220. var newObj = {};if (obj != null) {
  30221. for (var key in obj) {
  30222. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  30223. }
  30224. }newObj.default = obj;return newObj;
  30225. }
  30226. }
  30227. function _interopRequireDefault(obj) {
  30228. return obj && obj.__esModule ? obj : { default: obj };
  30229. }
  30230. var buildRest = (0, _babelTemplate2.default)("\n for (var LEN = ARGUMENTS.length,\n ARRAY = Array(ARRAY_LEN),\n KEY = START;\n KEY < LEN;\n KEY++) {\n ARRAY[ARRAY_KEY] = ARGUMENTS[KEY];\n }\n");
  30231. var restIndex = (0, _babelTemplate2.default)("\n ARGUMENTS.length <= INDEX ? undefined : ARGUMENTS[INDEX]\n");
  30232. var restIndexImpure = (0, _babelTemplate2.default)("\n REF = INDEX, ARGUMENTS.length <= REF ? undefined : ARGUMENTS[REF]\n");
  30233. var restLength = (0, _babelTemplate2.default)("\n ARGUMENTS.length <= OFFSET ? 0 : ARGUMENTS.length - OFFSET\n");
  30234. var memberExpressionOptimisationVisitor = {
  30235. Scope: function Scope(path, state) {
  30236. if (!path.scope.bindingIdentifierEquals(state.name, state.outerBinding)) {
  30237. path.skip();
  30238. }
  30239. },
  30240. Flow: function Flow(path) {
  30241. if (path.isTypeCastExpression()) return;
  30242. path.skip();
  30243. },
  30244. "Function|ClassProperty": function FunctionClassProperty(path, state) {
  30245. var oldNoOptimise = state.noOptimise;
  30246. state.noOptimise = true;
  30247. path.traverse(memberExpressionOptimisationVisitor, state);
  30248. state.noOptimise = oldNoOptimise;
  30249. path.skip();
  30250. },
  30251. ReferencedIdentifier: function ReferencedIdentifier(path, state) {
  30252. var node = path.node;
  30253. if (node.name === "arguments") {
  30254. state.deopted = true;
  30255. }
  30256. if (node.name !== state.name) return;
  30257. if (state.noOptimise) {
  30258. state.deopted = true;
  30259. } else {
  30260. var parentPath = path.parentPath;
  30261. if (parentPath.listKey === "params" && parentPath.key < state.offset) {
  30262. return;
  30263. }
  30264. if (parentPath.isMemberExpression({ object: node })) {
  30265. var grandparentPath = parentPath.parentPath;
  30266. var argsOptEligible = !state.deopted && !(grandparentPath.isAssignmentExpression() && parentPath.node === grandparentPath.node.left || grandparentPath.isLVal() || grandparentPath.isForXStatement() || grandparentPath.isUpdateExpression() || grandparentPath.isUnaryExpression({ operator: "delete" }) || (grandparentPath.isCallExpression() || grandparentPath.isNewExpression()) && parentPath.node === grandparentPath.node.callee);
  30267. if (argsOptEligible) {
  30268. if (parentPath.node.computed) {
  30269. if (parentPath.get("property").isBaseType("number")) {
  30270. state.candidates.push({ cause: "indexGetter", path: path });
  30271. return;
  30272. }
  30273. } else if (parentPath.node.property.name === "length") {
  30274. state.candidates.push({ cause: "lengthGetter", path: path });
  30275. return;
  30276. }
  30277. }
  30278. }
  30279. if (state.offset === 0 && parentPath.isSpreadElement()) {
  30280. var call = parentPath.parentPath;
  30281. if (call.isCallExpression() && call.node.arguments.length === 1) {
  30282. state.candidates.push({ cause: "argSpread", path: path });
  30283. return;
  30284. }
  30285. }
  30286. state.references.push(path);
  30287. }
  30288. },
  30289. BindingIdentifier: function BindingIdentifier(_ref, state) {
  30290. var node = _ref.node;
  30291. if (node.name === state.name) {
  30292. state.deopted = true;
  30293. }
  30294. }
  30295. };
  30296. function hasRest(node) {
  30297. return t.isRestElement(node.params[node.params.length - 1]);
  30298. }
  30299. function optimiseIndexGetter(path, argsId, offset) {
  30300. var index = void 0;
  30301. if (t.isNumericLiteral(path.parent.property)) {
  30302. index = t.numericLiteral(path.parent.property.value + offset);
  30303. } else if (offset === 0) {
  30304. index = path.parent.property;
  30305. } else {
  30306. index = t.binaryExpression("+", path.parent.property, t.numericLiteral(offset));
  30307. }
  30308. var scope = path.scope;
  30309. if (!scope.isPure(index)) {
  30310. var temp = scope.generateUidIdentifierBasedOnNode(index);
  30311. scope.push({ id: temp, kind: "var" });
  30312. path.parentPath.replaceWith(restIndexImpure({
  30313. ARGUMENTS: argsId,
  30314. INDEX: index,
  30315. REF: temp
  30316. }));
  30317. } else {
  30318. path.parentPath.replaceWith(restIndex({
  30319. ARGUMENTS: argsId,
  30320. INDEX: index
  30321. }));
  30322. }
  30323. }
  30324. function optimiseLengthGetter(path, argsId, offset) {
  30325. if (offset) {
  30326. path.parentPath.replaceWith(restLength({
  30327. ARGUMENTS: argsId,
  30328. OFFSET: t.numericLiteral(offset)
  30329. }));
  30330. } else {
  30331. path.replaceWith(argsId);
  30332. }
  30333. }
  30334. var visitor = exports.visitor = {
  30335. Function: function Function(path) {
  30336. var node = path.node,
  30337. scope = path.scope;
  30338. if (!hasRest(node)) return;
  30339. var rest = node.params.pop().argument;
  30340. var argsId = t.identifier("arguments");
  30341. argsId._shadowedFunctionLiteral = path;
  30342. var state = {
  30343. references: [],
  30344. offset: node.params.length,
  30345. argumentsNode: argsId,
  30346. outerBinding: scope.getBindingIdentifier(rest.name),
  30347. candidates: [],
  30348. name: rest.name,
  30349. deopted: false
  30350. };
  30351. path.traverse(memberExpressionOptimisationVisitor, state);
  30352. if (!state.deopted && !state.references.length) {
  30353. for (var _iterator = state.candidates, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
  30354. var _ref3;
  30355. if (_isArray) {
  30356. if (_i >= _iterator.length) break;
  30357. _ref3 = _iterator[_i++];
  30358. } else {
  30359. _i = _iterator.next();
  30360. if (_i.done) break;
  30361. _ref3 = _i.value;
  30362. }
  30363. var _ref4 = _ref3;
  30364. var _path = _ref4.path,
  30365. cause = _ref4.cause;
  30366. switch (cause) {
  30367. case "indexGetter":
  30368. optimiseIndexGetter(_path, argsId, state.offset);
  30369. break;
  30370. case "lengthGetter":
  30371. optimiseLengthGetter(_path, argsId, state.offset);
  30372. break;
  30373. default:
  30374. _path.replaceWith(argsId);
  30375. }
  30376. }
  30377. return;
  30378. }
  30379. state.references = state.references.concat(state.candidates.map(function (_ref5) {
  30380. var path = _ref5.path;
  30381. return path;
  30382. }));
  30383. state.deopted = state.deopted || !!node.shadow;
  30384. var start = t.numericLiteral(node.params.length);
  30385. var key = scope.generateUidIdentifier("key");
  30386. var len = scope.generateUidIdentifier("len");
  30387. var arrKey = key;
  30388. var arrLen = len;
  30389. if (node.params.length) {
  30390. arrKey = t.binaryExpression("-", key, start);
  30391. arrLen = t.conditionalExpression(t.binaryExpression(">", len, start), t.binaryExpression("-", len, start), t.numericLiteral(0));
  30392. }
  30393. var loop = buildRest({
  30394. ARGUMENTS: argsId,
  30395. ARRAY_KEY: arrKey,
  30396. ARRAY_LEN: arrLen,
  30397. START: start,
  30398. ARRAY: rest,
  30399. KEY: key,
  30400. LEN: len
  30401. });
  30402. if (state.deopted) {
  30403. loop._blockHoist = node.params.length + 1;
  30404. node.body.body.unshift(loop);
  30405. } else {
  30406. loop._blockHoist = 1;
  30407. var target = path.getEarliestCommonAncestorFrom(state.references).getStatementParent();
  30408. target.findParent(function (path) {
  30409. if (path.isLoop()) {
  30410. target = path;
  30411. } else {
  30412. return path.isFunction();
  30413. }
  30414. });
  30415. target.insertBefore(loop);
  30416. }
  30417. }
  30418. };
  30419. /***/ }),
  30420. /* 336 */
  30421. /***/ (function(module, exports) {
  30422. "use strict";
  30423. exports.__esModule = true;
  30424. exports.default = function (_ref) {
  30425. var t = _ref.types;
  30426. return {
  30427. visitor: {
  30428. MemberExpression: {
  30429. exit: function exit(_ref2) {
  30430. var node = _ref2.node;
  30431. var prop = node.property;
  30432. if (!node.computed && t.isIdentifier(prop) && !t.isValidIdentifier(prop.name)) {
  30433. node.property = t.stringLiteral(prop.name);
  30434. node.computed = true;
  30435. }
  30436. }
  30437. }
  30438. }
  30439. };
  30440. };
  30441. module.exports = exports["default"];
  30442. /***/ }),
  30443. /* 337 */
  30444. /***/ (function(module, exports) {
  30445. "use strict";
  30446. exports.__esModule = true;
  30447. exports.default = function (_ref) {
  30448. var t = _ref.types;
  30449. return {
  30450. visitor: {
  30451. ObjectProperty: {
  30452. exit: function exit(_ref2) {
  30453. var node = _ref2.node;
  30454. var key = node.key;
  30455. if (!node.computed && t.isIdentifier(key) && !t.isValidIdentifier(key.name)) {
  30456. node.key = t.stringLiteral(key.name);
  30457. }
  30458. }
  30459. }
  30460. }
  30461. };
  30462. };
  30463. module.exports = exports["default"];
  30464. /***/ }),
  30465. /* 338 */
  30466. /***/ (function(module, exports, __webpack_require__) {
  30467. "use strict";
  30468. exports.__esModule = true;
  30469. var _getIterator2 = __webpack_require__(2);
  30470. var _getIterator3 = _interopRequireDefault(_getIterator2);
  30471. exports.default = function (_ref) {
  30472. var t = _ref.types;
  30473. return {
  30474. visitor: {
  30475. ObjectExpression: function ObjectExpression(path, file) {
  30476. var node = path.node;
  30477. var hasAny = false;
  30478. for (var _iterator = node.properties, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
  30479. var _ref2;
  30480. if (_isArray) {
  30481. if (_i >= _iterator.length) break;
  30482. _ref2 = _iterator[_i++];
  30483. } else {
  30484. _i = _iterator.next();
  30485. if (_i.done) break;
  30486. _ref2 = _i.value;
  30487. }
  30488. var prop = _ref2;
  30489. if (prop.kind === "get" || prop.kind === "set") {
  30490. hasAny = true;
  30491. break;
  30492. }
  30493. }
  30494. if (!hasAny) return;
  30495. var mutatorMap = {};
  30496. node.properties = node.properties.filter(function (prop) {
  30497. if (!prop.computed && (prop.kind === "get" || prop.kind === "set")) {
  30498. defineMap.push(mutatorMap, prop, null, file);
  30499. return false;
  30500. } else {
  30501. return true;
  30502. }
  30503. });
  30504. path.replaceWith(t.callExpression(t.memberExpression(t.identifier("Object"), t.identifier("defineProperties")), [node, defineMap.toDefineObject(mutatorMap)]));
  30505. }
  30506. }
  30507. };
  30508. };
  30509. var _babelHelperDefineMap = __webpack_require__(188);
  30510. var defineMap = _interopRequireWildcard(_babelHelperDefineMap);
  30511. function _interopRequireWildcard(obj) {
  30512. if (obj && obj.__esModule) {
  30513. return obj;
  30514. } else {
  30515. var newObj = {};if (obj != null) {
  30516. for (var key in obj) {
  30517. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  30518. }
  30519. }newObj.default = obj;return newObj;
  30520. }
  30521. }
  30522. function _interopRequireDefault(obj) {
  30523. return obj && obj.__esModule ? obj : { default: obj };
  30524. }
  30525. module.exports = exports["default"];
  30526. /***/ }),
  30527. /* 339 */
  30528. /***/ (function(module, exports) {
  30529. "use strict";
  30530. exports.__esModule = true;
  30531. exports.default = function (_ref) {
  30532. var parse = _ref.parse,
  30533. traverse = _ref.traverse;
  30534. return {
  30535. visitor: {
  30536. CallExpression: function CallExpression(path) {
  30537. if (path.get("callee").isIdentifier({ name: "eval" }) && path.node.arguments.length === 1) {
  30538. var evaluate = path.get("arguments")[0].evaluate();
  30539. if (!evaluate.confident) return;
  30540. var code = evaluate.value;
  30541. if (typeof code !== "string") return;
  30542. var ast = parse(code);
  30543. traverse.removeProperties(ast);
  30544. return ast.program;
  30545. }
  30546. }
  30547. }
  30548. };
  30549. };
  30550. module.exports = exports["default"];
  30551. /***/ }),
  30552. /* 340 */
  30553. /***/ (function(module, exports, __webpack_require__) {
  30554. "use strict";
  30555. exports.__esModule = true;
  30556. exports.default = function (_ref) {
  30557. var t = _ref.types;
  30558. function wrapInFlowComment(path, parent) {
  30559. path.addComment("trailing", generateComment(path, parent));
  30560. path.replaceWith(t.noop());
  30561. }
  30562. function generateComment(path, parent) {
  30563. var comment = path.getSource().replace(/\*-\//g, "*-ESCAPED/").replace(/\*\//g, "*-/");
  30564. if (parent && parent.optional) comment = "?" + comment;
  30565. if (comment[0] !== ":") comment = ":: " + comment;
  30566. return comment;
  30567. }
  30568. return {
  30569. inherits: __webpack_require__(126),
  30570. visitor: {
  30571. TypeCastExpression: function TypeCastExpression(path) {
  30572. var node = path.node;
  30573. path.get("expression").addComment("trailing", generateComment(path.get("typeAnnotation")));
  30574. path.replaceWith(t.parenthesizedExpression(node.expression));
  30575. },
  30576. Identifier: function Identifier(path) {
  30577. var node = path.node;
  30578. if (!node.optional || node.typeAnnotation) {
  30579. return;
  30580. }
  30581. path.addComment("trailing", ":: ?");
  30582. },
  30583. AssignmentPattern: {
  30584. exit: function exit(_ref2) {
  30585. var node = _ref2.node;
  30586. node.left.optional = false;
  30587. }
  30588. },
  30589. Function: {
  30590. exit: function exit(_ref3) {
  30591. var node = _ref3.node;
  30592. node.params.forEach(function (param) {
  30593. return param.optional = false;
  30594. });
  30595. }
  30596. },
  30597. ClassProperty: function ClassProperty(path) {
  30598. var node = path.node,
  30599. parent = path.parent;
  30600. if (!node.value) wrapInFlowComment(path, parent);
  30601. },
  30602. "ExportNamedDeclaration|Flow": function ExportNamedDeclarationFlow(path) {
  30603. var node = path.node,
  30604. parent = path.parent;
  30605. if (t.isExportNamedDeclaration(node) && !t.isFlow(node.declaration)) {
  30606. return;
  30607. }
  30608. wrapInFlowComment(path, parent);
  30609. },
  30610. ImportDeclaration: function ImportDeclaration(path) {
  30611. var node = path.node,
  30612. parent = path.parent;
  30613. if (t.isImportDeclaration(node) && node.importKind !== "type" && node.importKind !== "typeof") {
  30614. return;
  30615. }
  30616. wrapInFlowComment(path, parent);
  30617. }
  30618. }
  30619. };
  30620. };
  30621. module.exports = exports["default"];
  30622. /***/ }),
  30623. /* 341 */
  30624. /***/ (function(module, exports) {
  30625. "use strict";
  30626. exports.__esModule = true;
  30627. exports.default = function (_ref) {
  30628. var t = _ref.types;
  30629. return {
  30630. visitor: {
  30631. FunctionExpression: {
  30632. exit: function exit(path) {
  30633. var node = path.node;
  30634. if (!node.id) return;
  30635. node._ignoreUserWhitespace = true;
  30636. path.replaceWith(t.callExpression(t.functionExpression(null, [], t.blockStatement([t.toStatement(node), t.returnStatement(node.id)])), []));
  30637. }
  30638. }
  30639. }
  30640. };
  30641. };
  30642. module.exports = exports["default"];
  30643. /***/ }),
  30644. /* 342 */
  30645. /***/ (function(module, exports) {
  30646. "use strict";
  30647. exports.__esModule = true;
  30648. exports.default = function () {
  30649. return {
  30650. visitor: {
  30651. CallExpression: function CallExpression(path, file) {
  30652. if (path.get("callee").matchesPattern("Object.assign")) {
  30653. path.node.callee = file.addHelper("extends");
  30654. }
  30655. }
  30656. }
  30657. };
  30658. };
  30659. module.exports = exports["default"];
  30660. /***/ }),
  30661. /* 343 */
  30662. /***/ (function(module, exports) {
  30663. "use strict";
  30664. exports.__esModule = true;
  30665. exports.default = function () {
  30666. return {
  30667. visitor: {
  30668. CallExpression: function CallExpression(path, file) {
  30669. if (path.get("callee").matchesPattern("Object.setPrototypeOf")) {
  30670. path.node.callee = file.addHelper("defaults");
  30671. }
  30672. }
  30673. }
  30674. };
  30675. };
  30676. module.exports = exports["default"];
  30677. /***/ }),
  30678. /* 344 */
  30679. /***/ (function(module, exports, __webpack_require__) {
  30680. "use strict";
  30681. exports.__esModule = true;
  30682. var _getIterator2 = __webpack_require__(2);
  30683. var _getIterator3 = _interopRequireDefault(_getIterator2);
  30684. exports.default = function (_ref) {
  30685. var t = _ref.types;
  30686. function isProtoKey(node) {
  30687. return t.isLiteral(t.toComputedKey(node, node.key), { value: "__proto__" });
  30688. }
  30689. function isProtoAssignmentExpression(node) {
  30690. var left = node.left;
  30691. return t.isMemberExpression(left) && t.isLiteral(t.toComputedKey(left, left.property), { value: "__proto__" });
  30692. }
  30693. function buildDefaultsCallExpression(expr, ref, file) {
  30694. return t.expressionStatement(t.callExpression(file.addHelper("defaults"), [ref, expr.right]));
  30695. }
  30696. return {
  30697. visitor: {
  30698. AssignmentExpression: function AssignmentExpression(path, file) {
  30699. if (!isProtoAssignmentExpression(path.node)) return;
  30700. var nodes = [];
  30701. var left = path.node.left.object;
  30702. var temp = path.scope.maybeGenerateMemoised(left);
  30703. if (temp) nodes.push(t.expressionStatement(t.assignmentExpression("=", temp, left)));
  30704. nodes.push(buildDefaultsCallExpression(path.node, temp || left, file));
  30705. if (temp) nodes.push(temp);
  30706. path.replaceWithMultiple(nodes);
  30707. },
  30708. ExpressionStatement: function ExpressionStatement(path, file) {
  30709. var expr = path.node.expression;
  30710. if (!t.isAssignmentExpression(expr, { operator: "=" })) return;
  30711. if (isProtoAssignmentExpression(expr)) {
  30712. path.replaceWith(buildDefaultsCallExpression(expr, expr.left.object, file));
  30713. }
  30714. },
  30715. ObjectExpression: function ObjectExpression(path, file) {
  30716. var proto = void 0;
  30717. var node = path.node;
  30718. for (var _iterator = node.properties, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
  30719. var _ref2;
  30720. if (_isArray) {
  30721. if (_i >= _iterator.length) break;
  30722. _ref2 = _iterator[_i++];
  30723. } else {
  30724. _i = _iterator.next();
  30725. if (_i.done) break;
  30726. _ref2 = _i.value;
  30727. }
  30728. var prop = _ref2;
  30729. if (isProtoKey(prop)) {
  30730. proto = prop.value;
  30731. (0, _pull2.default)(node.properties, prop);
  30732. }
  30733. }
  30734. if (proto) {
  30735. var args = [t.objectExpression([]), proto];
  30736. if (node.properties.length) args.push(node);
  30737. path.replaceWith(t.callExpression(file.addHelper("extends"), args));
  30738. }
  30739. }
  30740. }
  30741. };
  30742. };
  30743. var _pull = __webpack_require__(277);
  30744. var _pull2 = _interopRequireDefault(_pull);
  30745. function _interopRequireDefault(obj) {
  30746. return obj && obj.__esModule ? obj : { default: obj };
  30747. }
  30748. module.exports = exports["default"];
  30749. /***/ }),
  30750. /* 345 */
  30751. /***/ (function(module, exports, __webpack_require__) {
  30752. "use strict";
  30753. exports.__esModule = true;
  30754. var _typeof2 = __webpack_require__(11);
  30755. var _typeof3 = _interopRequireDefault(_typeof2);
  30756. exports.default = function (_ref) {
  30757. var t = _ref.types;
  30758. var immutabilityVisitor = {
  30759. enter: function enter(path, state) {
  30760. var stop = function stop() {
  30761. state.isImmutable = false;
  30762. path.stop();
  30763. };
  30764. if (path.isJSXClosingElement()) {
  30765. path.skip();
  30766. return;
  30767. }
  30768. if (path.isJSXIdentifier({ name: "ref" }) && path.parentPath.isJSXAttribute({ name: path.node })) {
  30769. return stop();
  30770. }
  30771. if (path.isJSXIdentifier() || path.isIdentifier() || path.isJSXMemberExpression()) {
  30772. return;
  30773. }
  30774. if (!path.isImmutable()) {
  30775. if (path.isPure()) {
  30776. var expressionResult = path.evaluate();
  30777. if (expressionResult.confident) {
  30778. var value = expressionResult.value;
  30779. var isMutable = value && (typeof value === "undefined" ? "undefined" : (0, _typeof3.default)(value)) === "object" || typeof value === "function";
  30780. if (!isMutable) {
  30781. return;
  30782. }
  30783. } else if (t.isIdentifier(expressionResult.deopt)) {
  30784. return;
  30785. }
  30786. }
  30787. stop();
  30788. }
  30789. }
  30790. };
  30791. return {
  30792. visitor: {
  30793. JSXElement: function JSXElement(path) {
  30794. if (path.node._hoisted) return;
  30795. var state = { isImmutable: true };
  30796. path.traverse(immutabilityVisitor, state);
  30797. if (state.isImmutable) {
  30798. path.hoist();
  30799. } else {
  30800. path.node._hoisted = true;
  30801. }
  30802. }
  30803. }
  30804. };
  30805. };
  30806. function _interopRequireDefault(obj) {
  30807. return obj && obj.__esModule ? obj : { default: obj };
  30808. }
  30809. module.exports = exports["default"];
  30810. /***/ }),
  30811. /* 346 */
  30812. /***/ (function(module, exports, __webpack_require__) {
  30813. "use strict";
  30814. exports.__esModule = true;
  30815. var _getIterator2 = __webpack_require__(2);
  30816. var _getIterator3 = _interopRequireDefault(_getIterator2);
  30817. exports.default = function (_ref) {
  30818. var t = _ref.types;
  30819. function hasRefOrSpread(attrs) {
  30820. for (var i = 0; i < attrs.length; i++) {
  30821. var attr = attrs[i];
  30822. if (t.isJSXSpreadAttribute(attr)) return true;
  30823. if (isJSXAttributeOfName(attr, "ref")) return true;
  30824. }
  30825. return false;
  30826. }
  30827. function isJSXAttributeOfName(attr, name) {
  30828. return t.isJSXAttribute(attr) && t.isJSXIdentifier(attr.name, { name: name });
  30829. }
  30830. function getAttributeValue(attr) {
  30831. var value = attr.value;
  30832. if (!value) return t.identifier("true");
  30833. if (t.isJSXExpressionContainer(value)) value = value.expression;
  30834. return value;
  30835. }
  30836. return {
  30837. visitor: {
  30838. JSXElement: function JSXElement(path, file) {
  30839. var node = path.node;
  30840. var open = node.openingElement;
  30841. if (hasRefOrSpread(open.attributes)) return;
  30842. var props = t.objectExpression([]);
  30843. var key = null;
  30844. var type = open.name;
  30845. if (t.isJSXIdentifier(type) && t.react.isCompatTag(type.name)) {
  30846. type = t.stringLiteral(type.name);
  30847. }
  30848. function pushProp(objProps, key, value) {
  30849. objProps.push(t.objectProperty(key, value));
  30850. }
  30851. for (var _iterator = open.attributes, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
  30852. var _ref2;
  30853. if (_isArray) {
  30854. if (_i >= _iterator.length) break;
  30855. _ref2 = _iterator[_i++];
  30856. } else {
  30857. _i = _iterator.next();
  30858. if (_i.done) break;
  30859. _ref2 = _i.value;
  30860. }
  30861. var attr = _ref2;
  30862. if (isJSXAttributeOfName(attr, "key")) {
  30863. key = getAttributeValue(attr);
  30864. } else {
  30865. var name = attr.name.name;
  30866. var propertyKey = t.isValidIdentifier(name) ? t.identifier(name) : t.stringLiteral(name);
  30867. pushProp(props.properties, propertyKey, getAttributeValue(attr));
  30868. }
  30869. }
  30870. var args = [type, props];
  30871. if (key || node.children.length) {
  30872. var children = t.react.buildChildren(node);
  30873. args.push.apply(args, [key || t.unaryExpression("void", t.numericLiteral(0), true)].concat(children));
  30874. }
  30875. var el = t.callExpression(file.addHelper("jsx"), args);
  30876. path.replaceWith(el);
  30877. }
  30878. }
  30879. };
  30880. };
  30881. function _interopRequireDefault(obj) {
  30882. return obj && obj.__esModule ? obj : { default: obj };
  30883. }
  30884. module.exports = exports["default"];
  30885. /***/ }),
  30886. /* 347 */
  30887. /***/ (function(module, exports, __webpack_require__) {
  30888. "use strict";
  30889. exports.__esModule = true;
  30890. exports.default = function (_ref) {
  30891. var t = _ref.types;
  30892. return {
  30893. manipulateOptions: function manipulateOptions(opts, parserOpts) {
  30894. parserOpts.plugins.push("jsx");
  30895. },
  30896. visitor: (0, _babelHelperBuilderReactJsx2.default)({
  30897. pre: function pre(state) {
  30898. state.callee = state.tagExpr;
  30899. },
  30900. post: function post(state) {
  30901. if (t.react.isCompatTag(state.tagName)) {
  30902. state.call = t.callExpression(t.memberExpression(t.memberExpression(t.identifier("React"), t.identifier("DOM")), state.tagExpr, t.isLiteral(state.tagExpr)), state.args);
  30903. }
  30904. }
  30905. })
  30906. };
  30907. };
  30908. var _babelHelperBuilderReactJsx = __webpack_require__(348);
  30909. var _babelHelperBuilderReactJsx2 = _interopRequireDefault(_babelHelperBuilderReactJsx);
  30910. function _interopRequireDefault(obj) {
  30911. return obj && obj.__esModule ? obj : { default: obj };
  30912. }
  30913. module.exports = exports["default"];
  30914. /***/ }),
  30915. /* 348 */
  30916. /***/ (function(module, exports, __webpack_require__) {
  30917. "use strict";
  30918. exports.__esModule = true;
  30919. exports.default = function (opts) {
  30920. var visitor = {};
  30921. visitor.JSXNamespacedName = function (path) {
  30922. throw path.buildCodeFrameError("Namespace tags are not supported. ReactJSX is not XML.");
  30923. };
  30924. visitor.JSXElement = {
  30925. exit: function exit(path, file) {
  30926. var callExpr = buildElementCall(path.get("openingElement"), file);
  30927. callExpr.arguments = callExpr.arguments.concat(path.node.children);
  30928. if (callExpr.arguments.length >= 3) {
  30929. callExpr._prettyCall = true;
  30930. }
  30931. path.replaceWith(t.inherits(callExpr, path.node));
  30932. }
  30933. };
  30934. return visitor;
  30935. function convertJSXIdentifier(node, parent) {
  30936. if (t.isJSXIdentifier(node)) {
  30937. if (node.name === "this" && t.isReferenced(node, parent)) {
  30938. return t.thisExpression();
  30939. } else if (_esutils2.default.keyword.isIdentifierNameES6(node.name)) {
  30940. node.type = "Identifier";
  30941. } else {
  30942. return t.stringLiteral(node.name);
  30943. }
  30944. } else if (t.isJSXMemberExpression(node)) {
  30945. return t.memberExpression(convertJSXIdentifier(node.object, node), convertJSXIdentifier(node.property, node));
  30946. }
  30947. return node;
  30948. }
  30949. function convertAttributeValue(node) {
  30950. if (t.isJSXExpressionContainer(node)) {
  30951. return node.expression;
  30952. } else {
  30953. return node;
  30954. }
  30955. }
  30956. function convertAttribute(node) {
  30957. var value = convertAttributeValue(node.value || t.booleanLiteral(true));
  30958. if (t.isStringLiteral(value) && !t.isJSXExpressionContainer(node.value)) {
  30959. value.value = value.value.replace(/\n\s+/g, " ");
  30960. }
  30961. if (t.isValidIdentifier(node.name.name)) {
  30962. node.name.type = "Identifier";
  30963. } else {
  30964. node.name = t.stringLiteral(node.name.name);
  30965. }
  30966. return t.inherits(t.objectProperty(node.name, value), node);
  30967. }
  30968. function buildElementCall(path, file) {
  30969. path.parent.children = t.react.buildChildren(path.parent);
  30970. var tagExpr = convertJSXIdentifier(path.node.name, path.node);
  30971. var args = [];
  30972. var tagName = void 0;
  30973. if (t.isIdentifier(tagExpr)) {
  30974. tagName = tagExpr.name;
  30975. } else if (t.isLiteral(tagExpr)) {
  30976. tagName = tagExpr.value;
  30977. }
  30978. var state = {
  30979. tagExpr: tagExpr,
  30980. tagName: tagName,
  30981. args: args
  30982. };
  30983. if (opts.pre) {
  30984. opts.pre(state, file);
  30985. }
  30986. var attribs = path.node.attributes;
  30987. if (attribs.length) {
  30988. attribs = buildOpeningElementAttributes(attribs, file);
  30989. } else {
  30990. attribs = t.nullLiteral();
  30991. }
  30992. args.push(attribs);
  30993. if (opts.post) {
  30994. opts.post(state, file);
  30995. }
  30996. return state.call || t.callExpression(state.callee, args);
  30997. }
  30998. function buildOpeningElementAttributes(attribs, file) {
  30999. var _props = [];
  31000. var objs = [];
  31001. var useBuiltIns = file.opts.useBuiltIns || false;
  31002. if (typeof useBuiltIns !== "boolean") {
  31003. throw new Error("transform-react-jsx currently only accepts a boolean option for " + "useBuiltIns (defaults to false)");
  31004. }
  31005. function pushProps() {
  31006. if (!_props.length) return;
  31007. objs.push(t.objectExpression(_props));
  31008. _props = [];
  31009. }
  31010. while (attribs.length) {
  31011. var prop = attribs.shift();
  31012. if (t.isJSXSpreadAttribute(prop)) {
  31013. pushProps();
  31014. objs.push(prop.argument);
  31015. } else {
  31016. _props.push(convertAttribute(prop));
  31017. }
  31018. }
  31019. pushProps();
  31020. if (objs.length === 1) {
  31021. attribs = objs[0];
  31022. } else {
  31023. if (!t.isObjectExpression(objs[0])) {
  31024. objs.unshift(t.objectExpression([]));
  31025. }
  31026. var helper = useBuiltIns ? t.memberExpression(t.identifier("Object"), t.identifier("assign")) : file.addHelper("extends");
  31027. attribs = t.callExpression(helper, objs);
  31028. }
  31029. return attribs;
  31030. }
  31031. };
  31032. var _esutils = __webpack_require__(97);
  31033. var _esutils2 = _interopRequireDefault(_esutils);
  31034. var _babelTypes = __webpack_require__(1);
  31035. var t = _interopRequireWildcard(_babelTypes);
  31036. function _interopRequireWildcard(obj) {
  31037. if (obj && obj.__esModule) {
  31038. return obj;
  31039. } else {
  31040. var newObj = {};if (obj != null) {
  31041. for (var key in obj) {
  31042. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  31043. }
  31044. }newObj.default = obj;return newObj;
  31045. }
  31046. }
  31047. function _interopRequireDefault(obj) {
  31048. return obj && obj.__esModule ? obj : { default: obj };
  31049. }
  31050. module.exports = exports["default"];
  31051. /***/ }),
  31052. /* 349 */
  31053. /***/ (function(module, exports) {
  31054. "use strict";
  31055. exports.__esModule = true;
  31056. exports.default = function (_ref) {
  31057. var t = _ref.types;
  31058. var visitor = {
  31059. JSXOpeningElement: function JSXOpeningElement(_ref2) {
  31060. var node = _ref2.node;
  31061. var id = t.jSXIdentifier(TRACE_ID);
  31062. var trace = t.thisExpression();
  31063. node.attributes.push(t.jSXAttribute(id, t.jSXExpressionContainer(trace)));
  31064. }
  31065. };
  31066. return {
  31067. visitor: visitor
  31068. };
  31069. };
  31070. var TRACE_ID = "__self";
  31071. module.exports = exports["default"];
  31072. /***/ }),
  31073. /* 350 */
  31074. /***/ (function(module, exports) {
  31075. "use strict";
  31076. exports.__esModule = true;
  31077. exports.default = function (_ref) {
  31078. var t = _ref.types;
  31079. function makeTrace(fileNameIdentifier, lineNumber) {
  31080. var fileLineLiteral = lineNumber != null ? t.numericLiteral(lineNumber) : t.nullLiteral();
  31081. var fileNameProperty = t.objectProperty(t.identifier("fileName"), fileNameIdentifier);
  31082. var lineNumberProperty = t.objectProperty(t.identifier("lineNumber"), fileLineLiteral);
  31083. return t.objectExpression([fileNameProperty, lineNumberProperty]);
  31084. }
  31085. var visitor = {
  31086. JSXOpeningElement: function JSXOpeningElement(path, state) {
  31087. var id = t.jSXIdentifier(TRACE_ID);
  31088. var location = path.container.openingElement.loc;
  31089. if (!location) {
  31090. return;
  31091. }
  31092. var attributes = path.container.openingElement.attributes;
  31093. for (var i = 0; i < attributes.length; i++) {
  31094. var name = attributes[i].name;
  31095. if (name && name.name === TRACE_ID) {
  31096. return;
  31097. }
  31098. }
  31099. if (!state.fileNameIdentifier) {
  31100. var fileName = state.file.log.filename !== "unknown" ? state.file.log.filename : null;
  31101. var fileNameIdentifier = path.scope.generateUidIdentifier(FILE_NAME_VAR);
  31102. path.hub.file.scope.push({ id: fileNameIdentifier, init: t.stringLiteral(fileName) });
  31103. state.fileNameIdentifier = fileNameIdentifier;
  31104. }
  31105. var trace = makeTrace(state.fileNameIdentifier, location.start.line);
  31106. attributes.push(t.jSXAttribute(id, t.jSXExpressionContainer(trace)));
  31107. }
  31108. };
  31109. return {
  31110. visitor: visitor
  31111. };
  31112. };
  31113. var TRACE_ID = "__source";
  31114. var FILE_NAME_VAR = "_jsxFileName";
  31115. module.exports = exports["default"];
  31116. /***/ }),
  31117. /* 351 */
  31118. 348,
  31119. /* 352 */
  31120. /***/ (function(module, exports) {
  31121. "use strict";
  31122. module.exports = {
  31123. builtins: {
  31124. Symbol: "symbol",
  31125. Promise: "promise",
  31126. Map: "map",
  31127. WeakMap: "weak-map",
  31128. Set: "set",
  31129. WeakSet: "weak-set",
  31130. Observable: "observable",
  31131. setImmediate: "set-immediate",
  31132. clearImmediate: "clear-immediate",
  31133. asap: "asap"
  31134. },
  31135. methods: {
  31136. Array: {
  31137. concat: "array/concat",
  31138. copyWithin: "array/copy-within",
  31139. entries: "array/entries",
  31140. every: "array/every",
  31141. fill: "array/fill",
  31142. filter: "array/filter",
  31143. findIndex: "array/find-index",
  31144. find: "array/find",
  31145. forEach: "array/for-each",
  31146. from: "array/from",
  31147. includes: "array/includes",
  31148. indexOf: "array/index-of",
  31149. join: "array/join",
  31150. keys: "array/keys",
  31151. lastIndexOf: "array/last-index-of",
  31152. map: "array/map",
  31153. of: "array/of",
  31154. pop: "array/pop",
  31155. push: "array/push",
  31156. reduceRight: "array/reduce-right",
  31157. reduce: "array/reduce",
  31158. reverse: "array/reverse",
  31159. shift: "array/shift",
  31160. slice: "array/slice",
  31161. some: "array/some",
  31162. sort: "array/sort",
  31163. splice: "array/splice",
  31164. unshift: "array/unshift",
  31165. values: "array/values"
  31166. },
  31167. JSON: {
  31168. stringify: "json/stringify"
  31169. },
  31170. Object: {
  31171. assign: "object/assign",
  31172. create: "object/create",
  31173. defineProperties: "object/define-properties",
  31174. defineProperty: "object/define-property",
  31175. entries: "object/entries",
  31176. freeze: "object/freeze",
  31177. getOwnPropertyDescriptor: "object/get-own-property-descriptor",
  31178. getOwnPropertyDescriptors: "object/get-own-property-descriptors",
  31179. getOwnPropertyNames: "object/get-own-property-names",
  31180. getOwnPropertySymbols: "object/get-own-property-symbols",
  31181. getPrototypeOf: "object/get-prototype-of",
  31182. isExtensible: "object/is-extensible",
  31183. isFrozen: "object/is-frozen",
  31184. isSealed: "object/is-sealed",
  31185. is: "object/is",
  31186. keys: "object/keys",
  31187. preventExtensions: "object/prevent-extensions",
  31188. seal: "object/seal",
  31189. setPrototypeOf: "object/set-prototype-of",
  31190. values: "object/values"
  31191. },
  31192. RegExp: {
  31193. escape: "regexp/escape" },
  31194. Math: {
  31195. acosh: "math/acosh",
  31196. asinh: "math/asinh",
  31197. atanh: "math/atanh",
  31198. cbrt: "math/cbrt",
  31199. clz32: "math/clz32",
  31200. cosh: "math/cosh",
  31201. expm1: "math/expm1",
  31202. fround: "math/fround",
  31203. hypot: "math/hypot",
  31204. imul: "math/imul",
  31205. log10: "math/log10",
  31206. log1p: "math/log1p",
  31207. log2: "math/log2",
  31208. sign: "math/sign",
  31209. sinh: "math/sinh",
  31210. tanh: "math/tanh",
  31211. trunc: "math/trunc",
  31212. iaddh: "math/iaddh",
  31213. isubh: "math/isubh",
  31214. imulh: "math/imulh",
  31215. umulh: "math/umulh"
  31216. },
  31217. Symbol: {
  31218. for: "symbol/for",
  31219. hasInstance: "symbol/has-instance",
  31220. isConcatSpreadable: "symbol/is-concat-spreadable",
  31221. iterator: "symbol/iterator",
  31222. keyFor: "symbol/key-for",
  31223. match: "symbol/match",
  31224. replace: "symbol/replace",
  31225. search: "symbol/search",
  31226. species: "symbol/species",
  31227. split: "symbol/split",
  31228. toPrimitive: "symbol/to-primitive",
  31229. toStringTag: "symbol/to-string-tag",
  31230. unscopables: "symbol/unscopables"
  31231. },
  31232. String: {
  31233. at: "string/at",
  31234. codePointAt: "string/code-point-at",
  31235. endsWith: "string/ends-with",
  31236. fromCodePoint: "string/from-code-point",
  31237. includes: "string/includes",
  31238. matchAll: "string/match-all",
  31239. padLeft: "string/pad-left",
  31240. padRight: "string/pad-right",
  31241. padStart: "string/pad-start",
  31242. padEnd: "string/pad-end",
  31243. raw: "string/raw",
  31244. repeat: "string/repeat",
  31245. startsWith: "string/starts-with",
  31246. trim: "string/trim",
  31247. trimLeft: "string/trim-left",
  31248. trimRight: "string/trim-right",
  31249. trimStart: "string/trim-start",
  31250. trimEnd: "string/trim-end"
  31251. },
  31252. Number: {
  31253. EPSILON: "number/epsilon",
  31254. isFinite: "number/is-finite",
  31255. isInteger: "number/is-integer",
  31256. isNaN: "number/is-nan",
  31257. isSafeInteger: "number/is-safe-integer",
  31258. MAX_SAFE_INTEGER: "number/max-safe-integer",
  31259. MIN_SAFE_INTEGER: "number/min-safe-integer",
  31260. parseFloat: "number/parse-float",
  31261. parseInt: "number/parse-int"
  31262. },
  31263. Reflect: {
  31264. apply: "reflect/apply",
  31265. construct: "reflect/construct",
  31266. defineProperty: "reflect/define-property",
  31267. deleteProperty: "reflect/delete-property",
  31268. enumerate: "reflect/enumerate",
  31269. getOwnPropertyDescriptor: "reflect/get-own-property-descriptor",
  31270. getPrototypeOf: "reflect/get-prototype-of",
  31271. get: "reflect/get",
  31272. has: "reflect/has",
  31273. isExtensible: "reflect/is-extensible",
  31274. ownKeys: "reflect/own-keys",
  31275. preventExtensions: "reflect/prevent-extensions",
  31276. setPrototypeOf: "reflect/set-prototype-of",
  31277. set: "reflect/set",
  31278. defineMetadata: "reflect/define-metadata",
  31279. deleteMetadata: "reflect/delete-metadata",
  31280. getMetadata: "reflect/get-metadata",
  31281. getMetadataKeys: "reflect/get-metadata-keys",
  31282. getOwnMetadata: "reflect/get-own-metadata",
  31283. getOwnMetadataKeys: "reflect/get-own-metadata-keys",
  31284. hasMetadata: "reflect/has-metadata",
  31285. hasOwnMetadata: "reflect/has-own-metadata",
  31286. metadata: "reflect/metadata"
  31287. },
  31288. System: {
  31289. global: "system/global"
  31290. },
  31291. Error: {
  31292. isError: "error/is-error" },
  31293. Date: {},
  31294. Function: {}
  31295. }
  31296. };
  31297. /***/ }),
  31298. /* 353 */
  31299. /***/ (function(module, exports, __webpack_require__) {
  31300. "use strict";
  31301. exports.__esModule = true;
  31302. exports.definitions = undefined;
  31303. exports.default = function (_ref) {
  31304. var t = _ref.types;
  31305. function getRuntimeModuleName(opts) {
  31306. return opts.moduleName || "babel-runtime";
  31307. }
  31308. function has(obj, key) {
  31309. return Object.prototype.hasOwnProperty.call(obj, key);
  31310. }
  31311. var HELPER_BLACKLIST = ["interopRequireWildcard", "interopRequireDefault"];
  31312. return {
  31313. pre: function pre(file) {
  31314. var moduleName = getRuntimeModuleName(this.opts);
  31315. if (this.opts.helpers !== false) {
  31316. file.set("helperGenerator", function (name) {
  31317. if (HELPER_BLACKLIST.indexOf(name) < 0) {
  31318. return file.addImport(moduleName + "/helpers/" + name, "default", name);
  31319. }
  31320. });
  31321. }
  31322. this.setDynamic("regeneratorIdentifier", function () {
  31323. return file.addImport(moduleName + "/regenerator", "default", "regeneratorRuntime");
  31324. });
  31325. },
  31326. visitor: {
  31327. ReferencedIdentifier: function ReferencedIdentifier(path, state) {
  31328. var node = path.node,
  31329. parent = path.parent,
  31330. scope = path.scope;
  31331. if (node.name === "regeneratorRuntime" && state.opts.regenerator !== false) {
  31332. path.replaceWith(state.get("regeneratorIdentifier"));
  31333. return;
  31334. }
  31335. if (state.opts.polyfill === false) return;
  31336. if (t.isMemberExpression(parent)) return;
  31337. if (!has(_definitions2.default.builtins, node.name)) return;
  31338. if (scope.getBindingIdentifier(node.name)) return;
  31339. var moduleName = getRuntimeModuleName(state.opts);
  31340. path.replaceWith(state.addImport(moduleName + "/core-js/" + _definitions2.default.builtins[node.name], "default", node.name));
  31341. },
  31342. CallExpression: function CallExpression(path, state) {
  31343. if (state.opts.polyfill === false) return;
  31344. if (path.node.arguments.length) return;
  31345. var callee = path.node.callee;
  31346. if (!t.isMemberExpression(callee)) return;
  31347. if (!callee.computed) return;
  31348. if (!path.get("callee.property").matchesPattern("Symbol.iterator")) return;
  31349. var moduleName = getRuntimeModuleName(state.opts);
  31350. path.replaceWith(t.callExpression(state.addImport(moduleName + "/core-js/get-iterator", "default", "getIterator"), [callee.object]));
  31351. },
  31352. BinaryExpression: function BinaryExpression(path, state) {
  31353. if (state.opts.polyfill === false) return;
  31354. if (path.node.operator !== "in") return;
  31355. if (!path.get("left").matchesPattern("Symbol.iterator")) return;
  31356. var moduleName = getRuntimeModuleName(state.opts);
  31357. path.replaceWith(t.callExpression(state.addImport(moduleName + "/core-js/is-iterable", "default", "isIterable"), [path.node.right]));
  31358. },
  31359. MemberExpression: {
  31360. enter: function enter(path, state) {
  31361. if (state.opts.polyfill === false) return;
  31362. if (!path.isReferenced()) return;
  31363. var node = path.node;
  31364. var obj = node.object;
  31365. var prop = node.property;
  31366. if (!t.isReferenced(obj, node)) return;
  31367. if (node.computed) return;
  31368. if (!has(_definitions2.default.methods, obj.name)) return;
  31369. var methods = _definitions2.default.methods[obj.name];
  31370. if (!has(methods, prop.name)) return;
  31371. if (path.scope.getBindingIdentifier(obj.name)) return;
  31372. if (obj.name === "Object" && prop.name === "defineProperty" && path.parentPath.isCallExpression()) {
  31373. var call = path.parentPath.node;
  31374. if (call.arguments.length === 3 && t.isLiteral(call.arguments[1])) return;
  31375. }
  31376. var moduleName = getRuntimeModuleName(state.opts);
  31377. path.replaceWith(state.addImport(moduleName + "/core-js/" + methods[prop.name], "default", obj.name + "$" + prop.name));
  31378. },
  31379. exit: function exit(path, state) {
  31380. if (state.opts.polyfill === false) return;
  31381. if (!path.isReferenced()) return;
  31382. var node = path.node;
  31383. var obj = node.object;
  31384. if (!has(_definitions2.default.builtins, obj.name)) return;
  31385. if (path.scope.getBindingIdentifier(obj.name)) return;
  31386. var moduleName = getRuntimeModuleName(state.opts);
  31387. path.replaceWith(t.memberExpression(state.addImport(moduleName + "/core-js/" + _definitions2.default.builtins[obj.name], "default", obj.name), node.property, node.computed));
  31388. }
  31389. }
  31390. }
  31391. };
  31392. };
  31393. var _definitions = __webpack_require__(352);
  31394. var _definitions2 = _interopRequireDefault(_definitions);
  31395. function _interopRequireDefault(obj) {
  31396. return obj && obj.__esModule ? obj : { default: obj };
  31397. }
  31398. exports.definitions = _definitions2.default;
  31399. /***/ }),
  31400. /* 354 */
  31401. /***/ (function(module, exports, __webpack_require__) {
  31402. "use strict";
  31403. exports.__esModule = true;
  31404. exports.default = function (_ref) {
  31405. var messages = _ref.messages;
  31406. return {
  31407. visitor: {
  31408. ReferencedIdentifier: function ReferencedIdentifier(path) {
  31409. var node = path.node,
  31410. scope = path.scope;
  31411. var binding = scope.getBinding(node.name);
  31412. if (binding && binding.kind === "type" && !path.parentPath.isFlow()) {
  31413. throw path.buildCodeFrameError(messages.get("undeclaredVariableType", node.name), ReferenceError);
  31414. }
  31415. if (scope.hasBinding(node.name)) return;
  31416. var bindings = scope.getAllBindings();
  31417. var closest = void 0;
  31418. var shortest = -1;
  31419. for (var name in bindings) {
  31420. var distance = (0, _leven2.default)(node.name, name);
  31421. if (distance <= 0 || distance > 3) continue;
  31422. if (distance <= shortest) continue;
  31423. closest = name;
  31424. shortest = distance;
  31425. }
  31426. var msg = void 0;
  31427. if (closest) {
  31428. msg = messages.get("undeclaredVariableSuggestion", node.name, closest);
  31429. } else {
  31430. msg = messages.get("undeclaredVariable", node.name);
  31431. }
  31432. throw path.buildCodeFrameError(msg, ReferenceError);
  31433. }
  31434. }
  31435. };
  31436. };
  31437. var _leven = __webpack_require__(471);
  31438. var _leven2 = _interopRequireDefault(_leven);
  31439. function _interopRequireDefault(obj) {
  31440. return obj && obj.__esModule ? obj : { default: obj };
  31441. }
  31442. module.exports = exports["default"];
  31443. /***/ }),
  31444. /* 355 */
  31445. /***/ (function(module, exports, __webpack_require__) {
  31446. "use strict";
  31447. exports.__esModule = true;
  31448. var _babelPluginTransformFlowStripTypes = __webpack_require__(211);
  31449. var _babelPluginTransformFlowStripTypes2 = _interopRequireDefault(_babelPluginTransformFlowStripTypes);
  31450. function _interopRequireDefault(obj) {
  31451. return obj && obj.__esModule ? obj : { default: obj };
  31452. }
  31453. exports.default = {
  31454. plugins: [_babelPluginTransformFlowStripTypes2.default]
  31455. };
  31456. module.exports = exports["default"];
  31457. /***/ }),
  31458. /* 356 */
  31459. /***/ (function(module, exports, __webpack_require__) {
  31460. "use strict";
  31461. exports.__esModule = true;
  31462. exports.default = function (context) {
  31463. var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  31464. return {
  31465. presets: [opts.es2015 !== false && [_babelPresetEs2.default.buildPreset, opts.es2015], opts.es2016 !== false && _babelPresetEs4.default, opts.es2017 !== false && _babelPresetEs6.default].filter(Boolean) };
  31466. };
  31467. var _babelPresetEs = __webpack_require__(217);
  31468. var _babelPresetEs2 = _interopRequireDefault(_babelPresetEs);
  31469. var _babelPresetEs3 = __webpack_require__(218);
  31470. var _babelPresetEs4 = _interopRequireDefault(_babelPresetEs3);
  31471. var _babelPresetEs5 = __webpack_require__(219);
  31472. var _babelPresetEs6 = _interopRequireDefault(_babelPresetEs5);
  31473. function _interopRequireDefault(obj) {
  31474. return obj && obj.__esModule ? obj : { default: obj };
  31475. }
  31476. module.exports = exports["default"];
  31477. /***/ }),
  31478. /* 357 */
  31479. /***/ (function(module, exports, __webpack_require__) {
  31480. "use strict";
  31481. exports.__esModule = true;
  31482. var _babelPresetFlow = __webpack_require__(355);
  31483. var _babelPresetFlow2 = _interopRequireDefault(_babelPresetFlow);
  31484. var _babelPluginTransformReactJsx = __webpack_require__(215);
  31485. var _babelPluginTransformReactJsx2 = _interopRequireDefault(_babelPluginTransformReactJsx);
  31486. var _babelPluginSyntaxJsx = __webpack_require__(127);
  31487. var _babelPluginSyntaxJsx2 = _interopRequireDefault(_babelPluginSyntaxJsx);
  31488. var _babelPluginTransformReactDisplayName = __webpack_require__(214);
  31489. var _babelPluginTransformReactDisplayName2 = _interopRequireDefault(_babelPluginTransformReactDisplayName);
  31490. function _interopRequireDefault(obj) {
  31491. return obj && obj.__esModule ? obj : { default: obj };
  31492. }
  31493. exports.default = {
  31494. presets: [_babelPresetFlow2.default],
  31495. plugins: [_babelPluginTransformReactJsx2.default, _babelPluginSyntaxJsx2.default, _babelPluginTransformReactDisplayName2.default],
  31496. env: {
  31497. development: {
  31498. plugins: []
  31499. }
  31500. }
  31501. };
  31502. module.exports = exports["default"];
  31503. /***/ }),
  31504. /* 358 */
  31505. /***/ (function(module, exports, __webpack_require__) {
  31506. "use strict";
  31507. exports.__esModule = true;
  31508. var _babelPresetStage = __webpack_require__(220);
  31509. var _babelPresetStage2 = _interopRequireDefault(_babelPresetStage);
  31510. var _babelPluginTransformDoExpressions = __webpack_require__(206);
  31511. var _babelPluginTransformDoExpressions2 = _interopRequireDefault(_babelPluginTransformDoExpressions);
  31512. var _babelPluginTransformFunctionBind = __webpack_require__(212);
  31513. var _babelPluginTransformFunctionBind2 = _interopRequireDefault(_babelPluginTransformFunctionBind);
  31514. function _interopRequireDefault(obj) {
  31515. return obj && obj.__esModule ? obj : { default: obj };
  31516. }
  31517. exports.default = {
  31518. presets: [_babelPresetStage2.default],
  31519. plugins: [_babelPluginTransformDoExpressions2.default, _babelPluginTransformFunctionBind2.default]
  31520. };
  31521. module.exports = exports["default"];
  31522. /***/ }),
  31523. /* 359 */
  31524. /***/ (function(module, exports, __webpack_require__) {
  31525. "use strict";
  31526. module.exports = { "default": __webpack_require__(407), __esModule: true };
  31527. /***/ }),
  31528. /* 360 */
  31529. /***/ (function(module, exports, __webpack_require__) {
  31530. "use strict";
  31531. module.exports = { "default": __webpack_require__(410), __esModule: true };
  31532. /***/ }),
  31533. /* 361 */
  31534. /***/ (function(module, exports, __webpack_require__) {
  31535. "use strict";
  31536. module.exports = { "default": __webpack_require__(412), __esModule: true };
  31537. /***/ }),
  31538. /* 362 */
  31539. /***/ (function(module, exports, __webpack_require__) {
  31540. "use strict";
  31541. module.exports = { "default": __webpack_require__(413), __esModule: true };
  31542. /***/ }),
  31543. /* 363 */
  31544. /***/ (function(module, exports, __webpack_require__) {
  31545. "use strict";
  31546. module.exports = { "default": __webpack_require__(415), __esModule: true };
  31547. /***/ }),
  31548. /* 364 */
  31549. /***/ (function(module, exports, __webpack_require__) {
  31550. "use strict";
  31551. module.exports = { "default": __webpack_require__(416), __esModule: true };
  31552. /***/ }),
  31553. /* 365 */
  31554. /***/ (function(module, exports, __webpack_require__) {
  31555. "use strict";
  31556. module.exports = { "default": __webpack_require__(417), __esModule: true };
  31557. /***/ }),
  31558. /* 366 */
  31559. /***/ (function(module, exports) {
  31560. "use strict";
  31561. exports.__esModule = true;
  31562. exports.default = function (obj, keys) {
  31563. var target = {};
  31564. for (var i in obj) {
  31565. if (keys.indexOf(i) >= 0) continue;
  31566. if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;
  31567. target[i] = obj[i];
  31568. }
  31569. return target;
  31570. };
  31571. /***/ }),
  31572. /* 367 */
  31573. /***/ (function(module, exports, __webpack_require__) {
  31574. "use strict";
  31575. exports.__esModule = true;
  31576. var _getIterator2 = __webpack_require__(2);
  31577. var _getIterator3 = _interopRequireDefault(_getIterator2);
  31578. var _classCallCheck2 = __webpack_require__(3);
  31579. var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
  31580. var _path2 = __webpack_require__(36);
  31581. var _path3 = _interopRequireDefault(_path2);
  31582. var _babelTypes = __webpack_require__(1);
  31583. var t = _interopRequireWildcard(_babelTypes);
  31584. function _interopRequireWildcard(obj) {
  31585. if (obj && obj.__esModule) {
  31586. return obj;
  31587. } else {
  31588. var newObj = {};if (obj != null) {
  31589. for (var key in obj) {
  31590. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  31591. }
  31592. }newObj.default = obj;return newObj;
  31593. }
  31594. }
  31595. function _interopRequireDefault(obj) {
  31596. return obj && obj.__esModule ? obj : { default: obj };
  31597. }
  31598. var testing = ("production") === "test";
  31599. var TraversalContext = function () {
  31600. function TraversalContext(scope, opts, state, parentPath) {
  31601. (0, _classCallCheck3.default)(this, TraversalContext);
  31602. this.queue = null;
  31603. this.parentPath = parentPath;
  31604. this.scope = scope;
  31605. this.state = state;
  31606. this.opts = opts;
  31607. }
  31608. TraversalContext.prototype.shouldVisit = function shouldVisit(node) {
  31609. var opts = this.opts;
  31610. if (opts.enter || opts.exit) return true;
  31611. if (opts[node.type]) return true;
  31612. var keys = t.VISITOR_KEYS[node.type];
  31613. if (!keys || !keys.length) return false;
  31614. for (var _iterator = keys, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
  31615. var _ref;
  31616. if (_isArray) {
  31617. if (_i >= _iterator.length) break;
  31618. _ref = _iterator[_i++];
  31619. } else {
  31620. _i = _iterator.next();
  31621. if (_i.done) break;
  31622. _ref = _i.value;
  31623. }
  31624. var key = _ref;
  31625. if (node[key]) return true;
  31626. }
  31627. return false;
  31628. };
  31629. TraversalContext.prototype.create = function create(node, obj, key, listKey) {
  31630. return _path3.default.get({
  31631. parentPath: this.parentPath,
  31632. parent: node,
  31633. container: obj,
  31634. key: key,
  31635. listKey: listKey
  31636. });
  31637. };
  31638. TraversalContext.prototype.maybeQueue = function maybeQueue(path, notPriority) {
  31639. if (this.trap) {
  31640. throw new Error("Infinite cycle detected");
  31641. }
  31642. if (this.queue) {
  31643. if (notPriority) {
  31644. this.queue.push(path);
  31645. } else {
  31646. this.priorityQueue.push(path);
  31647. }
  31648. }
  31649. };
  31650. TraversalContext.prototype.visitMultiple = function visitMultiple(container, parent, listKey) {
  31651. if (container.length === 0) return false;
  31652. var queue = [];
  31653. for (var key = 0; key < container.length; key++) {
  31654. var node = container[key];
  31655. if (node && this.shouldVisit(node)) {
  31656. queue.push(this.create(parent, container, key, listKey));
  31657. }
  31658. }
  31659. return this.visitQueue(queue);
  31660. };
  31661. TraversalContext.prototype.visitSingle = function visitSingle(node, key) {
  31662. if (this.shouldVisit(node[key])) {
  31663. return this.visitQueue([this.create(node, node, key)]);
  31664. } else {
  31665. return false;
  31666. }
  31667. };
  31668. TraversalContext.prototype.visitQueue = function visitQueue(queue) {
  31669. this.queue = queue;
  31670. this.priorityQueue = [];
  31671. var visited = [];
  31672. var stop = false;
  31673. for (var _iterator2 = queue, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) {
  31674. var _ref2;
  31675. if (_isArray2) {
  31676. if (_i2 >= _iterator2.length) break;
  31677. _ref2 = _iterator2[_i2++];
  31678. } else {
  31679. _i2 = _iterator2.next();
  31680. if (_i2.done) break;
  31681. _ref2 = _i2.value;
  31682. }
  31683. var path = _ref2;
  31684. path.resync();
  31685. if (path.contexts.length === 0 || path.contexts[path.contexts.length - 1] !== this) {
  31686. path.pushContext(this);
  31687. }
  31688. if (path.key === null) continue;
  31689. if (testing && queue.length >= 10000) {
  31690. this.trap = true;
  31691. }
  31692. if (visited.indexOf(path.node) >= 0) continue;
  31693. visited.push(path.node);
  31694. if (path.visit()) {
  31695. stop = true;
  31696. break;
  31697. }
  31698. if (this.priorityQueue.length) {
  31699. stop = this.visitQueue(this.priorityQueue);
  31700. this.priorityQueue = [];
  31701. this.queue = queue;
  31702. if (stop) break;
  31703. }
  31704. }
  31705. for (var _iterator3 = queue, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) {
  31706. var _ref3;
  31707. if (_isArray3) {
  31708. if (_i3 >= _iterator3.length) break;
  31709. _ref3 = _iterator3[_i3++];
  31710. } else {
  31711. _i3 = _iterator3.next();
  31712. if (_i3.done) break;
  31713. _ref3 = _i3.value;
  31714. }
  31715. var _path = _ref3;
  31716. _path.popContext();
  31717. }
  31718. this.queue = null;
  31719. return stop;
  31720. };
  31721. TraversalContext.prototype.visit = function visit(node, key) {
  31722. var nodes = node[key];
  31723. if (!nodes) return false;
  31724. if (Array.isArray(nodes)) {
  31725. return this.visitMultiple(nodes, node, key);
  31726. } else {
  31727. return this.visitSingle(node, key);
  31728. }
  31729. };
  31730. return TraversalContext;
  31731. }();
  31732. exports.default = TraversalContext;
  31733. module.exports = exports["default"];
  31734. /***/ }),
  31735. /* 368 */
  31736. /***/ (function(module, exports, __webpack_require__) {
  31737. "use strict";
  31738. exports.__esModule = true;
  31739. var _getIterator2 = __webpack_require__(2);
  31740. var _getIterator3 = _interopRequireDefault(_getIterator2);
  31741. exports.findParent = findParent;
  31742. exports.find = find;
  31743. exports.getFunctionParent = getFunctionParent;
  31744. exports.getStatementParent = getStatementParent;
  31745. exports.getEarliestCommonAncestorFrom = getEarliestCommonAncestorFrom;
  31746. exports.getDeepestCommonAncestorFrom = getDeepestCommonAncestorFrom;
  31747. exports.getAncestry = getAncestry;
  31748. exports.isAncestor = isAncestor;
  31749. exports.isDescendant = isDescendant;
  31750. exports.inType = inType;
  31751. exports.inShadow = inShadow;
  31752. var _babelTypes = __webpack_require__(1);
  31753. var t = _interopRequireWildcard(_babelTypes);
  31754. var _index = __webpack_require__(36);
  31755. var _index2 = _interopRequireDefault(_index);
  31756. function _interopRequireWildcard(obj) {
  31757. if (obj && obj.__esModule) {
  31758. return obj;
  31759. } else {
  31760. var newObj = {};if (obj != null) {
  31761. for (var key in obj) {
  31762. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  31763. }
  31764. }newObj.default = obj;return newObj;
  31765. }
  31766. }
  31767. function _interopRequireDefault(obj) {
  31768. return obj && obj.__esModule ? obj : { default: obj };
  31769. }
  31770. function findParent(callback) {
  31771. var path = this;
  31772. while (path = path.parentPath) {
  31773. if (callback(path)) return path;
  31774. }
  31775. return null;
  31776. }
  31777. function find(callback) {
  31778. var path = this;
  31779. do {
  31780. if (callback(path)) return path;
  31781. } while (path = path.parentPath);
  31782. return null;
  31783. }
  31784. function getFunctionParent() {
  31785. return this.findParent(function (path) {
  31786. return path.isFunction() || path.isProgram();
  31787. });
  31788. }
  31789. function getStatementParent() {
  31790. var path = this;
  31791. do {
  31792. if (Array.isArray(path.container)) {
  31793. return path;
  31794. }
  31795. } while (path = path.parentPath);
  31796. }
  31797. function getEarliestCommonAncestorFrom(paths) {
  31798. return this.getDeepestCommonAncestorFrom(paths, function (deepest, i, ancestries) {
  31799. var earliest = void 0;
  31800. var keys = t.VISITOR_KEYS[deepest.type];
  31801. for (var _iterator = ancestries, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
  31802. var _ref;
  31803. if (_isArray) {
  31804. if (_i >= _iterator.length) break;
  31805. _ref = _iterator[_i++];
  31806. } else {
  31807. _i = _iterator.next();
  31808. if (_i.done) break;
  31809. _ref = _i.value;
  31810. }
  31811. var ancestry = _ref;
  31812. var path = ancestry[i + 1];
  31813. if (!earliest) {
  31814. earliest = path;
  31815. continue;
  31816. }
  31817. if (path.listKey && earliest.listKey === path.listKey) {
  31818. if (path.key < earliest.key) {
  31819. earliest = path;
  31820. continue;
  31821. }
  31822. }
  31823. var earliestKeyIndex = keys.indexOf(earliest.parentKey);
  31824. var currentKeyIndex = keys.indexOf(path.parentKey);
  31825. if (earliestKeyIndex > currentKeyIndex) {
  31826. earliest = path;
  31827. }
  31828. }
  31829. return earliest;
  31830. });
  31831. }
  31832. function getDeepestCommonAncestorFrom(paths, filter) {
  31833. var _this = this;
  31834. if (!paths.length) {
  31835. return this;
  31836. }
  31837. if (paths.length === 1) {
  31838. return paths[0];
  31839. }
  31840. var minDepth = Infinity;
  31841. var lastCommonIndex = void 0,
  31842. lastCommon = void 0;
  31843. var ancestries = paths.map(function (path) {
  31844. var ancestry = [];
  31845. do {
  31846. ancestry.unshift(path);
  31847. } while ((path = path.parentPath) && path !== _this);
  31848. if (ancestry.length < minDepth) {
  31849. minDepth = ancestry.length;
  31850. }
  31851. return ancestry;
  31852. });
  31853. var first = ancestries[0];
  31854. depthLoop: for (var i = 0; i < minDepth; i++) {
  31855. var shouldMatch = first[i];
  31856. for (var _iterator2 = ancestries, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) {
  31857. var _ref2;
  31858. if (_isArray2) {
  31859. if (_i2 >= _iterator2.length) break;
  31860. _ref2 = _iterator2[_i2++];
  31861. } else {
  31862. _i2 = _iterator2.next();
  31863. if (_i2.done) break;
  31864. _ref2 = _i2.value;
  31865. }
  31866. var ancestry = _ref2;
  31867. if (ancestry[i] !== shouldMatch) {
  31868. break depthLoop;
  31869. }
  31870. }
  31871. lastCommonIndex = i;
  31872. lastCommon = shouldMatch;
  31873. }
  31874. if (lastCommon) {
  31875. if (filter) {
  31876. return filter(lastCommon, lastCommonIndex, ancestries);
  31877. } else {
  31878. return lastCommon;
  31879. }
  31880. } else {
  31881. throw new Error("Couldn't find intersection");
  31882. }
  31883. }
  31884. function getAncestry() {
  31885. var path = this;
  31886. var paths = [];
  31887. do {
  31888. paths.push(path);
  31889. } while (path = path.parentPath);
  31890. return paths;
  31891. }
  31892. function isAncestor(maybeDescendant) {
  31893. return maybeDescendant.isDescendant(this);
  31894. }
  31895. function isDescendant(maybeAncestor) {
  31896. return !!this.findParent(function (parent) {
  31897. return parent === maybeAncestor;
  31898. });
  31899. }
  31900. function inType() {
  31901. var path = this;
  31902. while (path) {
  31903. for (var _iterator3 = arguments, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) {
  31904. var _ref3;
  31905. if (_isArray3) {
  31906. if (_i3 >= _iterator3.length) break;
  31907. _ref3 = _iterator3[_i3++];
  31908. } else {
  31909. _i3 = _iterator3.next();
  31910. if (_i3.done) break;
  31911. _ref3 = _i3.value;
  31912. }
  31913. var type = _ref3;
  31914. if (path.node.type === type) return true;
  31915. }
  31916. path = path.parentPath;
  31917. }
  31918. return false;
  31919. }
  31920. function inShadow(key) {
  31921. var parentFn = this.isFunction() ? this : this.findParent(function (p) {
  31922. return p.isFunction();
  31923. });
  31924. if (!parentFn) return;
  31925. if (parentFn.isFunctionExpression() || parentFn.isFunctionDeclaration()) {
  31926. var shadow = parentFn.node.shadow;
  31927. if (shadow && (!key || shadow[key] !== false)) {
  31928. return parentFn;
  31929. }
  31930. } else if (parentFn.isArrowFunctionExpression()) {
  31931. return parentFn;
  31932. }
  31933. return null;
  31934. }
  31935. /***/ }),
  31936. /* 369 */
  31937. /***/ (function(module, exports) {
  31938. "use strict";
  31939. exports.__esModule = true;
  31940. exports.shareCommentsWithSiblings = shareCommentsWithSiblings;
  31941. exports.addComment = addComment;
  31942. exports.addComments = addComments;
  31943. function shareCommentsWithSiblings() {
  31944. if (typeof this.key === "string") return;
  31945. var node = this.node;
  31946. if (!node) return;
  31947. var trailing = node.trailingComments;
  31948. var leading = node.leadingComments;
  31949. if (!trailing && !leading) return;
  31950. var prev = this.getSibling(this.key - 1);
  31951. var next = this.getSibling(this.key + 1);
  31952. if (!prev.node) prev = next;
  31953. if (!next.node) next = prev;
  31954. prev.addComments("trailing", leading);
  31955. next.addComments("leading", trailing);
  31956. }
  31957. function addComment(type, content, line) {
  31958. this.addComments(type, [{
  31959. type: line ? "CommentLine" : "CommentBlock",
  31960. value: content
  31961. }]);
  31962. }
  31963. function addComments(type, comments) {
  31964. if (!comments) return;
  31965. var node = this.node;
  31966. if (!node) return;
  31967. var key = type + "Comments";
  31968. if (node[key]) {
  31969. node[key] = node[key].concat(comments);
  31970. } else {
  31971. node[key] = comments;
  31972. }
  31973. }
  31974. /***/ }),
  31975. /* 370 */
  31976. /***/ (function(module, exports, __webpack_require__) {
  31977. "use strict";
  31978. exports.__esModule = true;
  31979. var _getIterator2 = __webpack_require__(2);
  31980. var _getIterator3 = _interopRequireDefault(_getIterator2);
  31981. exports.call = call;
  31982. exports._call = _call;
  31983. exports.isBlacklisted = isBlacklisted;
  31984. exports.visit = visit;
  31985. exports.skip = skip;
  31986. exports.skipKey = skipKey;
  31987. exports.stop = stop;
  31988. exports.setScope = setScope;
  31989. exports.setContext = setContext;
  31990. exports.resync = resync;
  31991. exports._resyncParent = _resyncParent;
  31992. exports._resyncKey = _resyncKey;
  31993. exports._resyncList = _resyncList;
  31994. exports._resyncRemoved = _resyncRemoved;
  31995. exports.popContext = popContext;
  31996. exports.pushContext = pushContext;
  31997. exports.setup = setup;
  31998. exports.setKey = setKey;
  31999. exports.requeue = requeue;
  32000. exports._getQueueContexts = _getQueueContexts;
  32001. var _index = __webpack_require__(7);
  32002. var _index2 = _interopRequireDefault(_index);
  32003. function _interopRequireDefault(obj) {
  32004. return obj && obj.__esModule ? obj : { default: obj };
  32005. }
  32006. function call(key) {
  32007. var opts = this.opts;
  32008. this.debug(function () {
  32009. return key;
  32010. });
  32011. if (this.node) {
  32012. if (this._call(opts[key])) return true;
  32013. }
  32014. if (this.node) {
  32015. return this._call(opts[this.node.type] && opts[this.node.type][key]);
  32016. }
  32017. return false;
  32018. }
  32019. function _call(fns) {
  32020. if (!fns) return false;
  32021. for (var _iterator = fns, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
  32022. var _ref;
  32023. if (_isArray) {
  32024. if (_i >= _iterator.length) break;
  32025. _ref = _iterator[_i++];
  32026. } else {
  32027. _i = _iterator.next();
  32028. if (_i.done) break;
  32029. _ref = _i.value;
  32030. }
  32031. var fn = _ref;
  32032. if (!fn) continue;
  32033. var node = this.node;
  32034. if (!node) return true;
  32035. var ret = fn.call(this.state, this, this.state);
  32036. if (ret) throw new Error("Unexpected return value from visitor method " + fn);
  32037. if (this.node !== node) return true;
  32038. if (this.shouldStop || this.shouldSkip || this.removed) return true;
  32039. }
  32040. return false;
  32041. }
  32042. function isBlacklisted() {
  32043. var blacklist = this.opts.blacklist;
  32044. return blacklist && blacklist.indexOf(this.node.type) > -1;
  32045. }
  32046. function visit() {
  32047. if (!this.node) {
  32048. return false;
  32049. }
  32050. if (this.isBlacklisted()) {
  32051. return false;
  32052. }
  32053. if (this.opts.shouldSkip && this.opts.shouldSkip(this)) {
  32054. return false;
  32055. }
  32056. if (this.call("enter") || this.shouldSkip) {
  32057. this.debug(function () {
  32058. return "Skip...";
  32059. });
  32060. return this.shouldStop;
  32061. }
  32062. this.debug(function () {
  32063. return "Recursing into...";
  32064. });
  32065. _index2.default.node(this.node, this.opts, this.scope, this.state, this, this.skipKeys);
  32066. this.call("exit");
  32067. return this.shouldStop;
  32068. }
  32069. function skip() {
  32070. this.shouldSkip = true;
  32071. }
  32072. function skipKey(key) {
  32073. this.skipKeys[key] = true;
  32074. }
  32075. function stop() {
  32076. this.shouldStop = true;
  32077. this.shouldSkip = true;
  32078. }
  32079. function setScope() {
  32080. if (this.opts && this.opts.noScope) return;
  32081. var target = this.context && this.context.scope;
  32082. if (!target) {
  32083. var path = this.parentPath;
  32084. while (path && !target) {
  32085. if (path.opts && path.opts.noScope) return;
  32086. target = path.scope;
  32087. path = path.parentPath;
  32088. }
  32089. }
  32090. this.scope = this.getScope(target);
  32091. if (this.scope) this.scope.init();
  32092. }
  32093. function setContext(context) {
  32094. this.shouldSkip = false;
  32095. this.shouldStop = false;
  32096. this.removed = false;
  32097. this.skipKeys = {};
  32098. if (context) {
  32099. this.context = context;
  32100. this.state = context.state;
  32101. this.opts = context.opts;
  32102. }
  32103. this.setScope();
  32104. return this;
  32105. }
  32106. function resync() {
  32107. if (this.removed) return;
  32108. this._resyncParent();
  32109. this._resyncList();
  32110. this._resyncKey();
  32111. }
  32112. function _resyncParent() {
  32113. if (this.parentPath) {
  32114. this.parent = this.parentPath.node;
  32115. }
  32116. }
  32117. function _resyncKey() {
  32118. if (!this.container) return;
  32119. if (this.node === this.container[this.key]) return;
  32120. if (Array.isArray(this.container)) {
  32121. for (var i = 0; i < this.container.length; i++) {
  32122. if (this.container[i] === this.node) {
  32123. return this.setKey(i);
  32124. }
  32125. }
  32126. } else {
  32127. for (var key in this.container) {
  32128. if (this.container[key] === this.node) {
  32129. return this.setKey(key);
  32130. }
  32131. }
  32132. }
  32133. this.key = null;
  32134. }
  32135. function _resyncList() {
  32136. if (!this.parent || !this.inList) return;
  32137. var newContainer = this.parent[this.listKey];
  32138. if (this.container === newContainer) return;
  32139. this.container = newContainer || null;
  32140. }
  32141. function _resyncRemoved() {
  32142. if (this.key == null || !this.container || this.container[this.key] !== this.node) {
  32143. this._markRemoved();
  32144. }
  32145. }
  32146. function popContext() {
  32147. this.contexts.pop();
  32148. this.setContext(this.contexts[this.contexts.length - 1]);
  32149. }
  32150. function pushContext(context) {
  32151. this.contexts.push(context);
  32152. this.setContext(context);
  32153. }
  32154. function setup(parentPath, container, listKey, key) {
  32155. this.inList = !!listKey;
  32156. this.listKey = listKey;
  32157. this.parentKey = listKey || key;
  32158. this.container = container;
  32159. this.parentPath = parentPath || this.parentPath;
  32160. this.setKey(key);
  32161. }
  32162. function setKey(key) {
  32163. this.key = key;
  32164. this.node = this.container[this.key];
  32165. this.type = this.node && this.node.type;
  32166. }
  32167. function requeue() {
  32168. var pathToQueue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this;
  32169. if (pathToQueue.removed) return;
  32170. var contexts = this.contexts;
  32171. for (var _iterator2 = contexts, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) {
  32172. var _ref2;
  32173. if (_isArray2) {
  32174. if (_i2 >= _iterator2.length) break;
  32175. _ref2 = _iterator2[_i2++];
  32176. } else {
  32177. _i2 = _iterator2.next();
  32178. if (_i2.done) break;
  32179. _ref2 = _i2.value;
  32180. }
  32181. var context = _ref2;
  32182. context.maybeQueue(pathToQueue);
  32183. }
  32184. }
  32185. function _getQueueContexts() {
  32186. var path = this;
  32187. var contexts = this.contexts;
  32188. while (!contexts.length) {
  32189. path = path.parentPath;
  32190. contexts = path.contexts;
  32191. }
  32192. return contexts;
  32193. }
  32194. /***/ }),
  32195. /* 371 */
  32196. /***/ (function(module, exports, __webpack_require__) {
  32197. "use strict";
  32198. exports.__esModule = true;
  32199. exports.toComputedKey = toComputedKey;
  32200. exports.ensureBlock = ensureBlock;
  32201. exports.arrowFunctionToShadowed = arrowFunctionToShadowed;
  32202. var _babelTypes = __webpack_require__(1);
  32203. var t = _interopRequireWildcard(_babelTypes);
  32204. function _interopRequireWildcard(obj) {
  32205. if (obj && obj.__esModule) {
  32206. return obj;
  32207. } else {
  32208. var newObj = {};if (obj != null) {
  32209. for (var key in obj) {
  32210. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  32211. }
  32212. }newObj.default = obj;return newObj;
  32213. }
  32214. }
  32215. function toComputedKey() {
  32216. var node = this.node;
  32217. var key = void 0;
  32218. if (this.isMemberExpression()) {
  32219. key = node.property;
  32220. } else if (this.isProperty() || this.isMethod()) {
  32221. key = node.key;
  32222. } else {
  32223. throw new ReferenceError("todo");
  32224. }
  32225. if (!node.computed) {
  32226. if (t.isIdentifier(key)) key = t.stringLiteral(key.name);
  32227. }
  32228. return key;
  32229. }
  32230. function ensureBlock() {
  32231. return t.ensureBlock(this.node);
  32232. }
  32233. function arrowFunctionToShadowed() {
  32234. if (!this.isArrowFunctionExpression()) return;
  32235. this.ensureBlock();
  32236. var node = this.node;
  32237. node.expression = false;
  32238. node.type = "FunctionExpression";
  32239. node.shadow = node.shadow || true;
  32240. }
  32241. /***/ }),
  32242. /* 372 */
  32243. /***/ (function(module, exports, __webpack_require__) {
  32244. /* WEBPACK VAR INJECTION */(function(global) {"use strict";
  32245. exports.__esModule = true;
  32246. var _typeof2 = __webpack_require__(11);
  32247. var _typeof3 = _interopRequireDefault(_typeof2);
  32248. var _getIterator2 = __webpack_require__(2);
  32249. var _getIterator3 = _interopRequireDefault(_getIterator2);
  32250. var _map = __webpack_require__(133);
  32251. var _map2 = _interopRequireDefault(_map);
  32252. exports.evaluateTruthy = evaluateTruthy;
  32253. exports.evaluate = evaluate;
  32254. function _interopRequireDefault(obj) {
  32255. return obj && obj.__esModule ? obj : { default: obj };
  32256. }
  32257. var VALID_CALLEES = ["String", "Number", "Math"];
  32258. var INVALID_METHODS = ["random"];
  32259. function evaluateTruthy() {
  32260. var res = this.evaluate();
  32261. if (res.confident) return !!res.value;
  32262. }
  32263. function evaluate() {
  32264. var confident = true;
  32265. var deoptPath = void 0;
  32266. var seen = new _map2.default();
  32267. function deopt(path) {
  32268. if (!confident) return;
  32269. deoptPath = path;
  32270. confident = false;
  32271. }
  32272. var value = evaluate(this);
  32273. if (!confident) value = undefined;
  32274. return {
  32275. confident: confident,
  32276. deopt: deoptPath,
  32277. value: value
  32278. };
  32279. function evaluate(path) {
  32280. var node = path.node;
  32281. if (seen.has(node)) {
  32282. var existing = seen.get(node);
  32283. if (existing.resolved) {
  32284. return existing.value;
  32285. } else {
  32286. deopt(path);
  32287. return;
  32288. }
  32289. } else {
  32290. var item = { resolved: false };
  32291. seen.set(node, item);
  32292. var val = _evaluate(path);
  32293. if (confident) {
  32294. item.resolved = true;
  32295. item.value = val;
  32296. }
  32297. return val;
  32298. }
  32299. }
  32300. function _evaluate(path) {
  32301. if (!confident) return;
  32302. var node = path.node;
  32303. if (path.isSequenceExpression()) {
  32304. var exprs = path.get("expressions");
  32305. return evaluate(exprs[exprs.length - 1]);
  32306. }
  32307. if (path.isStringLiteral() || path.isNumericLiteral() || path.isBooleanLiteral()) {
  32308. return node.value;
  32309. }
  32310. if (path.isNullLiteral()) {
  32311. return null;
  32312. }
  32313. if (path.isTemplateLiteral()) {
  32314. var str = "";
  32315. var i = 0;
  32316. var _exprs = path.get("expressions");
  32317. for (var _iterator = node.quasis, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
  32318. var _ref;
  32319. if (_isArray) {
  32320. if (_i >= _iterator.length) break;
  32321. _ref = _iterator[_i++];
  32322. } else {
  32323. _i = _iterator.next();
  32324. if (_i.done) break;
  32325. _ref = _i.value;
  32326. }
  32327. var elem = _ref;
  32328. if (!confident) break;
  32329. str += elem.value.cooked;
  32330. var expr = _exprs[i++];
  32331. if (expr) str += String(evaluate(expr));
  32332. }
  32333. if (!confident) return;
  32334. return str;
  32335. }
  32336. if (path.isConditionalExpression()) {
  32337. var testResult = evaluate(path.get("test"));
  32338. if (!confident) return;
  32339. if (testResult) {
  32340. return evaluate(path.get("consequent"));
  32341. } else {
  32342. return evaluate(path.get("alternate"));
  32343. }
  32344. }
  32345. if (path.isExpressionWrapper()) {
  32346. return evaluate(path.get("expression"));
  32347. }
  32348. if (path.isMemberExpression() && !path.parentPath.isCallExpression({ callee: node })) {
  32349. var property = path.get("property");
  32350. var object = path.get("object");
  32351. if (object.isLiteral() && property.isIdentifier()) {
  32352. var _value = object.node.value;
  32353. var type = typeof _value === "undefined" ? "undefined" : (0, _typeof3.default)(_value);
  32354. if (type === "number" || type === "string") {
  32355. return _value[property.node.name];
  32356. }
  32357. }
  32358. }
  32359. if (path.isReferencedIdentifier()) {
  32360. var binding = path.scope.getBinding(node.name);
  32361. if (binding && binding.constantViolations.length > 0) {
  32362. return deopt(binding.path);
  32363. }
  32364. if (binding && path.node.start < binding.path.node.end) {
  32365. return deopt(binding.path);
  32366. }
  32367. if (binding && binding.hasValue) {
  32368. return binding.value;
  32369. } else {
  32370. if (node.name === "undefined") {
  32371. return binding ? deopt(binding.path) : undefined;
  32372. } else if (node.name === "Infinity") {
  32373. return binding ? deopt(binding.path) : Infinity;
  32374. } else if (node.name === "NaN") {
  32375. return binding ? deopt(binding.path) : NaN;
  32376. }
  32377. var resolved = path.resolve();
  32378. if (resolved === path) {
  32379. return deopt(path);
  32380. } else {
  32381. return evaluate(resolved);
  32382. }
  32383. }
  32384. }
  32385. if (path.isUnaryExpression({ prefix: true })) {
  32386. if (node.operator === "void") {
  32387. return undefined;
  32388. }
  32389. var argument = path.get("argument");
  32390. if (node.operator === "typeof" && (argument.isFunction() || argument.isClass())) {
  32391. return "function";
  32392. }
  32393. var arg = evaluate(argument);
  32394. if (!confident) return;
  32395. switch (node.operator) {
  32396. case "!":
  32397. return !arg;
  32398. case "+":
  32399. return +arg;
  32400. case "-":
  32401. return -arg;
  32402. case "~":
  32403. return ~arg;
  32404. case "typeof":
  32405. return typeof arg === "undefined" ? "undefined" : (0, _typeof3.default)(arg);
  32406. }
  32407. }
  32408. if (path.isArrayExpression()) {
  32409. var arr = [];
  32410. var elems = path.get("elements");
  32411. for (var _iterator2 = elems, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) {
  32412. var _ref2;
  32413. if (_isArray2) {
  32414. if (_i2 >= _iterator2.length) break;
  32415. _ref2 = _iterator2[_i2++];
  32416. } else {
  32417. _i2 = _iterator2.next();
  32418. if (_i2.done) break;
  32419. _ref2 = _i2.value;
  32420. }
  32421. var _elem = _ref2;
  32422. _elem = _elem.evaluate();
  32423. if (_elem.confident) {
  32424. arr.push(_elem.value);
  32425. } else {
  32426. return deopt(_elem);
  32427. }
  32428. }
  32429. return arr;
  32430. }
  32431. if (path.isObjectExpression()) {
  32432. var obj = {};
  32433. var props = path.get("properties");
  32434. for (var _iterator3 = props, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) {
  32435. var _ref3;
  32436. if (_isArray3) {
  32437. if (_i3 >= _iterator3.length) break;
  32438. _ref3 = _iterator3[_i3++];
  32439. } else {
  32440. _i3 = _iterator3.next();
  32441. if (_i3.done) break;
  32442. _ref3 = _i3.value;
  32443. }
  32444. var prop = _ref3;
  32445. if (prop.isObjectMethod() || prop.isSpreadProperty()) {
  32446. return deopt(prop);
  32447. }
  32448. var keyPath = prop.get("key");
  32449. var key = keyPath;
  32450. if (prop.node.computed) {
  32451. key = key.evaluate();
  32452. if (!key.confident) {
  32453. return deopt(keyPath);
  32454. }
  32455. key = key.value;
  32456. } else if (key.isIdentifier()) {
  32457. key = key.node.name;
  32458. } else {
  32459. key = key.node.value;
  32460. }
  32461. var valuePath = prop.get("value");
  32462. var _value2 = valuePath.evaluate();
  32463. if (!_value2.confident) {
  32464. return deopt(valuePath);
  32465. }
  32466. _value2 = _value2.value;
  32467. obj[key] = _value2;
  32468. }
  32469. return obj;
  32470. }
  32471. if (path.isLogicalExpression()) {
  32472. var wasConfident = confident;
  32473. var left = evaluate(path.get("left"));
  32474. var leftConfident = confident;
  32475. confident = wasConfident;
  32476. var right = evaluate(path.get("right"));
  32477. var rightConfident = confident;
  32478. confident = leftConfident && rightConfident;
  32479. switch (node.operator) {
  32480. case "||":
  32481. if (left && leftConfident) {
  32482. confident = true;
  32483. return left;
  32484. }
  32485. if (!confident) return;
  32486. return left || right;
  32487. case "&&":
  32488. if (!left && leftConfident || !right && rightConfident) {
  32489. confident = true;
  32490. }
  32491. if (!confident) return;
  32492. return left && right;
  32493. }
  32494. }
  32495. if (path.isBinaryExpression()) {
  32496. var _left = evaluate(path.get("left"));
  32497. if (!confident) return;
  32498. var _right = evaluate(path.get("right"));
  32499. if (!confident) return;
  32500. switch (node.operator) {
  32501. case "-":
  32502. return _left - _right;
  32503. case "+":
  32504. return _left + _right;
  32505. case "/":
  32506. return _left / _right;
  32507. case "*":
  32508. return _left * _right;
  32509. case "%":
  32510. return _left % _right;
  32511. case "**":
  32512. return Math.pow(_left, _right);
  32513. case "<":
  32514. return _left < _right;
  32515. case ">":
  32516. return _left > _right;
  32517. case "<=":
  32518. return _left <= _right;
  32519. case ">=":
  32520. return _left >= _right;
  32521. case "==":
  32522. return _left == _right;
  32523. case "!=":
  32524. return _left != _right;
  32525. case "===":
  32526. return _left === _right;
  32527. case "!==":
  32528. return _left !== _right;
  32529. case "|":
  32530. return _left | _right;
  32531. case "&":
  32532. return _left & _right;
  32533. case "^":
  32534. return _left ^ _right;
  32535. case "<<":
  32536. return _left << _right;
  32537. case ">>":
  32538. return _left >> _right;
  32539. case ">>>":
  32540. return _left >>> _right;
  32541. }
  32542. }
  32543. if (path.isCallExpression()) {
  32544. var callee = path.get("callee");
  32545. var context = void 0;
  32546. var func = void 0;
  32547. if (callee.isIdentifier() && !path.scope.getBinding(callee.node.name, true) && VALID_CALLEES.indexOf(callee.node.name) >= 0) {
  32548. func = global[node.callee.name];
  32549. }
  32550. if (callee.isMemberExpression()) {
  32551. var _object = callee.get("object");
  32552. var _property = callee.get("property");
  32553. if (_object.isIdentifier() && _property.isIdentifier() && VALID_CALLEES.indexOf(_object.node.name) >= 0 && INVALID_METHODS.indexOf(_property.node.name) < 0) {
  32554. context = global[_object.node.name];
  32555. func = context[_property.node.name];
  32556. }
  32557. if (_object.isLiteral() && _property.isIdentifier()) {
  32558. var _type = (0, _typeof3.default)(_object.node.value);
  32559. if (_type === "string" || _type === "number") {
  32560. context = _object.node.value;
  32561. func = context[_property.node.name];
  32562. }
  32563. }
  32564. }
  32565. if (func) {
  32566. var args = path.get("arguments").map(evaluate);
  32567. if (!confident) return;
  32568. return func.apply(context, args);
  32569. }
  32570. }
  32571. deopt(path);
  32572. }
  32573. }
  32574. /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
  32575. /***/ }),
  32576. /* 373 */
  32577. /***/ (function(module, exports, __webpack_require__) {
  32578. "use strict";
  32579. exports.__esModule = true;
  32580. var _create = __webpack_require__(9);
  32581. var _create2 = _interopRequireDefault(_create);
  32582. var _getIterator2 = __webpack_require__(2);
  32583. var _getIterator3 = _interopRequireDefault(_getIterator2);
  32584. exports.getStatementParent = getStatementParent;
  32585. exports.getOpposite = getOpposite;
  32586. exports.getCompletionRecords = getCompletionRecords;
  32587. exports.getSibling = getSibling;
  32588. exports.getPrevSibling = getPrevSibling;
  32589. exports.getNextSibling = getNextSibling;
  32590. exports.getAllNextSiblings = getAllNextSiblings;
  32591. exports.getAllPrevSiblings = getAllPrevSiblings;
  32592. exports.get = get;
  32593. exports._getKey = _getKey;
  32594. exports._getPattern = _getPattern;
  32595. exports.getBindingIdentifiers = getBindingIdentifiers;
  32596. exports.getOuterBindingIdentifiers = getOuterBindingIdentifiers;
  32597. exports.getBindingIdentifierPaths = getBindingIdentifierPaths;
  32598. exports.getOuterBindingIdentifierPaths = getOuterBindingIdentifierPaths;
  32599. var _index = __webpack_require__(36);
  32600. var _index2 = _interopRequireDefault(_index);
  32601. var _babelTypes = __webpack_require__(1);
  32602. var t = _interopRequireWildcard(_babelTypes);
  32603. function _interopRequireWildcard(obj) {
  32604. if (obj && obj.__esModule) {
  32605. return obj;
  32606. } else {
  32607. var newObj = {};if (obj != null) {
  32608. for (var key in obj) {
  32609. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  32610. }
  32611. }newObj.default = obj;return newObj;
  32612. }
  32613. }
  32614. function _interopRequireDefault(obj) {
  32615. return obj && obj.__esModule ? obj : { default: obj };
  32616. }
  32617. function getStatementParent() {
  32618. var path = this;
  32619. do {
  32620. if (!path.parentPath || Array.isArray(path.container) && path.isStatement()) {
  32621. break;
  32622. } else {
  32623. path = path.parentPath;
  32624. }
  32625. } while (path);
  32626. if (path && (path.isProgram() || path.isFile())) {
  32627. throw new Error("File/Program node, we can't possibly find a statement parent to this");
  32628. }
  32629. return path;
  32630. }
  32631. function getOpposite() {
  32632. if (this.key === "left") {
  32633. return this.getSibling("right");
  32634. } else if (this.key === "right") {
  32635. return this.getSibling("left");
  32636. }
  32637. }
  32638. function getCompletionRecords() {
  32639. var paths = [];
  32640. var add = function add(path) {
  32641. if (path) paths = paths.concat(path.getCompletionRecords());
  32642. };
  32643. if (this.isIfStatement()) {
  32644. add(this.get("consequent"));
  32645. add(this.get("alternate"));
  32646. } else if (this.isDoExpression() || this.isFor() || this.isWhile()) {
  32647. add(this.get("body"));
  32648. } else if (this.isProgram() || this.isBlockStatement()) {
  32649. add(this.get("body").pop());
  32650. } else if (this.isFunction()) {
  32651. return this.get("body").getCompletionRecords();
  32652. } else if (this.isTryStatement()) {
  32653. add(this.get("block"));
  32654. add(this.get("handler"));
  32655. add(this.get("finalizer"));
  32656. } else {
  32657. paths.push(this);
  32658. }
  32659. return paths;
  32660. }
  32661. function getSibling(key) {
  32662. return _index2.default.get({
  32663. parentPath: this.parentPath,
  32664. parent: this.parent,
  32665. container: this.container,
  32666. listKey: this.listKey,
  32667. key: key
  32668. });
  32669. }
  32670. function getPrevSibling() {
  32671. return this.getSibling(this.key - 1);
  32672. }
  32673. function getNextSibling() {
  32674. return this.getSibling(this.key + 1);
  32675. }
  32676. function getAllNextSiblings() {
  32677. var _key = this.key;
  32678. var sibling = this.getSibling(++_key);
  32679. var siblings = [];
  32680. while (sibling.node) {
  32681. siblings.push(sibling);
  32682. sibling = this.getSibling(++_key);
  32683. }
  32684. return siblings;
  32685. }
  32686. function getAllPrevSiblings() {
  32687. var _key = this.key;
  32688. var sibling = this.getSibling(--_key);
  32689. var siblings = [];
  32690. while (sibling.node) {
  32691. siblings.push(sibling);
  32692. sibling = this.getSibling(--_key);
  32693. }
  32694. return siblings;
  32695. }
  32696. function get(key, context) {
  32697. if (context === true) context = this.context;
  32698. var parts = key.split(".");
  32699. if (parts.length === 1) {
  32700. return this._getKey(key, context);
  32701. } else {
  32702. return this._getPattern(parts, context);
  32703. }
  32704. }
  32705. function _getKey(key, context) {
  32706. var _this = this;
  32707. var node = this.node;
  32708. var container = node[key];
  32709. if (Array.isArray(container)) {
  32710. return container.map(function (_, i) {
  32711. return _index2.default.get({
  32712. listKey: key,
  32713. parentPath: _this,
  32714. parent: node,
  32715. container: container,
  32716. key: i
  32717. }).setContext(context);
  32718. });
  32719. } else {
  32720. return _index2.default.get({
  32721. parentPath: this,
  32722. parent: node,
  32723. container: node,
  32724. key: key
  32725. }).setContext(context);
  32726. }
  32727. }
  32728. function _getPattern(parts, context) {
  32729. var path = this;
  32730. for (var _iterator = parts, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
  32731. var _ref;
  32732. if (_isArray) {
  32733. if (_i >= _iterator.length) break;
  32734. _ref = _iterator[_i++];
  32735. } else {
  32736. _i = _iterator.next();
  32737. if (_i.done) break;
  32738. _ref = _i.value;
  32739. }
  32740. var part = _ref;
  32741. if (part === ".") {
  32742. path = path.parentPath;
  32743. } else {
  32744. if (Array.isArray(path)) {
  32745. path = path[part];
  32746. } else {
  32747. path = path.get(part, context);
  32748. }
  32749. }
  32750. }
  32751. return path;
  32752. }
  32753. function getBindingIdentifiers(duplicates) {
  32754. return t.getBindingIdentifiers(this.node, duplicates);
  32755. }
  32756. function getOuterBindingIdentifiers(duplicates) {
  32757. return t.getOuterBindingIdentifiers(this.node, duplicates);
  32758. }
  32759. function getBindingIdentifierPaths() {
  32760. var duplicates = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  32761. var outerOnly = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  32762. var path = this;
  32763. var search = [].concat(path);
  32764. var ids = (0, _create2.default)(null);
  32765. while (search.length) {
  32766. var id = search.shift();
  32767. if (!id) continue;
  32768. if (!id.node) continue;
  32769. var keys = t.getBindingIdentifiers.keys[id.node.type];
  32770. if (id.isIdentifier()) {
  32771. if (duplicates) {
  32772. var _ids = ids[id.node.name] = ids[id.node.name] || [];
  32773. _ids.push(id);
  32774. } else {
  32775. ids[id.node.name] = id;
  32776. }
  32777. continue;
  32778. }
  32779. if (id.isExportDeclaration()) {
  32780. var declaration = id.get("declaration");
  32781. if (declaration.isDeclaration()) {
  32782. search.push(declaration);
  32783. }
  32784. continue;
  32785. }
  32786. if (outerOnly) {
  32787. if (id.isFunctionDeclaration()) {
  32788. search.push(id.get("id"));
  32789. continue;
  32790. }
  32791. if (id.isFunctionExpression()) {
  32792. continue;
  32793. }
  32794. }
  32795. if (keys) {
  32796. for (var i = 0; i < keys.length; i++) {
  32797. var key = keys[i];
  32798. var child = id.get(key);
  32799. if (Array.isArray(child) || child.node) {
  32800. search = search.concat(child);
  32801. }
  32802. }
  32803. }
  32804. }
  32805. return ids;
  32806. }
  32807. function getOuterBindingIdentifierPaths(duplicates) {
  32808. return this.getBindingIdentifierPaths(duplicates, true);
  32809. }
  32810. /***/ }),
  32811. /* 374 */
  32812. /***/ (function(module, exports, __webpack_require__) {
  32813. "use strict";
  32814. exports.__esModule = true;
  32815. var _getIterator2 = __webpack_require__(2);
  32816. var _getIterator3 = _interopRequireDefault(_getIterator2);
  32817. exports.getTypeAnnotation = getTypeAnnotation;
  32818. exports._getTypeAnnotation = _getTypeAnnotation;
  32819. exports.isBaseType = isBaseType;
  32820. exports.couldBeBaseType = couldBeBaseType;
  32821. exports.baseTypeStrictlyMatches = baseTypeStrictlyMatches;
  32822. exports.isGenericType = isGenericType;
  32823. var _inferers = __webpack_require__(376);
  32824. var inferers = _interopRequireWildcard(_inferers);
  32825. var _babelTypes = __webpack_require__(1);
  32826. var t = _interopRequireWildcard(_babelTypes);
  32827. function _interopRequireWildcard(obj) {
  32828. if (obj && obj.__esModule) {
  32829. return obj;
  32830. } else {
  32831. var newObj = {};if (obj != null) {
  32832. for (var key in obj) {
  32833. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  32834. }
  32835. }newObj.default = obj;return newObj;
  32836. }
  32837. }
  32838. function _interopRequireDefault(obj) {
  32839. return obj && obj.__esModule ? obj : { default: obj };
  32840. }
  32841. function getTypeAnnotation() {
  32842. if (this.typeAnnotation) return this.typeAnnotation;
  32843. var type = this._getTypeAnnotation() || t.anyTypeAnnotation();
  32844. if (t.isTypeAnnotation(type)) type = type.typeAnnotation;
  32845. return this.typeAnnotation = type;
  32846. }
  32847. function _getTypeAnnotation() {
  32848. var node = this.node;
  32849. if (!node) {
  32850. if (this.key === "init" && this.parentPath.isVariableDeclarator()) {
  32851. var declar = this.parentPath.parentPath;
  32852. var declarParent = declar.parentPath;
  32853. if (declar.key === "left" && declarParent.isForInStatement()) {
  32854. return t.stringTypeAnnotation();
  32855. }
  32856. if (declar.key === "left" && declarParent.isForOfStatement()) {
  32857. return t.anyTypeAnnotation();
  32858. }
  32859. return t.voidTypeAnnotation();
  32860. } else {
  32861. return;
  32862. }
  32863. }
  32864. if (node.typeAnnotation) {
  32865. return node.typeAnnotation;
  32866. }
  32867. var inferer = inferers[node.type];
  32868. if (inferer) {
  32869. return inferer.call(this, node);
  32870. }
  32871. inferer = inferers[this.parentPath.type];
  32872. if (inferer && inferer.validParent) {
  32873. return this.parentPath.getTypeAnnotation();
  32874. }
  32875. }
  32876. function isBaseType(baseName, soft) {
  32877. return _isBaseType(baseName, this.getTypeAnnotation(), soft);
  32878. }
  32879. function _isBaseType(baseName, type, soft) {
  32880. if (baseName === "string") {
  32881. return t.isStringTypeAnnotation(type);
  32882. } else if (baseName === "number") {
  32883. return t.isNumberTypeAnnotation(type);
  32884. } else if (baseName === "boolean") {
  32885. return t.isBooleanTypeAnnotation(type);
  32886. } else if (baseName === "any") {
  32887. return t.isAnyTypeAnnotation(type);
  32888. } else if (baseName === "mixed") {
  32889. return t.isMixedTypeAnnotation(type);
  32890. } else if (baseName === "empty") {
  32891. return t.isEmptyTypeAnnotation(type);
  32892. } else if (baseName === "void") {
  32893. return t.isVoidTypeAnnotation(type);
  32894. } else {
  32895. if (soft) {
  32896. return false;
  32897. } else {
  32898. throw new Error("Unknown base type " + baseName);
  32899. }
  32900. }
  32901. }
  32902. function couldBeBaseType(name) {
  32903. var type = this.getTypeAnnotation();
  32904. if (t.isAnyTypeAnnotation(type)) return true;
  32905. if (t.isUnionTypeAnnotation(type)) {
  32906. for (var _iterator = type.types, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
  32907. var _ref;
  32908. if (_isArray) {
  32909. if (_i >= _iterator.length) break;
  32910. _ref = _iterator[_i++];
  32911. } else {
  32912. _i = _iterator.next();
  32913. if (_i.done) break;
  32914. _ref = _i.value;
  32915. }
  32916. var type2 = _ref;
  32917. if (t.isAnyTypeAnnotation(type2) || _isBaseType(name, type2, true)) {
  32918. return true;
  32919. }
  32920. }
  32921. return false;
  32922. } else {
  32923. return _isBaseType(name, type, true);
  32924. }
  32925. }
  32926. function baseTypeStrictlyMatches(right) {
  32927. var left = this.getTypeAnnotation();
  32928. right = right.getTypeAnnotation();
  32929. if (!t.isAnyTypeAnnotation(left) && t.isFlowBaseAnnotation(left)) {
  32930. return right.type === left.type;
  32931. }
  32932. }
  32933. function isGenericType(genericName) {
  32934. var type = this.getTypeAnnotation();
  32935. return t.isGenericTypeAnnotation(type) && t.isIdentifier(type.id, { name: genericName });
  32936. }
  32937. /***/ }),
  32938. /* 375 */
  32939. /***/ (function(module, exports, __webpack_require__) {
  32940. "use strict";
  32941. exports.__esModule = true;
  32942. var _getIterator2 = __webpack_require__(2);
  32943. var _getIterator3 = _interopRequireDefault(_getIterator2);
  32944. exports.default = function (node) {
  32945. if (!this.isReferenced()) return;
  32946. var binding = this.scope.getBinding(node.name);
  32947. if (binding) {
  32948. if (binding.identifier.typeAnnotation) {
  32949. return binding.identifier.typeAnnotation;
  32950. } else {
  32951. return getTypeAnnotationBindingConstantViolations(this, node.name);
  32952. }
  32953. }
  32954. if (node.name === "undefined") {
  32955. return t.voidTypeAnnotation();
  32956. } else if (node.name === "NaN" || node.name === "Infinity") {
  32957. return t.numberTypeAnnotation();
  32958. } else if (node.name === "arguments") {}
  32959. };
  32960. var _babelTypes = __webpack_require__(1);
  32961. var t = _interopRequireWildcard(_babelTypes);
  32962. function _interopRequireWildcard(obj) {
  32963. if (obj && obj.__esModule) {
  32964. return obj;
  32965. } else {
  32966. var newObj = {};if (obj != null) {
  32967. for (var key in obj) {
  32968. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  32969. }
  32970. }newObj.default = obj;return newObj;
  32971. }
  32972. }
  32973. function _interopRequireDefault(obj) {
  32974. return obj && obj.__esModule ? obj : { default: obj };
  32975. }
  32976. function getTypeAnnotationBindingConstantViolations(path, name) {
  32977. var binding = path.scope.getBinding(name);
  32978. var types = [];
  32979. path.typeAnnotation = t.unionTypeAnnotation(types);
  32980. var functionConstantViolations = [];
  32981. var constantViolations = getConstantViolationsBefore(binding, path, functionConstantViolations);
  32982. var testType = getConditionalAnnotation(path, name);
  32983. if (testType) {
  32984. var testConstantViolations = getConstantViolationsBefore(binding, testType.ifStatement);
  32985. constantViolations = constantViolations.filter(function (path) {
  32986. return testConstantViolations.indexOf(path) < 0;
  32987. });
  32988. types.push(testType.typeAnnotation);
  32989. }
  32990. if (constantViolations.length) {
  32991. constantViolations = constantViolations.concat(functionConstantViolations);
  32992. for (var _iterator = constantViolations, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
  32993. var _ref;
  32994. if (_isArray) {
  32995. if (_i >= _iterator.length) break;
  32996. _ref = _iterator[_i++];
  32997. } else {
  32998. _i = _iterator.next();
  32999. if (_i.done) break;
  33000. _ref = _i.value;
  33001. }
  33002. var violation = _ref;
  33003. types.push(violation.getTypeAnnotation());
  33004. }
  33005. }
  33006. if (types.length) {
  33007. return t.createUnionTypeAnnotation(types);
  33008. }
  33009. }
  33010. function getConstantViolationsBefore(binding, path, functions) {
  33011. var violations = binding.constantViolations.slice();
  33012. violations.unshift(binding.path);
  33013. return violations.filter(function (violation) {
  33014. violation = violation.resolve();
  33015. var status = violation._guessExecutionStatusRelativeTo(path);
  33016. if (functions && status === "function") functions.push(violation);
  33017. return status === "before";
  33018. });
  33019. }
  33020. function inferAnnotationFromBinaryExpression(name, path) {
  33021. var operator = path.node.operator;
  33022. var right = path.get("right").resolve();
  33023. var left = path.get("left").resolve();
  33024. var target = void 0;
  33025. if (left.isIdentifier({ name: name })) {
  33026. target = right;
  33027. } else if (right.isIdentifier({ name: name })) {
  33028. target = left;
  33029. }
  33030. if (target) {
  33031. if (operator === "===") {
  33032. return target.getTypeAnnotation();
  33033. } else if (t.BOOLEAN_NUMBER_BINARY_OPERATORS.indexOf(operator) >= 0) {
  33034. return t.numberTypeAnnotation();
  33035. } else {
  33036. return;
  33037. }
  33038. } else {
  33039. if (operator !== "===") return;
  33040. }
  33041. var typeofPath = void 0;
  33042. var typePath = void 0;
  33043. if (left.isUnaryExpression({ operator: "typeof" })) {
  33044. typeofPath = left;
  33045. typePath = right;
  33046. } else if (right.isUnaryExpression({ operator: "typeof" })) {
  33047. typeofPath = right;
  33048. typePath = left;
  33049. }
  33050. if (!typePath && !typeofPath) return;
  33051. typePath = typePath.resolve();
  33052. if (!typePath.isLiteral()) return;
  33053. var typeValue = typePath.node.value;
  33054. if (typeof typeValue !== "string") return;
  33055. if (!typeofPath.get("argument").isIdentifier({ name: name })) return;
  33056. return t.createTypeAnnotationBasedOnTypeof(typePath.node.value);
  33057. }
  33058. function getParentConditionalPath(path) {
  33059. var parentPath = void 0;
  33060. while (parentPath = path.parentPath) {
  33061. if (parentPath.isIfStatement() || parentPath.isConditionalExpression()) {
  33062. if (path.key === "test") {
  33063. return;
  33064. } else {
  33065. return parentPath;
  33066. }
  33067. } else {
  33068. path = parentPath;
  33069. }
  33070. }
  33071. }
  33072. function getConditionalAnnotation(path, name) {
  33073. var ifStatement = getParentConditionalPath(path);
  33074. if (!ifStatement) return;
  33075. var test = ifStatement.get("test");
  33076. var paths = [test];
  33077. var types = [];
  33078. do {
  33079. var _path = paths.shift().resolve();
  33080. if (_path.isLogicalExpression()) {
  33081. paths.push(_path.get("left"));
  33082. paths.push(_path.get("right"));
  33083. }
  33084. if (_path.isBinaryExpression()) {
  33085. var type = inferAnnotationFromBinaryExpression(name, _path);
  33086. if (type) types.push(type);
  33087. }
  33088. } while (paths.length);
  33089. if (types.length) {
  33090. return {
  33091. typeAnnotation: t.createUnionTypeAnnotation(types),
  33092. ifStatement: ifStatement
  33093. };
  33094. } else {
  33095. return getConditionalAnnotation(ifStatement, name);
  33096. }
  33097. }
  33098. module.exports = exports["default"];
  33099. /***/ }),
  33100. /* 376 */
  33101. /***/ (function(module, exports, __webpack_require__) {
  33102. "use strict";
  33103. exports.__esModule = true;
  33104. exports.ClassDeclaration = exports.ClassExpression = exports.FunctionDeclaration = exports.ArrowFunctionExpression = exports.FunctionExpression = exports.Identifier = undefined;
  33105. var _infererReference = __webpack_require__(375);
  33106. Object.defineProperty(exports, "Identifier", {
  33107. enumerable: true,
  33108. get: function get() {
  33109. return _interopRequireDefault(_infererReference).default;
  33110. }
  33111. });
  33112. exports.VariableDeclarator = VariableDeclarator;
  33113. exports.TypeCastExpression = TypeCastExpression;
  33114. exports.NewExpression = NewExpression;
  33115. exports.TemplateLiteral = TemplateLiteral;
  33116. exports.UnaryExpression = UnaryExpression;
  33117. exports.BinaryExpression = BinaryExpression;
  33118. exports.LogicalExpression = LogicalExpression;
  33119. exports.ConditionalExpression = ConditionalExpression;
  33120. exports.SequenceExpression = SequenceExpression;
  33121. exports.AssignmentExpression = AssignmentExpression;
  33122. exports.UpdateExpression = UpdateExpression;
  33123. exports.StringLiteral = StringLiteral;
  33124. exports.NumericLiteral = NumericLiteral;
  33125. exports.BooleanLiteral = BooleanLiteral;
  33126. exports.NullLiteral = NullLiteral;
  33127. exports.RegExpLiteral = RegExpLiteral;
  33128. exports.ObjectExpression = ObjectExpression;
  33129. exports.ArrayExpression = ArrayExpression;
  33130. exports.RestElement = RestElement;
  33131. exports.CallExpression = CallExpression;
  33132. exports.TaggedTemplateExpression = TaggedTemplateExpression;
  33133. var _babelTypes = __webpack_require__(1);
  33134. var t = _interopRequireWildcard(_babelTypes);
  33135. function _interopRequireWildcard(obj) {
  33136. if (obj && obj.__esModule) {
  33137. return obj;
  33138. } else {
  33139. var newObj = {};if (obj != null) {
  33140. for (var key in obj) {
  33141. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  33142. }
  33143. }newObj.default = obj;return newObj;
  33144. }
  33145. }
  33146. function _interopRequireDefault(obj) {
  33147. return obj && obj.__esModule ? obj : { default: obj };
  33148. }
  33149. function VariableDeclarator() {
  33150. var id = this.get("id");
  33151. if (id.isIdentifier()) {
  33152. return this.get("init").getTypeAnnotation();
  33153. } else {
  33154. return;
  33155. }
  33156. }
  33157. function TypeCastExpression(node) {
  33158. return node.typeAnnotation;
  33159. }
  33160. TypeCastExpression.validParent = true;
  33161. function NewExpression(node) {
  33162. if (this.get("callee").isIdentifier()) {
  33163. return t.genericTypeAnnotation(node.callee);
  33164. }
  33165. }
  33166. function TemplateLiteral() {
  33167. return t.stringTypeAnnotation();
  33168. }
  33169. function UnaryExpression(node) {
  33170. var operator = node.operator;
  33171. if (operator === "void") {
  33172. return t.voidTypeAnnotation();
  33173. } else if (t.NUMBER_UNARY_OPERATORS.indexOf(operator) >= 0) {
  33174. return t.numberTypeAnnotation();
  33175. } else if (t.STRING_UNARY_OPERATORS.indexOf(operator) >= 0) {
  33176. return t.stringTypeAnnotation();
  33177. } else if (t.BOOLEAN_UNARY_OPERATORS.indexOf(operator) >= 0) {
  33178. return t.booleanTypeAnnotation();
  33179. }
  33180. }
  33181. function BinaryExpression(node) {
  33182. var operator = node.operator;
  33183. if (t.NUMBER_BINARY_OPERATORS.indexOf(operator) >= 0) {
  33184. return t.numberTypeAnnotation();
  33185. } else if (t.BOOLEAN_BINARY_OPERATORS.indexOf(operator) >= 0) {
  33186. return t.booleanTypeAnnotation();
  33187. } else if (operator === "+") {
  33188. var right = this.get("right");
  33189. var left = this.get("left");
  33190. if (left.isBaseType("number") && right.isBaseType("number")) {
  33191. return t.numberTypeAnnotation();
  33192. } else if (left.isBaseType("string") || right.isBaseType("string")) {
  33193. return t.stringTypeAnnotation();
  33194. }
  33195. return t.unionTypeAnnotation([t.stringTypeAnnotation(), t.numberTypeAnnotation()]);
  33196. }
  33197. }
  33198. function LogicalExpression() {
  33199. return t.createUnionTypeAnnotation([this.get("left").getTypeAnnotation(), this.get("right").getTypeAnnotation()]);
  33200. }
  33201. function ConditionalExpression() {
  33202. return t.createUnionTypeAnnotation([this.get("consequent").getTypeAnnotation(), this.get("alternate").getTypeAnnotation()]);
  33203. }
  33204. function SequenceExpression() {
  33205. return this.get("expressions").pop().getTypeAnnotation();
  33206. }
  33207. function AssignmentExpression() {
  33208. return this.get("right").getTypeAnnotation();
  33209. }
  33210. function UpdateExpression(node) {
  33211. var operator = node.operator;
  33212. if (operator === "++" || operator === "--") {
  33213. return t.numberTypeAnnotation();
  33214. }
  33215. }
  33216. function StringLiteral() {
  33217. return t.stringTypeAnnotation();
  33218. }
  33219. function NumericLiteral() {
  33220. return t.numberTypeAnnotation();
  33221. }
  33222. function BooleanLiteral() {
  33223. return t.booleanTypeAnnotation();
  33224. }
  33225. function NullLiteral() {
  33226. return t.nullLiteralTypeAnnotation();
  33227. }
  33228. function RegExpLiteral() {
  33229. return t.genericTypeAnnotation(t.identifier("RegExp"));
  33230. }
  33231. function ObjectExpression() {
  33232. return t.genericTypeAnnotation(t.identifier("Object"));
  33233. }
  33234. function ArrayExpression() {
  33235. return t.genericTypeAnnotation(t.identifier("Array"));
  33236. }
  33237. function RestElement() {
  33238. return ArrayExpression();
  33239. }
  33240. RestElement.validParent = true;
  33241. function Func() {
  33242. return t.genericTypeAnnotation(t.identifier("Function"));
  33243. }
  33244. exports.FunctionExpression = Func;
  33245. exports.ArrowFunctionExpression = Func;
  33246. exports.FunctionDeclaration = Func;
  33247. exports.ClassExpression = Func;
  33248. exports.ClassDeclaration = Func;
  33249. function CallExpression() {
  33250. return resolveCall(this.get("callee"));
  33251. }
  33252. function TaggedTemplateExpression() {
  33253. return resolveCall(this.get("tag"));
  33254. }
  33255. function resolveCall(callee) {
  33256. callee = callee.resolve();
  33257. if (callee.isFunction()) {
  33258. if (callee.is("async")) {
  33259. if (callee.is("generator")) {
  33260. return t.genericTypeAnnotation(t.identifier("AsyncIterator"));
  33261. } else {
  33262. return t.genericTypeAnnotation(t.identifier("Promise"));
  33263. }
  33264. } else {
  33265. if (callee.node.returnType) {
  33266. return callee.node.returnType;
  33267. } else {}
  33268. }
  33269. }
  33270. }
  33271. /***/ }),
  33272. /* 377 */
  33273. /***/ (function(module, exports, __webpack_require__) {
  33274. "use strict";
  33275. exports.__esModule = true;
  33276. exports.is = undefined;
  33277. var _getIterator2 = __webpack_require__(2);
  33278. var _getIterator3 = _interopRequireDefault(_getIterator2);
  33279. exports.matchesPattern = matchesPattern;
  33280. exports.has = has;
  33281. exports.isStatic = isStatic;
  33282. exports.isnt = isnt;
  33283. exports.equals = equals;
  33284. exports.isNodeType = isNodeType;
  33285. exports.canHaveVariableDeclarationOrExpression = canHaveVariableDeclarationOrExpression;
  33286. exports.canSwapBetweenExpressionAndStatement = canSwapBetweenExpressionAndStatement;
  33287. exports.isCompletionRecord = isCompletionRecord;
  33288. exports.isStatementOrBlock = isStatementOrBlock;
  33289. exports.referencesImport = referencesImport;
  33290. exports.getSource = getSource;
  33291. exports.willIMaybeExecuteBefore = willIMaybeExecuteBefore;
  33292. exports._guessExecutionStatusRelativeTo = _guessExecutionStatusRelativeTo;
  33293. exports._guessExecutionStatusRelativeToDifferentFunctions = _guessExecutionStatusRelativeToDifferentFunctions;
  33294. exports.resolve = resolve;
  33295. exports._resolve = _resolve;
  33296. var _includes = __webpack_require__(111);
  33297. var _includes2 = _interopRequireDefault(_includes);
  33298. var _babelTypes = __webpack_require__(1);
  33299. var t = _interopRequireWildcard(_babelTypes);
  33300. function _interopRequireWildcard(obj) {
  33301. if (obj && obj.__esModule) {
  33302. return obj;
  33303. } else {
  33304. var newObj = {};if (obj != null) {
  33305. for (var key in obj) {
  33306. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  33307. }
  33308. }newObj.default = obj;return newObj;
  33309. }
  33310. }
  33311. function _interopRequireDefault(obj) {
  33312. return obj && obj.__esModule ? obj : { default: obj };
  33313. }
  33314. function matchesPattern(pattern, allowPartial) {
  33315. if (!this.isMemberExpression()) return false;
  33316. var parts = pattern.split(".");
  33317. var search = [this.node];
  33318. var i = 0;
  33319. function matches(name) {
  33320. var part = parts[i];
  33321. return part === "*" || name === part;
  33322. }
  33323. while (search.length) {
  33324. var node = search.shift();
  33325. if (allowPartial && i === parts.length) {
  33326. return true;
  33327. }
  33328. if (t.isIdentifier(node)) {
  33329. if (!matches(node.name)) return false;
  33330. } else if (t.isLiteral(node)) {
  33331. if (!matches(node.value)) return false;
  33332. } else if (t.isMemberExpression(node)) {
  33333. if (node.computed && !t.isLiteral(node.property)) {
  33334. return false;
  33335. } else {
  33336. search.unshift(node.property);
  33337. search.unshift(node.object);
  33338. continue;
  33339. }
  33340. } else if (t.isThisExpression(node)) {
  33341. if (!matches("this")) return false;
  33342. } else {
  33343. return false;
  33344. }
  33345. if (++i > parts.length) {
  33346. return false;
  33347. }
  33348. }
  33349. return i === parts.length;
  33350. }
  33351. function has(key) {
  33352. var val = this.node && this.node[key];
  33353. if (val && Array.isArray(val)) {
  33354. return !!val.length;
  33355. } else {
  33356. return !!val;
  33357. }
  33358. }
  33359. function isStatic() {
  33360. return this.scope.isStatic(this.node);
  33361. }
  33362. var is = exports.is = has;
  33363. function isnt(key) {
  33364. return !this.has(key);
  33365. }
  33366. function equals(key, value) {
  33367. return this.node[key] === value;
  33368. }
  33369. function isNodeType(type) {
  33370. return t.isType(this.type, type);
  33371. }
  33372. function canHaveVariableDeclarationOrExpression() {
  33373. return (this.key === "init" || this.key === "left") && this.parentPath.isFor();
  33374. }
  33375. function canSwapBetweenExpressionAndStatement(replacement) {
  33376. if (this.key !== "body" || !this.parentPath.isArrowFunctionExpression()) {
  33377. return false;
  33378. }
  33379. if (this.isExpression()) {
  33380. return t.isBlockStatement(replacement);
  33381. } else if (this.isBlockStatement()) {
  33382. return t.isExpression(replacement);
  33383. }
  33384. return false;
  33385. }
  33386. function isCompletionRecord(allowInsideFunction) {
  33387. var path = this;
  33388. var first = true;
  33389. do {
  33390. var container = path.container;
  33391. if (path.isFunction() && !first) {
  33392. return !!allowInsideFunction;
  33393. }
  33394. first = false;
  33395. if (Array.isArray(container) && path.key !== container.length - 1) {
  33396. return false;
  33397. }
  33398. } while ((path = path.parentPath) && !path.isProgram());
  33399. return true;
  33400. }
  33401. function isStatementOrBlock() {
  33402. if (this.parentPath.isLabeledStatement() || t.isBlockStatement(this.container)) {
  33403. return false;
  33404. } else {
  33405. return (0, _includes2.default)(t.STATEMENT_OR_BLOCK_KEYS, this.key);
  33406. }
  33407. }
  33408. function referencesImport(moduleSource, importName) {
  33409. if (!this.isReferencedIdentifier()) return false;
  33410. var binding = this.scope.getBinding(this.node.name);
  33411. if (!binding || binding.kind !== "module") return false;
  33412. var path = binding.path;
  33413. var parent = path.parentPath;
  33414. if (!parent.isImportDeclaration()) return false;
  33415. if (parent.node.source.value === moduleSource) {
  33416. if (!importName) return true;
  33417. } else {
  33418. return false;
  33419. }
  33420. if (path.isImportDefaultSpecifier() && importName === "default") {
  33421. return true;
  33422. }
  33423. if (path.isImportNamespaceSpecifier() && importName === "*") {
  33424. return true;
  33425. }
  33426. if (path.isImportSpecifier() && path.node.imported.name === importName) {
  33427. return true;
  33428. }
  33429. return false;
  33430. }
  33431. function getSource() {
  33432. var node = this.node;
  33433. if (node.end) {
  33434. return this.hub.file.code.slice(node.start, node.end);
  33435. } else {
  33436. return "";
  33437. }
  33438. }
  33439. function willIMaybeExecuteBefore(target) {
  33440. return this._guessExecutionStatusRelativeTo(target) !== "after";
  33441. }
  33442. function _guessExecutionStatusRelativeTo(target) {
  33443. var targetFuncParent = target.scope.getFunctionParent();
  33444. var selfFuncParent = this.scope.getFunctionParent();
  33445. if (targetFuncParent.node !== selfFuncParent.node) {
  33446. var status = this._guessExecutionStatusRelativeToDifferentFunctions(targetFuncParent);
  33447. if (status) {
  33448. return status;
  33449. } else {
  33450. target = targetFuncParent.path;
  33451. }
  33452. }
  33453. var targetPaths = target.getAncestry();
  33454. if (targetPaths.indexOf(this) >= 0) return "after";
  33455. var selfPaths = this.getAncestry();
  33456. var commonPath = void 0;
  33457. var targetIndex = void 0;
  33458. var selfIndex = void 0;
  33459. for (selfIndex = 0; selfIndex < selfPaths.length; selfIndex++) {
  33460. var selfPath = selfPaths[selfIndex];
  33461. targetIndex = targetPaths.indexOf(selfPath);
  33462. if (targetIndex >= 0) {
  33463. commonPath = selfPath;
  33464. break;
  33465. }
  33466. }
  33467. if (!commonPath) {
  33468. return "before";
  33469. }
  33470. var targetRelationship = targetPaths[targetIndex - 1];
  33471. var selfRelationship = selfPaths[selfIndex - 1];
  33472. if (!targetRelationship || !selfRelationship) {
  33473. return "before";
  33474. }
  33475. if (targetRelationship.listKey && targetRelationship.container === selfRelationship.container) {
  33476. return targetRelationship.key > selfRelationship.key ? "before" : "after";
  33477. }
  33478. var targetKeyPosition = t.VISITOR_KEYS[targetRelationship.type].indexOf(targetRelationship.key);
  33479. var selfKeyPosition = t.VISITOR_KEYS[selfRelationship.type].indexOf(selfRelationship.key);
  33480. return targetKeyPosition > selfKeyPosition ? "before" : "after";
  33481. }
  33482. function _guessExecutionStatusRelativeToDifferentFunctions(targetFuncParent) {
  33483. var targetFuncPath = targetFuncParent.path;
  33484. if (!targetFuncPath.isFunctionDeclaration()) return;
  33485. var binding = targetFuncPath.scope.getBinding(targetFuncPath.node.id.name);
  33486. if (!binding.references) return "before";
  33487. var referencePaths = binding.referencePaths;
  33488. for (var _iterator = referencePaths, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
  33489. var _ref;
  33490. if (_isArray) {
  33491. if (_i >= _iterator.length) break;
  33492. _ref = _iterator[_i++];
  33493. } else {
  33494. _i = _iterator.next();
  33495. if (_i.done) break;
  33496. _ref = _i.value;
  33497. }
  33498. var path = _ref;
  33499. if (path.key !== "callee" || !path.parentPath.isCallExpression()) {
  33500. return;
  33501. }
  33502. }
  33503. var allStatus = void 0;
  33504. for (var _iterator2 = referencePaths, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) {
  33505. var _ref2;
  33506. if (_isArray2) {
  33507. if (_i2 >= _iterator2.length) break;
  33508. _ref2 = _iterator2[_i2++];
  33509. } else {
  33510. _i2 = _iterator2.next();
  33511. if (_i2.done) break;
  33512. _ref2 = _i2.value;
  33513. }
  33514. var _path = _ref2;
  33515. var childOfFunction = !!_path.find(function (path) {
  33516. return path.node === targetFuncPath.node;
  33517. });
  33518. if (childOfFunction) continue;
  33519. var status = this._guessExecutionStatusRelativeTo(_path);
  33520. if (allStatus) {
  33521. if (allStatus !== status) return;
  33522. } else {
  33523. allStatus = status;
  33524. }
  33525. }
  33526. return allStatus;
  33527. }
  33528. function resolve(dangerous, resolved) {
  33529. return this._resolve(dangerous, resolved) || this;
  33530. }
  33531. function _resolve(dangerous, resolved) {
  33532. if (resolved && resolved.indexOf(this) >= 0) return;
  33533. resolved = resolved || [];
  33534. resolved.push(this);
  33535. if (this.isVariableDeclarator()) {
  33536. if (this.get("id").isIdentifier()) {
  33537. return this.get("init").resolve(dangerous, resolved);
  33538. } else {}
  33539. } else if (this.isReferencedIdentifier()) {
  33540. var binding = this.scope.getBinding(this.node.name);
  33541. if (!binding) return;
  33542. if (!binding.constant) return;
  33543. if (binding.kind === "module") return;
  33544. if (binding.path !== this) {
  33545. var ret = binding.path.resolve(dangerous, resolved);
  33546. if (this.find(function (parent) {
  33547. return parent.node === ret.node;
  33548. })) return;
  33549. return ret;
  33550. }
  33551. } else if (this.isTypeCastExpression()) {
  33552. return this.get("expression").resolve(dangerous, resolved);
  33553. } else if (dangerous && this.isMemberExpression()) {
  33554. var targetKey = this.toComputedKey();
  33555. if (!t.isLiteral(targetKey)) return;
  33556. var targetName = targetKey.value;
  33557. var target = this.get("object").resolve(dangerous, resolved);
  33558. if (target.isObjectExpression()) {
  33559. var props = target.get("properties");
  33560. for (var _iterator3 = props, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) {
  33561. var _ref3;
  33562. if (_isArray3) {
  33563. if (_i3 >= _iterator3.length) break;
  33564. _ref3 = _iterator3[_i3++];
  33565. } else {
  33566. _i3 = _iterator3.next();
  33567. if (_i3.done) break;
  33568. _ref3 = _i3.value;
  33569. }
  33570. var prop = _ref3;
  33571. if (!prop.isProperty()) continue;
  33572. var key = prop.get("key");
  33573. var match = prop.isnt("computed") && key.isIdentifier({ name: targetName });
  33574. match = match || key.isLiteral({ value: targetName });
  33575. if (match) return prop.get("value").resolve(dangerous, resolved);
  33576. }
  33577. } else if (target.isArrayExpression() && !isNaN(+targetName)) {
  33578. var elems = target.get("elements");
  33579. var elem = elems[targetName];
  33580. if (elem) return elem.resolve(dangerous, resolved);
  33581. }
  33582. }
  33583. }
  33584. /***/ }),
  33585. /* 378 */
  33586. /***/ (function(module, exports, __webpack_require__) {
  33587. "use strict";
  33588. exports.__esModule = true;
  33589. var _getIterator2 = __webpack_require__(2);
  33590. var _getIterator3 = _interopRequireDefault(_getIterator2);
  33591. var _classCallCheck2 = __webpack_require__(3);
  33592. var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
  33593. var _babelTypes = __webpack_require__(1);
  33594. var t = _interopRequireWildcard(_babelTypes);
  33595. function _interopRequireWildcard(obj) {
  33596. if (obj && obj.__esModule) {
  33597. return obj;
  33598. } else {
  33599. var newObj = {};if (obj != null) {
  33600. for (var key in obj) {
  33601. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  33602. }
  33603. }newObj.default = obj;return newObj;
  33604. }
  33605. }
  33606. function _interopRequireDefault(obj) {
  33607. return obj && obj.__esModule ? obj : { default: obj };
  33608. }
  33609. var referenceVisitor = {
  33610. ReferencedIdentifier: function ReferencedIdentifier(path, state) {
  33611. if (path.isJSXIdentifier() && _babelTypes.react.isCompatTag(path.node.name) && !path.parentPath.isJSXMemberExpression()) {
  33612. return;
  33613. }
  33614. if (path.node.name === "this") {
  33615. var scope = path.scope;
  33616. do {
  33617. if (scope.path.isFunction() && !scope.path.isArrowFunctionExpression()) break;
  33618. } while (scope = scope.parent);
  33619. if (scope) state.breakOnScopePaths.push(scope.path);
  33620. }
  33621. var binding = path.scope.getBinding(path.node.name);
  33622. if (!binding) return;
  33623. if (binding !== state.scope.getBinding(path.node.name)) return;
  33624. state.bindings[path.node.name] = binding;
  33625. }
  33626. };
  33627. var PathHoister = function () {
  33628. function PathHoister(path, scope) {
  33629. (0, _classCallCheck3.default)(this, PathHoister);
  33630. this.breakOnScopePaths = [];
  33631. this.bindings = {};
  33632. this.scopes = [];
  33633. this.scope = scope;
  33634. this.path = path;
  33635. this.attachAfter = false;
  33636. }
  33637. PathHoister.prototype.isCompatibleScope = function isCompatibleScope(scope) {
  33638. for (var key in this.bindings) {
  33639. var binding = this.bindings[key];
  33640. if (!scope.bindingIdentifierEquals(key, binding.identifier)) {
  33641. return false;
  33642. }
  33643. }
  33644. return true;
  33645. };
  33646. PathHoister.prototype.getCompatibleScopes = function getCompatibleScopes() {
  33647. var scope = this.path.scope;
  33648. do {
  33649. if (this.isCompatibleScope(scope)) {
  33650. this.scopes.push(scope);
  33651. } else {
  33652. break;
  33653. }
  33654. if (this.breakOnScopePaths.indexOf(scope.path) >= 0) {
  33655. break;
  33656. }
  33657. } while (scope = scope.parent);
  33658. };
  33659. PathHoister.prototype.getAttachmentPath = function getAttachmentPath() {
  33660. var path = this._getAttachmentPath();
  33661. if (!path) return;
  33662. var targetScope = path.scope;
  33663. if (targetScope.path === path) {
  33664. targetScope = path.scope.parent;
  33665. }
  33666. if (targetScope.path.isProgram() || targetScope.path.isFunction()) {
  33667. for (var name in this.bindings) {
  33668. if (!targetScope.hasOwnBinding(name)) continue;
  33669. var binding = this.bindings[name];
  33670. if (binding.kind === "param") continue;
  33671. if (this.getAttachmentParentForPath(binding.path).key > path.key) {
  33672. this.attachAfter = true;
  33673. path = binding.path;
  33674. for (var _iterator = binding.constantViolations, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
  33675. var _ref;
  33676. if (_isArray) {
  33677. if (_i >= _iterator.length) break;
  33678. _ref = _iterator[_i++];
  33679. } else {
  33680. _i = _iterator.next();
  33681. if (_i.done) break;
  33682. _ref = _i.value;
  33683. }
  33684. var violationPath = _ref;
  33685. if (this.getAttachmentParentForPath(violationPath).key > path.key) {
  33686. path = violationPath;
  33687. }
  33688. }
  33689. }
  33690. }
  33691. }
  33692. if (path.parentPath.isExportDeclaration()) {
  33693. path = path.parentPath;
  33694. }
  33695. return path;
  33696. };
  33697. PathHoister.prototype._getAttachmentPath = function _getAttachmentPath() {
  33698. var scopes = this.scopes;
  33699. var scope = scopes.pop();
  33700. if (!scope) return;
  33701. if (scope.path.isFunction()) {
  33702. if (this.hasOwnParamBindings(scope)) {
  33703. if (this.scope === scope) return;
  33704. return scope.path.get("body").get("body")[0];
  33705. } else {
  33706. return this.getNextScopeAttachmentParent();
  33707. }
  33708. } else if (scope.path.isProgram()) {
  33709. return this.getNextScopeAttachmentParent();
  33710. }
  33711. };
  33712. PathHoister.prototype.getNextScopeAttachmentParent = function getNextScopeAttachmentParent() {
  33713. var scope = this.scopes.pop();
  33714. if (scope) return this.getAttachmentParentForPath(scope.path);
  33715. };
  33716. PathHoister.prototype.getAttachmentParentForPath = function getAttachmentParentForPath(path) {
  33717. do {
  33718. if (!path.parentPath || Array.isArray(path.container) && path.isStatement() || path.isVariableDeclarator() && path.parentPath.node !== null && path.parentPath.node.declarations.length > 1) return path;
  33719. } while (path = path.parentPath);
  33720. };
  33721. PathHoister.prototype.hasOwnParamBindings = function hasOwnParamBindings(scope) {
  33722. for (var name in this.bindings) {
  33723. if (!scope.hasOwnBinding(name)) continue;
  33724. var binding = this.bindings[name];
  33725. if (binding.kind === "param" && binding.constant) return true;
  33726. }
  33727. return false;
  33728. };
  33729. PathHoister.prototype.run = function run() {
  33730. var node = this.path.node;
  33731. if (node._hoisted) return;
  33732. node._hoisted = true;
  33733. this.path.traverse(referenceVisitor, this);
  33734. this.getCompatibleScopes();
  33735. var attachTo = this.getAttachmentPath();
  33736. if (!attachTo) return;
  33737. if (attachTo.getFunctionParent() === this.path.getFunctionParent()) return;
  33738. var uid = attachTo.scope.generateUidIdentifier("ref");
  33739. var declarator = t.variableDeclarator(uid, this.path.node);
  33740. var insertFn = this.attachAfter ? "insertAfter" : "insertBefore";
  33741. attachTo[insertFn]([attachTo.isVariableDeclarator() ? declarator : t.variableDeclaration("var", [declarator])]);
  33742. var parent = this.path.parentPath;
  33743. if (parent.isJSXElement() && this.path.container === parent.node.children) {
  33744. uid = t.JSXExpressionContainer(uid);
  33745. }
  33746. this.path.replaceWith(uid);
  33747. };
  33748. return PathHoister;
  33749. }();
  33750. exports.default = PathHoister;
  33751. module.exports = exports["default"];
  33752. /***/ }),
  33753. /* 379 */
  33754. /***/ (function(module, exports) {
  33755. "use strict";
  33756. exports.__esModule = true;
  33757. var hooks = exports.hooks = [function (self, parent) {
  33758. var removeParent = self.key === "test" && (parent.isWhile() || parent.isSwitchCase()) || self.key === "declaration" && parent.isExportDeclaration() || self.key === "body" && parent.isLabeledStatement() || self.listKey === "declarations" && parent.isVariableDeclaration() && parent.node.declarations.length === 1 || self.key === "expression" && parent.isExpressionStatement();
  33759. if (removeParent) {
  33760. parent.remove();
  33761. return true;
  33762. }
  33763. }, function (self, parent) {
  33764. if (parent.isSequenceExpression() && parent.node.expressions.length === 1) {
  33765. parent.replaceWith(parent.node.expressions[0]);
  33766. return true;
  33767. }
  33768. }, function (self, parent) {
  33769. if (parent.isBinary()) {
  33770. if (self.key === "left") {
  33771. parent.replaceWith(parent.node.right);
  33772. } else {
  33773. parent.replaceWith(parent.node.left);
  33774. }
  33775. return true;
  33776. }
  33777. }, function (self, parent) {
  33778. if (parent.isIfStatement() && (self.key === "consequent" || self.key === "alternate") || self.key === "body" && (parent.isLoop() || parent.isArrowFunctionExpression())) {
  33779. self.replaceWith({
  33780. type: "BlockStatement",
  33781. body: []
  33782. });
  33783. return true;
  33784. }
  33785. }];
  33786. /***/ }),
  33787. /* 380 */
  33788. /***/ (function(module, exports, __webpack_require__) {
  33789. "use strict";
  33790. exports.__esModule = true;
  33791. var _typeof2 = __webpack_require__(11);
  33792. var _typeof3 = _interopRequireDefault(_typeof2);
  33793. var _getIterator2 = __webpack_require__(2);
  33794. var _getIterator3 = _interopRequireDefault(_getIterator2);
  33795. exports.insertBefore = insertBefore;
  33796. exports._containerInsert = _containerInsert;
  33797. exports._containerInsertBefore = _containerInsertBefore;
  33798. exports._containerInsertAfter = _containerInsertAfter;
  33799. exports._maybePopFromStatements = _maybePopFromStatements;
  33800. exports.insertAfter = insertAfter;
  33801. exports.updateSiblingKeys = updateSiblingKeys;
  33802. exports._verifyNodeList = _verifyNodeList;
  33803. exports.unshiftContainer = unshiftContainer;
  33804. exports.pushContainer = pushContainer;
  33805. exports.hoist = hoist;
  33806. var _cache = __webpack_require__(88);
  33807. var _hoister = __webpack_require__(378);
  33808. var _hoister2 = _interopRequireDefault(_hoister);
  33809. var _index = __webpack_require__(36);
  33810. var _index2 = _interopRequireDefault(_index);
  33811. var _babelTypes = __webpack_require__(1);
  33812. var t = _interopRequireWildcard(_babelTypes);
  33813. function _interopRequireWildcard(obj) {
  33814. if (obj && obj.__esModule) {
  33815. return obj;
  33816. } else {
  33817. var newObj = {};if (obj != null) {
  33818. for (var key in obj) {
  33819. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  33820. }
  33821. }newObj.default = obj;return newObj;
  33822. }
  33823. }
  33824. function _interopRequireDefault(obj) {
  33825. return obj && obj.__esModule ? obj : { default: obj };
  33826. }
  33827. function insertBefore(nodes) {
  33828. this._assertUnremoved();
  33829. nodes = this._verifyNodeList(nodes);
  33830. if (this.parentPath.isExpressionStatement() || this.parentPath.isLabeledStatement()) {
  33831. return this.parentPath.insertBefore(nodes);
  33832. } else if (this.isNodeType("Expression") || this.parentPath.isForStatement() && this.key === "init") {
  33833. if (this.node) nodes.push(this.node);
  33834. this.replaceExpressionWithStatements(nodes);
  33835. } else {
  33836. this._maybePopFromStatements(nodes);
  33837. if (Array.isArray(this.container)) {
  33838. return this._containerInsertBefore(nodes);
  33839. } else if (this.isStatementOrBlock()) {
  33840. if (this.node) nodes.push(this.node);
  33841. this._replaceWith(t.blockStatement(nodes));
  33842. } else {
  33843. throw new Error("We don't know what to do with this node type. " + "We were previously a Statement but we can't fit in here?");
  33844. }
  33845. }
  33846. return [this];
  33847. }
  33848. function _containerInsert(from, nodes) {
  33849. this.updateSiblingKeys(from, nodes.length);
  33850. var paths = [];
  33851. for (var i = 0; i < nodes.length; i++) {
  33852. var to = from + i;
  33853. var node = nodes[i];
  33854. this.container.splice(to, 0, node);
  33855. if (this.context) {
  33856. var path = this.context.create(this.parent, this.container, to, this.listKey);
  33857. if (this.context.queue) path.pushContext(this.context);
  33858. paths.push(path);
  33859. } else {
  33860. paths.push(_index2.default.get({
  33861. parentPath: this.parentPath,
  33862. parent: this.parent,
  33863. container: this.container,
  33864. listKey: this.listKey,
  33865. key: to
  33866. }));
  33867. }
  33868. }
  33869. var contexts = this._getQueueContexts();
  33870. for (var _iterator = paths, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
  33871. var _ref;
  33872. if (_isArray) {
  33873. if (_i >= _iterator.length) break;
  33874. _ref = _iterator[_i++];
  33875. } else {
  33876. _i = _iterator.next();
  33877. if (_i.done) break;
  33878. _ref = _i.value;
  33879. }
  33880. var _path = _ref;
  33881. _path.setScope();
  33882. _path.debug(function () {
  33883. return "Inserted.";
  33884. });
  33885. for (var _iterator2 = contexts, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) {
  33886. var _ref2;
  33887. if (_isArray2) {
  33888. if (_i2 >= _iterator2.length) break;
  33889. _ref2 = _iterator2[_i2++];
  33890. } else {
  33891. _i2 = _iterator2.next();
  33892. if (_i2.done) break;
  33893. _ref2 = _i2.value;
  33894. }
  33895. var context = _ref2;
  33896. context.maybeQueue(_path, true);
  33897. }
  33898. }
  33899. return paths;
  33900. }
  33901. function _containerInsertBefore(nodes) {
  33902. return this._containerInsert(this.key, nodes);
  33903. }
  33904. function _containerInsertAfter(nodes) {
  33905. return this._containerInsert(this.key + 1, nodes);
  33906. }
  33907. function _maybePopFromStatements(nodes) {
  33908. var last = nodes[nodes.length - 1];
  33909. var isIdentifier = t.isIdentifier(last) || t.isExpressionStatement(last) && t.isIdentifier(last.expression);
  33910. if (isIdentifier && !this.isCompletionRecord()) {
  33911. nodes.pop();
  33912. }
  33913. }
  33914. function insertAfter(nodes) {
  33915. this._assertUnremoved();
  33916. nodes = this._verifyNodeList(nodes);
  33917. if (this.parentPath.isExpressionStatement() || this.parentPath.isLabeledStatement()) {
  33918. return this.parentPath.insertAfter(nodes);
  33919. } else if (this.isNodeType("Expression") || this.parentPath.isForStatement() && this.key === "init") {
  33920. if (this.node) {
  33921. var temp = this.scope.generateDeclaredUidIdentifier();
  33922. nodes.unshift(t.expressionStatement(t.assignmentExpression("=", temp, this.node)));
  33923. nodes.push(t.expressionStatement(temp));
  33924. }
  33925. this.replaceExpressionWithStatements(nodes);
  33926. } else {
  33927. this._maybePopFromStatements(nodes);
  33928. if (Array.isArray(this.container)) {
  33929. return this._containerInsertAfter(nodes);
  33930. } else if (this.isStatementOrBlock()) {
  33931. if (this.node) nodes.unshift(this.node);
  33932. this._replaceWith(t.blockStatement(nodes));
  33933. } else {
  33934. throw new Error("We don't know what to do with this node type. " + "We were previously a Statement but we can't fit in here?");
  33935. }
  33936. }
  33937. return [this];
  33938. }
  33939. function updateSiblingKeys(fromIndex, incrementBy) {
  33940. if (!this.parent) return;
  33941. var paths = _cache.path.get(this.parent);
  33942. for (var i = 0; i < paths.length; i++) {
  33943. var path = paths[i];
  33944. if (path.key >= fromIndex) {
  33945. path.key += incrementBy;
  33946. }
  33947. }
  33948. }
  33949. function _verifyNodeList(nodes) {
  33950. if (!nodes) {
  33951. return [];
  33952. }
  33953. if (nodes.constructor !== Array) {
  33954. nodes = [nodes];
  33955. }
  33956. for (var i = 0; i < nodes.length; i++) {
  33957. var node = nodes[i];
  33958. var msg = void 0;
  33959. if (!node) {
  33960. msg = "has falsy node";
  33961. } else if ((typeof node === "undefined" ? "undefined" : (0, _typeof3.default)(node)) !== "object") {
  33962. msg = "contains a non-object node";
  33963. } else if (!node.type) {
  33964. msg = "without a type";
  33965. } else if (node instanceof _index2.default) {
  33966. msg = "has a NodePath when it expected a raw object";
  33967. }
  33968. if (msg) {
  33969. var type = Array.isArray(node) ? "array" : typeof node === "undefined" ? "undefined" : (0, _typeof3.default)(node);
  33970. throw new Error("Node list " + msg + " with the index of " + i + " and type of " + type);
  33971. }
  33972. }
  33973. return nodes;
  33974. }
  33975. function unshiftContainer(listKey, nodes) {
  33976. this._assertUnremoved();
  33977. nodes = this._verifyNodeList(nodes);
  33978. var path = _index2.default.get({
  33979. parentPath: this,
  33980. parent: this.node,
  33981. container: this.node[listKey],
  33982. listKey: listKey,
  33983. key: 0
  33984. });
  33985. return path.insertBefore(nodes);
  33986. }
  33987. function pushContainer(listKey, nodes) {
  33988. this._assertUnremoved();
  33989. nodes = this._verifyNodeList(nodes);
  33990. var container = this.node[listKey];
  33991. var path = _index2.default.get({
  33992. parentPath: this,
  33993. parent: this.node,
  33994. container: container,
  33995. listKey: listKey,
  33996. key: container.length
  33997. });
  33998. return path.replaceWithMultiple(nodes);
  33999. }
  34000. function hoist() {
  34001. var scope = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.scope;
  34002. var hoister = new _hoister2.default(this, scope);
  34003. return hoister.run();
  34004. }
  34005. /***/ }),
  34006. /* 381 */
  34007. /***/ (function(module, exports, __webpack_require__) {
  34008. "use strict";
  34009. exports.__esModule = true;
  34010. var _getIterator2 = __webpack_require__(2);
  34011. var _getIterator3 = _interopRequireDefault(_getIterator2);
  34012. exports.remove = remove;
  34013. exports._callRemovalHooks = _callRemovalHooks;
  34014. exports._remove = _remove;
  34015. exports._markRemoved = _markRemoved;
  34016. exports._assertUnremoved = _assertUnremoved;
  34017. var _removalHooks = __webpack_require__(379);
  34018. function _interopRequireDefault(obj) {
  34019. return obj && obj.__esModule ? obj : { default: obj };
  34020. }
  34021. function remove() {
  34022. this._assertUnremoved();
  34023. this.resync();
  34024. if (this._callRemovalHooks()) {
  34025. this._markRemoved();
  34026. return;
  34027. }
  34028. this.shareCommentsWithSiblings();
  34029. this._remove();
  34030. this._markRemoved();
  34031. }
  34032. function _callRemovalHooks() {
  34033. for (var _iterator = _removalHooks.hooks, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
  34034. var _ref;
  34035. if (_isArray) {
  34036. if (_i >= _iterator.length) break;
  34037. _ref = _iterator[_i++];
  34038. } else {
  34039. _i = _iterator.next();
  34040. if (_i.done) break;
  34041. _ref = _i.value;
  34042. }
  34043. var fn = _ref;
  34044. if (fn(this, this.parentPath)) return true;
  34045. }
  34046. }
  34047. function _remove() {
  34048. if (Array.isArray(this.container)) {
  34049. this.container.splice(this.key, 1);
  34050. this.updateSiblingKeys(this.key, -1);
  34051. } else {
  34052. this._replaceWith(null);
  34053. }
  34054. }
  34055. function _markRemoved() {
  34056. this.shouldSkip = true;
  34057. this.removed = true;
  34058. this.node = null;
  34059. }
  34060. function _assertUnremoved() {
  34061. if (this.removed) {
  34062. throw this.buildCodeFrameError("NodePath has been removed so is read-only.");
  34063. }
  34064. }
  34065. /***/ }),
  34066. /* 382 */
  34067. /***/ (function(module, exports, __webpack_require__) {
  34068. "use strict";
  34069. exports.__esModule = true;
  34070. var _getIterator2 = __webpack_require__(2);
  34071. var _getIterator3 = _interopRequireDefault(_getIterator2);
  34072. exports.replaceWithMultiple = replaceWithMultiple;
  34073. exports.replaceWithSourceString = replaceWithSourceString;
  34074. exports.replaceWith = replaceWith;
  34075. exports._replaceWith = _replaceWith;
  34076. exports.replaceExpressionWithStatements = replaceExpressionWithStatements;
  34077. exports.replaceInline = replaceInline;
  34078. var _babelCodeFrame = __webpack_require__(181);
  34079. var _babelCodeFrame2 = _interopRequireDefault(_babelCodeFrame);
  34080. var _index = __webpack_require__(7);
  34081. var _index2 = _interopRequireDefault(_index);
  34082. var _index3 = __webpack_require__(36);
  34083. var _index4 = _interopRequireDefault(_index3);
  34084. var _babylon = __webpack_require__(89);
  34085. var _babelTypes = __webpack_require__(1);
  34086. var t = _interopRequireWildcard(_babelTypes);
  34087. function _interopRequireWildcard(obj) {
  34088. if (obj && obj.__esModule) {
  34089. return obj;
  34090. } else {
  34091. var newObj = {};if (obj != null) {
  34092. for (var key in obj) {
  34093. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  34094. }
  34095. }newObj.default = obj;return newObj;
  34096. }
  34097. }
  34098. function _interopRequireDefault(obj) {
  34099. return obj && obj.__esModule ? obj : { default: obj };
  34100. }
  34101. var hoistVariablesVisitor = {
  34102. Function: function Function(path) {
  34103. path.skip();
  34104. },
  34105. VariableDeclaration: function VariableDeclaration(path) {
  34106. if (path.node.kind !== "var") return;
  34107. var bindings = path.getBindingIdentifiers();
  34108. for (var key in bindings) {
  34109. path.scope.push({ id: bindings[key] });
  34110. }
  34111. var exprs = [];
  34112. for (var _iterator = path.node.declarations, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
  34113. var _ref;
  34114. if (_isArray) {
  34115. if (_i >= _iterator.length) break;
  34116. _ref = _iterator[_i++];
  34117. } else {
  34118. _i = _iterator.next();
  34119. if (_i.done) break;
  34120. _ref = _i.value;
  34121. }
  34122. var declar = _ref;
  34123. if (declar.init) {
  34124. exprs.push(t.expressionStatement(t.assignmentExpression("=", declar.id, declar.init)));
  34125. }
  34126. }
  34127. path.replaceWithMultiple(exprs);
  34128. }
  34129. };
  34130. function replaceWithMultiple(nodes) {
  34131. this.resync();
  34132. nodes = this._verifyNodeList(nodes);
  34133. t.inheritLeadingComments(nodes[0], this.node);
  34134. t.inheritTrailingComments(nodes[nodes.length - 1], this.node);
  34135. this.node = this.container[this.key] = null;
  34136. this.insertAfter(nodes);
  34137. if (this.node) {
  34138. this.requeue();
  34139. } else {
  34140. this.remove();
  34141. }
  34142. }
  34143. function replaceWithSourceString(replacement) {
  34144. this.resync();
  34145. try {
  34146. replacement = "(" + replacement + ")";
  34147. replacement = (0, _babylon.parse)(replacement);
  34148. } catch (err) {
  34149. var loc = err.loc;
  34150. if (loc) {
  34151. err.message += " - make sure this is an expression.";
  34152. err.message += "\n" + (0, _babelCodeFrame2.default)(replacement, loc.line, loc.column + 1);
  34153. }
  34154. throw err;
  34155. }
  34156. replacement = replacement.program.body[0].expression;
  34157. _index2.default.removeProperties(replacement);
  34158. return this.replaceWith(replacement);
  34159. }
  34160. function replaceWith(replacement) {
  34161. this.resync();
  34162. if (this.removed) {
  34163. throw new Error("You can't replace this node, we've already removed it");
  34164. }
  34165. if (replacement instanceof _index4.default) {
  34166. replacement = replacement.node;
  34167. }
  34168. if (!replacement) {
  34169. throw new Error("You passed `path.replaceWith()` a falsy node, use `path.remove()` instead");
  34170. }
  34171. if (this.node === replacement) {
  34172. return;
  34173. }
  34174. if (this.isProgram() && !t.isProgram(replacement)) {
  34175. throw new Error("You can only replace a Program root node with another Program node");
  34176. }
  34177. if (Array.isArray(replacement)) {
  34178. throw new Error("Don't use `path.replaceWith()` with an array of nodes, use `path.replaceWithMultiple()`");
  34179. }
  34180. if (typeof replacement === "string") {
  34181. throw new Error("Don't use `path.replaceWith()` with a source string, use `path.replaceWithSourceString()`");
  34182. }
  34183. if (this.isNodeType("Statement") && t.isExpression(replacement)) {
  34184. if (!this.canHaveVariableDeclarationOrExpression() && !this.canSwapBetweenExpressionAndStatement(replacement) && !this.parentPath.isExportDefaultDeclaration()) {
  34185. replacement = t.expressionStatement(replacement);
  34186. }
  34187. }
  34188. if (this.isNodeType("Expression") && t.isStatement(replacement)) {
  34189. if (!this.canHaveVariableDeclarationOrExpression() && !this.canSwapBetweenExpressionAndStatement(replacement)) {
  34190. return this.replaceExpressionWithStatements([replacement]);
  34191. }
  34192. }
  34193. var oldNode = this.node;
  34194. if (oldNode) {
  34195. t.inheritsComments(replacement, oldNode);
  34196. t.removeComments(oldNode);
  34197. }
  34198. this._replaceWith(replacement);
  34199. this.type = replacement.type;
  34200. this.setScope();
  34201. this.requeue();
  34202. }
  34203. function _replaceWith(node) {
  34204. if (!this.container) {
  34205. throw new ReferenceError("Container is falsy");
  34206. }
  34207. if (this.inList) {
  34208. t.validate(this.parent, this.key, [node]);
  34209. } else {
  34210. t.validate(this.parent, this.key, node);
  34211. }
  34212. this.debug(function () {
  34213. return "Replace with " + (node && node.type);
  34214. });
  34215. this.node = this.container[this.key] = node;
  34216. }
  34217. function replaceExpressionWithStatements(nodes) {
  34218. this.resync();
  34219. var toSequenceExpression = t.toSequenceExpression(nodes, this.scope);
  34220. if (t.isSequenceExpression(toSequenceExpression)) {
  34221. var exprs = toSequenceExpression.expressions;
  34222. if (exprs.length >= 2 && this.parentPath.isExpressionStatement()) {
  34223. this._maybePopFromStatements(exprs);
  34224. }
  34225. if (exprs.length === 1) {
  34226. this.replaceWith(exprs[0]);
  34227. } else {
  34228. this.replaceWith(toSequenceExpression);
  34229. }
  34230. } else if (toSequenceExpression) {
  34231. this.replaceWith(toSequenceExpression);
  34232. } else {
  34233. var container = t.functionExpression(null, [], t.blockStatement(nodes));
  34234. container.shadow = true;
  34235. this.replaceWith(t.callExpression(container, []));
  34236. this.traverse(hoistVariablesVisitor);
  34237. var completionRecords = this.get("callee").getCompletionRecords();
  34238. for (var _iterator2 = completionRecords, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) {
  34239. var _ref2;
  34240. if (_isArray2) {
  34241. if (_i2 >= _iterator2.length) break;
  34242. _ref2 = _iterator2[_i2++];
  34243. } else {
  34244. _i2 = _iterator2.next();
  34245. if (_i2.done) break;
  34246. _ref2 = _i2.value;
  34247. }
  34248. var path = _ref2;
  34249. if (!path.isExpressionStatement()) continue;
  34250. var loop = path.findParent(function (path) {
  34251. return path.isLoop();
  34252. });
  34253. if (loop) {
  34254. var uid = loop.getData("expressionReplacementReturnUid");
  34255. if (!uid) {
  34256. var callee = this.get("callee");
  34257. uid = callee.scope.generateDeclaredUidIdentifier("ret");
  34258. callee.get("body").pushContainer("body", t.returnStatement(uid));
  34259. loop.setData("expressionReplacementReturnUid", uid);
  34260. } else {
  34261. uid = t.identifier(uid.name);
  34262. }
  34263. path.get("expression").replaceWith(t.assignmentExpression("=", uid, path.node.expression));
  34264. } else {
  34265. path.replaceWith(t.returnStatement(path.node.expression));
  34266. }
  34267. }
  34268. return this.node;
  34269. }
  34270. }
  34271. function replaceInline(nodes) {
  34272. this.resync();
  34273. if (Array.isArray(nodes)) {
  34274. if (Array.isArray(this.container)) {
  34275. nodes = this._verifyNodeList(nodes);
  34276. this._containerInsertAfter(nodes);
  34277. return this.remove();
  34278. } else {
  34279. return this.replaceWithMultiple(nodes);
  34280. }
  34281. } else {
  34282. return this.replaceWith(nodes);
  34283. }
  34284. }
  34285. /***/ }),
  34286. /* 383 */
  34287. /***/ (function(module, exports, __webpack_require__) {
  34288. "use strict";
  34289. exports.__esModule = true;
  34290. var _classCallCheck2 = __webpack_require__(3);
  34291. var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
  34292. var _binding = __webpack_require__(225);
  34293. var _binding2 = _interopRequireDefault(_binding);
  34294. var _babelTypes = __webpack_require__(1);
  34295. var t = _interopRequireWildcard(_babelTypes);
  34296. function _interopRequireWildcard(obj) {
  34297. if (obj && obj.__esModule) {
  34298. return obj;
  34299. } else {
  34300. var newObj = {};if (obj != null) {
  34301. for (var key in obj) {
  34302. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  34303. }
  34304. }newObj.default = obj;return newObj;
  34305. }
  34306. }
  34307. function _interopRequireDefault(obj) {
  34308. return obj && obj.__esModule ? obj : { default: obj };
  34309. }
  34310. var renameVisitor = {
  34311. ReferencedIdentifier: function ReferencedIdentifier(_ref, state) {
  34312. var node = _ref.node;
  34313. if (node.name === state.oldName) {
  34314. node.name = state.newName;
  34315. }
  34316. },
  34317. Scope: function Scope(path, state) {
  34318. if (!path.scope.bindingIdentifierEquals(state.oldName, state.binding.identifier)) {
  34319. path.skip();
  34320. }
  34321. },
  34322. "AssignmentExpression|Declaration": function AssignmentExpressionDeclaration(path, state) {
  34323. var ids = path.getOuterBindingIdentifiers();
  34324. for (var name in ids) {
  34325. if (name === state.oldName) ids[name].name = state.newName;
  34326. }
  34327. }
  34328. };
  34329. var Renamer = function () {
  34330. function Renamer(binding, oldName, newName) {
  34331. (0, _classCallCheck3.default)(this, Renamer);
  34332. this.newName = newName;
  34333. this.oldName = oldName;
  34334. this.binding = binding;
  34335. }
  34336. Renamer.prototype.maybeConvertFromExportDeclaration = function maybeConvertFromExportDeclaration(parentDeclar) {
  34337. var exportDeclar = parentDeclar.parentPath.isExportDeclaration() && parentDeclar.parentPath;
  34338. if (!exportDeclar) return;
  34339. var isDefault = exportDeclar.isExportDefaultDeclaration();
  34340. if (isDefault && (parentDeclar.isFunctionDeclaration() || parentDeclar.isClassDeclaration()) && !parentDeclar.node.id) {
  34341. parentDeclar.node.id = parentDeclar.scope.generateUidIdentifier("default");
  34342. }
  34343. var bindingIdentifiers = parentDeclar.getOuterBindingIdentifiers();
  34344. var specifiers = [];
  34345. for (var name in bindingIdentifiers) {
  34346. var localName = name === this.oldName ? this.newName : name;
  34347. var exportedName = isDefault ? "default" : name;
  34348. specifiers.push(t.exportSpecifier(t.identifier(localName), t.identifier(exportedName)));
  34349. }
  34350. if (specifiers.length) {
  34351. var aliasDeclar = t.exportNamedDeclaration(null, specifiers);
  34352. if (parentDeclar.isFunctionDeclaration()) {
  34353. aliasDeclar._blockHoist = 3;
  34354. }
  34355. exportDeclar.insertAfter(aliasDeclar);
  34356. exportDeclar.replaceWith(parentDeclar.node);
  34357. }
  34358. };
  34359. Renamer.prototype.rename = function rename(block) {
  34360. var binding = this.binding,
  34361. oldName = this.oldName,
  34362. newName = this.newName;
  34363. var scope = binding.scope,
  34364. path = binding.path;
  34365. var parentDeclar = path.find(function (path) {
  34366. return path.isDeclaration() || path.isFunctionExpression();
  34367. });
  34368. if (parentDeclar) {
  34369. this.maybeConvertFromExportDeclaration(parentDeclar);
  34370. }
  34371. scope.traverse(block || scope.block, renameVisitor, this);
  34372. if (!block) {
  34373. scope.removeOwnBinding(oldName);
  34374. scope.bindings[newName] = binding;
  34375. this.binding.identifier.name = newName;
  34376. }
  34377. if (binding.type === "hoisted") {}
  34378. };
  34379. return Renamer;
  34380. }();
  34381. exports.default = Renamer;
  34382. module.exports = exports["default"];
  34383. /***/ }),
  34384. /* 384 */
  34385. /***/ (function(module, exports, __webpack_require__) {
  34386. "use strict";
  34387. exports.__esModule = true;
  34388. var _typeof2 = __webpack_require__(11);
  34389. var _typeof3 = _interopRequireDefault(_typeof2);
  34390. var _keys = __webpack_require__(14);
  34391. var _keys2 = _interopRequireDefault(_keys);
  34392. var _getIterator2 = __webpack_require__(2);
  34393. var _getIterator3 = _interopRequireDefault(_getIterator2);
  34394. exports.explode = explode;
  34395. exports.verify = verify;
  34396. exports.merge = merge;
  34397. var _virtualTypes = __webpack_require__(224);
  34398. var virtualTypes = _interopRequireWildcard(_virtualTypes);
  34399. var _babelMessages = __webpack_require__(20);
  34400. var messages = _interopRequireWildcard(_babelMessages);
  34401. var _babelTypes = __webpack_require__(1);
  34402. var t = _interopRequireWildcard(_babelTypes);
  34403. var _clone = __webpack_require__(109);
  34404. var _clone2 = _interopRequireDefault(_clone);
  34405. function _interopRequireWildcard(obj) {
  34406. if (obj && obj.__esModule) {
  34407. return obj;
  34408. } else {
  34409. var newObj = {};if (obj != null) {
  34410. for (var key in obj) {
  34411. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  34412. }
  34413. }newObj.default = obj;return newObj;
  34414. }
  34415. }
  34416. function _interopRequireDefault(obj) {
  34417. return obj && obj.__esModule ? obj : { default: obj };
  34418. }
  34419. function explode(visitor) {
  34420. if (visitor._exploded) return visitor;
  34421. visitor._exploded = true;
  34422. for (var nodeType in visitor) {
  34423. if (shouldIgnoreKey(nodeType)) continue;
  34424. var parts = nodeType.split("|");
  34425. if (parts.length === 1) continue;
  34426. var fns = visitor[nodeType];
  34427. delete visitor[nodeType];
  34428. for (var _iterator = parts, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
  34429. var _ref;
  34430. if (_isArray) {
  34431. if (_i >= _iterator.length) break;
  34432. _ref = _iterator[_i++];
  34433. } else {
  34434. _i = _iterator.next();
  34435. if (_i.done) break;
  34436. _ref = _i.value;
  34437. }
  34438. var part = _ref;
  34439. visitor[part] = fns;
  34440. }
  34441. }
  34442. verify(visitor);
  34443. delete visitor.__esModule;
  34444. ensureEntranceObjects(visitor);
  34445. ensureCallbackArrays(visitor);
  34446. for (var _iterator2 = (0, _keys2.default)(visitor), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) {
  34447. var _ref2;
  34448. if (_isArray2) {
  34449. if (_i2 >= _iterator2.length) break;
  34450. _ref2 = _iterator2[_i2++];
  34451. } else {
  34452. _i2 = _iterator2.next();
  34453. if (_i2.done) break;
  34454. _ref2 = _i2.value;
  34455. }
  34456. var _nodeType3 = _ref2;
  34457. if (shouldIgnoreKey(_nodeType3)) continue;
  34458. var wrapper = virtualTypes[_nodeType3];
  34459. if (!wrapper) continue;
  34460. var _fns2 = visitor[_nodeType3];
  34461. for (var type in _fns2) {
  34462. _fns2[type] = wrapCheck(wrapper, _fns2[type]);
  34463. }
  34464. delete visitor[_nodeType3];
  34465. if (wrapper.types) {
  34466. for (var _iterator4 = wrapper.types, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, _getIterator3.default)(_iterator4);;) {
  34467. var _ref4;
  34468. if (_isArray4) {
  34469. if (_i4 >= _iterator4.length) break;
  34470. _ref4 = _iterator4[_i4++];
  34471. } else {
  34472. _i4 = _iterator4.next();
  34473. if (_i4.done) break;
  34474. _ref4 = _i4.value;
  34475. }
  34476. var _type = _ref4;
  34477. if (visitor[_type]) {
  34478. mergePair(visitor[_type], _fns2);
  34479. } else {
  34480. visitor[_type] = _fns2;
  34481. }
  34482. }
  34483. } else {
  34484. mergePair(visitor, _fns2);
  34485. }
  34486. }
  34487. for (var _nodeType in visitor) {
  34488. if (shouldIgnoreKey(_nodeType)) continue;
  34489. var _fns = visitor[_nodeType];
  34490. var aliases = t.FLIPPED_ALIAS_KEYS[_nodeType];
  34491. var deprecratedKey = t.DEPRECATED_KEYS[_nodeType];
  34492. if (deprecratedKey) {
  34493. console.trace("Visitor defined for " + _nodeType + " but it has been renamed to " + deprecratedKey);
  34494. aliases = [deprecratedKey];
  34495. }
  34496. if (!aliases) continue;
  34497. delete visitor[_nodeType];
  34498. for (var _iterator3 = aliases, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) {
  34499. var _ref3;
  34500. if (_isArray3) {
  34501. if (_i3 >= _iterator3.length) break;
  34502. _ref3 = _iterator3[_i3++];
  34503. } else {
  34504. _i3 = _iterator3.next();
  34505. if (_i3.done) break;
  34506. _ref3 = _i3.value;
  34507. }
  34508. var alias = _ref3;
  34509. var existing = visitor[alias];
  34510. if (existing) {
  34511. mergePair(existing, _fns);
  34512. } else {
  34513. visitor[alias] = (0, _clone2.default)(_fns);
  34514. }
  34515. }
  34516. }
  34517. for (var _nodeType2 in visitor) {
  34518. if (shouldIgnoreKey(_nodeType2)) continue;
  34519. ensureCallbackArrays(visitor[_nodeType2]);
  34520. }
  34521. return visitor;
  34522. }
  34523. function verify(visitor) {
  34524. if (visitor._verified) return;
  34525. if (typeof visitor === "function") {
  34526. throw new Error(messages.get("traverseVerifyRootFunction"));
  34527. }
  34528. for (var nodeType in visitor) {
  34529. if (nodeType === "enter" || nodeType === "exit") {
  34530. validateVisitorMethods(nodeType, visitor[nodeType]);
  34531. }
  34532. if (shouldIgnoreKey(nodeType)) continue;
  34533. if (t.TYPES.indexOf(nodeType) < 0) {
  34534. throw new Error(messages.get("traverseVerifyNodeType", nodeType));
  34535. }
  34536. var visitors = visitor[nodeType];
  34537. if ((typeof visitors === "undefined" ? "undefined" : (0, _typeof3.default)(visitors)) === "object") {
  34538. for (var visitorKey in visitors) {
  34539. if (visitorKey === "enter" || visitorKey === "exit") {
  34540. validateVisitorMethods(nodeType + "." + visitorKey, visitors[visitorKey]);
  34541. } else {
  34542. throw new Error(messages.get("traverseVerifyVisitorProperty", nodeType, visitorKey));
  34543. }
  34544. }
  34545. }
  34546. }
  34547. visitor._verified = true;
  34548. }
  34549. function validateVisitorMethods(path, val) {
  34550. var fns = [].concat(val);
  34551. for (var _iterator5 = fns, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, _getIterator3.default)(_iterator5);;) {
  34552. var _ref5;
  34553. if (_isArray5) {
  34554. if (_i5 >= _iterator5.length) break;
  34555. _ref5 = _iterator5[_i5++];
  34556. } else {
  34557. _i5 = _iterator5.next();
  34558. if (_i5.done) break;
  34559. _ref5 = _i5.value;
  34560. }
  34561. var fn = _ref5;
  34562. if (typeof fn !== "function") {
  34563. throw new TypeError("Non-function found defined in " + path + " with type " + (typeof fn === "undefined" ? "undefined" : (0, _typeof3.default)(fn)));
  34564. }
  34565. }
  34566. }
  34567. function merge(visitors) {
  34568. var states = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  34569. var wrapper = arguments[2];
  34570. var rootVisitor = {};
  34571. for (var i = 0; i < visitors.length; i++) {
  34572. var visitor = visitors[i];
  34573. var state = states[i];
  34574. explode(visitor);
  34575. for (var type in visitor) {
  34576. var visitorType = visitor[type];
  34577. if (state || wrapper) {
  34578. visitorType = wrapWithStateOrWrapper(visitorType, state, wrapper);
  34579. }
  34580. var nodeVisitor = rootVisitor[type] = rootVisitor[type] || {};
  34581. mergePair(nodeVisitor, visitorType);
  34582. }
  34583. }
  34584. return rootVisitor;
  34585. }
  34586. function wrapWithStateOrWrapper(oldVisitor, state, wrapper) {
  34587. var newVisitor = {};
  34588. var _loop = function _loop(key) {
  34589. var fns = oldVisitor[key];
  34590. if (!Array.isArray(fns)) return "continue";
  34591. fns = fns.map(function (fn) {
  34592. var newFn = fn;
  34593. if (state) {
  34594. newFn = function newFn(path) {
  34595. return fn.call(state, path, state);
  34596. };
  34597. }
  34598. if (wrapper) {
  34599. newFn = wrapper(state.key, key, newFn);
  34600. }
  34601. return newFn;
  34602. });
  34603. newVisitor[key] = fns;
  34604. };
  34605. for (var key in oldVisitor) {
  34606. var _ret = _loop(key);
  34607. if (_ret === "continue") continue;
  34608. }
  34609. return newVisitor;
  34610. }
  34611. function ensureEntranceObjects(obj) {
  34612. for (var key in obj) {
  34613. if (shouldIgnoreKey(key)) continue;
  34614. var fns = obj[key];
  34615. if (typeof fns === "function") {
  34616. obj[key] = { enter: fns };
  34617. }
  34618. }
  34619. }
  34620. function ensureCallbackArrays(obj) {
  34621. if (obj.enter && !Array.isArray(obj.enter)) obj.enter = [obj.enter];
  34622. if (obj.exit && !Array.isArray(obj.exit)) obj.exit = [obj.exit];
  34623. }
  34624. function wrapCheck(wrapper, fn) {
  34625. var newFn = function newFn(path) {
  34626. if (wrapper.checkPath(path)) {
  34627. return fn.apply(this, arguments);
  34628. }
  34629. };
  34630. newFn.toString = function () {
  34631. return fn.toString();
  34632. };
  34633. return newFn;
  34634. }
  34635. function shouldIgnoreKey(key) {
  34636. if (key[0] === "_") return true;
  34637. if (key === "enter" || key === "exit" || key === "shouldSkip") return true;
  34638. if (key === "blacklist" || key === "noScope" || key === "skipKeys") return true;
  34639. return false;
  34640. }
  34641. function mergePair(dest, src) {
  34642. for (var key in src) {
  34643. dest[key] = [].concat(dest[key] || [], src[key]);
  34644. }
  34645. }
  34646. /***/ }),
  34647. /* 385 */
  34648. /***/ (function(module, exports, __webpack_require__) {
  34649. "use strict";
  34650. exports.__esModule = true;
  34651. var _maxSafeInteger = __webpack_require__(359);
  34652. var _maxSafeInteger2 = _interopRequireDefault(_maxSafeInteger);
  34653. var _stringify = __webpack_require__(35);
  34654. var _stringify2 = _interopRequireDefault(_stringify);
  34655. var _getIterator2 = __webpack_require__(2);
  34656. var _getIterator3 = _interopRequireDefault(_getIterator2);
  34657. exports.toComputedKey = toComputedKey;
  34658. exports.toSequenceExpression = toSequenceExpression;
  34659. exports.toKeyAlias = toKeyAlias;
  34660. exports.toIdentifier = toIdentifier;
  34661. exports.toBindingIdentifierName = toBindingIdentifierName;
  34662. exports.toStatement = toStatement;
  34663. exports.toExpression = toExpression;
  34664. exports.toBlock = toBlock;
  34665. exports.valueToNode = valueToNode;
  34666. var _isPlainObject = __webpack_require__(275);
  34667. var _isPlainObject2 = _interopRequireDefault(_isPlainObject);
  34668. var _isRegExp = __webpack_require__(276);
  34669. var _isRegExp2 = _interopRequireDefault(_isRegExp);
  34670. var _index = __webpack_require__(1);
  34671. var t = _interopRequireWildcard(_index);
  34672. function _interopRequireWildcard(obj) {
  34673. if (obj && obj.__esModule) {
  34674. return obj;
  34675. } else {
  34676. var newObj = {};if (obj != null) {
  34677. for (var key in obj) {
  34678. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  34679. }
  34680. }newObj.default = obj;return newObj;
  34681. }
  34682. }
  34683. function _interopRequireDefault(obj) {
  34684. return obj && obj.__esModule ? obj : { default: obj };
  34685. }
  34686. function toComputedKey(node) {
  34687. var key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : node.key || node.property;
  34688. if (!node.computed) {
  34689. if (t.isIdentifier(key)) key = t.stringLiteral(key.name);
  34690. }
  34691. return key;
  34692. }
  34693. function gatherSequenceExpressions(nodes, scope, declars) {
  34694. var exprs = [];
  34695. var ensureLastUndefined = true;
  34696. for (var _iterator = nodes, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
  34697. var _ref;
  34698. if (_isArray) {
  34699. if (_i >= _iterator.length) break;
  34700. _ref = _iterator[_i++];
  34701. } else {
  34702. _i = _iterator.next();
  34703. if (_i.done) break;
  34704. _ref = _i.value;
  34705. }
  34706. var node = _ref;
  34707. ensureLastUndefined = false;
  34708. if (t.isExpression(node)) {
  34709. exprs.push(node);
  34710. } else if (t.isExpressionStatement(node)) {
  34711. exprs.push(node.expression);
  34712. } else if (t.isVariableDeclaration(node)) {
  34713. if (node.kind !== "var") return;
  34714. for (var _iterator2 = node.declarations, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) {
  34715. var _ref2;
  34716. if (_isArray2) {
  34717. if (_i2 >= _iterator2.length) break;
  34718. _ref2 = _iterator2[_i2++];
  34719. } else {
  34720. _i2 = _iterator2.next();
  34721. if (_i2.done) break;
  34722. _ref2 = _i2.value;
  34723. }
  34724. var declar = _ref2;
  34725. var bindings = t.getBindingIdentifiers(declar);
  34726. for (var key in bindings) {
  34727. declars.push({
  34728. kind: node.kind,
  34729. id: bindings[key]
  34730. });
  34731. }
  34732. if (declar.init) {
  34733. exprs.push(t.assignmentExpression("=", declar.id, declar.init));
  34734. }
  34735. }
  34736. ensureLastUndefined = true;
  34737. } else if (t.isIfStatement(node)) {
  34738. var consequent = node.consequent ? gatherSequenceExpressions([node.consequent], scope, declars) : scope.buildUndefinedNode();
  34739. var alternate = node.alternate ? gatherSequenceExpressions([node.alternate], scope, declars) : scope.buildUndefinedNode();
  34740. if (!consequent || !alternate) return;
  34741. exprs.push(t.conditionalExpression(node.test, consequent, alternate));
  34742. } else if (t.isBlockStatement(node)) {
  34743. var body = gatherSequenceExpressions(node.body, scope, declars);
  34744. if (!body) return;
  34745. exprs.push(body);
  34746. } else if (t.isEmptyStatement(node)) {
  34747. ensureLastUndefined = true;
  34748. } else {
  34749. return;
  34750. }
  34751. }
  34752. if (ensureLastUndefined) {
  34753. exprs.push(scope.buildUndefinedNode());
  34754. }
  34755. if (exprs.length === 1) {
  34756. return exprs[0];
  34757. } else {
  34758. return t.sequenceExpression(exprs);
  34759. }
  34760. }
  34761. function toSequenceExpression(nodes, scope) {
  34762. if (!nodes || !nodes.length) return;
  34763. var declars = [];
  34764. var result = gatherSequenceExpressions(nodes, scope, declars);
  34765. if (!result) return;
  34766. for (var _iterator3 = declars, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) {
  34767. var _ref3;
  34768. if (_isArray3) {
  34769. if (_i3 >= _iterator3.length) break;
  34770. _ref3 = _iterator3[_i3++];
  34771. } else {
  34772. _i3 = _iterator3.next();
  34773. if (_i3.done) break;
  34774. _ref3 = _i3.value;
  34775. }
  34776. var declar = _ref3;
  34777. scope.push(declar);
  34778. }
  34779. return result;
  34780. }
  34781. function toKeyAlias(node) {
  34782. var key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : node.key;
  34783. var alias = void 0;
  34784. if (node.kind === "method") {
  34785. return toKeyAlias.increment() + "";
  34786. } else if (t.isIdentifier(key)) {
  34787. alias = key.name;
  34788. } else if (t.isStringLiteral(key)) {
  34789. alias = (0, _stringify2.default)(key.value);
  34790. } else {
  34791. alias = (0, _stringify2.default)(t.removePropertiesDeep(t.cloneDeep(key)));
  34792. }
  34793. if (node.computed) {
  34794. alias = "[" + alias + "]";
  34795. }
  34796. if (node.static) {
  34797. alias = "static:" + alias;
  34798. }
  34799. return alias;
  34800. }
  34801. toKeyAlias.uid = 0;
  34802. toKeyAlias.increment = function () {
  34803. if (toKeyAlias.uid >= _maxSafeInteger2.default) {
  34804. return toKeyAlias.uid = 0;
  34805. } else {
  34806. return toKeyAlias.uid++;
  34807. }
  34808. };
  34809. function toIdentifier(name) {
  34810. name = name + "";
  34811. name = name.replace(/[^a-zA-Z0-9$_]/g, "-");
  34812. name = name.replace(/^[-0-9]+/, "");
  34813. name = name.replace(/[-\s]+(.)?/g, function (match, c) {
  34814. return c ? c.toUpperCase() : "";
  34815. });
  34816. if (!t.isValidIdentifier(name)) {
  34817. name = "_" + name;
  34818. }
  34819. return name || "_";
  34820. }
  34821. function toBindingIdentifierName(name) {
  34822. name = toIdentifier(name);
  34823. if (name === "eval" || name === "arguments") name = "_" + name;
  34824. return name;
  34825. }
  34826. function toStatement(node, ignore) {
  34827. if (t.isStatement(node)) {
  34828. return node;
  34829. }
  34830. var mustHaveId = false;
  34831. var newType = void 0;
  34832. if (t.isClass(node)) {
  34833. mustHaveId = true;
  34834. newType = "ClassDeclaration";
  34835. } else if (t.isFunction(node)) {
  34836. mustHaveId = true;
  34837. newType = "FunctionDeclaration";
  34838. } else if (t.isAssignmentExpression(node)) {
  34839. return t.expressionStatement(node);
  34840. }
  34841. if (mustHaveId && !node.id) {
  34842. newType = false;
  34843. }
  34844. if (!newType) {
  34845. if (ignore) {
  34846. return false;
  34847. } else {
  34848. throw new Error("cannot turn " + node.type + " to a statement");
  34849. }
  34850. }
  34851. node.type = newType;
  34852. return node;
  34853. }
  34854. function toExpression(node) {
  34855. if (t.isExpressionStatement(node)) {
  34856. node = node.expression;
  34857. }
  34858. if (t.isExpression(node)) {
  34859. return node;
  34860. }
  34861. if (t.isClass(node)) {
  34862. node.type = "ClassExpression";
  34863. } else if (t.isFunction(node)) {
  34864. node.type = "FunctionExpression";
  34865. }
  34866. if (!t.isExpression(node)) {
  34867. throw new Error("cannot turn " + node.type + " to an expression");
  34868. }
  34869. return node;
  34870. }
  34871. function toBlock(node, parent) {
  34872. if (t.isBlockStatement(node)) {
  34873. return node;
  34874. }
  34875. if (t.isEmptyStatement(node)) {
  34876. node = [];
  34877. }
  34878. if (!Array.isArray(node)) {
  34879. if (!t.isStatement(node)) {
  34880. if (t.isFunction(parent)) {
  34881. node = t.returnStatement(node);
  34882. } else {
  34883. node = t.expressionStatement(node);
  34884. }
  34885. }
  34886. node = [node];
  34887. }
  34888. return t.blockStatement(node);
  34889. }
  34890. function valueToNode(value) {
  34891. if (value === undefined) {
  34892. return t.identifier("undefined");
  34893. }
  34894. if (value === true || value === false) {
  34895. return t.booleanLiteral(value);
  34896. }
  34897. if (value === null) {
  34898. return t.nullLiteral();
  34899. }
  34900. if (typeof value === "string") {
  34901. return t.stringLiteral(value);
  34902. }
  34903. if (typeof value === "number") {
  34904. return t.numericLiteral(value);
  34905. }
  34906. if ((0, _isRegExp2.default)(value)) {
  34907. var pattern = value.source;
  34908. var flags = value.toString().match(/\/([a-z]+|)$/)[1];
  34909. return t.regExpLiteral(pattern, flags);
  34910. }
  34911. if (Array.isArray(value)) {
  34912. return t.arrayExpression(value.map(t.valueToNode));
  34913. }
  34914. if ((0, _isPlainObject2.default)(value)) {
  34915. var props = [];
  34916. for (var key in value) {
  34917. var nodeKey = void 0;
  34918. if (t.isValidIdentifier(key)) {
  34919. nodeKey = t.identifier(key);
  34920. } else {
  34921. nodeKey = t.stringLiteral(key);
  34922. }
  34923. props.push(t.objectProperty(nodeKey, t.valueToNode(value[key])));
  34924. }
  34925. return t.objectExpression(props);
  34926. }
  34927. throw new Error("don't know how to turn this value into a node");
  34928. }
  34929. /***/ }),
  34930. /* 386 */
  34931. /***/ (function(module, exports, __webpack_require__) {
  34932. "use strict";
  34933. var _index = __webpack_require__(1);
  34934. var t = _interopRequireWildcard(_index);
  34935. var _constants = __webpack_require__(135);
  34936. var _index2 = __webpack_require__(26);
  34937. var _index3 = _interopRequireDefault(_index2);
  34938. function _interopRequireDefault(obj) {
  34939. return obj && obj.__esModule ? obj : { default: obj };
  34940. }
  34941. function _interopRequireWildcard(obj) {
  34942. if (obj && obj.__esModule) {
  34943. return obj;
  34944. } else {
  34945. var newObj = {};if (obj != null) {
  34946. for (var key in obj) {
  34947. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  34948. }
  34949. }newObj.default = obj;return newObj;
  34950. }
  34951. }
  34952. (0, _index3.default)("ArrayExpression", {
  34953. fields: {
  34954. elements: {
  34955. validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeOrValueType)("null", "Expression", "SpreadElement"))),
  34956. default: []
  34957. }
  34958. },
  34959. visitor: ["elements"],
  34960. aliases: ["Expression"]
  34961. });
  34962. (0, _index3.default)("AssignmentExpression", {
  34963. fields: {
  34964. operator: {
  34965. validate: (0, _index2.assertValueType)("string")
  34966. },
  34967. left: {
  34968. validate: (0, _index2.assertNodeType)("LVal")
  34969. },
  34970. right: {
  34971. validate: (0, _index2.assertNodeType)("Expression")
  34972. }
  34973. },
  34974. builder: ["operator", "left", "right"],
  34975. visitor: ["left", "right"],
  34976. aliases: ["Expression"]
  34977. });
  34978. (0, _index3.default)("BinaryExpression", {
  34979. builder: ["operator", "left", "right"],
  34980. fields: {
  34981. operator: {
  34982. validate: _index2.assertOneOf.apply(undefined, _constants.BINARY_OPERATORS)
  34983. },
  34984. left: {
  34985. validate: (0, _index2.assertNodeType)("Expression")
  34986. },
  34987. right: {
  34988. validate: (0, _index2.assertNodeType)("Expression")
  34989. }
  34990. },
  34991. visitor: ["left", "right"],
  34992. aliases: ["Binary", "Expression"]
  34993. });
  34994. (0, _index3.default)("Directive", {
  34995. visitor: ["value"],
  34996. fields: {
  34997. value: {
  34998. validate: (0, _index2.assertNodeType)("DirectiveLiteral")
  34999. }
  35000. }
  35001. });
  35002. (0, _index3.default)("DirectiveLiteral", {
  35003. builder: ["value"],
  35004. fields: {
  35005. value: {
  35006. validate: (0, _index2.assertValueType)("string")
  35007. }
  35008. }
  35009. });
  35010. (0, _index3.default)("BlockStatement", {
  35011. builder: ["body", "directives"],
  35012. visitor: ["directives", "body"],
  35013. fields: {
  35014. directives: {
  35015. validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Directive"))),
  35016. default: []
  35017. },
  35018. body: {
  35019. validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Statement")))
  35020. }
  35021. },
  35022. aliases: ["Scopable", "BlockParent", "Block", "Statement"]
  35023. });
  35024. (0, _index3.default)("BreakStatement", {
  35025. visitor: ["label"],
  35026. fields: {
  35027. label: {
  35028. validate: (0, _index2.assertNodeType)("Identifier"),
  35029. optional: true
  35030. }
  35031. },
  35032. aliases: ["Statement", "Terminatorless", "CompletionStatement"]
  35033. });
  35034. (0, _index3.default)("CallExpression", {
  35035. visitor: ["callee", "arguments"],
  35036. fields: {
  35037. callee: {
  35038. validate: (0, _index2.assertNodeType)("Expression")
  35039. },
  35040. arguments: {
  35041. validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Expression", "SpreadElement")))
  35042. }
  35043. },
  35044. aliases: ["Expression"]
  35045. });
  35046. (0, _index3.default)("CatchClause", {
  35047. visitor: ["param", "body"],
  35048. fields: {
  35049. param: {
  35050. validate: (0, _index2.assertNodeType)("Identifier")
  35051. },
  35052. body: {
  35053. validate: (0, _index2.assertNodeType)("BlockStatement")
  35054. }
  35055. },
  35056. aliases: ["Scopable"]
  35057. });
  35058. (0, _index3.default)("ConditionalExpression", {
  35059. visitor: ["test", "consequent", "alternate"],
  35060. fields: {
  35061. test: {
  35062. validate: (0, _index2.assertNodeType)("Expression")
  35063. },
  35064. consequent: {
  35065. validate: (0, _index2.assertNodeType)("Expression")
  35066. },
  35067. alternate: {
  35068. validate: (0, _index2.assertNodeType)("Expression")
  35069. }
  35070. },
  35071. aliases: ["Expression", "Conditional"]
  35072. });
  35073. (0, _index3.default)("ContinueStatement", {
  35074. visitor: ["label"],
  35075. fields: {
  35076. label: {
  35077. validate: (0, _index2.assertNodeType)("Identifier"),
  35078. optional: true
  35079. }
  35080. },
  35081. aliases: ["Statement", "Terminatorless", "CompletionStatement"]
  35082. });
  35083. (0, _index3.default)("DebuggerStatement", {
  35084. aliases: ["Statement"]
  35085. });
  35086. (0, _index3.default)("DoWhileStatement", {
  35087. visitor: ["test", "body"],
  35088. fields: {
  35089. test: {
  35090. validate: (0, _index2.assertNodeType)("Expression")
  35091. },
  35092. body: {
  35093. validate: (0, _index2.assertNodeType)("Statement")
  35094. }
  35095. },
  35096. aliases: ["Statement", "BlockParent", "Loop", "While", "Scopable"]
  35097. });
  35098. (0, _index3.default)("EmptyStatement", {
  35099. aliases: ["Statement"]
  35100. });
  35101. (0, _index3.default)("ExpressionStatement", {
  35102. visitor: ["expression"],
  35103. fields: {
  35104. expression: {
  35105. validate: (0, _index2.assertNodeType)("Expression")
  35106. }
  35107. },
  35108. aliases: ["Statement", "ExpressionWrapper"]
  35109. });
  35110. (0, _index3.default)("File", {
  35111. builder: ["program", "comments", "tokens"],
  35112. visitor: ["program"],
  35113. fields: {
  35114. program: {
  35115. validate: (0, _index2.assertNodeType)("Program")
  35116. }
  35117. }
  35118. });
  35119. (0, _index3.default)("ForInStatement", {
  35120. visitor: ["left", "right", "body"],
  35121. aliases: ["Scopable", "Statement", "For", "BlockParent", "Loop", "ForXStatement"],
  35122. fields: {
  35123. left: {
  35124. validate: (0, _index2.assertNodeType)("VariableDeclaration", "LVal")
  35125. },
  35126. right: {
  35127. validate: (0, _index2.assertNodeType)("Expression")
  35128. },
  35129. body: {
  35130. validate: (0, _index2.assertNodeType)("Statement")
  35131. }
  35132. }
  35133. });
  35134. (0, _index3.default)("ForStatement", {
  35135. visitor: ["init", "test", "update", "body"],
  35136. aliases: ["Scopable", "Statement", "For", "BlockParent", "Loop"],
  35137. fields: {
  35138. init: {
  35139. validate: (0, _index2.assertNodeType)("VariableDeclaration", "Expression"),
  35140. optional: true
  35141. },
  35142. test: {
  35143. validate: (0, _index2.assertNodeType)("Expression"),
  35144. optional: true
  35145. },
  35146. update: {
  35147. validate: (0, _index2.assertNodeType)("Expression"),
  35148. optional: true
  35149. },
  35150. body: {
  35151. validate: (0, _index2.assertNodeType)("Statement")
  35152. }
  35153. }
  35154. });
  35155. (0, _index3.default)("FunctionDeclaration", {
  35156. builder: ["id", "params", "body", "generator", "async"],
  35157. visitor: ["id", "params", "body", "returnType", "typeParameters"],
  35158. fields: {
  35159. id: {
  35160. validate: (0, _index2.assertNodeType)("Identifier")
  35161. },
  35162. params: {
  35163. validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("LVal")))
  35164. },
  35165. body: {
  35166. validate: (0, _index2.assertNodeType)("BlockStatement")
  35167. },
  35168. generator: {
  35169. default: false,
  35170. validate: (0, _index2.assertValueType)("boolean")
  35171. },
  35172. async: {
  35173. default: false,
  35174. validate: (0, _index2.assertValueType)("boolean")
  35175. }
  35176. },
  35177. aliases: ["Scopable", "Function", "BlockParent", "FunctionParent", "Statement", "Pureish", "Declaration"]
  35178. });
  35179. (0, _index3.default)("FunctionExpression", {
  35180. inherits: "FunctionDeclaration",
  35181. aliases: ["Scopable", "Function", "BlockParent", "FunctionParent", "Expression", "Pureish"],
  35182. fields: {
  35183. id: {
  35184. validate: (0, _index2.assertNodeType)("Identifier"),
  35185. optional: true
  35186. },
  35187. params: {
  35188. validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("LVal")))
  35189. },
  35190. body: {
  35191. validate: (0, _index2.assertNodeType)("BlockStatement")
  35192. },
  35193. generator: {
  35194. default: false,
  35195. validate: (0, _index2.assertValueType)("boolean")
  35196. },
  35197. async: {
  35198. default: false,
  35199. validate: (0, _index2.assertValueType)("boolean")
  35200. }
  35201. }
  35202. });
  35203. (0, _index3.default)("Identifier", {
  35204. builder: ["name"],
  35205. visitor: ["typeAnnotation"],
  35206. aliases: ["Expression", "LVal"],
  35207. fields: {
  35208. name: {
  35209. validate: function validate(node, key, val) {
  35210. if (!t.isValidIdentifier(val)) {}
  35211. }
  35212. },
  35213. decorators: {
  35214. validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Decorator")))
  35215. }
  35216. }
  35217. });
  35218. (0, _index3.default)("IfStatement", {
  35219. visitor: ["test", "consequent", "alternate"],
  35220. aliases: ["Statement", "Conditional"],
  35221. fields: {
  35222. test: {
  35223. validate: (0, _index2.assertNodeType)("Expression")
  35224. },
  35225. consequent: {
  35226. validate: (0, _index2.assertNodeType)("Statement")
  35227. },
  35228. alternate: {
  35229. optional: true,
  35230. validate: (0, _index2.assertNodeType)("Statement")
  35231. }
  35232. }
  35233. });
  35234. (0, _index3.default)("LabeledStatement", {
  35235. visitor: ["label", "body"],
  35236. aliases: ["Statement"],
  35237. fields: {
  35238. label: {
  35239. validate: (0, _index2.assertNodeType)("Identifier")
  35240. },
  35241. body: {
  35242. validate: (0, _index2.assertNodeType)("Statement")
  35243. }
  35244. }
  35245. });
  35246. (0, _index3.default)("StringLiteral", {
  35247. builder: ["value"],
  35248. fields: {
  35249. value: {
  35250. validate: (0, _index2.assertValueType)("string")
  35251. }
  35252. },
  35253. aliases: ["Expression", "Pureish", "Literal", "Immutable"]
  35254. });
  35255. (0, _index3.default)("NumericLiteral", {
  35256. builder: ["value"],
  35257. deprecatedAlias: "NumberLiteral",
  35258. fields: {
  35259. value: {
  35260. validate: (0, _index2.assertValueType)("number")
  35261. }
  35262. },
  35263. aliases: ["Expression", "Pureish", "Literal", "Immutable"]
  35264. });
  35265. (0, _index3.default)("NullLiteral", {
  35266. aliases: ["Expression", "Pureish", "Literal", "Immutable"]
  35267. });
  35268. (0, _index3.default)("BooleanLiteral", {
  35269. builder: ["value"],
  35270. fields: {
  35271. value: {
  35272. validate: (0, _index2.assertValueType)("boolean")
  35273. }
  35274. },
  35275. aliases: ["Expression", "Pureish", "Literal", "Immutable"]
  35276. });
  35277. (0, _index3.default)("RegExpLiteral", {
  35278. builder: ["pattern", "flags"],
  35279. deprecatedAlias: "RegexLiteral",
  35280. aliases: ["Expression", "Literal"],
  35281. fields: {
  35282. pattern: {
  35283. validate: (0, _index2.assertValueType)("string")
  35284. },
  35285. flags: {
  35286. validate: (0, _index2.assertValueType)("string"),
  35287. default: ""
  35288. }
  35289. }
  35290. });
  35291. (0, _index3.default)("LogicalExpression", {
  35292. builder: ["operator", "left", "right"],
  35293. visitor: ["left", "right"],
  35294. aliases: ["Binary", "Expression"],
  35295. fields: {
  35296. operator: {
  35297. validate: _index2.assertOneOf.apply(undefined, _constants.LOGICAL_OPERATORS)
  35298. },
  35299. left: {
  35300. validate: (0, _index2.assertNodeType)("Expression")
  35301. },
  35302. right: {
  35303. validate: (0, _index2.assertNodeType)("Expression")
  35304. }
  35305. }
  35306. });
  35307. (0, _index3.default)("MemberExpression", {
  35308. builder: ["object", "property", "computed"],
  35309. visitor: ["object", "property"],
  35310. aliases: ["Expression", "LVal"],
  35311. fields: {
  35312. object: {
  35313. validate: (0, _index2.assertNodeType)("Expression")
  35314. },
  35315. property: {
  35316. validate: function validate(node, key, val) {
  35317. var expectedType = node.computed ? "Expression" : "Identifier";
  35318. (0, _index2.assertNodeType)(expectedType)(node, key, val);
  35319. }
  35320. },
  35321. computed: {
  35322. default: false
  35323. }
  35324. }
  35325. });
  35326. (0, _index3.default)("NewExpression", {
  35327. visitor: ["callee", "arguments"],
  35328. aliases: ["Expression"],
  35329. fields: {
  35330. callee: {
  35331. validate: (0, _index2.assertNodeType)("Expression")
  35332. },
  35333. arguments: {
  35334. validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Expression", "SpreadElement")))
  35335. }
  35336. }
  35337. });
  35338. (0, _index3.default)("Program", {
  35339. visitor: ["directives", "body"],
  35340. builder: ["body", "directives"],
  35341. fields: {
  35342. directives: {
  35343. validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Directive"))),
  35344. default: []
  35345. },
  35346. body: {
  35347. validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Statement")))
  35348. }
  35349. },
  35350. aliases: ["Scopable", "BlockParent", "Block", "FunctionParent"]
  35351. });
  35352. (0, _index3.default)("ObjectExpression", {
  35353. visitor: ["properties"],
  35354. aliases: ["Expression"],
  35355. fields: {
  35356. properties: {
  35357. validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("ObjectMethod", "ObjectProperty", "SpreadProperty")))
  35358. }
  35359. }
  35360. });
  35361. (0, _index3.default)("ObjectMethod", {
  35362. builder: ["kind", "key", "params", "body", "computed"],
  35363. fields: {
  35364. kind: {
  35365. validate: (0, _index2.chain)((0, _index2.assertValueType)("string"), (0, _index2.assertOneOf)("method", "get", "set")),
  35366. default: "method"
  35367. },
  35368. computed: {
  35369. validate: (0, _index2.assertValueType)("boolean"),
  35370. default: false
  35371. },
  35372. key: {
  35373. validate: function validate(node, key, val) {
  35374. var expectedTypes = node.computed ? ["Expression"] : ["Identifier", "StringLiteral", "NumericLiteral"];
  35375. _index2.assertNodeType.apply(undefined, expectedTypes)(node, key, val);
  35376. }
  35377. },
  35378. decorators: {
  35379. validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Decorator")))
  35380. },
  35381. body: {
  35382. validate: (0, _index2.assertNodeType)("BlockStatement")
  35383. },
  35384. generator: {
  35385. default: false,
  35386. validate: (0, _index2.assertValueType)("boolean")
  35387. },
  35388. async: {
  35389. default: false,
  35390. validate: (0, _index2.assertValueType)("boolean")
  35391. }
  35392. },
  35393. visitor: ["key", "params", "body", "decorators", "returnType", "typeParameters"],
  35394. aliases: ["UserWhitespacable", "Function", "Scopable", "BlockParent", "FunctionParent", "Method", "ObjectMember"]
  35395. });
  35396. (0, _index3.default)("ObjectProperty", {
  35397. builder: ["key", "value", "computed", "shorthand", "decorators"],
  35398. fields: {
  35399. computed: {
  35400. validate: (0, _index2.assertValueType)("boolean"),
  35401. default: false
  35402. },
  35403. key: {
  35404. validate: function validate(node, key, val) {
  35405. var expectedTypes = node.computed ? ["Expression"] : ["Identifier", "StringLiteral", "NumericLiteral"];
  35406. _index2.assertNodeType.apply(undefined, expectedTypes)(node, key, val);
  35407. }
  35408. },
  35409. value: {
  35410. validate: (0, _index2.assertNodeType)("Expression", "Pattern", "RestElement")
  35411. },
  35412. shorthand: {
  35413. validate: (0, _index2.assertValueType)("boolean"),
  35414. default: false
  35415. },
  35416. decorators: {
  35417. validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Decorator"))),
  35418. optional: true
  35419. }
  35420. },
  35421. visitor: ["key", "value", "decorators"],
  35422. aliases: ["UserWhitespacable", "Property", "ObjectMember"]
  35423. });
  35424. (0, _index3.default)("RestElement", {
  35425. visitor: ["argument", "typeAnnotation"],
  35426. aliases: ["LVal"],
  35427. fields: {
  35428. argument: {
  35429. validate: (0, _index2.assertNodeType)("LVal")
  35430. },
  35431. decorators: {
  35432. validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Decorator")))
  35433. }
  35434. }
  35435. });
  35436. (0, _index3.default)("ReturnStatement", {
  35437. visitor: ["argument"],
  35438. aliases: ["Statement", "Terminatorless", "CompletionStatement"],
  35439. fields: {
  35440. argument: {
  35441. validate: (0, _index2.assertNodeType)("Expression"),
  35442. optional: true
  35443. }
  35444. }
  35445. });
  35446. (0, _index3.default)("SequenceExpression", {
  35447. visitor: ["expressions"],
  35448. fields: {
  35449. expressions: {
  35450. validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Expression")))
  35451. }
  35452. },
  35453. aliases: ["Expression"]
  35454. });
  35455. (0, _index3.default)("SwitchCase", {
  35456. visitor: ["test", "consequent"],
  35457. fields: {
  35458. test: {
  35459. validate: (0, _index2.assertNodeType)("Expression"),
  35460. optional: true
  35461. },
  35462. consequent: {
  35463. validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Statement")))
  35464. }
  35465. }
  35466. });
  35467. (0, _index3.default)("SwitchStatement", {
  35468. visitor: ["discriminant", "cases"],
  35469. aliases: ["Statement", "BlockParent", "Scopable"],
  35470. fields: {
  35471. discriminant: {
  35472. validate: (0, _index2.assertNodeType)("Expression")
  35473. },
  35474. cases: {
  35475. validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("SwitchCase")))
  35476. }
  35477. }
  35478. });
  35479. (0, _index3.default)("ThisExpression", {
  35480. aliases: ["Expression"]
  35481. });
  35482. (0, _index3.default)("ThrowStatement", {
  35483. visitor: ["argument"],
  35484. aliases: ["Statement", "Terminatorless", "CompletionStatement"],
  35485. fields: {
  35486. argument: {
  35487. validate: (0, _index2.assertNodeType)("Expression")
  35488. }
  35489. }
  35490. });
  35491. (0, _index3.default)("TryStatement", {
  35492. visitor: ["block", "handler", "finalizer"],
  35493. aliases: ["Statement"],
  35494. fields: {
  35495. body: {
  35496. validate: (0, _index2.assertNodeType)("BlockStatement")
  35497. },
  35498. handler: {
  35499. optional: true,
  35500. handler: (0, _index2.assertNodeType)("BlockStatement")
  35501. },
  35502. finalizer: {
  35503. optional: true,
  35504. validate: (0, _index2.assertNodeType)("BlockStatement")
  35505. }
  35506. }
  35507. });
  35508. (0, _index3.default)("UnaryExpression", {
  35509. builder: ["operator", "argument", "prefix"],
  35510. fields: {
  35511. prefix: {
  35512. default: true
  35513. },
  35514. argument: {
  35515. validate: (0, _index2.assertNodeType)("Expression")
  35516. },
  35517. operator: {
  35518. validate: _index2.assertOneOf.apply(undefined, _constants.UNARY_OPERATORS)
  35519. }
  35520. },
  35521. visitor: ["argument"],
  35522. aliases: ["UnaryLike", "Expression"]
  35523. });
  35524. (0, _index3.default)("UpdateExpression", {
  35525. builder: ["operator", "argument", "prefix"],
  35526. fields: {
  35527. prefix: {
  35528. default: false
  35529. },
  35530. argument: {
  35531. validate: (0, _index2.assertNodeType)("Expression")
  35532. },
  35533. operator: {
  35534. validate: _index2.assertOneOf.apply(undefined, _constants.UPDATE_OPERATORS)
  35535. }
  35536. },
  35537. visitor: ["argument"],
  35538. aliases: ["Expression"]
  35539. });
  35540. (0, _index3.default)("VariableDeclaration", {
  35541. builder: ["kind", "declarations"],
  35542. visitor: ["declarations"],
  35543. aliases: ["Statement", "Declaration"],
  35544. fields: {
  35545. kind: {
  35546. validate: (0, _index2.chain)((0, _index2.assertValueType)("string"), (0, _index2.assertOneOf)("var", "let", "const"))
  35547. },
  35548. declarations: {
  35549. validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("VariableDeclarator")))
  35550. }
  35551. }
  35552. });
  35553. (0, _index3.default)("VariableDeclarator", {
  35554. visitor: ["id", "init"],
  35555. fields: {
  35556. id: {
  35557. validate: (0, _index2.assertNodeType)("LVal")
  35558. },
  35559. init: {
  35560. optional: true,
  35561. validate: (0, _index2.assertNodeType)("Expression")
  35562. }
  35563. }
  35564. });
  35565. (0, _index3.default)("WhileStatement", {
  35566. visitor: ["test", "body"],
  35567. aliases: ["Statement", "BlockParent", "Loop", "While", "Scopable"],
  35568. fields: {
  35569. test: {
  35570. validate: (0, _index2.assertNodeType)("Expression")
  35571. },
  35572. body: {
  35573. validate: (0, _index2.assertNodeType)("BlockStatement", "Statement")
  35574. }
  35575. }
  35576. });
  35577. (0, _index3.default)("WithStatement", {
  35578. visitor: ["object", "body"],
  35579. aliases: ["Statement"],
  35580. fields: {
  35581. object: {
  35582. object: (0, _index2.assertNodeType)("Expression")
  35583. },
  35584. body: {
  35585. validate: (0, _index2.assertNodeType)("BlockStatement", "Statement")
  35586. }
  35587. }
  35588. });
  35589. /***/ }),
  35590. /* 387 */
  35591. /***/ (function(module, exports, __webpack_require__) {
  35592. "use strict";
  35593. var _index = __webpack_require__(26);
  35594. var _index2 = _interopRequireDefault(_index);
  35595. function _interopRequireDefault(obj) {
  35596. return obj && obj.__esModule ? obj : { default: obj };
  35597. }
  35598. (0, _index2.default)("AssignmentPattern", {
  35599. visitor: ["left", "right"],
  35600. aliases: ["Pattern", "LVal"],
  35601. fields: {
  35602. left: {
  35603. validate: (0, _index.assertNodeType)("Identifier")
  35604. },
  35605. right: {
  35606. validate: (0, _index.assertNodeType)("Expression")
  35607. },
  35608. decorators: {
  35609. validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("Decorator")))
  35610. }
  35611. }
  35612. });
  35613. (0, _index2.default)("ArrayPattern", {
  35614. visitor: ["elements", "typeAnnotation"],
  35615. aliases: ["Pattern", "LVal"],
  35616. fields: {
  35617. elements: {
  35618. validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("Identifier", "Pattern", "RestElement")))
  35619. },
  35620. decorators: {
  35621. validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("Decorator")))
  35622. }
  35623. }
  35624. });
  35625. (0, _index2.default)("ArrowFunctionExpression", {
  35626. builder: ["params", "body", "async"],
  35627. visitor: ["params", "body", "returnType", "typeParameters"],
  35628. aliases: ["Scopable", "Function", "BlockParent", "FunctionParent", "Expression", "Pureish"],
  35629. fields: {
  35630. params: {
  35631. validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("LVal")))
  35632. },
  35633. body: {
  35634. validate: (0, _index.assertNodeType)("BlockStatement", "Expression")
  35635. },
  35636. async: {
  35637. validate: (0, _index.assertValueType)("boolean"),
  35638. default: false
  35639. }
  35640. }
  35641. });
  35642. (0, _index2.default)("ClassBody", {
  35643. visitor: ["body"],
  35644. fields: {
  35645. body: {
  35646. validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("ClassMethod", "ClassProperty")))
  35647. }
  35648. }
  35649. });
  35650. (0, _index2.default)("ClassDeclaration", {
  35651. builder: ["id", "superClass", "body", "decorators"],
  35652. visitor: ["id", "body", "superClass", "mixins", "typeParameters", "superTypeParameters", "implements", "decorators"],
  35653. aliases: ["Scopable", "Class", "Statement", "Declaration", "Pureish"],
  35654. fields: {
  35655. id: {
  35656. validate: (0, _index.assertNodeType)("Identifier")
  35657. },
  35658. body: {
  35659. validate: (0, _index.assertNodeType)("ClassBody")
  35660. },
  35661. superClass: {
  35662. optional: true,
  35663. validate: (0, _index.assertNodeType)("Expression")
  35664. },
  35665. decorators: {
  35666. validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("Decorator")))
  35667. }
  35668. }
  35669. });
  35670. (0, _index2.default)("ClassExpression", {
  35671. inherits: "ClassDeclaration",
  35672. aliases: ["Scopable", "Class", "Expression", "Pureish"],
  35673. fields: {
  35674. id: {
  35675. optional: true,
  35676. validate: (0, _index.assertNodeType)("Identifier")
  35677. },
  35678. body: {
  35679. validate: (0, _index.assertNodeType)("ClassBody")
  35680. },
  35681. superClass: {
  35682. optional: true,
  35683. validate: (0, _index.assertNodeType)("Expression")
  35684. },
  35685. decorators: {
  35686. validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("Decorator")))
  35687. }
  35688. }
  35689. });
  35690. (0, _index2.default)("ExportAllDeclaration", {
  35691. visitor: ["source"],
  35692. aliases: ["Statement", "Declaration", "ModuleDeclaration", "ExportDeclaration"],
  35693. fields: {
  35694. source: {
  35695. validate: (0, _index.assertNodeType)("StringLiteral")
  35696. }
  35697. }
  35698. });
  35699. (0, _index2.default)("ExportDefaultDeclaration", {
  35700. visitor: ["declaration"],
  35701. aliases: ["Statement", "Declaration", "ModuleDeclaration", "ExportDeclaration"],
  35702. fields: {
  35703. declaration: {
  35704. validate: (0, _index.assertNodeType)("FunctionDeclaration", "ClassDeclaration", "Expression")
  35705. }
  35706. }
  35707. });
  35708. (0, _index2.default)("ExportNamedDeclaration", {
  35709. visitor: ["declaration", "specifiers", "source"],
  35710. aliases: ["Statement", "Declaration", "ModuleDeclaration", "ExportDeclaration"],
  35711. fields: {
  35712. declaration: {
  35713. validate: (0, _index.assertNodeType)("Declaration"),
  35714. optional: true
  35715. },
  35716. specifiers: {
  35717. validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("ExportSpecifier")))
  35718. },
  35719. source: {
  35720. validate: (0, _index.assertNodeType)("StringLiteral"),
  35721. optional: true
  35722. }
  35723. }
  35724. });
  35725. (0, _index2.default)("ExportSpecifier", {
  35726. visitor: ["local", "exported"],
  35727. aliases: ["ModuleSpecifier"],
  35728. fields: {
  35729. local: {
  35730. validate: (0, _index.assertNodeType)("Identifier")
  35731. },
  35732. exported: {
  35733. validate: (0, _index.assertNodeType)("Identifier")
  35734. }
  35735. }
  35736. });
  35737. (0, _index2.default)("ForOfStatement", {
  35738. visitor: ["left", "right", "body"],
  35739. aliases: ["Scopable", "Statement", "For", "BlockParent", "Loop", "ForXStatement"],
  35740. fields: {
  35741. left: {
  35742. validate: (0, _index.assertNodeType)("VariableDeclaration", "LVal")
  35743. },
  35744. right: {
  35745. validate: (0, _index.assertNodeType)("Expression")
  35746. },
  35747. body: {
  35748. validate: (0, _index.assertNodeType)("Statement")
  35749. }
  35750. }
  35751. });
  35752. (0, _index2.default)("ImportDeclaration", {
  35753. visitor: ["specifiers", "source"],
  35754. aliases: ["Statement", "Declaration", "ModuleDeclaration"],
  35755. fields: {
  35756. specifiers: {
  35757. validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("ImportSpecifier", "ImportDefaultSpecifier", "ImportNamespaceSpecifier")))
  35758. },
  35759. source: {
  35760. validate: (0, _index.assertNodeType)("StringLiteral")
  35761. }
  35762. }
  35763. });
  35764. (0, _index2.default)("ImportDefaultSpecifier", {
  35765. visitor: ["local"],
  35766. aliases: ["ModuleSpecifier"],
  35767. fields: {
  35768. local: {
  35769. validate: (0, _index.assertNodeType)("Identifier")
  35770. }
  35771. }
  35772. });
  35773. (0, _index2.default)("ImportNamespaceSpecifier", {
  35774. visitor: ["local"],
  35775. aliases: ["ModuleSpecifier"],
  35776. fields: {
  35777. local: {
  35778. validate: (0, _index.assertNodeType)("Identifier")
  35779. }
  35780. }
  35781. });
  35782. (0, _index2.default)("ImportSpecifier", {
  35783. visitor: ["local", "imported"],
  35784. aliases: ["ModuleSpecifier"],
  35785. fields: {
  35786. local: {
  35787. validate: (0, _index.assertNodeType)("Identifier")
  35788. },
  35789. imported: {
  35790. validate: (0, _index.assertNodeType)("Identifier")
  35791. },
  35792. importKind: {
  35793. validate: (0, _index.assertOneOf)(null, "type", "typeof")
  35794. }
  35795. }
  35796. });
  35797. (0, _index2.default)("MetaProperty", {
  35798. visitor: ["meta", "property"],
  35799. aliases: ["Expression"],
  35800. fields: {
  35801. meta: {
  35802. validate: (0, _index.assertValueType)("string")
  35803. },
  35804. property: {
  35805. validate: (0, _index.assertValueType)("string")
  35806. }
  35807. }
  35808. });
  35809. (0, _index2.default)("ClassMethod", {
  35810. aliases: ["Function", "Scopable", "BlockParent", "FunctionParent", "Method"],
  35811. builder: ["kind", "key", "params", "body", "computed", "static"],
  35812. visitor: ["key", "params", "body", "decorators", "returnType", "typeParameters"],
  35813. fields: {
  35814. kind: {
  35815. validate: (0, _index.chain)((0, _index.assertValueType)("string"), (0, _index.assertOneOf)("get", "set", "method", "constructor")),
  35816. default: "method"
  35817. },
  35818. computed: {
  35819. default: false,
  35820. validate: (0, _index.assertValueType)("boolean")
  35821. },
  35822. static: {
  35823. default: false,
  35824. validate: (0, _index.assertValueType)("boolean")
  35825. },
  35826. key: {
  35827. validate: function validate(node, key, val) {
  35828. var expectedTypes = node.computed ? ["Expression"] : ["Identifier", "StringLiteral", "NumericLiteral"];
  35829. _index.assertNodeType.apply(undefined, expectedTypes)(node, key, val);
  35830. }
  35831. },
  35832. params: {
  35833. validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("LVal")))
  35834. },
  35835. body: {
  35836. validate: (0, _index.assertNodeType)("BlockStatement")
  35837. },
  35838. generator: {
  35839. default: false,
  35840. validate: (0, _index.assertValueType)("boolean")
  35841. },
  35842. async: {
  35843. default: false,
  35844. validate: (0, _index.assertValueType)("boolean")
  35845. }
  35846. }
  35847. });
  35848. (0, _index2.default)("ObjectPattern", {
  35849. visitor: ["properties", "typeAnnotation"],
  35850. aliases: ["Pattern", "LVal"],
  35851. fields: {
  35852. properties: {
  35853. validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("RestProperty", "Property")))
  35854. },
  35855. decorators: {
  35856. validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("Decorator")))
  35857. }
  35858. }
  35859. });
  35860. (0, _index2.default)("SpreadElement", {
  35861. visitor: ["argument"],
  35862. aliases: ["UnaryLike"],
  35863. fields: {
  35864. argument: {
  35865. validate: (0, _index.assertNodeType)("Expression")
  35866. }
  35867. }
  35868. });
  35869. (0, _index2.default)("Super", {
  35870. aliases: ["Expression"]
  35871. });
  35872. (0, _index2.default)("TaggedTemplateExpression", {
  35873. visitor: ["tag", "quasi"],
  35874. aliases: ["Expression"],
  35875. fields: {
  35876. tag: {
  35877. validate: (0, _index.assertNodeType)("Expression")
  35878. },
  35879. quasi: {
  35880. validate: (0, _index.assertNodeType)("TemplateLiteral")
  35881. }
  35882. }
  35883. });
  35884. (0, _index2.default)("TemplateElement", {
  35885. builder: ["value", "tail"],
  35886. fields: {
  35887. value: {},
  35888. tail: {
  35889. validate: (0, _index.assertValueType)("boolean"),
  35890. default: false
  35891. }
  35892. }
  35893. });
  35894. (0, _index2.default)("TemplateLiteral", {
  35895. visitor: ["quasis", "expressions"],
  35896. aliases: ["Expression", "Literal"],
  35897. fields: {
  35898. quasis: {
  35899. validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("TemplateElement")))
  35900. },
  35901. expressions: {
  35902. validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("Expression")))
  35903. }
  35904. }
  35905. });
  35906. (0, _index2.default)("YieldExpression", {
  35907. builder: ["argument", "delegate"],
  35908. visitor: ["argument"],
  35909. aliases: ["Expression", "Terminatorless"],
  35910. fields: {
  35911. delegate: {
  35912. validate: (0, _index.assertValueType)("boolean"),
  35913. default: false
  35914. },
  35915. argument: {
  35916. optional: true,
  35917. validate: (0, _index.assertNodeType)("Expression")
  35918. }
  35919. }
  35920. });
  35921. /***/ }),
  35922. /* 388 */
  35923. /***/ (function(module, exports, __webpack_require__) {
  35924. "use strict";
  35925. var _index = __webpack_require__(26);
  35926. var _index2 = _interopRequireDefault(_index);
  35927. function _interopRequireDefault(obj) {
  35928. return obj && obj.__esModule ? obj : { default: obj };
  35929. }
  35930. (0, _index2.default)("AwaitExpression", {
  35931. builder: ["argument"],
  35932. visitor: ["argument"],
  35933. aliases: ["Expression", "Terminatorless"],
  35934. fields: {
  35935. argument: {
  35936. validate: (0, _index.assertNodeType)("Expression")
  35937. }
  35938. }
  35939. });
  35940. (0, _index2.default)("ForAwaitStatement", {
  35941. visitor: ["left", "right", "body"],
  35942. aliases: ["Scopable", "Statement", "For", "BlockParent", "Loop", "ForXStatement"],
  35943. fields: {
  35944. left: {
  35945. validate: (0, _index.assertNodeType)("VariableDeclaration", "LVal")
  35946. },
  35947. right: {
  35948. validate: (0, _index.assertNodeType)("Expression")
  35949. },
  35950. body: {
  35951. validate: (0, _index.assertNodeType)("Statement")
  35952. }
  35953. }
  35954. });
  35955. (0, _index2.default)("BindExpression", {
  35956. visitor: ["object", "callee"],
  35957. aliases: ["Expression"],
  35958. fields: {}
  35959. });
  35960. (0, _index2.default)("Import", {
  35961. aliases: ["Expression"]
  35962. });
  35963. (0, _index2.default)("Decorator", {
  35964. visitor: ["expression"],
  35965. fields: {
  35966. expression: {
  35967. validate: (0, _index.assertNodeType)("Expression")
  35968. }
  35969. }
  35970. });
  35971. (0, _index2.default)("DoExpression", {
  35972. visitor: ["body"],
  35973. aliases: ["Expression"],
  35974. fields: {
  35975. body: {
  35976. validate: (0, _index.assertNodeType)("BlockStatement")
  35977. }
  35978. }
  35979. });
  35980. (0, _index2.default)("ExportDefaultSpecifier", {
  35981. visitor: ["exported"],
  35982. aliases: ["ModuleSpecifier"],
  35983. fields: {
  35984. exported: {
  35985. validate: (0, _index.assertNodeType)("Identifier")
  35986. }
  35987. }
  35988. });
  35989. (0, _index2.default)("ExportNamespaceSpecifier", {
  35990. visitor: ["exported"],
  35991. aliases: ["ModuleSpecifier"],
  35992. fields: {
  35993. exported: {
  35994. validate: (0, _index.assertNodeType)("Identifier")
  35995. }
  35996. }
  35997. });
  35998. (0, _index2.default)("RestProperty", {
  35999. visitor: ["argument"],
  36000. aliases: ["UnaryLike"],
  36001. fields: {
  36002. argument: {
  36003. validate: (0, _index.assertNodeType)("LVal")
  36004. }
  36005. }
  36006. });
  36007. (0, _index2.default)("SpreadProperty", {
  36008. visitor: ["argument"],
  36009. aliases: ["UnaryLike"],
  36010. fields: {
  36011. argument: {
  36012. validate: (0, _index.assertNodeType)("Expression")
  36013. }
  36014. }
  36015. });
  36016. /***/ }),
  36017. /* 389 */
  36018. /***/ (function(module, exports, __webpack_require__) {
  36019. "use strict";
  36020. var _index = __webpack_require__(26);
  36021. var _index2 = _interopRequireDefault(_index);
  36022. function _interopRequireDefault(obj) {
  36023. return obj && obj.__esModule ? obj : { default: obj };
  36024. }
  36025. (0, _index2.default)("AnyTypeAnnotation", {
  36026. aliases: ["Flow", "FlowBaseAnnotation"],
  36027. fields: {}
  36028. });
  36029. (0, _index2.default)("ArrayTypeAnnotation", {
  36030. visitor: ["elementType"],
  36031. aliases: ["Flow"],
  36032. fields: {}
  36033. });
  36034. (0, _index2.default)("BooleanTypeAnnotation", {
  36035. aliases: ["Flow", "FlowBaseAnnotation"],
  36036. fields: {}
  36037. });
  36038. (0, _index2.default)("BooleanLiteralTypeAnnotation", {
  36039. aliases: ["Flow"],
  36040. fields: {}
  36041. });
  36042. (0, _index2.default)("NullLiteralTypeAnnotation", {
  36043. aliases: ["Flow", "FlowBaseAnnotation"],
  36044. fields: {}
  36045. });
  36046. (0, _index2.default)("ClassImplements", {
  36047. visitor: ["id", "typeParameters"],
  36048. aliases: ["Flow"],
  36049. fields: {}
  36050. });
  36051. (0, _index2.default)("ClassProperty", {
  36052. visitor: ["key", "value", "typeAnnotation", "decorators"],
  36053. builder: ["key", "value", "typeAnnotation", "decorators", "computed"],
  36054. aliases: ["Property"],
  36055. fields: {
  36056. computed: {
  36057. validate: (0, _index.assertValueType)("boolean"),
  36058. default: false
  36059. }
  36060. }
  36061. });
  36062. (0, _index2.default)("DeclareClass", {
  36063. visitor: ["id", "typeParameters", "extends", "body"],
  36064. aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
  36065. fields: {}
  36066. });
  36067. (0, _index2.default)("DeclareFunction", {
  36068. visitor: ["id"],
  36069. aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
  36070. fields: {}
  36071. });
  36072. (0, _index2.default)("DeclareInterface", {
  36073. visitor: ["id", "typeParameters", "extends", "body"],
  36074. aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
  36075. fields: {}
  36076. });
  36077. (0, _index2.default)("DeclareModule", {
  36078. visitor: ["id", "body"],
  36079. aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
  36080. fields: {}
  36081. });
  36082. (0, _index2.default)("DeclareModuleExports", {
  36083. visitor: ["typeAnnotation"],
  36084. aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
  36085. fields: {}
  36086. });
  36087. (0, _index2.default)("DeclareTypeAlias", {
  36088. visitor: ["id", "typeParameters", "right"],
  36089. aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
  36090. fields: {}
  36091. });
  36092. (0, _index2.default)("DeclareOpaqueType", {
  36093. visitor: ["id", "typeParameters", "supertype"],
  36094. aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
  36095. fields: {}
  36096. });
  36097. (0, _index2.default)("DeclareVariable", {
  36098. visitor: ["id"],
  36099. aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
  36100. fields: {}
  36101. });
  36102. (0, _index2.default)("DeclareExportDeclaration", {
  36103. visitor: ["declaration", "specifiers", "source"],
  36104. aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
  36105. fields: {}
  36106. });
  36107. (0, _index2.default)("ExistentialTypeParam", {
  36108. aliases: ["Flow"]
  36109. });
  36110. (0, _index2.default)("FunctionTypeAnnotation", {
  36111. visitor: ["typeParameters", "params", "rest", "returnType"],
  36112. aliases: ["Flow"],
  36113. fields: {}
  36114. });
  36115. (0, _index2.default)("FunctionTypeParam", {
  36116. visitor: ["name", "typeAnnotation"],
  36117. aliases: ["Flow"],
  36118. fields: {}
  36119. });
  36120. (0, _index2.default)("GenericTypeAnnotation", {
  36121. visitor: ["id", "typeParameters"],
  36122. aliases: ["Flow"],
  36123. fields: {}
  36124. });
  36125. (0, _index2.default)("InterfaceExtends", {
  36126. visitor: ["id", "typeParameters"],
  36127. aliases: ["Flow"],
  36128. fields: {}
  36129. });
  36130. (0, _index2.default)("InterfaceDeclaration", {
  36131. visitor: ["id", "typeParameters", "extends", "body"],
  36132. aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
  36133. fields: {}
  36134. });
  36135. (0, _index2.default)("IntersectionTypeAnnotation", {
  36136. visitor: ["types"],
  36137. aliases: ["Flow"],
  36138. fields: {}
  36139. });
  36140. (0, _index2.default)("MixedTypeAnnotation", {
  36141. aliases: ["Flow", "FlowBaseAnnotation"]
  36142. });
  36143. (0, _index2.default)("EmptyTypeAnnotation", {
  36144. aliases: ["Flow", "FlowBaseAnnotation"]
  36145. });
  36146. (0, _index2.default)("NullableTypeAnnotation", {
  36147. visitor: ["typeAnnotation"],
  36148. aliases: ["Flow"],
  36149. fields: {}
  36150. });
  36151. (0, _index2.default)("NumericLiteralTypeAnnotation", {
  36152. aliases: ["Flow"],
  36153. fields: {}
  36154. });
  36155. (0, _index2.default)("NumberTypeAnnotation", {
  36156. aliases: ["Flow", "FlowBaseAnnotation"],
  36157. fields: {}
  36158. });
  36159. (0, _index2.default)("StringLiteralTypeAnnotation", {
  36160. aliases: ["Flow"],
  36161. fields: {}
  36162. });
  36163. (0, _index2.default)("StringTypeAnnotation", {
  36164. aliases: ["Flow", "FlowBaseAnnotation"],
  36165. fields: {}
  36166. });
  36167. (0, _index2.default)("ThisTypeAnnotation", {
  36168. aliases: ["Flow", "FlowBaseAnnotation"],
  36169. fields: {}
  36170. });
  36171. (0, _index2.default)("TupleTypeAnnotation", {
  36172. visitor: ["types"],
  36173. aliases: ["Flow"],
  36174. fields: {}
  36175. });
  36176. (0, _index2.default)("TypeofTypeAnnotation", {
  36177. visitor: ["argument"],
  36178. aliases: ["Flow"],
  36179. fields: {}
  36180. });
  36181. (0, _index2.default)("TypeAlias", {
  36182. visitor: ["id", "typeParameters", "right"],
  36183. aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
  36184. fields: {}
  36185. });
  36186. (0, _index2.default)("OpaqueType", {
  36187. visitor: ["id", "typeParameters", "impltype", "supertype"],
  36188. aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
  36189. fields: {}
  36190. });
  36191. (0, _index2.default)("TypeAnnotation", {
  36192. visitor: ["typeAnnotation"],
  36193. aliases: ["Flow"],
  36194. fields: {}
  36195. });
  36196. (0, _index2.default)("TypeCastExpression", {
  36197. visitor: ["expression", "typeAnnotation"],
  36198. aliases: ["Flow", "ExpressionWrapper", "Expression"],
  36199. fields: {}
  36200. });
  36201. (0, _index2.default)("TypeParameter", {
  36202. visitor: ["bound"],
  36203. aliases: ["Flow"],
  36204. fields: {}
  36205. });
  36206. (0, _index2.default)("TypeParameterDeclaration", {
  36207. visitor: ["params"],
  36208. aliases: ["Flow"],
  36209. fields: {}
  36210. });
  36211. (0, _index2.default)("TypeParameterInstantiation", {
  36212. visitor: ["params"],
  36213. aliases: ["Flow"],
  36214. fields: {}
  36215. });
  36216. (0, _index2.default)("ObjectTypeAnnotation", {
  36217. visitor: ["properties", "indexers", "callProperties"],
  36218. aliases: ["Flow"],
  36219. fields: {}
  36220. });
  36221. (0, _index2.default)("ObjectTypeCallProperty", {
  36222. visitor: ["value"],
  36223. aliases: ["Flow", "UserWhitespacable"],
  36224. fields: {}
  36225. });
  36226. (0, _index2.default)("ObjectTypeIndexer", {
  36227. visitor: ["id", "key", "value"],
  36228. aliases: ["Flow", "UserWhitespacable"],
  36229. fields: {}
  36230. });
  36231. (0, _index2.default)("ObjectTypeProperty", {
  36232. visitor: ["key", "value"],
  36233. aliases: ["Flow", "UserWhitespacable"],
  36234. fields: {}
  36235. });
  36236. (0, _index2.default)("ObjectTypeSpreadProperty", {
  36237. visitor: ["argument"],
  36238. aliases: ["Flow", "UserWhitespacable"],
  36239. fields: {}
  36240. });
  36241. (0, _index2.default)("QualifiedTypeIdentifier", {
  36242. visitor: ["id", "qualification"],
  36243. aliases: ["Flow"],
  36244. fields: {}
  36245. });
  36246. (0, _index2.default)("UnionTypeAnnotation", {
  36247. visitor: ["types"],
  36248. aliases: ["Flow"],
  36249. fields: {}
  36250. });
  36251. (0, _index2.default)("VoidTypeAnnotation", {
  36252. aliases: ["Flow", "FlowBaseAnnotation"],
  36253. fields: {}
  36254. });
  36255. /***/ }),
  36256. /* 390 */
  36257. /***/ (function(module, exports, __webpack_require__) {
  36258. "use strict";
  36259. __webpack_require__(26);
  36260. __webpack_require__(386);
  36261. __webpack_require__(387);
  36262. __webpack_require__(389);
  36263. __webpack_require__(391);
  36264. __webpack_require__(392);
  36265. __webpack_require__(388);
  36266. /***/ }),
  36267. /* 391 */
  36268. /***/ (function(module, exports, __webpack_require__) {
  36269. "use strict";
  36270. var _index = __webpack_require__(26);
  36271. var _index2 = _interopRequireDefault(_index);
  36272. function _interopRequireDefault(obj) {
  36273. return obj && obj.__esModule ? obj : { default: obj };
  36274. }
  36275. (0, _index2.default)("JSXAttribute", {
  36276. visitor: ["name", "value"],
  36277. aliases: ["JSX", "Immutable"],
  36278. fields: {
  36279. name: {
  36280. validate: (0, _index.assertNodeType)("JSXIdentifier", "JSXNamespacedName")
  36281. },
  36282. value: {
  36283. optional: true,
  36284. validate: (0, _index.assertNodeType)("JSXElement", "StringLiteral", "JSXExpressionContainer")
  36285. }
  36286. }
  36287. });
  36288. (0, _index2.default)("JSXClosingElement", {
  36289. visitor: ["name"],
  36290. aliases: ["JSX", "Immutable"],
  36291. fields: {
  36292. name: {
  36293. validate: (0, _index.assertNodeType)("JSXIdentifier", "JSXMemberExpression")
  36294. }
  36295. }
  36296. });
  36297. (0, _index2.default)("JSXElement", {
  36298. builder: ["openingElement", "closingElement", "children", "selfClosing"],
  36299. visitor: ["openingElement", "children", "closingElement"],
  36300. aliases: ["JSX", "Immutable", "Expression"],
  36301. fields: {
  36302. openingElement: {
  36303. validate: (0, _index.assertNodeType)("JSXOpeningElement")
  36304. },
  36305. closingElement: {
  36306. optional: true,
  36307. validate: (0, _index.assertNodeType)("JSXClosingElement")
  36308. },
  36309. children: {
  36310. validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("JSXText", "JSXExpressionContainer", "JSXSpreadChild", "JSXElement")))
  36311. }
  36312. }
  36313. });
  36314. (0, _index2.default)("JSXEmptyExpression", {
  36315. aliases: ["JSX", "Expression"]
  36316. });
  36317. (0, _index2.default)("JSXExpressionContainer", {
  36318. visitor: ["expression"],
  36319. aliases: ["JSX", "Immutable"],
  36320. fields: {
  36321. expression: {
  36322. validate: (0, _index.assertNodeType)("Expression")
  36323. }
  36324. }
  36325. });
  36326. (0, _index2.default)("JSXSpreadChild", {
  36327. visitor: ["expression"],
  36328. aliases: ["JSX", "Immutable"],
  36329. fields: {
  36330. expression: {
  36331. validate: (0, _index.assertNodeType)("Expression")
  36332. }
  36333. }
  36334. });
  36335. (0, _index2.default)("JSXIdentifier", {
  36336. builder: ["name"],
  36337. aliases: ["JSX", "Expression"],
  36338. fields: {
  36339. name: {
  36340. validate: (0, _index.assertValueType)("string")
  36341. }
  36342. }
  36343. });
  36344. (0, _index2.default)("JSXMemberExpression", {
  36345. visitor: ["object", "property"],
  36346. aliases: ["JSX", "Expression"],
  36347. fields: {
  36348. object: {
  36349. validate: (0, _index.assertNodeType)("JSXMemberExpression", "JSXIdentifier")
  36350. },
  36351. property: {
  36352. validate: (0, _index.assertNodeType)("JSXIdentifier")
  36353. }
  36354. }
  36355. });
  36356. (0, _index2.default)("JSXNamespacedName", {
  36357. visitor: ["namespace", "name"],
  36358. aliases: ["JSX"],
  36359. fields: {
  36360. namespace: {
  36361. validate: (0, _index.assertNodeType)("JSXIdentifier")
  36362. },
  36363. name: {
  36364. validate: (0, _index.assertNodeType)("JSXIdentifier")
  36365. }
  36366. }
  36367. });
  36368. (0, _index2.default)("JSXOpeningElement", {
  36369. builder: ["name", "attributes", "selfClosing"],
  36370. visitor: ["name", "attributes"],
  36371. aliases: ["JSX", "Immutable"],
  36372. fields: {
  36373. name: {
  36374. validate: (0, _index.assertNodeType)("JSXIdentifier", "JSXMemberExpression")
  36375. },
  36376. selfClosing: {
  36377. default: false,
  36378. validate: (0, _index.assertValueType)("boolean")
  36379. },
  36380. attributes: {
  36381. validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("JSXAttribute", "JSXSpreadAttribute")))
  36382. }
  36383. }
  36384. });
  36385. (0, _index2.default)("JSXSpreadAttribute", {
  36386. visitor: ["argument"],
  36387. aliases: ["JSX"],
  36388. fields: {
  36389. argument: {
  36390. validate: (0, _index.assertNodeType)("Expression")
  36391. }
  36392. }
  36393. });
  36394. (0, _index2.default)("JSXText", {
  36395. aliases: ["JSX", "Immutable"],
  36396. builder: ["value"],
  36397. fields: {
  36398. value: {
  36399. validate: (0, _index.assertValueType)("string")
  36400. }
  36401. }
  36402. });
  36403. /***/ }),
  36404. /* 392 */
  36405. /***/ (function(module, exports, __webpack_require__) {
  36406. "use strict";
  36407. var _index = __webpack_require__(26);
  36408. var _index2 = _interopRequireDefault(_index);
  36409. function _interopRequireDefault(obj) {
  36410. return obj && obj.__esModule ? obj : { default: obj };
  36411. }
  36412. (0, _index2.default)("Noop", {
  36413. visitor: []
  36414. });
  36415. (0, _index2.default)("ParenthesizedExpression", {
  36416. visitor: ["expression"],
  36417. aliases: ["Expression", "ExpressionWrapper"],
  36418. fields: {
  36419. expression: {
  36420. validate: (0, _index.assertNodeType)("Expression")
  36421. }
  36422. }
  36423. });
  36424. /***/ }),
  36425. /* 393 */
  36426. /***/ (function(module, exports, __webpack_require__) {
  36427. "use strict";
  36428. exports.__esModule = true;
  36429. exports.createUnionTypeAnnotation = createUnionTypeAnnotation;
  36430. exports.removeTypeDuplicates = removeTypeDuplicates;
  36431. exports.createTypeAnnotationBasedOnTypeof = createTypeAnnotationBasedOnTypeof;
  36432. var _index = __webpack_require__(1);
  36433. var t = _interopRequireWildcard(_index);
  36434. function _interopRequireWildcard(obj) {
  36435. if (obj && obj.__esModule) {
  36436. return obj;
  36437. } else {
  36438. var newObj = {};if (obj != null) {
  36439. for (var key in obj) {
  36440. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  36441. }
  36442. }newObj.default = obj;return newObj;
  36443. }
  36444. }
  36445. function createUnionTypeAnnotation(types) {
  36446. var flattened = removeTypeDuplicates(types);
  36447. if (flattened.length === 1) {
  36448. return flattened[0];
  36449. } else {
  36450. return t.unionTypeAnnotation(flattened);
  36451. }
  36452. }
  36453. function removeTypeDuplicates(nodes) {
  36454. var generics = {};
  36455. var bases = {};
  36456. var typeGroups = [];
  36457. var types = [];
  36458. for (var i = 0; i < nodes.length; i++) {
  36459. var node = nodes[i];
  36460. if (!node) continue;
  36461. if (types.indexOf(node) >= 0) {
  36462. continue;
  36463. }
  36464. if (t.isAnyTypeAnnotation(node)) {
  36465. return [node];
  36466. }
  36467. if (t.isFlowBaseAnnotation(node)) {
  36468. bases[node.type] = node;
  36469. continue;
  36470. }
  36471. if (t.isUnionTypeAnnotation(node)) {
  36472. if (typeGroups.indexOf(node.types) < 0) {
  36473. nodes = nodes.concat(node.types);
  36474. typeGroups.push(node.types);
  36475. }
  36476. continue;
  36477. }
  36478. if (t.isGenericTypeAnnotation(node)) {
  36479. var name = node.id.name;
  36480. if (generics[name]) {
  36481. var existing = generics[name];
  36482. if (existing.typeParameters) {
  36483. if (node.typeParameters) {
  36484. existing.typeParameters.params = removeTypeDuplicates(existing.typeParameters.params.concat(node.typeParameters.params));
  36485. }
  36486. } else {
  36487. existing = node.typeParameters;
  36488. }
  36489. } else {
  36490. generics[name] = node;
  36491. }
  36492. continue;
  36493. }
  36494. types.push(node);
  36495. }
  36496. for (var type in bases) {
  36497. types.push(bases[type]);
  36498. }
  36499. for (var _name in generics) {
  36500. types.push(generics[_name]);
  36501. }
  36502. return types;
  36503. }
  36504. function createTypeAnnotationBasedOnTypeof(type) {
  36505. if (type === "string") {
  36506. return t.stringTypeAnnotation();
  36507. } else if (type === "number") {
  36508. return t.numberTypeAnnotation();
  36509. } else if (type === "undefined") {
  36510. return t.voidTypeAnnotation();
  36511. } else if (type === "boolean") {
  36512. return t.booleanTypeAnnotation();
  36513. } else if (type === "function") {
  36514. return t.genericTypeAnnotation(t.identifier("Function"));
  36515. } else if (type === "object") {
  36516. return t.genericTypeAnnotation(t.identifier("Object"));
  36517. } else if (type === "symbol") {
  36518. return t.genericTypeAnnotation(t.identifier("Symbol"));
  36519. } else {
  36520. throw new Error("Invalid typeof value");
  36521. }
  36522. }
  36523. /***/ }),
  36524. /* 394 */
  36525. /***/ (function(module, exports, __webpack_require__) {
  36526. "use strict";
  36527. exports.__esModule = true;
  36528. exports.isReactComponent = undefined;
  36529. exports.isCompatTag = isCompatTag;
  36530. exports.buildChildren = buildChildren;
  36531. var _index = __webpack_require__(1);
  36532. var t = _interopRequireWildcard(_index);
  36533. function _interopRequireWildcard(obj) {
  36534. if (obj && obj.__esModule) {
  36535. return obj;
  36536. } else {
  36537. var newObj = {};if (obj != null) {
  36538. for (var key in obj) {
  36539. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  36540. }
  36541. }newObj.default = obj;return newObj;
  36542. }
  36543. }
  36544. var isReactComponent = exports.isReactComponent = t.buildMatchMemberExpression("React.Component");
  36545. function isCompatTag(tagName) {
  36546. return !!tagName && /^[a-z]|\-/.test(tagName);
  36547. }
  36548. function cleanJSXElementLiteralChild(child, args) {
  36549. var lines = child.value.split(/\r\n|\n|\r/);
  36550. var lastNonEmptyLine = 0;
  36551. for (var i = 0; i < lines.length; i++) {
  36552. if (lines[i].match(/[^ \t]/)) {
  36553. lastNonEmptyLine = i;
  36554. }
  36555. }
  36556. var str = "";
  36557. for (var _i = 0; _i < lines.length; _i++) {
  36558. var line = lines[_i];
  36559. var isFirstLine = _i === 0;
  36560. var isLastLine = _i === lines.length - 1;
  36561. var isLastNonEmptyLine = _i === lastNonEmptyLine;
  36562. var trimmedLine = line.replace(/\t/g, " ");
  36563. if (!isFirstLine) {
  36564. trimmedLine = trimmedLine.replace(/^[ ]+/, "");
  36565. }
  36566. if (!isLastLine) {
  36567. trimmedLine = trimmedLine.replace(/[ ]+$/, "");
  36568. }
  36569. if (trimmedLine) {
  36570. if (!isLastNonEmptyLine) {
  36571. trimmedLine += " ";
  36572. }
  36573. str += trimmedLine;
  36574. }
  36575. }
  36576. if (str) args.push(t.stringLiteral(str));
  36577. }
  36578. function buildChildren(node) {
  36579. var elems = [];
  36580. for (var i = 0; i < node.children.length; i++) {
  36581. var child = node.children[i];
  36582. if (t.isJSXText(child)) {
  36583. cleanJSXElementLiteralChild(child, elems);
  36584. continue;
  36585. }
  36586. if (t.isJSXExpressionContainer(child)) child = child.expression;
  36587. if (t.isJSXEmptyExpression(child)) continue;
  36588. elems.push(child);
  36589. }
  36590. return elems;
  36591. }
  36592. /***/ }),
  36593. /* 395 */
  36594. /***/ (function(module, exports, __webpack_require__) {
  36595. "use strict";
  36596. exports.__esModule = true;
  36597. var _keys = __webpack_require__(14);
  36598. var _keys2 = _interopRequireDefault(_keys);
  36599. var _typeof2 = __webpack_require__(11);
  36600. var _typeof3 = _interopRequireDefault(_typeof2);
  36601. var _getIterator2 = __webpack_require__(2);
  36602. var _getIterator3 = _interopRequireDefault(_getIterator2);
  36603. exports.isBinding = isBinding;
  36604. exports.isReferenced = isReferenced;
  36605. exports.isValidIdentifier = isValidIdentifier;
  36606. exports.isLet = isLet;
  36607. exports.isBlockScoped = isBlockScoped;
  36608. exports.isVar = isVar;
  36609. exports.isSpecifierDefault = isSpecifierDefault;
  36610. exports.isScope = isScope;
  36611. exports.isImmutable = isImmutable;
  36612. exports.isNodesEquivalent = isNodesEquivalent;
  36613. var _retrievers = __webpack_require__(226);
  36614. var _esutils = __webpack_require__(97);
  36615. var _esutils2 = _interopRequireDefault(_esutils);
  36616. var _index = __webpack_require__(1);
  36617. var t = _interopRequireWildcard(_index);
  36618. var _constants = __webpack_require__(135);
  36619. function _interopRequireWildcard(obj) {
  36620. if (obj && obj.__esModule) {
  36621. return obj;
  36622. } else {
  36623. var newObj = {};if (obj != null) {
  36624. for (var key in obj) {
  36625. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  36626. }
  36627. }newObj.default = obj;return newObj;
  36628. }
  36629. }
  36630. function _interopRequireDefault(obj) {
  36631. return obj && obj.__esModule ? obj : { default: obj };
  36632. }
  36633. function isBinding(node, parent) {
  36634. var keys = _retrievers.getBindingIdentifiers.keys[parent.type];
  36635. if (keys) {
  36636. for (var i = 0; i < keys.length; i++) {
  36637. var key = keys[i];
  36638. var val = parent[key];
  36639. if (Array.isArray(val)) {
  36640. if (val.indexOf(node) >= 0) return true;
  36641. } else {
  36642. if (val === node) return true;
  36643. }
  36644. }
  36645. }
  36646. return false;
  36647. }
  36648. function isReferenced(node, parent) {
  36649. switch (parent.type) {
  36650. case "BindExpression":
  36651. return parent.object === node || parent.callee === node;
  36652. case "MemberExpression":
  36653. case "JSXMemberExpression":
  36654. if (parent.property === node && parent.computed) {
  36655. return true;
  36656. } else if (parent.object === node) {
  36657. return true;
  36658. } else {
  36659. return false;
  36660. }
  36661. case "MetaProperty":
  36662. return false;
  36663. case "ObjectProperty":
  36664. if (parent.key === node) {
  36665. return parent.computed;
  36666. }
  36667. case "VariableDeclarator":
  36668. return parent.id !== node;
  36669. case "ArrowFunctionExpression":
  36670. case "FunctionDeclaration":
  36671. case "FunctionExpression":
  36672. for (var _iterator = parent.params, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
  36673. var _ref;
  36674. if (_isArray) {
  36675. if (_i >= _iterator.length) break;
  36676. _ref = _iterator[_i++];
  36677. } else {
  36678. _i = _iterator.next();
  36679. if (_i.done) break;
  36680. _ref = _i.value;
  36681. }
  36682. var param = _ref;
  36683. if (param === node) return false;
  36684. }
  36685. return parent.id !== node;
  36686. case "ExportSpecifier":
  36687. if (parent.source) {
  36688. return false;
  36689. } else {
  36690. return parent.local === node;
  36691. }
  36692. case "ExportNamespaceSpecifier":
  36693. case "ExportDefaultSpecifier":
  36694. return false;
  36695. case "JSXAttribute":
  36696. return parent.name !== node;
  36697. case "ClassProperty":
  36698. if (parent.key === node) {
  36699. return parent.computed;
  36700. } else {
  36701. return parent.value === node;
  36702. }
  36703. case "ImportDefaultSpecifier":
  36704. case "ImportNamespaceSpecifier":
  36705. case "ImportSpecifier":
  36706. return false;
  36707. case "ClassDeclaration":
  36708. case "ClassExpression":
  36709. return parent.id !== node;
  36710. case "ClassMethod":
  36711. case "ObjectMethod":
  36712. return parent.key === node && parent.computed;
  36713. case "LabeledStatement":
  36714. return false;
  36715. case "CatchClause":
  36716. return parent.param !== node;
  36717. case "RestElement":
  36718. return false;
  36719. case "AssignmentExpression":
  36720. return parent.right === node;
  36721. case "AssignmentPattern":
  36722. return parent.right === node;
  36723. case "ObjectPattern":
  36724. case "ArrayPattern":
  36725. return false;
  36726. }
  36727. return true;
  36728. }
  36729. function isValidIdentifier(name) {
  36730. if (typeof name !== "string" || _esutils2.default.keyword.isReservedWordES6(name, true)) {
  36731. return false;
  36732. } else if (name === "await") {
  36733. return false;
  36734. } else {
  36735. return _esutils2.default.keyword.isIdentifierNameES6(name);
  36736. }
  36737. }
  36738. function isLet(node) {
  36739. return t.isVariableDeclaration(node) && (node.kind !== "var" || node[_constants.BLOCK_SCOPED_SYMBOL]);
  36740. }
  36741. function isBlockScoped(node) {
  36742. return t.isFunctionDeclaration(node) || t.isClassDeclaration(node) || t.isLet(node);
  36743. }
  36744. function isVar(node) {
  36745. return t.isVariableDeclaration(node, { kind: "var" }) && !node[_constants.BLOCK_SCOPED_SYMBOL];
  36746. }
  36747. function isSpecifierDefault(specifier) {
  36748. return t.isImportDefaultSpecifier(specifier) || t.isIdentifier(specifier.imported || specifier.exported, { name: "default" });
  36749. }
  36750. function isScope(node, parent) {
  36751. if (t.isBlockStatement(node) && t.isFunction(parent, { body: node })) {
  36752. return false;
  36753. }
  36754. return t.isScopable(node);
  36755. }
  36756. function isImmutable(node) {
  36757. if (t.isType(node.type, "Immutable")) return true;
  36758. if (t.isIdentifier(node)) {
  36759. if (node.name === "undefined") {
  36760. return true;
  36761. } else {
  36762. return false;
  36763. }
  36764. }
  36765. return false;
  36766. }
  36767. function isNodesEquivalent(a, b) {
  36768. if ((typeof a === "undefined" ? "undefined" : (0, _typeof3.default)(a)) !== "object" || (typeof a === "undefined" ? "undefined" : (0, _typeof3.default)(a)) !== "object" || a == null || b == null) {
  36769. return a === b;
  36770. }
  36771. if (a.type !== b.type) {
  36772. return false;
  36773. }
  36774. var fields = (0, _keys2.default)(t.NODE_FIELDS[a.type] || a.type);
  36775. for (var _iterator2 = fields, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) {
  36776. var _ref2;
  36777. if (_isArray2) {
  36778. if (_i2 >= _iterator2.length) break;
  36779. _ref2 = _iterator2[_i2++];
  36780. } else {
  36781. _i2 = _iterator2.next();
  36782. if (_i2.done) break;
  36783. _ref2 = _i2.value;
  36784. }
  36785. var field = _ref2;
  36786. if ((0, _typeof3.default)(a[field]) !== (0, _typeof3.default)(b[field])) {
  36787. return false;
  36788. }
  36789. if (Array.isArray(a[field])) {
  36790. if (!Array.isArray(b[field])) {
  36791. return false;
  36792. }
  36793. if (a[field].length !== b[field].length) {
  36794. return false;
  36795. }
  36796. for (var i = 0; i < a[field].length; i++) {
  36797. if (!isNodesEquivalent(a[field][i], b[field][i])) {
  36798. return false;
  36799. }
  36800. }
  36801. continue;
  36802. }
  36803. if (!isNodesEquivalent(a[field], b[field])) {
  36804. return false;
  36805. }
  36806. }
  36807. return true;
  36808. }
  36809. /***/ }),
  36810. /* 396 */
  36811. /***/ (function(module, exports) {
  36812. 'use strict';
  36813. module.exports = balanced;
  36814. function balanced(a, b, str) {
  36815. if (a instanceof RegExp) a = maybeMatch(a, str);
  36816. if (b instanceof RegExp) b = maybeMatch(b, str);
  36817. var r = range(a, b, str);
  36818. return r && {
  36819. start: r[0],
  36820. end: r[1],
  36821. pre: str.slice(0, r[0]),
  36822. body: str.slice(r[0] + a.length, r[1]),
  36823. post: str.slice(r[1] + b.length)
  36824. };
  36825. }
  36826. function maybeMatch(reg, str) {
  36827. var m = str.match(reg);
  36828. return m ? m[0] : null;
  36829. }
  36830. balanced.range = range;
  36831. function range(a, b, str) {
  36832. var begs, beg, left, right, result;
  36833. var ai = str.indexOf(a);
  36834. var bi = str.indexOf(b, ai + 1);
  36835. var i = ai;
  36836. if (ai >= 0 && bi > 0) {
  36837. begs = [];
  36838. left = str.length;
  36839. while (i >= 0 && !result) {
  36840. if (i == ai) {
  36841. begs.push(i);
  36842. ai = str.indexOf(a, i + 1);
  36843. } else if (begs.length == 1) {
  36844. result = [begs.pop(), bi];
  36845. } else {
  36846. beg = begs.pop();
  36847. if (beg < left) {
  36848. left = beg;
  36849. right = bi;
  36850. }
  36851. bi = str.indexOf(b, i + 1);
  36852. }
  36853. i = ai < bi && ai >= 0 ? ai : bi;
  36854. }
  36855. if (begs.length) {
  36856. result = [left, right];
  36857. }
  36858. }
  36859. return result;
  36860. }
  36861. /***/ }),
  36862. /* 397 */
  36863. /***/ (function(module, exports) {
  36864. 'use strict';
  36865. exports.byteLength = byteLength;
  36866. exports.toByteArray = toByteArray;
  36867. exports.fromByteArray = fromByteArray;
  36868. var lookup = [];
  36869. var revLookup = [];
  36870. var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array;
  36871. var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
  36872. for (var i = 0, len = code.length; i < len; ++i) {
  36873. lookup[i] = code[i];
  36874. revLookup[code.charCodeAt(i)] = i;
  36875. }
  36876. revLookup['-'.charCodeAt(0)] = 62;
  36877. revLookup['_'.charCodeAt(0)] = 63;
  36878. function placeHoldersCount(b64) {
  36879. var len = b64.length;
  36880. if (len % 4 > 0) {
  36881. throw new Error('Invalid string. Length must be a multiple of 4');
  36882. }
  36883. // the number of equal signs (place holders)
  36884. // if there are two placeholders, than the two characters before it
  36885. // represent one byte
  36886. // if there is only one, then the three characters before it represent 2 bytes
  36887. // this is just a cheap hack to not do indexOf twice
  36888. return b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0;
  36889. }
  36890. function byteLength(b64) {
  36891. // base64 is 4/3 + up to two characters of the original data
  36892. return b64.length * 3 / 4 - placeHoldersCount(b64);
  36893. }
  36894. function toByteArray(b64) {
  36895. var i, l, tmp, placeHolders, arr;
  36896. var len = b64.length;
  36897. placeHolders = placeHoldersCount(b64);
  36898. arr = new Arr(len * 3 / 4 - placeHolders);
  36899. // if there are placeholders, only get up to the last complete 4 chars
  36900. l = placeHolders > 0 ? len - 4 : len;
  36901. var L = 0;
  36902. for (i = 0; i < l; i += 4) {
  36903. tmp = revLookup[b64.charCodeAt(i)] << 18 | revLookup[b64.charCodeAt(i + 1)] << 12 | revLookup[b64.charCodeAt(i + 2)] << 6 | revLookup[b64.charCodeAt(i + 3)];
  36904. arr[L++] = tmp >> 16 & 0xFF;
  36905. arr[L++] = tmp >> 8 & 0xFF;
  36906. arr[L++] = tmp & 0xFF;
  36907. }
  36908. if (placeHolders === 2) {
  36909. tmp = revLookup[b64.charCodeAt(i)] << 2 | revLookup[b64.charCodeAt(i + 1)] >> 4;
  36910. arr[L++] = tmp & 0xFF;
  36911. } else if (placeHolders === 1) {
  36912. tmp = revLookup[b64.charCodeAt(i)] << 10 | revLookup[b64.charCodeAt(i + 1)] << 4 | revLookup[b64.charCodeAt(i + 2)] >> 2;
  36913. arr[L++] = tmp >> 8 & 0xFF;
  36914. arr[L++] = tmp & 0xFF;
  36915. }
  36916. return arr;
  36917. }
  36918. function tripletToBase64(num) {
  36919. return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F];
  36920. }
  36921. function encodeChunk(uint8, start, end) {
  36922. var tmp;
  36923. var output = [];
  36924. for (var i = start; i < end; i += 3) {
  36925. tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + uint8[i + 2];
  36926. output.push(tripletToBase64(tmp));
  36927. }
  36928. return output.join('');
  36929. }
  36930. function fromByteArray(uint8) {
  36931. var tmp;
  36932. var len = uint8.length;
  36933. var extraBytes = len % 3; // if we have 1 byte left, pad 2 bytes
  36934. var output = '';
  36935. var parts = [];
  36936. var maxChunkLength = 16383; // must be multiple of 3
  36937. // go through the array every three bytes, we'll deal with trailing stuff later
  36938. for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
  36939. parts.push(encodeChunk(uint8, i, i + maxChunkLength > len2 ? len2 : i + maxChunkLength));
  36940. }
  36941. // pad the end with zeros, but make sure to not forget the extra bytes
  36942. if (extraBytes === 1) {
  36943. tmp = uint8[len - 1];
  36944. output += lookup[tmp >> 2];
  36945. output += lookup[tmp << 4 & 0x3F];
  36946. output += '==';
  36947. } else if (extraBytes === 2) {
  36948. tmp = (uint8[len - 2] << 8) + uint8[len - 1];
  36949. output += lookup[tmp >> 10];
  36950. output += lookup[tmp >> 4 & 0x3F];
  36951. output += lookup[tmp << 2 & 0x3F];
  36952. output += '=';
  36953. }
  36954. parts.push(output);
  36955. return parts.join('');
  36956. }
  36957. /***/ }),
  36958. /* 398 */
  36959. /***/ (function(module, exports, __webpack_require__) {
  36960. 'use strict';
  36961. var concatMap = __webpack_require__(402);
  36962. var balanced = __webpack_require__(396);
  36963. module.exports = expandTop;
  36964. var escSlash = '\0SLASH' + Math.random() + '\0';
  36965. var escOpen = '\0OPEN' + Math.random() + '\0';
  36966. var escClose = '\0CLOSE' + Math.random() + '\0';
  36967. var escComma = '\0COMMA' + Math.random() + '\0';
  36968. var escPeriod = '\0PERIOD' + Math.random() + '\0';
  36969. function numeric(str) {
  36970. return parseInt(str, 10) == str ? parseInt(str, 10) : str.charCodeAt(0);
  36971. }
  36972. function escapeBraces(str) {
  36973. return str.split('\\\\').join(escSlash).split('\\{').join(escOpen).split('\\}').join(escClose).split('\\,').join(escComma).split('\\.').join(escPeriod);
  36974. }
  36975. function unescapeBraces(str) {
  36976. return str.split(escSlash).join('\\').split(escOpen).join('{').split(escClose).join('}').split(escComma).join(',').split(escPeriod).join('.');
  36977. }
  36978. // Basically just str.split(","), but handling cases
  36979. // where we have nested braced sections, which should be
  36980. // treated as individual members, like {a,{b,c},d}
  36981. function parseCommaParts(str) {
  36982. if (!str) return [''];
  36983. var parts = [];
  36984. var m = balanced('{', '}', str);
  36985. if (!m) return str.split(',');
  36986. var pre = m.pre;
  36987. var body = m.body;
  36988. var post = m.post;
  36989. var p = pre.split(',');
  36990. p[p.length - 1] += '{' + body + '}';
  36991. var postParts = parseCommaParts(post);
  36992. if (post.length) {
  36993. p[p.length - 1] += postParts.shift();
  36994. p.push.apply(p, postParts);
  36995. }
  36996. parts.push.apply(parts, p);
  36997. return parts;
  36998. }
  36999. function expandTop(str) {
  37000. if (!str) return [];
  37001. // I don't know why Bash 4.3 does this, but it does.
  37002. // Anything starting with {} will have the first two bytes preserved
  37003. // but *only* at the top level, so {},a}b will not expand to anything,
  37004. // but a{},b}c will be expanded to [a}c,abc].
  37005. // One could argue that this is a bug in Bash, but since the goal of
  37006. // this module is to match Bash's rules, we escape a leading {}
  37007. if (str.substr(0, 2) === '{}') {
  37008. str = '\\{\\}' + str.substr(2);
  37009. }
  37010. return expand(escapeBraces(str), true).map(unescapeBraces);
  37011. }
  37012. function identity(e) {
  37013. return e;
  37014. }
  37015. function embrace(str) {
  37016. return '{' + str + '}';
  37017. }
  37018. function isPadded(el) {
  37019. return (/^-?0\d/.test(el)
  37020. );
  37021. }
  37022. function lte(i, y) {
  37023. return i <= y;
  37024. }
  37025. function gte(i, y) {
  37026. return i >= y;
  37027. }
  37028. function expand(str, isTop) {
  37029. var expansions = [];
  37030. var m = balanced('{', '}', str);
  37031. if (!m || /\$$/.test(m.pre)) return [str];
  37032. var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
  37033. var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
  37034. var isSequence = isNumericSequence || isAlphaSequence;
  37035. var isOptions = m.body.indexOf(',') >= 0;
  37036. if (!isSequence && !isOptions) {
  37037. // {a},b}
  37038. if (m.post.match(/,.*\}/)) {
  37039. str = m.pre + '{' + m.body + escClose + m.post;
  37040. return expand(str);
  37041. }
  37042. return [str];
  37043. }
  37044. var n;
  37045. if (isSequence) {
  37046. n = m.body.split(/\.\./);
  37047. } else {
  37048. n = parseCommaParts(m.body);
  37049. if (n.length === 1) {
  37050. // x{{a,b}}y ==> x{a}y x{b}y
  37051. n = expand(n[0], false).map(embrace);
  37052. if (n.length === 1) {
  37053. var post = m.post.length ? expand(m.post, false) : [''];
  37054. return post.map(function (p) {
  37055. return m.pre + n[0] + p;
  37056. });
  37057. }
  37058. }
  37059. }
  37060. // at this point, n is the parts, and we know it's not a comma set
  37061. // with a single entry.
  37062. // no need to expand pre, since it is guaranteed to be free of brace-sets
  37063. var pre = m.pre;
  37064. var post = m.post.length ? expand(m.post, false) : [''];
  37065. var N;
  37066. if (isSequence) {
  37067. var x = numeric(n[0]);
  37068. var y = numeric(n[1]);
  37069. var width = Math.max(n[0].length, n[1].length);
  37070. var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1;
  37071. var test = lte;
  37072. var reverse = y < x;
  37073. if (reverse) {
  37074. incr *= -1;
  37075. test = gte;
  37076. }
  37077. var pad = n.some(isPadded);
  37078. N = [];
  37079. for (var i = x; test(i, y); i += incr) {
  37080. var c;
  37081. if (isAlphaSequence) {
  37082. c = String.fromCharCode(i);
  37083. if (c === '\\') c = '';
  37084. } else {
  37085. c = String(i);
  37086. if (pad) {
  37087. var need = width - c.length;
  37088. if (need > 0) {
  37089. var z = new Array(need + 1).join('0');
  37090. if (i < 0) c = '-' + z + c.slice(1);else c = z + c;
  37091. }
  37092. }
  37093. }
  37094. N.push(c);
  37095. }
  37096. } else {
  37097. N = concatMap(n, function (el) {
  37098. return expand(el, false);
  37099. });
  37100. }
  37101. for (var j = 0; j < N.length; j++) {
  37102. for (var k = 0; k < post.length; k++) {
  37103. var expansion = pre + N[j] + post[k];
  37104. if (!isTop || isSequence || expansion) expansions.push(expansion);
  37105. }
  37106. }
  37107. return expansions;
  37108. }
  37109. /***/ }),
  37110. /* 399 */
  37111. /***/ (function(module, exports, __webpack_require__) {
  37112. /* WEBPACK VAR INJECTION */(function(global) {/*!
  37113. * The buffer module from node.js, for the browser.
  37114. *
  37115. * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
  37116. * @license MIT
  37117. */
  37118. /* eslint-disable no-proto */
  37119. 'use strict';
  37120. var base64 = __webpack_require__(397);
  37121. var ieee754 = __webpack_require__(465);
  37122. var isArray = __webpack_require__(400);
  37123. exports.Buffer = Buffer;
  37124. exports.SlowBuffer = SlowBuffer;
  37125. exports.INSPECT_MAX_BYTES = 50;
  37126. /**
  37127. * If `Buffer.TYPED_ARRAY_SUPPORT`:
  37128. * === true Use Uint8Array implementation (fastest)
  37129. * === false Use Object implementation (most compatible, even IE6)
  37130. *
  37131. * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
  37132. * Opera 11.6+, iOS 4.2+.
  37133. *
  37134. * Due to various browser bugs, sometimes the Object implementation will be used even
  37135. * when the browser supports typed arrays.
  37136. *
  37137. * Note:
  37138. *
  37139. * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,
  37140. * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.
  37141. *
  37142. * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.
  37143. *
  37144. * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of
  37145. * incorrect length in some situations.
  37146. * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they
  37147. * get the Object implementation, which is slower but behaves correctly.
  37148. */
  37149. Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined ? global.TYPED_ARRAY_SUPPORT : typedArraySupport();
  37150. /*
  37151. * Export kMaxLength after typed array support is determined.
  37152. */
  37153. exports.kMaxLength = kMaxLength();
  37154. function typedArraySupport() {
  37155. try {
  37156. var arr = new Uint8Array(1);
  37157. arr.__proto__ = { __proto__: Uint8Array.prototype, foo: function foo() {
  37158. return 42;
  37159. } };
  37160. return arr.foo() === 42 && // typed array instances can be augmented
  37161. typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`
  37162. arr.subarray(1, 1).byteLength === 0; // ie10 has broken `subarray`
  37163. } catch (e) {
  37164. return false;
  37165. }
  37166. }
  37167. function kMaxLength() {
  37168. return Buffer.TYPED_ARRAY_SUPPORT ? 0x7fffffff : 0x3fffffff;
  37169. }
  37170. function createBuffer(that, length) {
  37171. if (kMaxLength() < length) {
  37172. throw new RangeError('Invalid typed array length');
  37173. }
  37174. if (Buffer.TYPED_ARRAY_SUPPORT) {
  37175. // Return an augmented `Uint8Array` instance, for best performance
  37176. that = new Uint8Array(length);
  37177. that.__proto__ = Buffer.prototype;
  37178. } else {
  37179. // Fallback: Return an object instance of the Buffer class
  37180. if (that === null) {
  37181. that = new Buffer(length);
  37182. }
  37183. that.length = length;
  37184. }
  37185. return that;
  37186. }
  37187. /**
  37188. * The Buffer constructor returns instances of `Uint8Array` that have their
  37189. * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
  37190. * `Uint8Array`, so the returned instances will have all the node `Buffer` methods
  37191. * and the `Uint8Array` methods. Square bracket notation works as expected -- it
  37192. * returns a single octet.
  37193. *
  37194. * The `Uint8Array` prototype remains unmodified.
  37195. */
  37196. function Buffer(arg, encodingOrOffset, length) {
  37197. if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {
  37198. return new Buffer(arg, encodingOrOffset, length);
  37199. }
  37200. // Common case.
  37201. if (typeof arg === 'number') {
  37202. if (typeof encodingOrOffset === 'string') {
  37203. throw new Error('If encoding is specified then the first argument must be a string');
  37204. }
  37205. return allocUnsafe(this, arg);
  37206. }
  37207. return from(this, arg, encodingOrOffset, length);
  37208. }
  37209. Buffer.poolSize = 8192; // not used by this implementation
  37210. // TODO: Legacy, not needed anymore. Remove in next major version.
  37211. Buffer._augment = function (arr) {
  37212. arr.__proto__ = Buffer.prototype;
  37213. return arr;
  37214. };
  37215. function from(that, value, encodingOrOffset, length) {
  37216. if (typeof value === 'number') {
  37217. throw new TypeError('"value" argument must not be a number');
  37218. }
  37219. if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {
  37220. return fromArrayBuffer(that, value, encodingOrOffset, length);
  37221. }
  37222. if (typeof value === 'string') {
  37223. return fromString(that, value, encodingOrOffset);
  37224. }
  37225. return fromObject(that, value);
  37226. }
  37227. /**
  37228. * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
  37229. * if value is a number.
  37230. * Buffer.from(str[, encoding])
  37231. * Buffer.from(array)
  37232. * Buffer.from(buffer)
  37233. * Buffer.from(arrayBuffer[, byteOffset[, length]])
  37234. **/
  37235. Buffer.from = function (value, encodingOrOffset, length) {
  37236. return from(null, value, encodingOrOffset, length);
  37237. };
  37238. if (Buffer.TYPED_ARRAY_SUPPORT) {
  37239. Buffer.prototype.__proto__ = Uint8Array.prototype;
  37240. Buffer.__proto__ = Uint8Array;
  37241. if (typeof Symbol !== 'undefined' && Symbol.species && Buffer[Symbol.species] === Buffer) {
  37242. // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97
  37243. Object.defineProperty(Buffer, Symbol.species, {
  37244. value: null,
  37245. configurable: true
  37246. });
  37247. }
  37248. }
  37249. function assertSize(size) {
  37250. if (typeof size !== 'number') {
  37251. throw new TypeError('"size" argument must be a number');
  37252. } else if (size < 0) {
  37253. throw new RangeError('"size" argument must not be negative');
  37254. }
  37255. }
  37256. function alloc(that, size, fill, encoding) {
  37257. assertSize(size);
  37258. if (size <= 0) {
  37259. return createBuffer(that, size);
  37260. }
  37261. if (fill !== undefined) {
  37262. // Only pay attention to encoding if it's a string. This
  37263. // prevents accidentally sending in a number that would
  37264. // be interpretted as a start offset.
  37265. return typeof encoding === 'string' ? createBuffer(that, size).fill(fill, encoding) : createBuffer(that, size).fill(fill);
  37266. }
  37267. return createBuffer(that, size);
  37268. }
  37269. /**
  37270. * Creates a new filled Buffer instance.
  37271. * alloc(size[, fill[, encoding]])
  37272. **/
  37273. Buffer.alloc = function (size, fill, encoding) {
  37274. return alloc(null, size, fill, encoding);
  37275. };
  37276. function allocUnsafe(that, size) {
  37277. assertSize(size);
  37278. that = createBuffer(that, size < 0 ? 0 : checked(size) | 0);
  37279. if (!Buffer.TYPED_ARRAY_SUPPORT) {
  37280. for (var i = 0; i < size; ++i) {
  37281. that[i] = 0;
  37282. }
  37283. }
  37284. return that;
  37285. }
  37286. /**
  37287. * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
  37288. * */
  37289. Buffer.allocUnsafe = function (size) {
  37290. return allocUnsafe(null, size);
  37291. };
  37292. /**
  37293. * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
  37294. */
  37295. Buffer.allocUnsafeSlow = function (size) {
  37296. return allocUnsafe(null, size);
  37297. };
  37298. function fromString(that, string, encoding) {
  37299. if (typeof encoding !== 'string' || encoding === '') {
  37300. encoding = 'utf8';
  37301. }
  37302. if (!Buffer.isEncoding(encoding)) {
  37303. throw new TypeError('"encoding" must be a valid string encoding');
  37304. }
  37305. var length = byteLength(string, encoding) | 0;
  37306. that = createBuffer(that, length);
  37307. var actual = that.write(string, encoding);
  37308. if (actual !== length) {
  37309. // Writing a hex string, for example, that contains invalid characters will
  37310. // cause everything after the first invalid character to be ignored. (e.g.
  37311. // 'abxxcd' will be treated as 'ab')
  37312. that = that.slice(0, actual);
  37313. }
  37314. return that;
  37315. }
  37316. function fromArrayLike(that, array) {
  37317. var length = array.length < 0 ? 0 : checked(array.length) | 0;
  37318. that = createBuffer(that, length);
  37319. for (var i = 0; i < length; i += 1) {
  37320. that[i] = array[i] & 255;
  37321. }
  37322. return that;
  37323. }
  37324. function fromArrayBuffer(that, array, byteOffset, length) {
  37325. array.byteLength; // this throws if `array` is not a valid ArrayBuffer
  37326. if (byteOffset < 0 || array.byteLength < byteOffset) {
  37327. throw new RangeError('\'offset\' is out of bounds');
  37328. }
  37329. if (array.byteLength < byteOffset + (length || 0)) {
  37330. throw new RangeError('\'length\' is out of bounds');
  37331. }
  37332. if (byteOffset === undefined && length === undefined) {
  37333. array = new Uint8Array(array);
  37334. } else if (length === undefined) {
  37335. array = new Uint8Array(array, byteOffset);
  37336. } else {
  37337. array = new Uint8Array(array, byteOffset, length);
  37338. }
  37339. if (Buffer.TYPED_ARRAY_SUPPORT) {
  37340. // Return an augmented `Uint8Array` instance, for best performance
  37341. that = array;
  37342. that.__proto__ = Buffer.prototype;
  37343. } else {
  37344. // Fallback: Return an object instance of the Buffer class
  37345. that = fromArrayLike(that, array);
  37346. }
  37347. return that;
  37348. }
  37349. function fromObject(that, obj) {
  37350. if (Buffer.isBuffer(obj)) {
  37351. var len = checked(obj.length) | 0;
  37352. that = createBuffer(that, len);
  37353. if (that.length === 0) {
  37354. return that;
  37355. }
  37356. obj.copy(that, 0, 0, len);
  37357. return that;
  37358. }
  37359. if (obj) {
  37360. if (typeof ArrayBuffer !== 'undefined' && obj.buffer instanceof ArrayBuffer || 'length' in obj) {
  37361. if (typeof obj.length !== 'number' || isnan(obj.length)) {
  37362. return createBuffer(that, 0);
  37363. }
  37364. return fromArrayLike(that, obj);
  37365. }
  37366. if (obj.type === 'Buffer' && isArray(obj.data)) {
  37367. return fromArrayLike(that, obj.data);
  37368. }
  37369. }
  37370. throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.');
  37371. }
  37372. function checked(length) {
  37373. // Note: cannot use `length < kMaxLength()` here because that fails when
  37374. // length is NaN (which is otherwise coerced to zero.)
  37375. if (length >= kMaxLength()) {
  37376. throw new RangeError('Attempt to allocate Buffer larger than maximum ' + 'size: 0x' + kMaxLength().toString(16) + ' bytes');
  37377. }
  37378. return length | 0;
  37379. }
  37380. function SlowBuffer(length) {
  37381. if (+length != length) {
  37382. // eslint-disable-line eqeqeq
  37383. length = 0;
  37384. }
  37385. return Buffer.alloc(+length);
  37386. }
  37387. Buffer.isBuffer = function isBuffer(b) {
  37388. return !!(b != null && b._isBuffer);
  37389. };
  37390. Buffer.compare = function compare(a, b) {
  37391. if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
  37392. throw new TypeError('Arguments must be Buffers');
  37393. }
  37394. if (a === b) return 0;
  37395. var x = a.length;
  37396. var y = b.length;
  37397. for (var i = 0, len = Math.min(x, y); i < len; ++i) {
  37398. if (a[i] !== b[i]) {
  37399. x = a[i];
  37400. y = b[i];
  37401. break;
  37402. }
  37403. }
  37404. if (x < y) return -1;
  37405. if (y < x) return 1;
  37406. return 0;
  37407. };
  37408. Buffer.isEncoding = function isEncoding(encoding) {
  37409. switch (String(encoding).toLowerCase()) {
  37410. case 'hex':
  37411. case 'utf8':
  37412. case 'utf-8':
  37413. case 'ascii':
  37414. case 'latin1':
  37415. case 'binary':
  37416. case 'base64':
  37417. case 'ucs2':
  37418. case 'ucs-2':
  37419. case 'utf16le':
  37420. case 'utf-16le':
  37421. return true;
  37422. default:
  37423. return false;
  37424. }
  37425. };
  37426. Buffer.concat = function concat(list, length) {
  37427. if (!isArray(list)) {
  37428. throw new TypeError('"list" argument must be an Array of Buffers');
  37429. }
  37430. if (list.length === 0) {
  37431. return Buffer.alloc(0);
  37432. }
  37433. var i;
  37434. if (length === undefined) {
  37435. length = 0;
  37436. for (i = 0; i < list.length; ++i) {
  37437. length += list[i].length;
  37438. }
  37439. }
  37440. var buffer = Buffer.allocUnsafe(length);
  37441. var pos = 0;
  37442. for (i = 0; i < list.length; ++i) {
  37443. var buf = list[i];
  37444. if (!Buffer.isBuffer(buf)) {
  37445. throw new TypeError('"list" argument must be an Array of Buffers');
  37446. }
  37447. buf.copy(buffer, pos);
  37448. pos += buf.length;
  37449. }
  37450. return buffer;
  37451. };
  37452. function byteLength(string, encoding) {
  37453. if (Buffer.isBuffer(string)) {
  37454. return string.length;
  37455. }
  37456. if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' && (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {
  37457. return string.byteLength;
  37458. }
  37459. if (typeof string !== 'string') {
  37460. string = '' + string;
  37461. }
  37462. var len = string.length;
  37463. if (len === 0) return 0;
  37464. // Use a for loop to avoid recursion
  37465. var loweredCase = false;
  37466. for (;;) {
  37467. switch (encoding) {
  37468. case 'ascii':
  37469. case 'latin1':
  37470. case 'binary':
  37471. return len;
  37472. case 'utf8':
  37473. case 'utf-8':
  37474. case undefined:
  37475. return utf8ToBytes(string).length;
  37476. case 'ucs2':
  37477. case 'ucs-2':
  37478. case 'utf16le':
  37479. case 'utf-16le':
  37480. return len * 2;
  37481. case 'hex':
  37482. return len >>> 1;
  37483. case 'base64':
  37484. return base64ToBytes(string).length;
  37485. default:
  37486. if (loweredCase) return utf8ToBytes(string).length; // assume utf8
  37487. encoding = ('' + encoding).toLowerCase();
  37488. loweredCase = true;
  37489. }
  37490. }
  37491. }
  37492. Buffer.byteLength = byteLength;
  37493. function slowToString(encoding, start, end) {
  37494. var loweredCase = false;
  37495. // No need to verify that "this.length <= MAX_UINT32" since it's a read-only
  37496. // property of a typed array.
  37497. // This behaves neither like String nor Uint8Array in that we set start/end
  37498. // to their upper/lower bounds if the value passed is out of range.
  37499. // undefined is handled specially as per ECMA-262 6th Edition,
  37500. // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
  37501. if (start === undefined || start < 0) {
  37502. start = 0;
  37503. }
  37504. // Return early if start > this.length. Done here to prevent potential uint32
  37505. // coercion fail below.
  37506. if (start > this.length) {
  37507. return '';
  37508. }
  37509. if (end === undefined || end > this.length) {
  37510. end = this.length;
  37511. }
  37512. if (end <= 0) {
  37513. return '';
  37514. }
  37515. // Force coersion to uint32. This will also coerce falsey/NaN values to 0.
  37516. end >>>= 0;
  37517. start >>>= 0;
  37518. if (end <= start) {
  37519. return '';
  37520. }
  37521. if (!encoding) encoding = 'utf8';
  37522. while (true) {
  37523. switch (encoding) {
  37524. case 'hex':
  37525. return hexSlice(this, start, end);
  37526. case 'utf8':
  37527. case 'utf-8':
  37528. return utf8Slice(this, start, end);
  37529. case 'ascii':
  37530. return asciiSlice(this, start, end);
  37531. case 'latin1':
  37532. case 'binary':
  37533. return latin1Slice(this, start, end);
  37534. case 'base64':
  37535. return base64Slice(this, start, end);
  37536. case 'ucs2':
  37537. case 'ucs-2':
  37538. case 'utf16le':
  37539. case 'utf-16le':
  37540. return utf16leSlice(this, start, end);
  37541. default:
  37542. if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding);
  37543. encoding = (encoding + '').toLowerCase();
  37544. loweredCase = true;
  37545. }
  37546. }
  37547. }
  37548. // The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect
  37549. // Buffer instances.
  37550. Buffer.prototype._isBuffer = true;
  37551. function swap(b, n, m) {
  37552. var i = b[n];
  37553. b[n] = b[m];
  37554. b[m] = i;
  37555. }
  37556. Buffer.prototype.swap16 = function swap16() {
  37557. var len = this.length;
  37558. if (len % 2 !== 0) {
  37559. throw new RangeError('Buffer size must be a multiple of 16-bits');
  37560. }
  37561. for (var i = 0; i < len; i += 2) {
  37562. swap(this, i, i + 1);
  37563. }
  37564. return this;
  37565. };
  37566. Buffer.prototype.swap32 = function swap32() {
  37567. var len = this.length;
  37568. if (len % 4 !== 0) {
  37569. throw new RangeError('Buffer size must be a multiple of 32-bits');
  37570. }
  37571. for (var i = 0; i < len; i += 4) {
  37572. swap(this, i, i + 3);
  37573. swap(this, i + 1, i + 2);
  37574. }
  37575. return this;
  37576. };
  37577. Buffer.prototype.swap64 = function swap64() {
  37578. var len = this.length;
  37579. if (len % 8 !== 0) {
  37580. throw new RangeError('Buffer size must be a multiple of 64-bits');
  37581. }
  37582. for (var i = 0; i < len; i += 8) {
  37583. swap(this, i, i + 7);
  37584. swap(this, i + 1, i + 6);
  37585. swap(this, i + 2, i + 5);
  37586. swap(this, i + 3, i + 4);
  37587. }
  37588. return this;
  37589. };
  37590. Buffer.prototype.toString = function toString() {
  37591. var length = this.length | 0;
  37592. if (length === 0) return '';
  37593. if (arguments.length === 0) return utf8Slice(this, 0, length);
  37594. return slowToString.apply(this, arguments);
  37595. };
  37596. Buffer.prototype.equals = function equals(b) {
  37597. if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer');
  37598. if (this === b) return true;
  37599. return Buffer.compare(this, b) === 0;
  37600. };
  37601. Buffer.prototype.inspect = function inspect() {
  37602. var str = '';
  37603. var max = exports.INSPECT_MAX_BYTES;
  37604. if (this.length > 0) {
  37605. str = this.toString('hex', 0, max).match(/.{2}/g).join(' ');
  37606. if (this.length > max) str += ' ... ';
  37607. }
  37608. return '<Buffer ' + str + '>';
  37609. };
  37610. Buffer.prototype.compare = function compare(target, start, end, thisStart, thisEnd) {
  37611. if (!Buffer.isBuffer(target)) {
  37612. throw new TypeError('Argument must be a Buffer');
  37613. }
  37614. if (start === undefined) {
  37615. start = 0;
  37616. }
  37617. if (end === undefined) {
  37618. end = target ? target.length : 0;
  37619. }
  37620. if (thisStart === undefined) {
  37621. thisStart = 0;
  37622. }
  37623. if (thisEnd === undefined) {
  37624. thisEnd = this.length;
  37625. }
  37626. if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
  37627. throw new RangeError('out of range index');
  37628. }
  37629. if (thisStart >= thisEnd && start >= end) {
  37630. return 0;
  37631. }
  37632. if (thisStart >= thisEnd) {
  37633. return -1;
  37634. }
  37635. if (start >= end) {
  37636. return 1;
  37637. }
  37638. start >>>= 0;
  37639. end >>>= 0;
  37640. thisStart >>>= 0;
  37641. thisEnd >>>= 0;
  37642. if (this === target) return 0;
  37643. var x = thisEnd - thisStart;
  37644. var y = end - start;
  37645. var len = Math.min(x, y);
  37646. var thisCopy = this.slice(thisStart, thisEnd);
  37647. var targetCopy = target.slice(start, end);
  37648. for (var i = 0; i < len; ++i) {
  37649. if (thisCopy[i] !== targetCopy[i]) {
  37650. x = thisCopy[i];
  37651. y = targetCopy[i];
  37652. break;
  37653. }
  37654. }
  37655. if (x < y) return -1;
  37656. if (y < x) return 1;
  37657. return 0;
  37658. };
  37659. // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
  37660. // OR the last index of `val` in `buffer` at offset <= `byteOffset`.
  37661. //
  37662. // Arguments:
  37663. // - buffer - a Buffer to search
  37664. // - val - a string, Buffer, or number
  37665. // - byteOffset - an index into `buffer`; will be clamped to an int32
  37666. // - encoding - an optional encoding, relevant is val is a string
  37667. // - dir - true for indexOf, false for lastIndexOf
  37668. function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) {
  37669. // Empty buffer means no match
  37670. if (buffer.length === 0) return -1;
  37671. // Normalize byteOffset
  37672. if (typeof byteOffset === 'string') {
  37673. encoding = byteOffset;
  37674. byteOffset = 0;
  37675. } else if (byteOffset > 0x7fffffff) {
  37676. byteOffset = 0x7fffffff;
  37677. } else if (byteOffset < -0x80000000) {
  37678. byteOffset = -0x80000000;
  37679. }
  37680. byteOffset = +byteOffset; // Coerce to Number.
  37681. if (isNaN(byteOffset)) {
  37682. // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
  37683. byteOffset = dir ? 0 : buffer.length - 1;
  37684. }
  37685. // Normalize byteOffset: negative offsets start from the end of the buffer
  37686. if (byteOffset < 0) byteOffset = buffer.length + byteOffset;
  37687. if (byteOffset >= buffer.length) {
  37688. if (dir) return -1;else byteOffset = buffer.length - 1;
  37689. } else if (byteOffset < 0) {
  37690. if (dir) byteOffset = 0;else return -1;
  37691. }
  37692. // Normalize val
  37693. if (typeof val === 'string') {
  37694. val = Buffer.from(val, encoding);
  37695. }
  37696. // Finally, search either indexOf (if dir is true) or lastIndexOf
  37697. if (Buffer.isBuffer(val)) {
  37698. // Special case: looking for empty string/buffer always fails
  37699. if (val.length === 0) {
  37700. return -1;
  37701. }
  37702. return arrayIndexOf(buffer, val, byteOffset, encoding, dir);
  37703. } else if (typeof val === 'number') {
  37704. val = val & 0xFF; // Search for a byte value [0-255]
  37705. if (Buffer.TYPED_ARRAY_SUPPORT && typeof Uint8Array.prototype.indexOf === 'function') {
  37706. if (dir) {
  37707. return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset);
  37708. } else {
  37709. return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset);
  37710. }
  37711. }
  37712. return arrayIndexOf(buffer, [val], byteOffset, encoding, dir);
  37713. }
  37714. throw new TypeError('val must be string, number or Buffer');
  37715. }
  37716. function arrayIndexOf(arr, val, byteOffset, encoding, dir) {
  37717. var indexSize = 1;
  37718. var arrLength = arr.length;
  37719. var valLength = val.length;
  37720. if (encoding !== undefined) {
  37721. encoding = String(encoding).toLowerCase();
  37722. if (encoding === 'ucs2' || encoding === 'ucs-2' || encoding === 'utf16le' || encoding === 'utf-16le') {
  37723. if (arr.length < 2 || val.length < 2) {
  37724. return -1;
  37725. }
  37726. indexSize = 2;
  37727. arrLength /= 2;
  37728. valLength /= 2;
  37729. byteOffset /= 2;
  37730. }
  37731. }
  37732. function read(buf, i) {
  37733. if (indexSize === 1) {
  37734. return buf[i];
  37735. } else {
  37736. return buf.readUInt16BE(i * indexSize);
  37737. }
  37738. }
  37739. var i;
  37740. if (dir) {
  37741. var foundIndex = -1;
  37742. for (i = byteOffset; i < arrLength; i++) {
  37743. if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
  37744. if (foundIndex === -1) foundIndex = i;
  37745. if (i - foundIndex + 1 === valLength) return foundIndex * indexSize;
  37746. } else {
  37747. if (foundIndex !== -1) i -= i - foundIndex;
  37748. foundIndex = -1;
  37749. }
  37750. }
  37751. } else {
  37752. if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength;
  37753. for (i = byteOffset; i >= 0; i--) {
  37754. var found = true;
  37755. for (var j = 0; j < valLength; j++) {
  37756. if (read(arr, i + j) !== read(val, j)) {
  37757. found = false;
  37758. break;
  37759. }
  37760. }
  37761. if (found) return i;
  37762. }
  37763. }
  37764. return -1;
  37765. }
  37766. Buffer.prototype.includes = function includes(val, byteOffset, encoding) {
  37767. return this.indexOf(val, byteOffset, encoding) !== -1;
  37768. };
  37769. Buffer.prototype.indexOf = function indexOf(val, byteOffset, encoding) {
  37770. return bidirectionalIndexOf(this, val, byteOffset, encoding, true);
  37771. };
  37772. Buffer.prototype.lastIndexOf = function lastIndexOf(val, byteOffset, encoding) {
  37773. return bidirectionalIndexOf(this, val, byteOffset, encoding, false);
  37774. };
  37775. function hexWrite(buf, string, offset, length) {
  37776. offset = Number(offset) || 0;
  37777. var remaining = buf.length - offset;
  37778. if (!length) {
  37779. length = remaining;
  37780. } else {
  37781. length = Number(length);
  37782. if (length > remaining) {
  37783. length = remaining;
  37784. }
  37785. }
  37786. // must be an even number of digits
  37787. var strLen = string.length;
  37788. if (strLen % 2 !== 0) throw new TypeError('Invalid hex string');
  37789. if (length > strLen / 2) {
  37790. length = strLen / 2;
  37791. }
  37792. for (var i = 0; i < length; ++i) {
  37793. var parsed = parseInt(string.substr(i * 2, 2), 16);
  37794. if (isNaN(parsed)) return i;
  37795. buf[offset + i] = parsed;
  37796. }
  37797. return i;
  37798. }
  37799. function utf8Write(buf, string, offset, length) {
  37800. return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length);
  37801. }
  37802. function asciiWrite(buf, string, offset, length) {
  37803. return blitBuffer(asciiToBytes(string), buf, offset, length);
  37804. }
  37805. function latin1Write(buf, string, offset, length) {
  37806. return asciiWrite(buf, string, offset, length);
  37807. }
  37808. function base64Write(buf, string, offset, length) {
  37809. return blitBuffer(base64ToBytes(string), buf, offset, length);
  37810. }
  37811. function ucs2Write(buf, string, offset, length) {
  37812. return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length);
  37813. }
  37814. Buffer.prototype.write = function write(string, offset, length, encoding) {
  37815. // Buffer#write(string)
  37816. if (offset === undefined) {
  37817. encoding = 'utf8';
  37818. length = this.length;
  37819. offset = 0;
  37820. // Buffer#write(string, encoding)
  37821. } else if (length === undefined && typeof offset === 'string') {
  37822. encoding = offset;
  37823. length = this.length;
  37824. offset = 0;
  37825. // Buffer#write(string, offset[, length][, encoding])
  37826. } else if (isFinite(offset)) {
  37827. offset = offset | 0;
  37828. if (isFinite(length)) {
  37829. length = length | 0;
  37830. if (encoding === undefined) encoding = 'utf8';
  37831. } else {
  37832. encoding = length;
  37833. length = undefined;
  37834. }
  37835. // legacy write(string, encoding, offset, length) - remove in v0.13
  37836. } else {
  37837. throw new Error('Buffer.write(string, encoding, offset[, length]) is no longer supported');
  37838. }
  37839. var remaining = this.length - offset;
  37840. if (length === undefined || length > remaining) length = remaining;
  37841. if (string.length > 0 && (length < 0 || offset < 0) || offset > this.length) {
  37842. throw new RangeError('Attempt to write outside buffer bounds');
  37843. }
  37844. if (!encoding) encoding = 'utf8';
  37845. var loweredCase = false;
  37846. for (;;) {
  37847. switch (encoding) {
  37848. case 'hex':
  37849. return hexWrite(this, string, offset, length);
  37850. case 'utf8':
  37851. case 'utf-8':
  37852. return utf8Write(this, string, offset, length);
  37853. case 'ascii':
  37854. return asciiWrite(this, string, offset, length);
  37855. case 'latin1':
  37856. case 'binary':
  37857. return latin1Write(this, string, offset, length);
  37858. case 'base64':
  37859. // Warning: maxLength not taken into account in base64Write
  37860. return base64Write(this, string, offset, length);
  37861. case 'ucs2':
  37862. case 'ucs-2':
  37863. case 'utf16le':
  37864. case 'utf-16le':
  37865. return ucs2Write(this, string, offset, length);
  37866. default:
  37867. if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding);
  37868. encoding = ('' + encoding).toLowerCase();
  37869. loweredCase = true;
  37870. }
  37871. }
  37872. };
  37873. Buffer.prototype.toJSON = function toJSON() {
  37874. return {
  37875. type: 'Buffer',
  37876. data: Array.prototype.slice.call(this._arr || this, 0)
  37877. };
  37878. };
  37879. function base64Slice(buf, start, end) {
  37880. if (start === 0 && end === buf.length) {
  37881. return base64.fromByteArray(buf);
  37882. } else {
  37883. return base64.fromByteArray(buf.slice(start, end));
  37884. }
  37885. }
  37886. function utf8Slice(buf, start, end) {
  37887. end = Math.min(buf.length, end);
  37888. var res = [];
  37889. var i = start;
  37890. while (i < end) {
  37891. var firstByte = buf[i];
  37892. var codePoint = null;
  37893. var bytesPerSequence = firstByte > 0xEF ? 4 : firstByte > 0xDF ? 3 : firstByte > 0xBF ? 2 : 1;
  37894. if (i + bytesPerSequence <= end) {
  37895. var secondByte, thirdByte, fourthByte, tempCodePoint;
  37896. switch (bytesPerSequence) {
  37897. case 1:
  37898. if (firstByte < 0x80) {
  37899. codePoint = firstByte;
  37900. }
  37901. break;
  37902. case 2:
  37903. secondByte = buf[i + 1];
  37904. if ((secondByte & 0xC0) === 0x80) {
  37905. tempCodePoint = (firstByte & 0x1F) << 0x6 | secondByte & 0x3F;
  37906. if (tempCodePoint > 0x7F) {
  37907. codePoint = tempCodePoint;
  37908. }
  37909. }
  37910. break;
  37911. case 3:
  37912. secondByte = buf[i + 1];
  37913. thirdByte = buf[i + 2];
  37914. if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
  37915. tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | thirdByte & 0x3F;
  37916. if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
  37917. codePoint = tempCodePoint;
  37918. }
  37919. }
  37920. break;
  37921. case 4:
  37922. secondByte = buf[i + 1];
  37923. thirdByte = buf[i + 2];
  37924. fourthByte = buf[i + 3];
  37925. if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
  37926. tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | fourthByte & 0x3F;
  37927. if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
  37928. codePoint = tempCodePoint;
  37929. }
  37930. }
  37931. }
  37932. }
  37933. if (codePoint === null) {
  37934. // we did not generate a valid codePoint so insert a
  37935. // replacement char (U+FFFD) and advance only 1 byte
  37936. codePoint = 0xFFFD;
  37937. bytesPerSequence = 1;
  37938. } else if (codePoint > 0xFFFF) {
  37939. // encode to utf16 (surrogate pair dance)
  37940. codePoint -= 0x10000;
  37941. res.push(codePoint >>> 10 & 0x3FF | 0xD800);
  37942. codePoint = 0xDC00 | codePoint & 0x3FF;
  37943. }
  37944. res.push(codePoint);
  37945. i += bytesPerSequence;
  37946. }
  37947. return decodeCodePointsArray(res);
  37948. }
  37949. // Based on http://stackoverflow.com/a/22747272/680742, the browser with
  37950. // the lowest limit is Chrome, with 0x10000 args.
  37951. // We go 1 magnitude less, for safety
  37952. var MAX_ARGUMENTS_LENGTH = 0x1000;
  37953. function decodeCodePointsArray(codePoints) {
  37954. var len = codePoints.length;
  37955. if (len <= MAX_ARGUMENTS_LENGTH) {
  37956. return String.fromCharCode.apply(String, codePoints); // avoid extra slice()
  37957. }
  37958. // Decode in chunks to avoid "call stack size exceeded".
  37959. var res = '';
  37960. var i = 0;
  37961. while (i < len) {
  37962. res += String.fromCharCode.apply(String, codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH));
  37963. }
  37964. return res;
  37965. }
  37966. function asciiSlice(buf, start, end) {
  37967. var ret = '';
  37968. end = Math.min(buf.length, end);
  37969. for (var i = start; i < end; ++i) {
  37970. ret += String.fromCharCode(buf[i] & 0x7F);
  37971. }
  37972. return ret;
  37973. }
  37974. function latin1Slice(buf, start, end) {
  37975. var ret = '';
  37976. end = Math.min(buf.length, end);
  37977. for (var i = start; i < end; ++i) {
  37978. ret += String.fromCharCode(buf[i]);
  37979. }
  37980. return ret;
  37981. }
  37982. function hexSlice(buf, start, end) {
  37983. var len = buf.length;
  37984. if (!start || start < 0) start = 0;
  37985. if (!end || end < 0 || end > len) end = len;
  37986. var out = '';
  37987. for (var i = start; i < end; ++i) {
  37988. out += toHex(buf[i]);
  37989. }
  37990. return out;
  37991. }
  37992. function utf16leSlice(buf, start, end) {
  37993. var bytes = buf.slice(start, end);
  37994. var res = '';
  37995. for (var i = 0; i < bytes.length; i += 2) {
  37996. res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256);
  37997. }
  37998. return res;
  37999. }
  38000. Buffer.prototype.slice = function slice(start, end) {
  38001. var len = this.length;
  38002. start = ~~start;
  38003. end = end === undefined ? len : ~~end;
  38004. if (start < 0) {
  38005. start += len;
  38006. if (start < 0) start = 0;
  38007. } else if (start > len) {
  38008. start = len;
  38009. }
  38010. if (end < 0) {
  38011. end += len;
  38012. if (end < 0) end = 0;
  38013. } else if (end > len) {
  38014. end = len;
  38015. }
  38016. if (end < start) end = start;
  38017. var newBuf;
  38018. if (Buffer.TYPED_ARRAY_SUPPORT) {
  38019. newBuf = this.subarray(start, end);
  38020. newBuf.__proto__ = Buffer.prototype;
  38021. } else {
  38022. var sliceLen = end - start;
  38023. newBuf = new Buffer(sliceLen, undefined);
  38024. for (var i = 0; i < sliceLen; ++i) {
  38025. newBuf[i] = this[i + start];
  38026. }
  38027. }
  38028. return newBuf;
  38029. };
  38030. /*
  38031. * Need to make sure that buffer isn't trying to write out of bounds.
  38032. */
  38033. function checkOffset(offset, ext, length) {
  38034. if (offset % 1 !== 0 || offset < 0) throw new RangeError('offset is not uint');
  38035. if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length');
  38036. }
  38037. Buffer.prototype.readUIntLE = function readUIntLE(offset, byteLength, noAssert) {
  38038. offset = offset | 0;
  38039. byteLength = byteLength | 0;
  38040. if (!noAssert) checkOffset(offset, byteLength, this.length);
  38041. var val = this[offset];
  38042. var mul = 1;
  38043. var i = 0;
  38044. while (++i < byteLength && (mul *= 0x100)) {
  38045. val += this[offset + i] * mul;
  38046. }
  38047. return val;
  38048. };
  38049. Buffer.prototype.readUIntBE = function readUIntBE(offset, byteLength, noAssert) {
  38050. offset = offset | 0;
  38051. byteLength = byteLength | 0;
  38052. if (!noAssert) {
  38053. checkOffset(offset, byteLength, this.length);
  38054. }
  38055. var val = this[offset + --byteLength];
  38056. var mul = 1;
  38057. while (byteLength > 0 && (mul *= 0x100)) {
  38058. val += this[offset + --byteLength] * mul;
  38059. }
  38060. return val;
  38061. };
  38062. Buffer.prototype.readUInt8 = function readUInt8(offset, noAssert) {
  38063. if (!noAssert) checkOffset(offset, 1, this.length);
  38064. return this[offset];
  38065. };
  38066. Buffer.prototype.readUInt16LE = function readUInt16LE(offset, noAssert) {
  38067. if (!noAssert) checkOffset(offset, 2, this.length);
  38068. return this[offset] | this[offset + 1] << 8;
  38069. };
  38070. Buffer.prototype.readUInt16BE = function readUInt16BE(offset, noAssert) {
  38071. if (!noAssert) checkOffset(offset, 2, this.length);
  38072. return this[offset] << 8 | this[offset + 1];
  38073. };
  38074. Buffer.prototype.readUInt32LE = function readUInt32LE(offset, noAssert) {
  38075. if (!noAssert) checkOffset(offset, 4, this.length);
  38076. return (this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16) + this[offset + 3] * 0x1000000;
  38077. };
  38078. Buffer.prototype.readUInt32BE = function readUInt32BE(offset, noAssert) {
  38079. if (!noAssert) checkOffset(offset, 4, this.length);
  38080. return this[offset] * 0x1000000 + (this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]);
  38081. };
  38082. Buffer.prototype.readIntLE = function readIntLE(offset, byteLength, noAssert) {
  38083. offset = offset | 0;
  38084. byteLength = byteLength | 0;
  38085. if (!noAssert) checkOffset(offset, byteLength, this.length);
  38086. var val = this[offset];
  38087. var mul = 1;
  38088. var i = 0;
  38089. while (++i < byteLength && (mul *= 0x100)) {
  38090. val += this[offset + i] * mul;
  38091. }
  38092. mul *= 0x80;
  38093. if (val >= mul) val -= Math.pow(2, 8 * byteLength);
  38094. return val;
  38095. };
  38096. Buffer.prototype.readIntBE = function readIntBE(offset, byteLength, noAssert) {
  38097. offset = offset | 0;
  38098. byteLength = byteLength | 0;
  38099. if (!noAssert) checkOffset(offset, byteLength, this.length);
  38100. var i = byteLength;
  38101. var mul = 1;
  38102. var val = this[offset + --i];
  38103. while (i > 0 && (mul *= 0x100)) {
  38104. val += this[offset + --i] * mul;
  38105. }
  38106. mul *= 0x80;
  38107. if (val >= mul) val -= Math.pow(2, 8 * byteLength);
  38108. return val;
  38109. };
  38110. Buffer.prototype.readInt8 = function readInt8(offset, noAssert) {
  38111. if (!noAssert) checkOffset(offset, 1, this.length);
  38112. if (!(this[offset] & 0x80)) return this[offset];
  38113. return (0xff - this[offset] + 1) * -1;
  38114. };
  38115. Buffer.prototype.readInt16LE = function readInt16LE(offset, noAssert) {
  38116. if (!noAssert) checkOffset(offset, 2, this.length);
  38117. var val = this[offset] | this[offset + 1] << 8;
  38118. return val & 0x8000 ? val | 0xFFFF0000 : val;
  38119. };
  38120. Buffer.prototype.readInt16BE = function readInt16BE(offset, noAssert) {
  38121. if (!noAssert) checkOffset(offset, 2, this.length);
  38122. var val = this[offset + 1] | this[offset] << 8;
  38123. return val & 0x8000 ? val | 0xFFFF0000 : val;
  38124. };
  38125. Buffer.prototype.readInt32LE = function readInt32LE(offset, noAssert) {
  38126. if (!noAssert) checkOffset(offset, 4, this.length);
  38127. return this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16 | this[offset + 3] << 24;
  38128. };
  38129. Buffer.prototype.readInt32BE = function readInt32BE(offset, noAssert) {
  38130. if (!noAssert) checkOffset(offset, 4, this.length);
  38131. return this[offset] << 24 | this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3];
  38132. };
  38133. Buffer.prototype.readFloatLE = function readFloatLE(offset, noAssert) {
  38134. if (!noAssert) checkOffset(offset, 4, this.length);
  38135. return ieee754.read(this, offset, true, 23, 4);
  38136. };
  38137. Buffer.prototype.readFloatBE = function readFloatBE(offset, noAssert) {
  38138. if (!noAssert) checkOffset(offset, 4, this.length);
  38139. return ieee754.read(this, offset, false, 23, 4);
  38140. };
  38141. Buffer.prototype.readDoubleLE = function readDoubleLE(offset, noAssert) {
  38142. if (!noAssert) checkOffset(offset, 8, this.length);
  38143. return ieee754.read(this, offset, true, 52, 8);
  38144. };
  38145. Buffer.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) {
  38146. if (!noAssert) checkOffset(offset, 8, this.length);
  38147. return ieee754.read(this, offset, false, 52, 8);
  38148. };
  38149. function checkInt(buf, value, offset, ext, max, min) {
  38150. if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance');
  38151. if (value > max || value < min) throw new RangeError('"value" argument is out of bounds');
  38152. if (offset + ext > buf.length) throw new RangeError('Index out of range');
  38153. }
  38154. Buffer.prototype.writeUIntLE = function writeUIntLE(value, offset, byteLength, noAssert) {
  38155. value = +value;
  38156. offset = offset | 0;
  38157. byteLength = byteLength | 0;
  38158. if (!noAssert) {
  38159. var maxBytes = Math.pow(2, 8 * byteLength) - 1;
  38160. checkInt(this, value, offset, byteLength, maxBytes, 0);
  38161. }
  38162. var mul = 1;
  38163. var i = 0;
  38164. this[offset] = value & 0xFF;
  38165. while (++i < byteLength && (mul *= 0x100)) {
  38166. this[offset + i] = value / mul & 0xFF;
  38167. }
  38168. return offset + byteLength;
  38169. };
  38170. Buffer.prototype.writeUIntBE = function writeUIntBE(value, offset, byteLength, noAssert) {
  38171. value = +value;
  38172. offset = offset | 0;
  38173. byteLength = byteLength | 0;
  38174. if (!noAssert) {
  38175. var maxBytes = Math.pow(2, 8 * byteLength) - 1;
  38176. checkInt(this, value, offset, byteLength, maxBytes, 0);
  38177. }
  38178. var i = byteLength - 1;
  38179. var mul = 1;
  38180. this[offset + i] = value & 0xFF;
  38181. while (--i >= 0 && (mul *= 0x100)) {
  38182. this[offset + i] = value / mul & 0xFF;
  38183. }
  38184. return offset + byteLength;
  38185. };
  38186. Buffer.prototype.writeUInt8 = function writeUInt8(value, offset, noAssert) {
  38187. value = +value;
  38188. offset = offset | 0;
  38189. if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0);
  38190. if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value);
  38191. this[offset] = value & 0xff;
  38192. return offset + 1;
  38193. };
  38194. function objectWriteUInt16(buf, value, offset, littleEndian) {
  38195. if (value < 0) value = 0xffff + value + 1;
  38196. for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {
  38197. buf[offset + i] = (value & 0xff << 8 * (littleEndian ? i : 1 - i)) >>> (littleEndian ? i : 1 - i) * 8;
  38198. }
  38199. }
  38200. Buffer.prototype.writeUInt16LE = function writeUInt16LE(value, offset, noAssert) {
  38201. value = +value;
  38202. offset = offset | 0;
  38203. if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0);
  38204. if (Buffer.TYPED_ARRAY_SUPPORT) {
  38205. this[offset] = value & 0xff;
  38206. this[offset + 1] = value >>> 8;
  38207. } else {
  38208. objectWriteUInt16(this, value, offset, true);
  38209. }
  38210. return offset + 2;
  38211. };
  38212. Buffer.prototype.writeUInt16BE = function writeUInt16BE(value, offset, noAssert) {
  38213. value = +value;
  38214. offset = offset | 0;
  38215. if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0);
  38216. if (Buffer.TYPED_ARRAY_SUPPORT) {
  38217. this[offset] = value >>> 8;
  38218. this[offset + 1] = value & 0xff;
  38219. } else {
  38220. objectWriteUInt16(this, value, offset, false);
  38221. }
  38222. return offset + 2;
  38223. };
  38224. function objectWriteUInt32(buf, value, offset, littleEndian) {
  38225. if (value < 0) value = 0xffffffff + value + 1;
  38226. for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {
  38227. buf[offset + i] = value >>> (littleEndian ? i : 3 - i) * 8 & 0xff;
  38228. }
  38229. }
  38230. Buffer.prototype.writeUInt32LE = function writeUInt32LE(value, offset, noAssert) {
  38231. value = +value;
  38232. offset = offset | 0;
  38233. if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0);
  38234. if (Buffer.TYPED_ARRAY_SUPPORT) {
  38235. this[offset + 3] = value >>> 24;
  38236. this[offset + 2] = value >>> 16;
  38237. this[offset + 1] = value >>> 8;
  38238. this[offset] = value & 0xff;
  38239. } else {
  38240. objectWriteUInt32(this, value, offset, true);
  38241. }
  38242. return offset + 4;
  38243. };
  38244. Buffer.prototype.writeUInt32BE = function writeUInt32BE(value, offset, noAssert) {
  38245. value = +value;
  38246. offset = offset | 0;
  38247. if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0);
  38248. if (Buffer.TYPED_ARRAY_SUPPORT) {
  38249. this[offset] = value >>> 24;
  38250. this[offset + 1] = value >>> 16;
  38251. this[offset + 2] = value >>> 8;
  38252. this[offset + 3] = value & 0xff;
  38253. } else {
  38254. objectWriteUInt32(this, value, offset, false);
  38255. }
  38256. return offset + 4;
  38257. };
  38258. Buffer.prototype.writeIntLE = function writeIntLE(value, offset, byteLength, noAssert) {
  38259. value = +value;
  38260. offset = offset | 0;
  38261. if (!noAssert) {
  38262. var limit = Math.pow(2, 8 * byteLength - 1);
  38263. checkInt(this, value, offset, byteLength, limit - 1, -limit);
  38264. }
  38265. var i = 0;
  38266. var mul = 1;
  38267. var sub = 0;
  38268. this[offset] = value & 0xFF;
  38269. while (++i < byteLength && (mul *= 0x100)) {
  38270. if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
  38271. sub = 1;
  38272. }
  38273. this[offset + i] = (value / mul >> 0) - sub & 0xFF;
  38274. }
  38275. return offset + byteLength;
  38276. };
  38277. Buffer.prototype.writeIntBE = function writeIntBE(value, offset, byteLength, noAssert) {
  38278. value = +value;
  38279. offset = offset | 0;
  38280. if (!noAssert) {
  38281. var limit = Math.pow(2, 8 * byteLength - 1);
  38282. checkInt(this, value, offset, byteLength, limit - 1, -limit);
  38283. }
  38284. var i = byteLength - 1;
  38285. var mul = 1;
  38286. var sub = 0;
  38287. this[offset + i] = value & 0xFF;
  38288. while (--i >= 0 && (mul *= 0x100)) {
  38289. if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
  38290. sub = 1;
  38291. }
  38292. this[offset + i] = (value / mul >> 0) - sub & 0xFF;
  38293. }
  38294. return offset + byteLength;
  38295. };
  38296. Buffer.prototype.writeInt8 = function writeInt8(value, offset, noAssert) {
  38297. value = +value;
  38298. offset = offset | 0;
  38299. if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80);
  38300. if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value);
  38301. if (value < 0) value = 0xff + value + 1;
  38302. this[offset] = value & 0xff;
  38303. return offset + 1;
  38304. };
  38305. Buffer.prototype.writeInt16LE = function writeInt16LE(value, offset, noAssert) {
  38306. value = +value;
  38307. offset = offset | 0;
  38308. if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000);
  38309. if (Buffer.TYPED_ARRAY_SUPPORT) {
  38310. this[offset] = value & 0xff;
  38311. this[offset + 1] = value >>> 8;
  38312. } else {
  38313. objectWriteUInt16(this, value, offset, true);
  38314. }
  38315. return offset + 2;
  38316. };
  38317. Buffer.prototype.writeInt16BE = function writeInt16BE(value, offset, noAssert) {
  38318. value = +value;
  38319. offset = offset | 0;
  38320. if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000);
  38321. if (Buffer.TYPED_ARRAY_SUPPORT) {
  38322. this[offset] = value >>> 8;
  38323. this[offset + 1] = value & 0xff;
  38324. } else {
  38325. objectWriteUInt16(this, value, offset, false);
  38326. }
  38327. return offset + 2;
  38328. };
  38329. Buffer.prototype.writeInt32LE = function writeInt32LE(value, offset, noAssert) {
  38330. value = +value;
  38331. offset = offset | 0;
  38332. if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000);
  38333. if (Buffer.TYPED_ARRAY_SUPPORT) {
  38334. this[offset] = value & 0xff;
  38335. this[offset + 1] = value >>> 8;
  38336. this[offset + 2] = value >>> 16;
  38337. this[offset + 3] = value >>> 24;
  38338. } else {
  38339. objectWriteUInt32(this, value, offset, true);
  38340. }
  38341. return offset + 4;
  38342. };
  38343. Buffer.prototype.writeInt32BE = function writeInt32BE(value, offset, noAssert) {
  38344. value = +value;
  38345. offset = offset | 0;
  38346. if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000);
  38347. if (value < 0) value = 0xffffffff + value + 1;
  38348. if (Buffer.TYPED_ARRAY_SUPPORT) {
  38349. this[offset] = value >>> 24;
  38350. this[offset + 1] = value >>> 16;
  38351. this[offset + 2] = value >>> 8;
  38352. this[offset + 3] = value & 0xff;
  38353. } else {
  38354. objectWriteUInt32(this, value, offset, false);
  38355. }
  38356. return offset + 4;
  38357. };
  38358. function checkIEEE754(buf, value, offset, ext, max, min) {
  38359. if (offset + ext > buf.length) throw new RangeError('Index out of range');
  38360. if (offset < 0) throw new RangeError('Index out of range');
  38361. }
  38362. function writeFloat(buf, value, offset, littleEndian, noAssert) {
  38363. if (!noAssert) {
  38364. checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38);
  38365. }
  38366. ieee754.write(buf, value, offset, littleEndian, 23, 4);
  38367. return offset + 4;
  38368. }
  38369. Buffer.prototype.writeFloatLE = function writeFloatLE(value, offset, noAssert) {
  38370. return writeFloat(this, value, offset, true, noAssert);
  38371. };
  38372. Buffer.prototype.writeFloatBE = function writeFloatBE(value, offset, noAssert) {
  38373. return writeFloat(this, value, offset, false, noAssert);
  38374. };
  38375. function writeDouble(buf, value, offset, littleEndian, noAssert) {
  38376. if (!noAssert) {
  38377. checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308);
  38378. }
  38379. ieee754.write(buf, value, offset, littleEndian, 52, 8);
  38380. return offset + 8;
  38381. }
  38382. Buffer.prototype.writeDoubleLE = function writeDoubleLE(value, offset, noAssert) {
  38383. return writeDouble(this, value, offset, true, noAssert);
  38384. };
  38385. Buffer.prototype.writeDoubleBE = function writeDoubleBE(value, offset, noAssert) {
  38386. return writeDouble(this, value, offset, false, noAssert);
  38387. };
  38388. // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
  38389. Buffer.prototype.copy = function copy(target, targetStart, start, end) {
  38390. if (!start) start = 0;
  38391. if (!end && end !== 0) end = this.length;
  38392. if (targetStart >= target.length) targetStart = target.length;
  38393. if (!targetStart) targetStart = 0;
  38394. if (end > 0 && end < start) end = start;
  38395. // Copy 0 bytes; we're done
  38396. if (end === start) return 0;
  38397. if (target.length === 0 || this.length === 0) return 0;
  38398. // Fatal error conditions
  38399. if (targetStart < 0) {
  38400. throw new RangeError('targetStart out of bounds');
  38401. }
  38402. if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds');
  38403. if (end < 0) throw new RangeError('sourceEnd out of bounds');
  38404. // Are we oob?
  38405. if (end > this.length) end = this.length;
  38406. if (target.length - targetStart < end - start) {
  38407. end = target.length - targetStart + start;
  38408. }
  38409. var len = end - start;
  38410. var i;
  38411. if (this === target && start < targetStart && targetStart < end) {
  38412. // descending copy from end
  38413. for (i = len - 1; i >= 0; --i) {
  38414. target[i + targetStart] = this[i + start];
  38415. }
  38416. } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {
  38417. // ascending copy from start
  38418. for (i = 0; i < len; ++i) {
  38419. target[i + targetStart] = this[i + start];
  38420. }
  38421. } else {
  38422. Uint8Array.prototype.set.call(target, this.subarray(start, start + len), targetStart);
  38423. }
  38424. return len;
  38425. };
  38426. // Usage:
  38427. // buffer.fill(number[, offset[, end]])
  38428. // buffer.fill(buffer[, offset[, end]])
  38429. // buffer.fill(string[, offset[, end]][, encoding])
  38430. Buffer.prototype.fill = function fill(val, start, end, encoding) {
  38431. // Handle string cases:
  38432. if (typeof val === 'string') {
  38433. if (typeof start === 'string') {
  38434. encoding = start;
  38435. start = 0;
  38436. end = this.length;
  38437. } else if (typeof end === 'string') {
  38438. encoding = end;
  38439. end = this.length;
  38440. }
  38441. if (val.length === 1) {
  38442. var code = val.charCodeAt(0);
  38443. if (code < 256) {
  38444. val = code;
  38445. }
  38446. }
  38447. if (encoding !== undefined && typeof encoding !== 'string') {
  38448. throw new TypeError('encoding must be a string');
  38449. }
  38450. if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
  38451. throw new TypeError('Unknown encoding: ' + encoding);
  38452. }
  38453. } else if (typeof val === 'number') {
  38454. val = val & 255;
  38455. }
  38456. // Invalid ranges are not set to a default, so can range check early.
  38457. if (start < 0 || this.length < start || this.length < end) {
  38458. throw new RangeError('Out of range index');
  38459. }
  38460. if (end <= start) {
  38461. return this;
  38462. }
  38463. start = start >>> 0;
  38464. end = end === undefined ? this.length : end >>> 0;
  38465. if (!val) val = 0;
  38466. var i;
  38467. if (typeof val === 'number') {
  38468. for (i = start; i < end; ++i) {
  38469. this[i] = val;
  38470. }
  38471. } else {
  38472. var bytes = Buffer.isBuffer(val) ? val : utf8ToBytes(new Buffer(val, encoding).toString());
  38473. var len = bytes.length;
  38474. for (i = 0; i < end - start; ++i) {
  38475. this[i + start] = bytes[i % len];
  38476. }
  38477. }
  38478. return this;
  38479. };
  38480. // HELPER FUNCTIONS
  38481. // ================
  38482. var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g;
  38483. function base64clean(str) {
  38484. // Node strips out invalid characters like \n and \t from the string, base64-js does not
  38485. str = stringtrim(str).replace(INVALID_BASE64_RE, '');
  38486. // Node converts strings with length < 2 to ''
  38487. if (str.length < 2) return '';
  38488. // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
  38489. while (str.length % 4 !== 0) {
  38490. str = str + '=';
  38491. }
  38492. return str;
  38493. }
  38494. function stringtrim(str) {
  38495. if (str.trim) return str.trim();
  38496. return str.replace(/^\s+|\s+$/g, '');
  38497. }
  38498. function toHex(n) {
  38499. if (n < 16) return '0' + n.toString(16);
  38500. return n.toString(16);
  38501. }
  38502. function utf8ToBytes(string, units) {
  38503. units = units || Infinity;
  38504. var codePoint;
  38505. var length = string.length;
  38506. var leadSurrogate = null;
  38507. var bytes = [];
  38508. for (var i = 0; i < length; ++i) {
  38509. codePoint = string.charCodeAt(i);
  38510. // is surrogate component
  38511. if (codePoint > 0xD7FF && codePoint < 0xE000) {
  38512. // last char was a lead
  38513. if (!leadSurrogate) {
  38514. // no lead yet
  38515. if (codePoint > 0xDBFF) {
  38516. // unexpected trail
  38517. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);
  38518. continue;
  38519. } else if (i + 1 === length) {
  38520. // unpaired lead
  38521. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);
  38522. continue;
  38523. }
  38524. // valid lead
  38525. leadSurrogate = codePoint;
  38526. continue;
  38527. }
  38528. // 2 leads in a row
  38529. if (codePoint < 0xDC00) {
  38530. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);
  38531. leadSurrogate = codePoint;
  38532. continue;
  38533. }
  38534. // valid surrogate pair
  38535. codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000;
  38536. } else if (leadSurrogate) {
  38537. // valid bmp char, but last char was a lead
  38538. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);
  38539. }
  38540. leadSurrogate = null;
  38541. // encode utf8
  38542. if (codePoint < 0x80) {
  38543. if ((units -= 1) < 0) break;
  38544. bytes.push(codePoint);
  38545. } else if (codePoint < 0x800) {
  38546. if ((units -= 2) < 0) break;
  38547. bytes.push(codePoint >> 0x6 | 0xC0, codePoint & 0x3F | 0x80);
  38548. } else if (codePoint < 0x10000) {
  38549. if ((units -= 3) < 0) break;
  38550. bytes.push(codePoint >> 0xC | 0xE0, codePoint >> 0x6 & 0x3F | 0x80, codePoint & 0x3F | 0x80);
  38551. } else if (codePoint < 0x110000) {
  38552. if ((units -= 4) < 0) break;
  38553. bytes.push(codePoint >> 0x12 | 0xF0, codePoint >> 0xC & 0x3F | 0x80, codePoint >> 0x6 & 0x3F | 0x80, codePoint & 0x3F | 0x80);
  38554. } else {
  38555. throw new Error('Invalid code point');
  38556. }
  38557. }
  38558. return bytes;
  38559. }
  38560. function asciiToBytes(str) {
  38561. var byteArray = [];
  38562. for (var i = 0; i < str.length; ++i) {
  38563. // Node's code seems to be doing this and not & 0x7F..
  38564. byteArray.push(str.charCodeAt(i) & 0xFF);
  38565. }
  38566. return byteArray;
  38567. }
  38568. function utf16leToBytes(str, units) {
  38569. var c, hi, lo;
  38570. var byteArray = [];
  38571. for (var i = 0; i < str.length; ++i) {
  38572. if ((units -= 2) < 0) break;
  38573. c = str.charCodeAt(i);
  38574. hi = c >> 8;
  38575. lo = c % 256;
  38576. byteArray.push(lo);
  38577. byteArray.push(hi);
  38578. }
  38579. return byteArray;
  38580. }
  38581. function base64ToBytes(str) {
  38582. return base64.toByteArray(base64clean(str));
  38583. }
  38584. function blitBuffer(src, dst, offset, length) {
  38585. for (var i = 0; i < length; ++i) {
  38586. if (i + offset >= dst.length || i >= src.length) break;
  38587. dst[i + offset] = src[i];
  38588. }
  38589. return i;
  38590. }
  38591. function isnan(val) {
  38592. return val !== val; // eslint-disable-line no-self-compare
  38593. }
  38594. /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
  38595. /***/ }),
  38596. /* 400 */
  38597. /***/ (function(module, exports) {
  38598. 'use strict';
  38599. var toString = {}.toString;
  38600. module.exports = Array.isArray || function (arr) {
  38601. return toString.call(arr) == '[object Array]';
  38602. };
  38603. /***/ }),
  38604. /* 401 */
  38605. /***/ (function(module, exports, __webpack_require__) {
  38606. /* WEBPACK VAR INJECTION */(function(process) {'use strict';
  38607. var escapeStringRegexp = __webpack_require__(460);
  38608. var ansiStyles = __webpack_require__(289);
  38609. var stripAnsi = __webpack_require__(622);
  38610. var hasAnsi = __webpack_require__(464);
  38611. var supportsColor = __webpack_require__(623);
  38612. var defineProps = Object.defineProperties;
  38613. var isSimpleWindowsTerm = process.platform === 'win32' && !/^xterm/i.test(process.env.TERM);
  38614. function Chalk(options) {
  38615. // detect mode if not set manually
  38616. this.enabled = !options || options.enabled === undefined ? supportsColor : options.enabled;
  38617. }
  38618. // use bright blue on Windows as the normal blue color is illegible
  38619. if (isSimpleWindowsTerm) {
  38620. ansiStyles.blue.open = '\x1B[94m';
  38621. }
  38622. var styles = function () {
  38623. var ret = {};
  38624. Object.keys(ansiStyles).forEach(function (key) {
  38625. ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g');
  38626. ret[key] = {
  38627. get: function get() {
  38628. return build.call(this, this._styles.concat(key));
  38629. }
  38630. };
  38631. });
  38632. return ret;
  38633. }();
  38634. var proto = defineProps(function chalk() {}, styles);
  38635. function build(_styles) {
  38636. var builder = function builder() {
  38637. return applyStyle.apply(builder, arguments);
  38638. };
  38639. builder._styles = _styles;
  38640. builder.enabled = this.enabled;
  38641. // __proto__ is used because we must return a function, but there is
  38642. // no way to create a function with a different prototype.
  38643. /* eslint-disable no-proto */
  38644. builder.__proto__ = proto;
  38645. return builder;
  38646. }
  38647. function applyStyle() {
  38648. // support varags, but simply cast to string in case there's only one arg
  38649. var args = arguments;
  38650. var argsLen = args.length;
  38651. var str = argsLen !== 0 && String(arguments[0]);
  38652. if (argsLen > 1) {
  38653. // don't slice `arguments`, it prevents v8 optimizations
  38654. for (var a = 1; a < argsLen; a++) {
  38655. str += ' ' + args[a];
  38656. }
  38657. }
  38658. if (!this.enabled || !str) {
  38659. return str;
  38660. }
  38661. var nestedStyles = this._styles;
  38662. var i = nestedStyles.length;
  38663. // Turns out that on Windows dimmed gray text becomes invisible in cmd.exe,
  38664. // see https://github.com/chalk/chalk/issues/58
  38665. // If we're on Windows and we're dealing with a gray color, temporarily make 'dim' a noop.
  38666. var originalDim = ansiStyles.dim.open;
  38667. if (isSimpleWindowsTerm && (nestedStyles.indexOf('gray') !== -1 || nestedStyles.indexOf('grey') !== -1)) {
  38668. ansiStyles.dim.open = '';
  38669. }
  38670. while (i--) {
  38671. var code = ansiStyles[nestedStyles[i]];
  38672. // Replace any instances already present with a re-opening code
  38673. // otherwise only the part of the string until said closing code
  38674. // will be colored, and the rest will simply be 'plain'.
  38675. str = code.open + str.replace(code.closeRe, code.open) + code.close;
  38676. }
  38677. // Reset the original 'dim' if we changed it to work around the Windows dimmed gray issue.
  38678. ansiStyles.dim.open = originalDim;
  38679. return str;
  38680. }
  38681. function init() {
  38682. var ret = {};
  38683. Object.keys(styles).forEach(function (name) {
  38684. ret[name] = {
  38685. get: function get() {
  38686. return build.call(this, [name]);
  38687. }
  38688. };
  38689. });
  38690. return ret;
  38691. }
  38692. defineProps(Chalk.prototype, init());
  38693. module.exports = new Chalk();
  38694. module.exports.styles = ansiStyles;
  38695. module.exports.hasColor = hasAnsi;
  38696. module.exports.stripColor = stripAnsi;
  38697. module.exports.supportsColor = supportsColor;
  38698. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(8)))
  38699. /***/ }),
  38700. /* 402 */
  38701. /***/ (function(module, exports) {
  38702. 'use strict';
  38703. module.exports = function (xs, fn) {
  38704. var res = [];
  38705. for (var i = 0; i < xs.length; i++) {
  38706. var x = fn(xs[i], i);
  38707. if (isArray(x)) res.push.apply(res, x);else res.push(x);
  38708. }
  38709. return res;
  38710. };
  38711. var isArray = Array.isArray || function (xs) {
  38712. return Object.prototype.toString.call(xs) === '[object Array]';
  38713. };
  38714. /***/ }),
  38715. /* 403 */
  38716. /***/ (function(module, exports, __webpack_require__) {
  38717. /* WEBPACK VAR INJECTION */(function(Buffer) {'use strict';
  38718. var fs = __webpack_require__(115);
  38719. var path = __webpack_require__(19);
  38720. Object.defineProperty(exports, 'commentRegex', {
  38721. get: function getCommentRegex() {
  38722. return (/^\s*\/(?:\/|\*)[@#]\s+sourceMappingURL=data:(?:application|text)\/json;(?:charset[:=]\S+?;)?base64,(?:.*)$/mg
  38723. );
  38724. }
  38725. });
  38726. Object.defineProperty(exports, 'mapFileCommentRegex', {
  38727. get: function getMapFileCommentRegex() {
  38728. //Example (Extra space between slashes added to solve Safari bug. Exclude space in production):
  38729. // / /# sourceMappingURL=foo.js.map /*# sourceMappingURL=foo.js.map */
  38730. return (/(?:\/\/[@#][ \t]+sourceMappingURL=([^\s'"]+?)[ \t]*$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^\*]+?)[ \t]*(?:\*\/){1}[ \t]*$)/mg
  38731. );
  38732. }
  38733. });
  38734. function decodeBase64(base64) {
  38735. return new Buffer(base64, 'base64').toString();
  38736. }
  38737. function stripComment(sm) {
  38738. return sm.split(',').pop();
  38739. }
  38740. function readFromFileMap(sm, dir) {
  38741. // NOTE: this will only work on the server since it attempts to read the map file
  38742. var r = exports.mapFileCommentRegex.exec(sm);
  38743. // for some odd reason //# .. captures in 1 and /* .. */ in 2
  38744. var filename = r[1] || r[2];
  38745. var filepath = path.resolve(dir, filename);
  38746. try {
  38747. return fs.readFileSync(filepath, 'utf8');
  38748. } catch (e) {
  38749. throw new Error('An error occurred while trying to read the map file at ' + filepath + '\n' + e);
  38750. }
  38751. }
  38752. function Converter(sm, opts) {
  38753. opts = opts || {};
  38754. if (opts.isFileComment) sm = readFromFileMap(sm, opts.commentFileDir);
  38755. if (opts.hasComment) sm = stripComment(sm);
  38756. if (opts.isEncoded) sm = decodeBase64(sm);
  38757. if (opts.isJSON || opts.isEncoded) sm = JSON.parse(sm);
  38758. this.sourcemap = sm;
  38759. }
  38760. Converter.prototype.toJSON = function (space) {
  38761. return JSON.stringify(this.sourcemap, null, space);
  38762. };
  38763. Converter.prototype.toBase64 = function () {
  38764. var json = this.toJSON();
  38765. return new Buffer(json).toString('base64');
  38766. };
  38767. Converter.prototype.toComment = function (options) {
  38768. var base64 = this.toBase64();
  38769. var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;
  38770. return options && options.multiline ? '/*# ' + data + ' */' : '//# ' + data;
  38771. };
  38772. // returns copy instead of original
  38773. Converter.prototype.toObject = function () {
  38774. return JSON.parse(this.toJSON());
  38775. };
  38776. Converter.prototype.addProperty = function (key, value) {
  38777. if (this.sourcemap.hasOwnProperty(key)) throw new Error('property %s already exists on the sourcemap, use set property instead');
  38778. return this.setProperty(key, value);
  38779. };
  38780. Converter.prototype.setProperty = function (key, value) {
  38781. this.sourcemap[key] = value;
  38782. return this;
  38783. };
  38784. Converter.prototype.getProperty = function (key) {
  38785. return this.sourcemap[key];
  38786. };
  38787. exports.fromObject = function (obj) {
  38788. return new Converter(obj);
  38789. };
  38790. exports.fromJSON = function (json) {
  38791. return new Converter(json, { isJSON: true });
  38792. };
  38793. exports.fromBase64 = function (base64) {
  38794. return new Converter(base64, { isEncoded: true });
  38795. };
  38796. exports.fromComment = function (comment) {
  38797. comment = comment.replace(/^\/\*/g, '//').replace(/\*\/$/g, '');
  38798. return new Converter(comment, { isEncoded: true, hasComment: true });
  38799. };
  38800. exports.fromMapFileComment = function (comment, dir) {
  38801. return new Converter(comment, { commentFileDir: dir, isFileComment: true, isJSON: true });
  38802. };
  38803. // Finds last sourcemap comment in file or returns null if none was found
  38804. exports.fromSource = function (content) {
  38805. var m = content.match(exports.commentRegex);
  38806. return m ? exports.fromComment(m.pop()) : null;
  38807. };
  38808. // Finds last sourcemap comment in file or returns null if none was found
  38809. exports.fromMapFileSource = function (content, dir) {
  38810. var m = content.match(exports.mapFileCommentRegex);
  38811. return m ? exports.fromMapFileComment(m.pop(), dir) : null;
  38812. };
  38813. exports.removeComments = function (src) {
  38814. return src.replace(exports.commentRegex, '');
  38815. };
  38816. exports.removeMapFileComments = function (src) {
  38817. return src.replace(exports.mapFileCommentRegex, '');
  38818. };
  38819. exports.generateMapFileComment = function (file, options) {
  38820. var data = 'sourceMappingURL=' + file;
  38821. return options && options.multiline ? '/*# ' + data + ' */' : '//# ' + data;
  38822. };
  38823. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(399).Buffer))
  38824. /***/ }),
  38825. /* 404 */
  38826. /***/ (function(module, exports, __webpack_require__) {
  38827. 'use strict';
  38828. __webpack_require__(59);
  38829. __webpack_require__(157);
  38830. module.exports = __webpack_require__(439);
  38831. /***/ }),
  38832. /* 405 */
  38833. /***/ (function(module, exports, __webpack_require__) {
  38834. 'use strict';
  38835. var core = __webpack_require__(5);
  38836. var $JSON = core.JSON || (core.JSON = { stringify: JSON.stringify });
  38837. module.exports = function stringify(it) {
  38838. // eslint-disable-line no-unused-vars
  38839. return $JSON.stringify.apply($JSON, arguments);
  38840. };
  38841. /***/ }),
  38842. /* 406 */
  38843. /***/ (function(module, exports, __webpack_require__) {
  38844. 'use strict';
  38845. __webpack_require__(96);
  38846. __webpack_require__(157);
  38847. __webpack_require__(59);
  38848. __webpack_require__(441);
  38849. __webpack_require__(451);
  38850. __webpack_require__(450);
  38851. __webpack_require__(449);
  38852. module.exports = __webpack_require__(5).Map;
  38853. /***/ }),
  38854. /* 407 */
  38855. /***/ (function(module, exports, __webpack_require__) {
  38856. 'use strict';
  38857. __webpack_require__(442);
  38858. module.exports = 0x1fffffffffffff;
  38859. /***/ }),
  38860. /* 408 */
  38861. /***/ (function(module, exports, __webpack_require__) {
  38862. 'use strict';
  38863. __webpack_require__(443);
  38864. module.exports = __webpack_require__(5).Object.assign;
  38865. /***/ }),
  38866. /* 409 */
  38867. /***/ (function(module, exports, __webpack_require__) {
  38868. 'use strict';
  38869. __webpack_require__(444);
  38870. var $Object = __webpack_require__(5).Object;
  38871. module.exports = function create(P, D) {
  38872. return $Object.create(P, D);
  38873. };
  38874. /***/ }),
  38875. /* 410 */
  38876. /***/ (function(module, exports, __webpack_require__) {
  38877. 'use strict';
  38878. __webpack_require__(158);
  38879. module.exports = __webpack_require__(5).Object.getOwnPropertySymbols;
  38880. /***/ }),
  38881. /* 411 */
  38882. /***/ (function(module, exports, __webpack_require__) {
  38883. 'use strict';
  38884. __webpack_require__(445);
  38885. module.exports = __webpack_require__(5).Object.keys;
  38886. /***/ }),
  38887. /* 412 */
  38888. /***/ (function(module, exports, __webpack_require__) {
  38889. 'use strict';
  38890. __webpack_require__(446);
  38891. module.exports = __webpack_require__(5).Object.setPrototypeOf;
  38892. /***/ }),
  38893. /* 413 */
  38894. /***/ (function(module, exports, __webpack_require__) {
  38895. 'use strict';
  38896. __webpack_require__(158);
  38897. module.exports = __webpack_require__(5).Symbol['for'];
  38898. /***/ }),
  38899. /* 414 */
  38900. /***/ (function(module, exports, __webpack_require__) {
  38901. 'use strict';
  38902. __webpack_require__(158);
  38903. __webpack_require__(96);
  38904. __webpack_require__(452);
  38905. __webpack_require__(453);
  38906. module.exports = __webpack_require__(5).Symbol;
  38907. /***/ }),
  38908. /* 415 */
  38909. /***/ (function(module, exports, __webpack_require__) {
  38910. 'use strict';
  38911. __webpack_require__(157);
  38912. __webpack_require__(59);
  38913. module.exports = __webpack_require__(156).f('iterator');
  38914. /***/ }),
  38915. /* 416 */
  38916. /***/ (function(module, exports, __webpack_require__) {
  38917. 'use strict';
  38918. __webpack_require__(96);
  38919. __webpack_require__(59);
  38920. __webpack_require__(447);
  38921. __webpack_require__(455);
  38922. __webpack_require__(454);
  38923. module.exports = __webpack_require__(5).WeakMap;
  38924. /***/ }),
  38925. /* 417 */
  38926. /***/ (function(module, exports, __webpack_require__) {
  38927. 'use strict';
  38928. __webpack_require__(96);
  38929. __webpack_require__(59);
  38930. __webpack_require__(448);
  38931. __webpack_require__(457);
  38932. __webpack_require__(456);
  38933. module.exports = __webpack_require__(5).WeakSet;
  38934. /***/ }),
  38935. /* 418 */
  38936. /***/ (function(module, exports) {
  38937. "use strict";
  38938. module.exports = function () {/* empty */};
  38939. /***/ }),
  38940. /* 419 */
  38941. /***/ (function(module, exports, __webpack_require__) {
  38942. 'use strict';
  38943. var forOf = __webpack_require__(55);
  38944. module.exports = function (iter, ITERATOR) {
  38945. var result = [];
  38946. forOf(iter, false, result.push, result, ITERATOR);
  38947. return result;
  38948. };
  38949. /***/ }),
  38950. /* 420 */
  38951. /***/ (function(module, exports, __webpack_require__) {
  38952. 'use strict';
  38953. // false -> Array#indexOf
  38954. // true -> Array#includes
  38955. var toIObject = __webpack_require__(37);
  38956. var toLength = __webpack_require__(153);
  38957. var toAbsoluteIndex = __webpack_require__(438);
  38958. module.exports = function (IS_INCLUDES) {
  38959. return function ($this, el, fromIndex) {
  38960. var O = toIObject($this);
  38961. var length = toLength(O.length);
  38962. var index = toAbsoluteIndex(fromIndex, length);
  38963. var value;
  38964. // Array#includes uses SameValueZero equality algorithm
  38965. // eslint-disable-next-line no-self-compare
  38966. if (IS_INCLUDES && el != el) while (length > index) {
  38967. value = O[index++];
  38968. // eslint-disable-next-line no-self-compare
  38969. if (value != value) return true;
  38970. // Array#indexOf ignores holes, Array#includes - not
  38971. } else for (; length > index; index++) {
  38972. if (IS_INCLUDES || index in O) {
  38973. if (O[index] === el) return IS_INCLUDES || index || 0;
  38974. }
  38975. }return !IS_INCLUDES && -1;
  38976. };
  38977. };
  38978. /***/ }),
  38979. /* 421 */
  38980. /***/ (function(module, exports, __webpack_require__) {
  38981. 'use strict';
  38982. var isObject = __webpack_require__(16);
  38983. var isArray = __webpack_require__(232);
  38984. var SPECIES = __webpack_require__(13)('species');
  38985. module.exports = function (original) {
  38986. var C;
  38987. if (isArray(original)) {
  38988. C = original.constructor;
  38989. // cross-realm fallback
  38990. if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
  38991. if (isObject(C)) {
  38992. C = C[SPECIES];
  38993. if (C === null) C = undefined;
  38994. }
  38995. }return C === undefined ? Array : C;
  38996. };
  38997. /***/ }),
  38998. /* 422 */
  38999. /***/ (function(module, exports, __webpack_require__) {
  39000. 'use strict';
  39001. // 9.4.2.3 ArraySpeciesCreate(originalArray, length)
  39002. var speciesConstructor = __webpack_require__(421);
  39003. module.exports = function (original, length) {
  39004. return new (speciesConstructor(original))(length);
  39005. };
  39006. /***/ }),
  39007. /* 423 */
  39008. /***/ (function(module, exports, __webpack_require__) {
  39009. 'use strict';
  39010. var dP = __webpack_require__(23).f;
  39011. var create = __webpack_require__(90);
  39012. var redefineAll = __webpack_require__(146);
  39013. var ctx = __webpack_require__(43);
  39014. var anInstance = __webpack_require__(136);
  39015. var forOf = __webpack_require__(55);
  39016. var $iterDefine = __webpack_require__(143);
  39017. var step = __webpack_require__(233);
  39018. var setSpecies = __webpack_require__(436);
  39019. var DESCRIPTORS = __webpack_require__(22);
  39020. var fastKey = __webpack_require__(57).fastKey;
  39021. var validate = __webpack_require__(58);
  39022. var SIZE = DESCRIPTORS ? '_s' : 'size';
  39023. var getEntry = function getEntry(that, key) {
  39024. // fast case
  39025. var index = fastKey(key);
  39026. var entry;
  39027. if (index !== 'F') return that._i[index];
  39028. // frozen object case
  39029. for (entry = that._f; entry; entry = entry.n) {
  39030. if (entry.k == key) return entry;
  39031. }
  39032. };
  39033. module.exports = {
  39034. getConstructor: function getConstructor(wrapper, NAME, IS_MAP, ADDER) {
  39035. var C = wrapper(function (that, iterable) {
  39036. anInstance(that, C, NAME, '_i');
  39037. that._t = NAME; // collection type
  39038. that._i = create(null); // index
  39039. that._f = undefined; // first entry
  39040. that._l = undefined; // last entry
  39041. that[SIZE] = 0; // size
  39042. if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);
  39043. });
  39044. redefineAll(C.prototype, {
  39045. // 23.1.3.1 Map.prototype.clear()
  39046. // 23.2.3.2 Set.prototype.clear()
  39047. clear: function clear() {
  39048. for (var that = validate(this, NAME), data = that._i, entry = that._f; entry; entry = entry.n) {
  39049. entry.r = true;
  39050. if (entry.p) entry.p = entry.p.n = undefined;
  39051. delete data[entry.i];
  39052. }
  39053. that._f = that._l = undefined;
  39054. that[SIZE] = 0;
  39055. },
  39056. // 23.1.3.3 Map.prototype.delete(key)
  39057. // 23.2.3.4 Set.prototype.delete(value)
  39058. 'delete': function _delete(key) {
  39059. var that = validate(this, NAME);
  39060. var entry = getEntry(that, key);
  39061. if (entry) {
  39062. var next = entry.n;
  39063. var prev = entry.p;
  39064. delete that._i[entry.i];
  39065. entry.r = true;
  39066. if (prev) prev.n = next;
  39067. if (next) next.p = prev;
  39068. if (that._f == entry) that._f = next;
  39069. if (that._l == entry) that._l = prev;
  39070. that[SIZE]--;
  39071. }return !!entry;
  39072. },
  39073. // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)
  39074. // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)
  39075. forEach: function forEach(callbackfn /* , that = undefined */) {
  39076. validate(this, NAME);
  39077. var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3);
  39078. var entry;
  39079. while (entry = entry ? entry.n : this._f) {
  39080. f(entry.v, entry.k, this);
  39081. // revert to the last existing entry
  39082. while (entry && entry.r) {
  39083. entry = entry.p;
  39084. }
  39085. }
  39086. },
  39087. // 23.1.3.7 Map.prototype.has(key)
  39088. // 23.2.3.7 Set.prototype.has(value)
  39089. has: function has(key) {
  39090. return !!getEntry(validate(this, NAME), key);
  39091. }
  39092. });
  39093. if (DESCRIPTORS) dP(C.prototype, 'size', {
  39094. get: function get() {
  39095. return validate(this, NAME)[SIZE];
  39096. }
  39097. });
  39098. return C;
  39099. },
  39100. def: function def(that, key, value) {
  39101. var entry = getEntry(that, key);
  39102. var prev, index;
  39103. // change existing entry
  39104. if (entry) {
  39105. entry.v = value;
  39106. // create new entry
  39107. } else {
  39108. that._l = entry = {
  39109. i: index = fastKey(key, true), // <- index
  39110. k: key, // <- key
  39111. v: value, // <- value
  39112. p: prev = that._l, // <- previous entry
  39113. n: undefined, // <- next entry
  39114. r: false // <- removed
  39115. };
  39116. if (!that._f) that._f = entry;
  39117. if (prev) prev.n = entry;
  39118. that[SIZE]++;
  39119. // add to index
  39120. if (index !== 'F') that._i[index] = entry;
  39121. }return that;
  39122. },
  39123. getEntry: getEntry,
  39124. setStrong: function setStrong(C, NAME, IS_MAP) {
  39125. // add .keys, .values, .entries, [@@iterator]
  39126. // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11
  39127. $iterDefine(C, NAME, function (iterated, kind) {
  39128. this._t = validate(iterated, NAME); // target
  39129. this._k = kind; // kind
  39130. this._l = undefined; // previous
  39131. }, function () {
  39132. var that = this;
  39133. var kind = that._k;
  39134. var entry = that._l;
  39135. // revert to the last existing entry
  39136. while (entry && entry.r) {
  39137. entry = entry.p;
  39138. } // get next entry
  39139. if (!that._t || !(that._l = entry = entry ? entry.n : that._t._f)) {
  39140. // or finish the iteration
  39141. that._t = undefined;
  39142. return step(1);
  39143. }
  39144. // return step by kind
  39145. if (kind == 'keys') return step(0, entry.k);
  39146. if (kind == 'values') return step(0, entry.v);
  39147. return step(0, [entry.k, entry.v]);
  39148. }, IS_MAP ? 'entries' : 'values', !IS_MAP, true);
  39149. // add [@@species], 23.1.2.2, 23.2.2.2
  39150. setSpecies(NAME);
  39151. }
  39152. };
  39153. /***/ }),
  39154. /* 424 */
  39155. /***/ (function(module, exports, __webpack_require__) {
  39156. 'use strict';
  39157. // https://github.com/DavidBruant/Map-Set.prototype.toJSON
  39158. var classof = __webpack_require__(228);
  39159. var from = __webpack_require__(419);
  39160. module.exports = function (NAME) {
  39161. return function toJSON() {
  39162. if (classof(this) != NAME) throw TypeError(NAME + "#toJSON isn't generic");
  39163. return from(this);
  39164. };
  39165. };
  39166. /***/ }),
  39167. /* 425 */
  39168. /***/ (function(module, exports, __webpack_require__) {
  39169. 'use strict';
  39170. // all enumerable object keys, includes symbols
  39171. var getKeys = __webpack_require__(44);
  39172. var gOPS = __webpack_require__(145);
  39173. var pIE = __webpack_require__(91);
  39174. module.exports = function (it) {
  39175. var result = getKeys(it);
  39176. var getSymbols = gOPS.f;
  39177. if (getSymbols) {
  39178. var symbols = getSymbols(it);
  39179. var isEnum = pIE.f;
  39180. var i = 0;
  39181. var key;
  39182. while (symbols.length > i) {
  39183. if (isEnum.call(it, key = symbols[i++])) result.push(key);
  39184. }
  39185. }return result;
  39186. };
  39187. /***/ }),
  39188. /* 426 */
  39189. /***/ (function(module, exports, __webpack_require__) {
  39190. 'use strict';
  39191. var document = __webpack_require__(15).document;
  39192. module.exports = document && document.documentElement;
  39193. /***/ }),
  39194. /* 427 */
  39195. /***/ (function(module, exports, __webpack_require__) {
  39196. 'use strict';
  39197. // check on default Array iterator
  39198. var Iterators = __webpack_require__(56);
  39199. var ITERATOR = __webpack_require__(13)('iterator');
  39200. var ArrayProto = Array.prototype;
  39201. module.exports = function (it) {
  39202. return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);
  39203. };
  39204. /***/ }),
  39205. /* 428 */
  39206. /***/ (function(module, exports, __webpack_require__) {
  39207. 'use strict';
  39208. // call something on iterator step with safe closing on error
  39209. var anObject = __webpack_require__(21);
  39210. module.exports = function (iterator, fn, value, entries) {
  39211. try {
  39212. return entries ? fn(anObject(value)[0], value[1]) : fn(value);
  39213. // 7.4.6 IteratorClose(iterator, completion)
  39214. } catch (e) {
  39215. var ret = iterator['return'];
  39216. if (ret !== undefined) anObject(ret.call(iterator));
  39217. throw e;
  39218. }
  39219. };
  39220. /***/ }),
  39221. /* 429 */
  39222. /***/ (function(module, exports, __webpack_require__) {
  39223. 'use strict';
  39224. var create = __webpack_require__(90);
  39225. var descriptor = __webpack_require__(92);
  39226. var setToStringTag = __webpack_require__(93);
  39227. var IteratorPrototype = {};
  39228. // 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
  39229. __webpack_require__(29)(IteratorPrototype, __webpack_require__(13)('iterator'), function () {
  39230. return this;
  39231. });
  39232. module.exports = function (Constructor, NAME, next) {
  39233. Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });
  39234. setToStringTag(Constructor, NAME + ' Iterator');
  39235. };
  39236. /***/ }),
  39237. /* 430 */
  39238. /***/ (function(module, exports, __webpack_require__) {
  39239. 'use strict';
  39240. var getKeys = __webpack_require__(44);
  39241. var toIObject = __webpack_require__(37);
  39242. module.exports = function (object, el) {
  39243. var O = toIObject(object);
  39244. var keys = getKeys(O);
  39245. var length = keys.length;
  39246. var index = 0;
  39247. var key;
  39248. while (length > index) {
  39249. if (O[key = keys[index++]] === el) return key;
  39250. }
  39251. };
  39252. /***/ }),
  39253. /* 431 */
  39254. /***/ (function(module, exports, __webpack_require__) {
  39255. 'use strict';
  39256. var dP = __webpack_require__(23);
  39257. var anObject = __webpack_require__(21);
  39258. var getKeys = __webpack_require__(44);
  39259. module.exports = __webpack_require__(22) ? Object.defineProperties : function defineProperties(O, Properties) {
  39260. anObject(O);
  39261. var keys = getKeys(Properties);
  39262. var length = keys.length;
  39263. var i = 0;
  39264. var P;
  39265. while (length > i) {
  39266. dP.f(O, P = keys[i++], Properties[P]);
  39267. }return O;
  39268. };
  39269. /***/ }),
  39270. /* 432 */
  39271. /***/ (function(module, exports, __webpack_require__) {
  39272. 'use strict';
  39273. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  39274. // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
  39275. var toIObject = __webpack_require__(37);
  39276. var gOPN = __webpack_require__(236).f;
  39277. var toString = {}.toString;
  39278. var windowNames = (typeof window === 'undefined' ? 'undefined' : _typeof(window)) == 'object' && window && Object.getOwnPropertyNames ? Object.getOwnPropertyNames(window) : [];
  39279. var getWindowNames = function getWindowNames(it) {
  39280. try {
  39281. return gOPN(it);
  39282. } catch (e) {
  39283. return windowNames.slice();
  39284. }
  39285. };
  39286. module.exports.f = function getOwnPropertyNames(it) {
  39287. return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));
  39288. };
  39289. /***/ }),
  39290. /* 433 */
  39291. /***/ (function(module, exports, __webpack_require__) {
  39292. 'use strict';
  39293. // 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)
  39294. var has = __webpack_require__(28);
  39295. var toObject = __webpack_require__(94);
  39296. var IE_PROTO = __webpack_require__(150)('IE_PROTO');
  39297. var ObjectProto = Object.prototype;
  39298. module.exports = Object.getPrototypeOf || function (O) {
  39299. O = toObject(O);
  39300. if (has(O, IE_PROTO)) return O[IE_PROTO];
  39301. if (typeof O.constructor == 'function' && O instanceof O.constructor) {
  39302. return O.constructor.prototype;
  39303. }return O instanceof Object ? ObjectProto : null;
  39304. };
  39305. /***/ }),
  39306. /* 434 */
  39307. /***/ (function(module, exports, __webpack_require__) {
  39308. 'use strict';
  39309. // most Object methods by ES6 should accept primitives
  39310. var $export = __webpack_require__(12);
  39311. var core = __webpack_require__(5);
  39312. var fails = __webpack_require__(27);
  39313. module.exports = function (KEY, exec) {
  39314. var fn = (core.Object || {})[KEY] || Object[KEY];
  39315. var exp = {};
  39316. exp[KEY] = exec(fn);
  39317. $export($export.S + $export.F * fails(function () {
  39318. fn(1);
  39319. }), 'Object', exp);
  39320. };
  39321. /***/ }),
  39322. /* 435 */
  39323. /***/ (function(module, exports, __webpack_require__) {
  39324. 'use strict';
  39325. // Works with __proto__ only. Old v8 can't work with null proto objects.
  39326. /* eslint-disable no-proto */
  39327. var isObject = __webpack_require__(16);
  39328. var anObject = __webpack_require__(21);
  39329. var check = function check(O, proto) {
  39330. anObject(O);
  39331. if (!isObject(proto) && proto !== null) throw TypeError(proto + ": can't set as prototype!");
  39332. };
  39333. module.exports = {
  39334. set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line
  39335. function (test, buggy, set) {
  39336. try {
  39337. set = __webpack_require__(43)(Function.call, __webpack_require__(235).f(Object.prototype, '__proto__').set, 2);
  39338. set(test, []);
  39339. buggy = !(test instanceof Array);
  39340. } catch (e) {
  39341. buggy = true;
  39342. }
  39343. return function setPrototypeOf(O, proto) {
  39344. check(O, proto);
  39345. if (buggy) O.__proto__ = proto;else set(O, proto);
  39346. return O;
  39347. };
  39348. }({}, false) : undefined),
  39349. check: check
  39350. };
  39351. /***/ }),
  39352. /* 436 */
  39353. /***/ (function(module, exports, __webpack_require__) {
  39354. 'use strict';
  39355. var global = __webpack_require__(15);
  39356. var core = __webpack_require__(5);
  39357. var dP = __webpack_require__(23);
  39358. var DESCRIPTORS = __webpack_require__(22);
  39359. var SPECIES = __webpack_require__(13)('species');
  39360. module.exports = function (KEY) {
  39361. var C = typeof core[KEY] == 'function' ? core[KEY] : global[KEY];
  39362. if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, {
  39363. configurable: true,
  39364. get: function get() {
  39365. return this;
  39366. }
  39367. });
  39368. };
  39369. /***/ }),
  39370. /* 437 */
  39371. /***/ (function(module, exports, __webpack_require__) {
  39372. 'use strict';
  39373. var toInteger = __webpack_require__(152);
  39374. var defined = __webpack_require__(140);
  39375. // true -> String#at
  39376. // false -> String#codePointAt
  39377. module.exports = function (TO_STRING) {
  39378. return function (that, pos) {
  39379. var s = String(defined(that));
  39380. var i = toInteger(pos);
  39381. var l = s.length;
  39382. var a, b;
  39383. if (i < 0 || i >= l) return TO_STRING ? '' : undefined;
  39384. a = s.charCodeAt(i);
  39385. return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff ? TO_STRING ? s.charAt(i) : a : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;
  39386. };
  39387. };
  39388. /***/ }),
  39389. /* 438 */
  39390. /***/ (function(module, exports, __webpack_require__) {
  39391. 'use strict';
  39392. var toInteger = __webpack_require__(152);
  39393. var max = Math.max;
  39394. var min = Math.min;
  39395. module.exports = function (index, length) {
  39396. index = toInteger(index);
  39397. return index < 0 ? max(index + length, 0) : min(index, length);
  39398. };
  39399. /***/ }),
  39400. /* 439 */
  39401. /***/ (function(module, exports, __webpack_require__) {
  39402. 'use strict';
  39403. var anObject = __webpack_require__(21);
  39404. var get = __webpack_require__(238);
  39405. module.exports = __webpack_require__(5).getIterator = function (it) {
  39406. var iterFn = get(it);
  39407. if (typeof iterFn != 'function') throw TypeError(it + ' is not iterable!');
  39408. return anObject(iterFn.call(it));
  39409. };
  39410. /***/ }),
  39411. /* 440 */
  39412. /***/ (function(module, exports, __webpack_require__) {
  39413. 'use strict';
  39414. var addToUnscopables = __webpack_require__(418);
  39415. var step = __webpack_require__(233);
  39416. var Iterators = __webpack_require__(56);
  39417. var toIObject = __webpack_require__(37);
  39418. // 22.1.3.4 Array.prototype.entries()
  39419. // 22.1.3.13 Array.prototype.keys()
  39420. // 22.1.3.29 Array.prototype.values()
  39421. // 22.1.3.30 Array.prototype[@@iterator]()
  39422. module.exports = __webpack_require__(143)(Array, 'Array', function (iterated, kind) {
  39423. this._t = toIObject(iterated); // target
  39424. this._i = 0; // next index
  39425. this._k = kind; // kind
  39426. // 22.1.5.2.1 %ArrayIteratorPrototype%.next()
  39427. }, function () {
  39428. var O = this._t;
  39429. var kind = this._k;
  39430. var index = this._i++;
  39431. if (!O || index >= O.length) {
  39432. this._t = undefined;
  39433. return step(1);
  39434. }
  39435. if (kind == 'keys') return step(0, index);
  39436. if (kind == 'values') return step(0, O[index]);
  39437. return step(0, [index, O[index]]);
  39438. }, 'values');
  39439. // argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)
  39440. Iterators.Arguments = Iterators.Array;
  39441. addToUnscopables('keys');
  39442. addToUnscopables('values');
  39443. addToUnscopables('entries');
  39444. /***/ }),
  39445. /* 441 */
  39446. /***/ (function(module, exports, __webpack_require__) {
  39447. 'use strict';
  39448. var strong = __webpack_require__(423);
  39449. var validate = __webpack_require__(58);
  39450. var MAP = 'Map';
  39451. // 23.1 Map Objects
  39452. module.exports = __webpack_require__(139)(MAP, function (get) {
  39453. return function Map() {
  39454. return get(this, arguments.length > 0 ? arguments[0] : undefined);
  39455. };
  39456. }, {
  39457. // 23.1.3.6 Map.prototype.get(key)
  39458. get: function get(key) {
  39459. var entry = strong.getEntry(validate(this, MAP), key);
  39460. return entry && entry.v;
  39461. },
  39462. // 23.1.3.9 Map.prototype.set(key, value)
  39463. set: function set(key, value) {
  39464. return strong.def(validate(this, MAP), key === 0 ? 0 : key, value);
  39465. }
  39466. }, strong, true);
  39467. /***/ }),
  39468. /* 442 */
  39469. /***/ (function(module, exports, __webpack_require__) {
  39470. 'use strict';
  39471. // 20.1.2.6 Number.MAX_SAFE_INTEGER
  39472. var $export = __webpack_require__(12);
  39473. $export($export.S, 'Number', { MAX_SAFE_INTEGER: 0x1fffffffffffff });
  39474. /***/ }),
  39475. /* 443 */
  39476. /***/ (function(module, exports, __webpack_require__) {
  39477. 'use strict';
  39478. // 19.1.3.1 Object.assign(target, source)
  39479. var $export = __webpack_require__(12);
  39480. $export($export.S + $export.F, 'Object', { assign: __webpack_require__(234) });
  39481. /***/ }),
  39482. /* 444 */
  39483. /***/ (function(module, exports, __webpack_require__) {
  39484. 'use strict';
  39485. var $export = __webpack_require__(12);
  39486. // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
  39487. $export($export.S, 'Object', { create: __webpack_require__(90) });
  39488. /***/ }),
  39489. /* 445 */
  39490. /***/ (function(module, exports, __webpack_require__) {
  39491. 'use strict';
  39492. // 19.1.2.14 Object.keys(O)
  39493. var toObject = __webpack_require__(94);
  39494. var $keys = __webpack_require__(44);
  39495. __webpack_require__(434)('keys', function () {
  39496. return function keys(it) {
  39497. return $keys(toObject(it));
  39498. };
  39499. });
  39500. /***/ }),
  39501. /* 446 */
  39502. /***/ (function(module, exports, __webpack_require__) {
  39503. 'use strict';
  39504. // 19.1.3.19 Object.setPrototypeOf(O, proto)
  39505. var $export = __webpack_require__(12);
  39506. $export($export.S, 'Object', { setPrototypeOf: __webpack_require__(435).set });
  39507. /***/ }),
  39508. /* 447 */
  39509. /***/ (function(module, exports, __webpack_require__) {
  39510. 'use strict';
  39511. var each = __webpack_require__(137)(0);
  39512. var redefine = __webpack_require__(147);
  39513. var meta = __webpack_require__(57);
  39514. var assign = __webpack_require__(234);
  39515. var weak = __webpack_require__(229);
  39516. var isObject = __webpack_require__(16);
  39517. var fails = __webpack_require__(27);
  39518. var validate = __webpack_require__(58);
  39519. var WEAK_MAP = 'WeakMap';
  39520. var getWeak = meta.getWeak;
  39521. var isExtensible = Object.isExtensible;
  39522. var uncaughtFrozenStore = weak.ufstore;
  39523. var tmp = {};
  39524. var InternalMap;
  39525. var wrapper = function wrapper(get) {
  39526. return function WeakMap() {
  39527. return get(this, arguments.length > 0 ? arguments[0] : undefined);
  39528. };
  39529. };
  39530. var methods = {
  39531. // 23.3.3.3 WeakMap.prototype.get(key)
  39532. get: function get(key) {
  39533. if (isObject(key)) {
  39534. var data = getWeak(key);
  39535. if (data === true) return uncaughtFrozenStore(validate(this, WEAK_MAP)).get(key);
  39536. return data ? data[this._i] : undefined;
  39537. }
  39538. },
  39539. // 23.3.3.5 WeakMap.prototype.set(key, value)
  39540. set: function set(key, value) {
  39541. return weak.def(validate(this, WEAK_MAP), key, value);
  39542. }
  39543. };
  39544. // 23.3 WeakMap Objects
  39545. var $WeakMap = module.exports = __webpack_require__(139)(WEAK_MAP, wrapper, methods, weak, true, true);
  39546. // IE11 WeakMap frozen keys fix
  39547. if (fails(function () {
  39548. return new $WeakMap().set((Object.freeze || Object)(tmp), 7).get(tmp) != 7;
  39549. })) {
  39550. InternalMap = weak.getConstructor(wrapper, WEAK_MAP);
  39551. assign(InternalMap.prototype, methods);
  39552. meta.NEED = true;
  39553. each(['delete', 'has', 'get', 'set'], function (key) {
  39554. var proto = $WeakMap.prototype;
  39555. var method = proto[key];
  39556. redefine(proto, key, function (a, b) {
  39557. // store frozen objects on internal weakmap shim
  39558. if (isObject(a) && !isExtensible(a)) {
  39559. if (!this._f) this._f = new InternalMap();
  39560. var result = this._f[key](a, b);
  39561. return key == 'set' ? this : result;
  39562. // store all the rest on native weakmap
  39563. }return method.call(this, a, b);
  39564. });
  39565. });
  39566. }
  39567. /***/ }),
  39568. /* 448 */
  39569. /***/ (function(module, exports, __webpack_require__) {
  39570. 'use strict';
  39571. var weak = __webpack_require__(229);
  39572. var validate = __webpack_require__(58);
  39573. var WEAK_SET = 'WeakSet';
  39574. // 23.4 WeakSet Objects
  39575. __webpack_require__(139)(WEAK_SET, function (get) {
  39576. return function WeakSet() {
  39577. return get(this, arguments.length > 0 ? arguments[0] : undefined);
  39578. };
  39579. }, {
  39580. // 23.4.3.1 WeakSet.prototype.add(value)
  39581. add: function add(value) {
  39582. return weak.def(validate(this, WEAK_SET), value, true);
  39583. }
  39584. }, weak, false, true);
  39585. /***/ }),
  39586. /* 449 */
  39587. /***/ (function(module, exports, __webpack_require__) {
  39588. 'use strict';
  39589. // https://tc39.github.io/proposal-setmap-offrom/#sec-map.from
  39590. __webpack_require__(148)('Map');
  39591. /***/ }),
  39592. /* 450 */
  39593. /***/ (function(module, exports, __webpack_require__) {
  39594. 'use strict';
  39595. // https://tc39.github.io/proposal-setmap-offrom/#sec-map.of
  39596. __webpack_require__(149)('Map');
  39597. /***/ }),
  39598. /* 451 */
  39599. /***/ (function(module, exports, __webpack_require__) {
  39600. 'use strict';
  39601. // https://github.com/DavidBruant/Map-Set.prototype.toJSON
  39602. var $export = __webpack_require__(12);
  39603. $export($export.P + $export.R, 'Map', { toJSON: __webpack_require__(424)('Map') });
  39604. /***/ }),
  39605. /* 452 */
  39606. /***/ (function(module, exports, __webpack_require__) {
  39607. 'use strict';
  39608. __webpack_require__(155)('asyncIterator');
  39609. /***/ }),
  39610. /* 453 */
  39611. /***/ (function(module, exports, __webpack_require__) {
  39612. 'use strict';
  39613. __webpack_require__(155)('observable');
  39614. /***/ }),
  39615. /* 454 */
  39616. /***/ (function(module, exports, __webpack_require__) {
  39617. 'use strict';
  39618. // https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.from
  39619. __webpack_require__(148)('WeakMap');
  39620. /***/ }),
  39621. /* 455 */
  39622. /***/ (function(module, exports, __webpack_require__) {
  39623. 'use strict';
  39624. // https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.of
  39625. __webpack_require__(149)('WeakMap');
  39626. /***/ }),
  39627. /* 456 */
  39628. /***/ (function(module, exports, __webpack_require__) {
  39629. 'use strict';
  39630. // https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.from
  39631. __webpack_require__(148)('WeakSet');
  39632. /***/ }),
  39633. /* 457 */
  39634. /***/ (function(module, exports, __webpack_require__) {
  39635. 'use strict';
  39636. // https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.of
  39637. __webpack_require__(149)('WeakSet');
  39638. /***/ }),
  39639. /* 458 */
  39640. /***/ (function(module, exports, __webpack_require__) {
  39641. 'use strict';
  39642. /**
  39643. * This is the common logic for both the Node.js and web browser
  39644. * implementations of `debug()`.
  39645. *
  39646. * Expose `debug()` as the module.
  39647. */
  39648. exports = module.exports = createDebug.debug = createDebug['default'] = createDebug;
  39649. exports.coerce = coerce;
  39650. exports.disable = disable;
  39651. exports.enable = enable;
  39652. exports.enabled = enabled;
  39653. exports.humanize = __webpack_require__(602);
  39654. /**
  39655. * The currently active debug mode names, and names to skip.
  39656. */
  39657. exports.names = [];
  39658. exports.skips = [];
  39659. /**
  39660. * Map of special "%n" handling functions, for the debug "format" argument.
  39661. *
  39662. * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
  39663. */
  39664. exports.formatters = {};
  39665. /**
  39666. * Previous log timestamp.
  39667. */
  39668. var prevTime;
  39669. /**
  39670. * Select a color.
  39671. * @param {String} namespace
  39672. * @return {Number}
  39673. * @api private
  39674. */
  39675. function selectColor(namespace) {
  39676. var hash = 0,
  39677. i;
  39678. for (i in namespace) {
  39679. hash = (hash << 5) - hash + namespace.charCodeAt(i);
  39680. hash |= 0; // Convert to 32bit integer
  39681. }
  39682. return exports.colors[Math.abs(hash) % exports.colors.length];
  39683. }
  39684. /**
  39685. * Create a debugger with the given `namespace`.
  39686. *
  39687. * @param {String} namespace
  39688. * @return {Function}
  39689. * @api public
  39690. */
  39691. function createDebug(namespace) {
  39692. function debug() {
  39693. // disabled?
  39694. if (!debug.enabled) return;
  39695. var self = debug;
  39696. // set `diff` timestamp
  39697. var curr = +new Date();
  39698. var ms = curr - (prevTime || curr);
  39699. self.diff = ms;
  39700. self.prev = prevTime;
  39701. self.curr = curr;
  39702. prevTime = curr;
  39703. // turn the `arguments` into a proper Array
  39704. var args = new Array(arguments.length);
  39705. for (var i = 0; i < args.length; i++) {
  39706. args[i] = arguments[i];
  39707. }
  39708. args[0] = exports.coerce(args[0]);
  39709. if ('string' !== typeof args[0]) {
  39710. // anything else let's inspect with %O
  39711. args.unshift('%O');
  39712. }
  39713. // apply any `formatters` transformations
  39714. var index = 0;
  39715. args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) {
  39716. // if we encounter an escaped % then don't increase the array index
  39717. if (match === '%%') return match;
  39718. index++;
  39719. var formatter = exports.formatters[format];
  39720. if ('function' === typeof formatter) {
  39721. var val = args[index];
  39722. match = formatter.call(self, val);
  39723. // now we need to remove `args[index]` since it's inlined in the `format`
  39724. args.splice(index, 1);
  39725. index--;
  39726. }
  39727. return match;
  39728. });
  39729. // apply env-specific formatting (colors, etc.)
  39730. exports.formatArgs.call(self, args);
  39731. var logFn = debug.log || exports.log || console.log.bind(console);
  39732. logFn.apply(self, args);
  39733. }
  39734. debug.namespace = namespace;
  39735. debug.enabled = exports.enabled(namespace);
  39736. debug.useColors = exports.useColors();
  39737. debug.color = selectColor(namespace);
  39738. // env-specific initialization logic for debug instances
  39739. if ('function' === typeof exports.init) {
  39740. exports.init(debug);
  39741. }
  39742. return debug;
  39743. }
  39744. /**
  39745. * Enables a debug mode by namespaces. This can include modes
  39746. * separated by a colon and wildcards.
  39747. *
  39748. * @param {String} namespaces
  39749. * @api public
  39750. */
  39751. function enable(namespaces) {
  39752. exports.save(namespaces);
  39753. exports.names = [];
  39754. exports.skips = [];
  39755. var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
  39756. var len = split.length;
  39757. for (var i = 0; i < len; i++) {
  39758. if (!split[i]) continue; // ignore empty strings
  39759. namespaces = split[i].replace(/\*/g, '.*?');
  39760. if (namespaces[0] === '-') {
  39761. exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
  39762. } else {
  39763. exports.names.push(new RegExp('^' + namespaces + '$'));
  39764. }
  39765. }
  39766. }
  39767. /**
  39768. * Disable debug output.
  39769. *
  39770. * @api public
  39771. */
  39772. function disable() {
  39773. exports.enable('');
  39774. }
  39775. /**
  39776. * Returns true if the given mode name is enabled, false otherwise.
  39777. *
  39778. * @param {String} name
  39779. * @return {Boolean}
  39780. * @api public
  39781. */
  39782. function enabled(name) {
  39783. var i, len;
  39784. for (i = 0, len = exports.skips.length; i < len; i++) {
  39785. if (exports.skips[i].test(name)) {
  39786. return false;
  39787. }
  39788. }
  39789. for (i = 0, len = exports.names.length; i < len; i++) {
  39790. if (exports.names[i].test(name)) {
  39791. return true;
  39792. }
  39793. }
  39794. return false;
  39795. }
  39796. /**
  39797. * Coerce `val`.
  39798. *
  39799. * @param {Mixed} val
  39800. * @return {Mixed}
  39801. * @api private
  39802. */
  39803. function coerce(val) {
  39804. if (val instanceof Error) return val.stack || val.message;
  39805. return val;
  39806. }
  39807. /***/ }),
  39808. /* 459 */
  39809. /***/ (function(module, exports, __webpack_require__) {
  39810. /* eslint-disable guard-for-in */
  39811. 'use strict';
  39812. var repeating = __webpack_require__(615);
  39813. // detect either spaces or tabs but not both to properly handle tabs
  39814. // for indentation and spaces for alignment
  39815. var INDENT_RE = /^(?:( )+|\t+)/;
  39816. function getMostUsed(indents) {
  39817. var result = 0;
  39818. var maxUsed = 0;
  39819. var maxWeight = 0;
  39820. for (var n in indents) {
  39821. var indent = indents[n];
  39822. var u = indent[0];
  39823. var w = indent[1];
  39824. if (u > maxUsed || u === maxUsed && w > maxWeight) {
  39825. maxUsed = u;
  39826. maxWeight = w;
  39827. result = Number(n);
  39828. }
  39829. }
  39830. return result;
  39831. }
  39832. module.exports = function (str) {
  39833. if (typeof str !== 'string') {
  39834. throw new TypeError('Expected a string');
  39835. }
  39836. // used to see if tabs or spaces are the most used
  39837. var tabs = 0;
  39838. var spaces = 0;
  39839. // remember the size of previous line's indentation
  39840. var prev = 0;
  39841. // remember how many indents/unindents as occurred for a given size
  39842. // and how much lines follow a given indentation
  39843. //
  39844. // indents = {
  39845. // 3: [1, 0],
  39846. // 4: [1, 5],
  39847. // 5: [1, 0],
  39848. // 12: [1, 0],
  39849. // }
  39850. var indents = {};
  39851. // pointer to the array of last used indent
  39852. var current;
  39853. // whether the last action was an indent (opposed to an unindent)
  39854. var isIndent;
  39855. str.split(/\n/g).forEach(function (line) {
  39856. if (!line) {
  39857. // ignore empty lines
  39858. return;
  39859. }
  39860. var indent;
  39861. var matches = line.match(INDENT_RE);
  39862. if (!matches) {
  39863. indent = 0;
  39864. } else {
  39865. indent = matches[0].length;
  39866. if (matches[1]) {
  39867. spaces++;
  39868. } else {
  39869. tabs++;
  39870. }
  39871. }
  39872. var diff = indent - prev;
  39873. prev = indent;
  39874. if (diff) {
  39875. // an indent or unindent has been detected
  39876. isIndent = diff > 0;
  39877. current = indents[isIndent ? diff : -diff];
  39878. if (current) {
  39879. current[0]++;
  39880. } else {
  39881. current = indents[diff] = [1, 0];
  39882. }
  39883. } else if (current) {
  39884. // if the last action was an indent, increment the weight
  39885. current[1] += Number(isIndent);
  39886. }
  39887. });
  39888. var amount = getMostUsed(indents);
  39889. var type;
  39890. var actual;
  39891. if (!amount) {
  39892. type = null;
  39893. actual = '';
  39894. } else if (spaces >= tabs) {
  39895. type = 'space';
  39896. actual = repeating(' ', amount);
  39897. } else {
  39898. type = 'tab';
  39899. actual = repeating('\t', amount);
  39900. }
  39901. return {
  39902. amount: amount,
  39903. type: type,
  39904. indent: actual
  39905. };
  39906. };
  39907. /***/ }),
  39908. /* 460 */
  39909. /***/ (function(module, exports) {
  39910. 'use strict';
  39911. var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g;
  39912. module.exports = function (str) {
  39913. if (typeof str !== 'string') {
  39914. throw new TypeError('Expected a string');
  39915. }
  39916. return str.replace(matchOperatorsRe, '\\$&');
  39917. };
  39918. /***/ }),
  39919. /* 461 */
  39920. /***/ (function(module, exports) {
  39921. 'use strict';
  39922. /*
  39923. Copyright (C) 2013 Yusuke Suzuki <utatane.tea@gmail.com>
  39924. Redistribution and use in source and binary forms, with or without
  39925. modification, are permitted provided that the following conditions are met:
  39926. * Redistributions of source code must retain the above copyright
  39927. notice, this list of conditions and the following disclaimer.
  39928. * Redistributions in binary form must reproduce the above copyright
  39929. notice, this list of conditions and the following disclaimer in the
  39930. documentation and/or other materials provided with the distribution.
  39931. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS'
  39932. AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  39933. IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  39934. ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
  39935. DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  39936. (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  39937. LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  39938. ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  39939. (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  39940. THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  39941. */
  39942. (function () {
  39943. 'use strict';
  39944. function isExpression(node) {
  39945. if (node == null) {
  39946. return false;
  39947. }
  39948. switch (node.type) {
  39949. case 'ArrayExpression':
  39950. case 'AssignmentExpression':
  39951. case 'BinaryExpression':
  39952. case 'CallExpression':
  39953. case 'ConditionalExpression':
  39954. case 'FunctionExpression':
  39955. case 'Identifier':
  39956. case 'Literal':
  39957. case 'LogicalExpression':
  39958. case 'MemberExpression':
  39959. case 'NewExpression':
  39960. case 'ObjectExpression':
  39961. case 'SequenceExpression':
  39962. case 'ThisExpression':
  39963. case 'UnaryExpression':
  39964. case 'UpdateExpression':
  39965. return true;
  39966. }
  39967. return false;
  39968. }
  39969. function isIterationStatement(node) {
  39970. if (node == null) {
  39971. return false;
  39972. }
  39973. switch (node.type) {
  39974. case 'DoWhileStatement':
  39975. case 'ForInStatement':
  39976. case 'ForStatement':
  39977. case 'WhileStatement':
  39978. return true;
  39979. }
  39980. return false;
  39981. }
  39982. function isStatement(node) {
  39983. if (node == null) {
  39984. return false;
  39985. }
  39986. switch (node.type) {
  39987. case 'BlockStatement':
  39988. case 'BreakStatement':
  39989. case 'ContinueStatement':
  39990. case 'DebuggerStatement':
  39991. case 'DoWhileStatement':
  39992. case 'EmptyStatement':
  39993. case 'ExpressionStatement':
  39994. case 'ForInStatement':
  39995. case 'ForStatement':
  39996. case 'IfStatement':
  39997. case 'LabeledStatement':
  39998. case 'ReturnStatement':
  39999. case 'SwitchStatement':
  40000. case 'ThrowStatement':
  40001. case 'TryStatement':
  40002. case 'VariableDeclaration':
  40003. case 'WhileStatement':
  40004. case 'WithStatement':
  40005. return true;
  40006. }
  40007. return false;
  40008. }
  40009. function isSourceElement(node) {
  40010. return isStatement(node) || node != null && node.type === 'FunctionDeclaration';
  40011. }
  40012. function trailingStatement(node) {
  40013. switch (node.type) {
  40014. case 'IfStatement':
  40015. if (node.alternate != null) {
  40016. return node.alternate;
  40017. }
  40018. return node.consequent;
  40019. case 'LabeledStatement':
  40020. case 'ForStatement':
  40021. case 'ForInStatement':
  40022. case 'WhileStatement':
  40023. case 'WithStatement':
  40024. return node.body;
  40025. }
  40026. return null;
  40027. }
  40028. function isProblematicIfStatement(node) {
  40029. var current;
  40030. if (node.type !== 'IfStatement') {
  40031. return false;
  40032. }
  40033. if (node.alternate == null) {
  40034. return false;
  40035. }
  40036. current = node.consequent;
  40037. do {
  40038. if (current.type === 'IfStatement') {
  40039. if (current.alternate == null) {
  40040. return true;
  40041. }
  40042. }
  40043. current = trailingStatement(current);
  40044. } while (current);
  40045. return false;
  40046. }
  40047. module.exports = {
  40048. isExpression: isExpression,
  40049. isStatement: isStatement,
  40050. isIterationStatement: isIterationStatement,
  40051. isSourceElement: isSourceElement,
  40052. isProblematicIfStatement: isProblematicIfStatement,
  40053. trailingStatement: trailingStatement
  40054. };
  40055. })();
  40056. /* vim: set sw=4 ts=4 et tw=80 : */
  40057. /***/ }),
  40058. /* 462 */
  40059. /***/ (function(module, exports, __webpack_require__) {
  40060. 'use strict';
  40061. /*
  40062. Copyright (C) 2013 Yusuke Suzuki <utatane.tea@gmail.com>
  40063. Redistribution and use in source and binary forms, with or without
  40064. modification, are permitted provided that the following conditions are met:
  40065. * Redistributions of source code must retain the above copyright
  40066. notice, this list of conditions and the following disclaimer.
  40067. * Redistributions in binary form must reproduce the above copyright
  40068. notice, this list of conditions and the following disclaimer in the
  40069. documentation and/or other materials provided with the distribution.
  40070. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  40071. AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  40072. IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  40073. ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
  40074. DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  40075. (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  40076. LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  40077. ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  40078. (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  40079. THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  40080. */
  40081. (function () {
  40082. 'use strict';
  40083. var code = __webpack_require__(240);
  40084. function isStrictModeReservedWordES6(id) {
  40085. switch (id) {
  40086. case 'implements':
  40087. case 'interface':
  40088. case 'package':
  40089. case 'private':
  40090. case 'protected':
  40091. case 'public':
  40092. case 'static':
  40093. case 'let':
  40094. return true;
  40095. default:
  40096. return false;
  40097. }
  40098. }
  40099. function isKeywordES5(id, strict) {
  40100. // yield should not be treated as keyword under non-strict mode.
  40101. if (!strict && id === 'yield') {
  40102. return false;
  40103. }
  40104. return isKeywordES6(id, strict);
  40105. }
  40106. function isKeywordES6(id, strict) {
  40107. if (strict && isStrictModeReservedWordES6(id)) {
  40108. return true;
  40109. }
  40110. switch (id.length) {
  40111. case 2:
  40112. return id === 'if' || id === 'in' || id === 'do';
  40113. case 3:
  40114. return id === 'var' || id === 'for' || id === 'new' || id === 'try';
  40115. case 4:
  40116. return id === 'this' || id === 'else' || id === 'case' || id === 'void' || id === 'with' || id === 'enum';
  40117. case 5:
  40118. return id === 'while' || id === 'break' || id === 'catch' || id === 'throw' || id === 'const' || id === 'yield' || id === 'class' || id === 'super';
  40119. case 6:
  40120. return id === 'return' || id === 'typeof' || id === 'delete' || id === 'switch' || id === 'export' || id === 'import';
  40121. case 7:
  40122. return id === 'default' || id === 'finally' || id === 'extends';
  40123. case 8:
  40124. return id === 'function' || id === 'continue' || id === 'debugger';
  40125. case 10:
  40126. return id === 'instanceof';
  40127. default:
  40128. return false;
  40129. }
  40130. }
  40131. function isReservedWordES5(id, strict) {
  40132. return id === 'null' || id === 'true' || id === 'false' || isKeywordES5(id, strict);
  40133. }
  40134. function isReservedWordES6(id, strict) {
  40135. return id === 'null' || id === 'true' || id === 'false' || isKeywordES6(id, strict);
  40136. }
  40137. function isRestrictedWord(id) {
  40138. return id === 'eval' || id === 'arguments';
  40139. }
  40140. function isIdentifierNameES5(id) {
  40141. var i, iz, ch;
  40142. if (id.length === 0) {
  40143. return false;
  40144. }
  40145. ch = id.charCodeAt(0);
  40146. if (!code.isIdentifierStartES5(ch)) {
  40147. return false;
  40148. }
  40149. for (i = 1, iz = id.length; i < iz; ++i) {
  40150. ch = id.charCodeAt(i);
  40151. if (!code.isIdentifierPartES5(ch)) {
  40152. return false;
  40153. }
  40154. }
  40155. return true;
  40156. }
  40157. function decodeUtf16(lead, trail) {
  40158. return (lead - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000;
  40159. }
  40160. function isIdentifierNameES6(id) {
  40161. var i, iz, ch, lowCh, check;
  40162. if (id.length === 0) {
  40163. return false;
  40164. }
  40165. check = code.isIdentifierStartES6;
  40166. for (i = 0, iz = id.length; i < iz; ++i) {
  40167. ch = id.charCodeAt(i);
  40168. if (0xD800 <= ch && ch <= 0xDBFF) {
  40169. ++i;
  40170. if (i >= iz) {
  40171. return false;
  40172. }
  40173. lowCh = id.charCodeAt(i);
  40174. if (!(0xDC00 <= lowCh && lowCh <= 0xDFFF)) {
  40175. return false;
  40176. }
  40177. ch = decodeUtf16(ch, lowCh);
  40178. }
  40179. if (!check(ch)) {
  40180. return false;
  40181. }
  40182. check = code.isIdentifierPartES6;
  40183. }
  40184. return true;
  40185. }
  40186. function isIdentifierES5(id, strict) {
  40187. return isIdentifierNameES5(id) && !isReservedWordES5(id, strict);
  40188. }
  40189. function isIdentifierES6(id, strict) {
  40190. return isIdentifierNameES6(id) && !isReservedWordES6(id, strict);
  40191. }
  40192. module.exports = {
  40193. isKeywordES5: isKeywordES5,
  40194. isKeywordES6: isKeywordES6,
  40195. isReservedWordES5: isReservedWordES5,
  40196. isReservedWordES6: isReservedWordES6,
  40197. isRestrictedWord: isRestrictedWord,
  40198. isIdentifierNameES5: isIdentifierNameES5,
  40199. isIdentifierNameES6: isIdentifierNameES6,
  40200. isIdentifierES5: isIdentifierES5,
  40201. isIdentifierES6: isIdentifierES6
  40202. };
  40203. })();
  40204. /* vim: set sw=4 ts=4 et tw=80 : */
  40205. /***/ }),
  40206. /* 463 */
  40207. /***/ (function(module, exports, __webpack_require__) {
  40208. 'use strict';
  40209. module.exports = __webpack_require__(630);
  40210. /***/ }),
  40211. /* 464 */
  40212. /***/ (function(module, exports, __webpack_require__) {
  40213. 'use strict';
  40214. var ansiRegex = __webpack_require__(180);
  40215. var re = new RegExp(ansiRegex().source); // remove the `g` flag
  40216. module.exports = re.test.bind(re);
  40217. /***/ }),
  40218. /* 465 */
  40219. /***/ (function(module, exports) {
  40220. "use strict";
  40221. exports.read = function (buffer, offset, isLE, mLen, nBytes) {
  40222. var e, m;
  40223. var eLen = nBytes * 8 - mLen - 1;
  40224. var eMax = (1 << eLen) - 1;
  40225. var eBias = eMax >> 1;
  40226. var nBits = -7;
  40227. var i = isLE ? nBytes - 1 : 0;
  40228. var d = isLE ? -1 : 1;
  40229. var s = buffer[offset + i];
  40230. i += d;
  40231. e = s & (1 << -nBits) - 1;
  40232. s >>= -nBits;
  40233. nBits += eLen;
  40234. for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}
  40235. m = e & (1 << -nBits) - 1;
  40236. e >>= -nBits;
  40237. nBits += mLen;
  40238. for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}
  40239. if (e === 0) {
  40240. e = 1 - eBias;
  40241. } else if (e === eMax) {
  40242. return m ? NaN : (s ? -1 : 1) * Infinity;
  40243. } else {
  40244. m = m + Math.pow(2, mLen);
  40245. e = e - eBias;
  40246. }
  40247. return (s ? -1 : 1) * m * Math.pow(2, e - mLen);
  40248. };
  40249. exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
  40250. var e, m, c;
  40251. var eLen = nBytes * 8 - mLen - 1;
  40252. var eMax = (1 << eLen) - 1;
  40253. var eBias = eMax >> 1;
  40254. var rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0;
  40255. var i = isLE ? 0 : nBytes - 1;
  40256. var d = isLE ? 1 : -1;
  40257. var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;
  40258. value = Math.abs(value);
  40259. if (isNaN(value) || value === Infinity) {
  40260. m = isNaN(value) ? 1 : 0;
  40261. e = eMax;
  40262. } else {
  40263. e = Math.floor(Math.log(value) / Math.LN2);
  40264. if (value * (c = Math.pow(2, -e)) < 1) {
  40265. e--;
  40266. c *= 2;
  40267. }
  40268. if (e + eBias >= 1) {
  40269. value += rt / c;
  40270. } else {
  40271. value += rt * Math.pow(2, 1 - eBias);
  40272. }
  40273. if (value * c >= 2) {
  40274. e++;
  40275. c /= 2;
  40276. }
  40277. if (e + eBias >= eMax) {
  40278. m = 0;
  40279. e = eMax;
  40280. } else if (e + eBias >= 1) {
  40281. m = (value * c - 1) * Math.pow(2, mLen);
  40282. e = e + eBias;
  40283. } else {
  40284. m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen);
  40285. e = 0;
  40286. }
  40287. }
  40288. for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
  40289. e = e << mLen | m;
  40290. eLen += mLen;
  40291. for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
  40292. buffer[offset + i - d] |= s * 128;
  40293. };
  40294. /***/ }),
  40295. /* 466 */
  40296. /***/ (function(module, exports, __webpack_require__) {
  40297. /**
  40298. * Copyright 2013-2015, Facebook, Inc.
  40299. * All rights reserved.
  40300. *
  40301. * This source code is licensed under the BSD-style license found in the
  40302. * LICENSE file in the root directory of this source tree. An additional grant
  40303. * of patent rights can be found in the PATENTS file in the same directory.
  40304. */
  40305. 'use strict';
  40306. /**
  40307. * Use invariant() to assert state which your program assumes to be true.
  40308. *
  40309. * Provide sprintf-style format (only %s is supported) and arguments
  40310. * to provide information about what broke and what you were
  40311. * expecting.
  40312. *
  40313. * The invariant message will be stripped in production, but the invariant
  40314. * will remain to ensure logic does not differ in production.
  40315. */
  40316. var invariant = function invariant(condition, format, a, b, c, d, e, f) {
  40317. if (false) {
  40318. if (format === undefined) {
  40319. throw new Error('invariant requires an error message argument');
  40320. }
  40321. }
  40322. if (!condition) {
  40323. var error;
  40324. if (format === undefined) {
  40325. error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
  40326. } else {
  40327. var args = [a, b, c, d, e, f];
  40328. var argIndex = 0;
  40329. error = new Error(format.replace(/%s/g, function () {
  40330. return args[argIndex++];
  40331. }));
  40332. error.name = 'Invariant Violation';
  40333. }
  40334. error.framesToPop = 1; // we don't care about invariant's own frame
  40335. throw error;
  40336. }
  40337. };
  40338. module.exports = invariant;
  40339. /***/ }),
  40340. /* 467 */
  40341. /***/ (function(module, exports, __webpack_require__) {
  40342. 'use strict';
  40343. var numberIsNan = __webpack_require__(603);
  40344. module.exports = Number.isFinite || function (val) {
  40345. return !(typeof val !== 'number' || numberIsNan(val) || val === Infinity || val === -Infinity);
  40346. };
  40347. /***/ }),
  40348. /* 468 */
  40349. /***/ (function(module, exports) {
  40350. "use strict";
  40351. // Copyright 2014, 2015, 2016, 2017 Simon Lydell
  40352. // License: MIT. (See LICENSE.)
  40353. Object.defineProperty(exports, "__esModule", {
  40354. value: true
  40355. });
  40356. // This regex comes from regex.coffee, and is inserted here by generate-index.js
  40357. // (run `npm run build`).
  40358. exports.default = /((['"])(?:(?!\2|\\).|\\(?:\r\n|[\s\S]))*(\2)?|`(?:[^`\\$]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{[^}]*\}?)*\}?)*(`)?)|(\/\/.*)|(\/\*(?:[^*]|\*(?!\/))*(\*\/)?)|(\/(?!\*)(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\]\\]).|\\.)+\/(?:(?!\s*(?:\b|[\u0080-\uFFFF$\\'"~({]|[+\-!](?!=)|\.?\d))|[gmiyu]{1,5}\b(?![\u0080-\uFFFF$\\]|\s*(?:[+\-*%&|^<>!=?({]|\/(?![\/*])))))|(0[xX][\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?)|((?!\d)(?:(?!\s)[$\w\u0080-\uFFFF]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+)|(--|\+\+|&&|\|\||=>|\.{3}|(?:[+\-\/%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2})=?|[?~.,:;[\](){}])|(\s+)|(^$|[\s\S])/g;
  40359. exports.matchToToken = function (match) {
  40360. var token = { type: "invalid", value: match[0] };
  40361. if (match[1]) token.type = "string", token.closed = !!(match[3] || match[4]);else if (match[5]) token.type = "comment";else if (match[6]) token.type = "comment", token.closed = !!match[7];else if (match[8]) token.type = "regex";else if (match[9]) token.type = "number";else if (match[10]) token.type = "name";else if (match[11]) token.type = "punctuator";else if (match[12]) token.type = "whitespace";
  40362. return token;
  40363. };
  40364. /***/ }),
  40365. /* 469 */
  40366. /***/ (function(module, exports, __webpack_require__) {
  40367. var __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(module, global) {'use strict';
  40368. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  40369. /*! https://mths.be/jsesc v1.3.0 by @mathias */
  40370. ;(function (root) {
  40371. // Detect free variables `exports`
  40372. var freeExports = ( false ? 'undefined' : _typeof(exports)) == 'object' && exports;
  40373. // Detect free variable `module`
  40374. var freeModule = ( false ? 'undefined' : _typeof(module)) == 'object' && module && module.exports == freeExports && module;
  40375. // Detect free variable `global`, from Node.js or Browserified code,
  40376. // and use it as `root`
  40377. var freeGlobal = (typeof global === 'undefined' ? 'undefined' : _typeof(global)) == 'object' && global;
  40378. if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) {
  40379. root = freeGlobal;
  40380. }
  40381. /*--------------------------------------------------------------------------*/
  40382. var object = {};
  40383. var hasOwnProperty = object.hasOwnProperty;
  40384. var forOwn = function forOwn(object, callback) {
  40385. var key;
  40386. for (key in object) {
  40387. if (hasOwnProperty.call(object, key)) {
  40388. callback(key, object[key]);
  40389. }
  40390. }
  40391. };
  40392. var extend = function extend(destination, source) {
  40393. if (!source) {
  40394. return destination;
  40395. }
  40396. forOwn(source, function (key, value) {
  40397. destination[key] = value;
  40398. });
  40399. return destination;
  40400. };
  40401. var forEach = function forEach(array, callback) {
  40402. var length = array.length;
  40403. var index = -1;
  40404. while (++index < length) {
  40405. callback(array[index]);
  40406. }
  40407. };
  40408. var toString = object.toString;
  40409. var isArray = function isArray(value) {
  40410. return toString.call(value) == '[object Array]';
  40411. };
  40412. var isObject = function isObject(value) {
  40413. // This is a very simple check, but it’s good enough for what we need.
  40414. return toString.call(value) == '[object Object]';
  40415. };
  40416. var isString = function isString(value) {
  40417. return typeof value == 'string' || toString.call(value) == '[object String]';
  40418. };
  40419. var isNumber = function isNumber(value) {
  40420. return typeof value == 'number' || toString.call(value) == '[object Number]';
  40421. };
  40422. var isFunction = function isFunction(value) {
  40423. // In a perfect world, the `typeof` check would be sufficient. However,
  40424. // in Chrome 1–12, `typeof /x/ == 'object'`, and in IE 6–8
  40425. // `typeof alert == 'object'` and similar for other host objects.
  40426. return typeof value == 'function' || toString.call(value) == '[object Function]';
  40427. };
  40428. var isMap = function isMap(value) {
  40429. return toString.call(value) == '[object Map]';
  40430. };
  40431. var isSet = function isSet(value) {
  40432. return toString.call(value) == '[object Set]';
  40433. };
  40434. /*--------------------------------------------------------------------------*/
  40435. // https://mathiasbynens.be/notes/javascript-escapes#single
  40436. var singleEscapes = {
  40437. '"': '\\"',
  40438. '\'': '\\\'',
  40439. '\\': '\\\\',
  40440. '\b': '\\b',
  40441. '\f': '\\f',
  40442. '\n': '\\n',
  40443. '\r': '\\r',
  40444. '\t': '\\t'
  40445. // `\v` is omitted intentionally, because in IE < 9, '\v' == 'v'.
  40446. // '\v': '\\x0B'
  40447. };
  40448. var regexSingleEscape = /["'\\\b\f\n\r\t]/;
  40449. var regexDigit = /[0-9]/;
  40450. var regexWhitelist = /[ !#-&\(-\[\]-~]/;
  40451. var jsesc = function jsesc(argument, options) {
  40452. // Handle options
  40453. var defaults = {
  40454. 'escapeEverything': false,
  40455. 'escapeEtago': false,
  40456. 'quotes': 'single',
  40457. 'wrap': false,
  40458. 'es6': false,
  40459. 'json': false,
  40460. 'compact': true,
  40461. 'lowercaseHex': false,
  40462. 'numbers': 'decimal',
  40463. 'indent': '\t',
  40464. '__indent__': '',
  40465. '__inline1__': false,
  40466. '__inline2__': false
  40467. };
  40468. var json = options && options.json;
  40469. if (json) {
  40470. defaults.quotes = 'double';
  40471. defaults.wrap = true;
  40472. }
  40473. options = extend(defaults, options);
  40474. if (options.quotes != 'single' && options.quotes != 'double') {
  40475. options.quotes = 'single';
  40476. }
  40477. var quote = options.quotes == 'double' ? '"' : '\'';
  40478. var compact = options.compact;
  40479. var indent = options.indent;
  40480. var lowercaseHex = options.lowercaseHex;
  40481. var oldIndent = '';
  40482. var inline1 = options.__inline1__;
  40483. var inline2 = options.__inline2__;
  40484. var newLine = compact ? '' : '\n';
  40485. var result;
  40486. var isEmpty = true;
  40487. var useBinNumbers = options.numbers == 'binary';
  40488. var useOctNumbers = options.numbers == 'octal';
  40489. var useDecNumbers = options.numbers == 'decimal';
  40490. var useHexNumbers = options.numbers == 'hexadecimal';
  40491. if (json && argument && isFunction(argument.toJSON)) {
  40492. argument = argument.toJSON();
  40493. }
  40494. if (!isString(argument)) {
  40495. if (isMap(argument)) {
  40496. if (argument.size == 0) {
  40497. return 'new Map()';
  40498. }
  40499. if (!compact) {
  40500. options.__inline1__ = true;
  40501. }
  40502. return 'new Map(' + jsesc(Array.from(argument), options) + ')';
  40503. }
  40504. if (isSet(argument)) {
  40505. if (argument.size == 0) {
  40506. return 'new Set()';
  40507. }
  40508. return 'new Set(' + jsesc(Array.from(argument), options) + ')';
  40509. }
  40510. if (isArray(argument)) {
  40511. result = [];
  40512. options.wrap = true;
  40513. if (inline1) {
  40514. options.__inline1__ = false;
  40515. options.__inline2__ = true;
  40516. } else {
  40517. oldIndent = options.__indent__;
  40518. indent += oldIndent;
  40519. options.__indent__ = indent;
  40520. }
  40521. forEach(argument, function (value) {
  40522. isEmpty = false;
  40523. if (inline2) {
  40524. options.__inline2__ = false;
  40525. }
  40526. result.push((compact || inline2 ? '' : indent) + jsesc(value, options));
  40527. });
  40528. if (isEmpty) {
  40529. return '[]';
  40530. }
  40531. if (inline2) {
  40532. return '[' + result.join(', ') + ']';
  40533. }
  40534. return '[' + newLine + result.join(',' + newLine) + newLine + (compact ? '' : oldIndent) + ']';
  40535. } else if (isNumber(argument)) {
  40536. if (json) {
  40537. // Some number values (e.g. `Infinity`) cannot be represented in JSON.
  40538. return JSON.stringify(argument);
  40539. }
  40540. if (useDecNumbers) {
  40541. return String(argument);
  40542. }
  40543. if (useHexNumbers) {
  40544. var tmp = argument.toString(16);
  40545. if (!lowercaseHex) {
  40546. tmp = tmp.toUpperCase();
  40547. }
  40548. return '0x' + tmp;
  40549. }
  40550. if (useBinNumbers) {
  40551. return '0b' + argument.toString(2);
  40552. }
  40553. if (useOctNumbers) {
  40554. return '0o' + argument.toString(8);
  40555. }
  40556. } else if (!isObject(argument)) {
  40557. if (json) {
  40558. // For some values (e.g. `undefined`, `function` objects),
  40559. // `JSON.stringify(value)` returns `undefined` (which isn’t valid
  40560. // JSON) instead of `'null'`.
  40561. return JSON.stringify(argument) || 'null';
  40562. }
  40563. return String(argument);
  40564. } else {
  40565. // it’s an object
  40566. result = [];
  40567. options.wrap = true;
  40568. oldIndent = options.__indent__;
  40569. indent += oldIndent;
  40570. options.__indent__ = indent;
  40571. forOwn(argument, function (key, value) {
  40572. isEmpty = false;
  40573. result.push((compact ? '' : indent) + jsesc(key, options) + ':' + (compact ? '' : ' ') + jsesc(value, options));
  40574. });
  40575. if (isEmpty) {
  40576. return '{}';
  40577. }
  40578. return '{' + newLine + result.join(',' + newLine) + newLine + (compact ? '' : oldIndent) + '}';
  40579. }
  40580. }
  40581. var string = argument;
  40582. // Loop over each code unit in the string and escape it
  40583. var index = -1;
  40584. var length = string.length;
  40585. var first;
  40586. var second;
  40587. var codePoint;
  40588. result = '';
  40589. while (++index < length) {
  40590. var character = string.charAt(index);
  40591. if (options.es6) {
  40592. first = string.charCodeAt(index);
  40593. if ( // check if it’s the start of a surrogate pair
  40594. first >= 0xD800 && first <= 0xDBFF && // high surrogate
  40595. length > index + 1 // there is a next code unit
  40596. ) {
  40597. second = string.charCodeAt(index + 1);
  40598. if (second >= 0xDC00 && second <= 0xDFFF) {
  40599. // low surrogate
  40600. // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
  40601. codePoint = (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;
  40602. var hexadecimal = codePoint.toString(16);
  40603. if (!lowercaseHex) {
  40604. hexadecimal = hexadecimal.toUpperCase();
  40605. }
  40606. result += '\\u{' + hexadecimal + '}';
  40607. index++;
  40608. continue;
  40609. }
  40610. }
  40611. }
  40612. if (!options.escapeEverything) {
  40613. if (regexWhitelist.test(character)) {
  40614. // It’s a printable ASCII character that is not `"`, `'` or `\`,
  40615. // so don’t escape it.
  40616. result += character;
  40617. continue;
  40618. }
  40619. if (character == '"') {
  40620. result += quote == character ? '\\"' : character;
  40621. continue;
  40622. }
  40623. if (character == '\'') {
  40624. result += quote == character ? '\\\'' : character;
  40625. continue;
  40626. }
  40627. }
  40628. if (character == '\0' && !json && !regexDigit.test(string.charAt(index + 1))) {
  40629. result += '\\0';
  40630. continue;
  40631. }
  40632. if (regexSingleEscape.test(character)) {
  40633. // no need for a `hasOwnProperty` check here
  40634. result += singleEscapes[character];
  40635. continue;
  40636. }
  40637. var charCode = character.charCodeAt(0);
  40638. var hexadecimal = charCode.toString(16);
  40639. if (!lowercaseHex) {
  40640. hexadecimal = hexadecimal.toUpperCase();
  40641. }
  40642. var longhand = hexadecimal.length > 2 || json;
  40643. var escaped = '\\' + (longhand ? 'u' : 'x') + ('0000' + hexadecimal).slice(longhand ? -4 : -2);
  40644. result += escaped;
  40645. continue;
  40646. }
  40647. if (options.wrap) {
  40648. result = quote + result + quote;
  40649. }
  40650. if (options.escapeEtago) {
  40651. // https://mathiasbynens.be/notes/etago
  40652. return result.replace(/<\/(script|style)/gi, '<\\/$1');
  40653. }
  40654. return result;
  40655. };
  40656. jsesc.version = '1.3.0';
  40657. /*--------------------------------------------------------------------------*/
  40658. // Some AMD build optimizers, like r.js, check for specific condition patterns
  40659. // like the following:
  40660. if ("function" == 'function' && _typeof(__webpack_require__(49)) == 'object' && __webpack_require__(49)) {
  40661. !(__WEBPACK_AMD_DEFINE_RESULT__ = function () {
  40662. return jsesc;
  40663. }.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  40664. } else if (freeExports && !freeExports.nodeType) {
  40665. if (freeModule) {
  40666. // in Node.js or RingoJS v0.8.0+
  40667. freeModule.exports = jsesc;
  40668. } else {
  40669. // in Narwhal or RingoJS v0.7.0-
  40670. freeExports.jsesc = jsesc;
  40671. }
  40672. } else {
  40673. // in Rhino or a web browser
  40674. root.jsesc = jsesc;
  40675. }
  40676. })(undefined);
  40677. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(39)(module), (function() { return this; }())))
  40678. /***/ }),
  40679. /* 470 */
  40680. /***/ (function(module, exports, __webpack_require__) {
  40681. "use strict";
  40682. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  40683. // json5.js
  40684. // Modern JSON. See README.md for details.
  40685. //
  40686. // This file is based directly off of Douglas Crockford's json_parse.js:
  40687. // https://github.com/douglascrockford/JSON-js/blob/master/json_parse.js
  40688. var JSON5 = ( false ? "undefined" : _typeof(exports)) === 'object' ? exports : {};
  40689. JSON5.parse = function () {
  40690. "use strict";
  40691. // This is a function that can parse a JSON5 text, producing a JavaScript
  40692. // data structure. It is a simple, recursive descent parser. It does not use
  40693. // eval or regular expressions, so it can be used as a model for implementing
  40694. // a JSON5 parser in other languages.
  40695. // We are defining the function inside of another function to avoid creating
  40696. // global variables.
  40697. var at,
  40698. // The index of the current character
  40699. lineNumber,
  40700. // The current line number
  40701. columnNumber,
  40702. // The current column number
  40703. ch,
  40704. // The current character
  40705. escapee = {
  40706. "'": "'",
  40707. '"': '"',
  40708. '\\': '\\',
  40709. '/': '/',
  40710. '\n': '', // Replace escaped newlines in strings w/ empty string
  40711. b: '\b',
  40712. f: '\f',
  40713. n: '\n',
  40714. r: '\r',
  40715. t: '\t'
  40716. },
  40717. ws = [' ', '\t', '\r', '\n', '\v', '\f', '\xA0', "\uFEFF"],
  40718. text,
  40719. renderChar = function renderChar(chr) {
  40720. return chr === '' ? 'EOF' : "'" + chr + "'";
  40721. },
  40722. error = function error(m) {
  40723. // Call error when something is wrong.
  40724. var error = new SyntaxError();
  40725. // beginning of message suffix to agree with that provided by Gecko - see https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse
  40726. error.message = m + " at line " + lineNumber + " column " + columnNumber + " of the JSON5 data. Still to read: " + JSON.stringify(text.substring(at - 1, at + 19));
  40727. error.at = at;
  40728. // These two property names have been chosen to agree with the ones in Gecko, the only popular
  40729. // environment which seems to supply this info on JSON.parse
  40730. error.lineNumber = lineNumber;
  40731. error.columnNumber = columnNumber;
  40732. throw error;
  40733. },
  40734. next = function next(c) {
  40735. // If a c parameter is provided, verify that it matches the current character.
  40736. if (c && c !== ch) {
  40737. error("Expected " + renderChar(c) + " instead of " + renderChar(ch));
  40738. }
  40739. // Get the next character. When there are no more characters,
  40740. // return the empty string.
  40741. ch = text.charAt(at);
  40742. at++;
  40743. columnNumber++;
  40744. if (ch === '\n' || ch === '\r' && peek() !== '\n') {
  40745. lineNumber++;
  40746. columnNumber = 0;
  40747. }
  40748. return ch;
  40749. },
  40750. peek = function peek() {
  40751. // Get the next character without consuming it or
  40752. // assigning it to the ch varaible.
  40753. return text.charAt(at);
  40754. },
  40755. identifier = function identifier() {
  40756. // Parse an identifier. Normally, reserved words are disallowed here, but we
  40757. // only use this for unquoted object keys, where reserved words are allowed,
  40758. // so we don't check for those here. References:
  40759. // - http://es5.github.com/#x7.6
  40760. // - https://developer.mozilla.org/en/Core_JavaScript_1.5_Guide/Core_Language_Features#Variables
  40761. // - http://docstore.mik.ua/orelly/webprog/jscript/ch02_07.htm
  40762. // TODO Identifiers can have Unicode "letters" in them; add support for those.
  40763. var key = ch;
  40764. // Identifiers must start with a letter, _ or $.
  40765. if (ch !== '_' && ch !== '$' && (ch < 'a' || ch > 'z') && (ch < 'A' || ch > 'Z')) {
  40766. error("Bad identifier as unquoted key");
  40767. }
  40768. // Subsequent characters can contain digits.
  40769. while (next() && (ch === '_' || ch === '$' || ch >= 'a' && ch <= 'z' || ch >= 'A' && ch <= 'Z' || ch >= '0' && ch <= '9')) {
  40770. key += ch;
  40771. }
  40772. return key;
  40773. },
  40774. number = function number() {
  40775. // Parse a number value.
  40776. var number,
  40777. sign = '',
  40778. string = '',
  40779. base = 10;
  40780. if (ch === '-' || ch === '+') {
  40781. sign = ch;
  40782. next(ch);
  40783. }
  40784. // support for Infinity (could tweak to allow other words):
  40785. if (ch === 'I') {
  40786. number = word();
  40787. if (typeof number !== 'number' || isNaN(number)) {
  40788. error('Unexpected word for number');
  40789. }
  40790. return sign === '-' ? -number : number;
  40791. }
  40792. // support for NaN
  40793. if (ch === 'N') {
  40794. number = word();
  40795. if (!isNaN(number)) {
  40796. error('expected word to be NaN');
  40797. }
  40798. // ignore sign as -NaN also is NaN
  40799. return number;
  40800. }
  40801. if (ch === '0') {
  40802. string += ch;
  40803. next();
  40804. if (ch === 'x' || ch === 'X') {
  40805. string += ch;
  40806. next();
  40807. base = 16;
  40808. } else if (ch >= '0' && ch <= '9') {
  40809. error('Octal literal');
  40810. }
  40811. }
  40812. switch (base) {
  40813. case 10:
  40814. while (ch >= '0' && ch <= '9') {
  40815. string += ch;
  40816. next();
  40817. }
  40818. if (ch === '.') {
  40819. string += '.';
  40820. while (next() && ch >= '0' && ch <= '9') {
  40821. string += ch;
  40822. }
  40823. }
  40824. if (ch === 'e' || ch === 'E') {
  40825. string += ch;
  40826. next();
  40827. if (ch === '-' || ch === '+') {
  40828. string += ch;
  40829. next();
  40830. }
  40831. while (ch >= '0' && ch <= '9') {
  40832. string += ch;
  40833. next();
  40834. }
  40835. }
  40836. break;
  40837. case 16:
  40838. while (ch >= '0' && ch <= '9' || ch >= 'A' && ch <= 'F' || ch >= 'a' && ch <= 'f') {
  40839. string += ch;
  40840. next();
  40841. }
  40842. break;
  40843. }
  40844. if (sign === '-') {
  40845. number = -string;
  40846. } else {
  40847. number = +string;
  40848. }
  40849. if (!isFinite(number)) {
  40850. error("Bad number");
  40851. } else {
  40852. return number;
  40853. }
  40854. },
  40855. string = function string() {
  40856. // Parse a string value.
  40857. var hex,
  40858. i,
  40859. string = '',
  40860. delim,
  40861. // double quote or single quote
  40862. uffff;
  40863. // When parsing for string values, we must look for ' or " and \ characters.
  40864. if (ch === '"' || ch === "'") {
  40865. delim = ch;
  40866. while (next()) {
  40867. if (ch === delim) {
  40868. next();
  40869. return string;
  40870. } else if (ch === '\\') {
  40871. next();
  40872. if (ch === 'u') {
  40873. uffff = 0;
  40874. for (i = 0; i < 4; i += 1) {
  40875. hex = parseInt(next(), 16);
  40876. if (!isFinite(hex)) {
  40877. break;
  40878. }
  40879. uffff = uffff * 16 + hex;
  40880. }
  40881. string += String.fromCharCode(uffff);
  40882. } else if (ch === '\r') {
  40883. if (peek() === '\n') {
  40884. next();
  40885. }
  40886. } else if (typeof escapee[ch] === 'string') {
  40887. string += escapee[ch];
  40888. } else {
  40889. break;
  40890. }
  40891. } else if (ch === '\n') {
  40892. // unescaped newlines are invalid; see:
  40893. // https://github.com/aseemk/json5/issues/24
  40894. // TODO this feels special-cased; are there other
  40895. // invalid unescaped chars?
  40896. break;
  40897. } else {
  40898. string += ch;
  40899. }
  40900. }
  40901. }
  40902. error("Bad string");
  40903. },
  40904. inlineComment = function inlineComment() {
  40905. // Skip an inline comment, assuming this is one. The current character should
  40906. // be the second / character in the // pair that begins this inline comment.
  40907. // To finish the inline comment, we look for a newline or the end of the text.
  40908. if (ch !== '/') {
  40909. error("Not an inline comment");
  40910. }
  40911. do {
  40912. next();
  40913. if (ch === '\n' || ch === '\r') {
  40914. next();
  40915. return;
  40916. }
  40917. } while (ch);
  40918. },
  40919. blockComment = function blockComment() {
  40920. // Skip a block comment, assuming this is one. The current character should be
  40921. // the * character in the /* pair that begins this block comment.
  40922. // To finish the block comment, we look for an ending */ pair of characters,
  40923. // but we also watch for the end of text before the comment is terminated.
  40924. if (ch !== '*') {
  40925. error("Not a block comment");
  40926. }
  40927. do {
  40928. next();
  40929. while (ch === '*') {
  40930. next('*');
  40931. if (ch === '/') {
  40932. next('/');
  40933. return;
  40934. }
  40935. }
  40936. } while (ch);
  40937. error("Unterminated block comment");
  40938. },
  40939. comment = function comment() {
  40940. // Skip a comment, whether inline or block-level, assuming this is one.
  40941. // Comments always begin with a / character.
  40942. if (ch !== '/') {
  40943. error("Not a comment");
  40944. }
  40945. next('/');
  40946. if (ch === '/') {
  40947. inlineComment();
  40948. } else if (ch === '*') {
  40949. blockComment();
  40950. } else {
  40951. error("Unrecognized comment");
  40952. }
  40953. },
  40954. white = function white() {
  40955. // Skip whitespace and comments.
  40956. // Note that we're detecting comments by only a single / character.
  40957. // This works since regular expressions are not valid JSON(5), but this will
  40958. // break if there are other valid values that begin with a / character!
  40959. while (ch) {
  40960. if (ch === '/') {
  40961. comment();
  40962. } else if (ws.indexOf(ch) >= 0) {
  40963. next();
  40964. } else {
  40965. return;
  40966. }
  40967. }
  40968. },
  40969. word = function word() {
  40970. // true, false, or null.
  40971. switch (ch) {
  40972. case 't':
  40973. next('t');
  40974. next('r');
  40975. next('u');
  40976. next('e');
  40977. return true;
  40978. case 'f':
  40979. next('f');
  40980. next('a');
  40981. next('l');
  40982. next('s');
  40983. next('e');
  40984. return false;
  40985. case 'n':
  40986. next('n');
  40987. next('u');
  40988. next('l');
  40989. next('l');
  40990. return null;
  40991. case 'I':
  40992. next('I');
  40993. next('n');
  40994. next('f');
  40995. next('i');
  40996. next('n');
  40997. next('i');
  40998. next('t');
  40999. next('y');
  41000. return Infinity;
  41001. case 'N':
  41002. next('N');
  41003. next('a');
  41004. next('N');
  41005. return NaN;
  41006. }
  41007. error("Unexpected " + renderChar(ch));
  41008. },
  41009. value,
  41010. // Place holder for the value function.
  41011. array = function array() {
  41012. // Parse an array value.
  41013. var array = [];
  41014. if (ch === '[') {
  41015. next('[');
  41016. white();
  41017. while (ch) {
  41018. if (ch === ']') {
  41019. next(']');
  41020. return array; // Potentially empty array
  41021. }
  41022. // ES5 allows omitting elements in arrays, e.g. [,] and
  41023. // [,null]. We don't allow this in JSON5.
  41024. if (ch === ',') {
  41025. error("Missing array element");
  41026. } else {
  41027. array.push(value());
  41028. }
  41029. white();
  41030. // If there's no comma after this value, this needs to
  41031. // be the end of the array.
  41032. if (ch !== ',') {
  41033. next(']');
  41034. return array;
  41035. }
  41036. next(',');
  41037. white();
  41038. }
  41039. }
  41040. error("Bad array");
  41041. },
  41042. object = function object() {
  41043. // Parse an object value.
  41044. var key,
  41045. object = {};
  41046. if (ch === '{') {
  41047. next('{');
  41048. white();
  41049. while (ch) {
  41050. if (ch === '}') {
  41051. next('}');
  41052. return object; // Potentially empty object
  41053. }
  41054. // Keys can be unquoted. If they are, they need to be
  41055. // valid JS identifiers.
  41056. if (ch === '"' || ch === "'") {
  41057. key = string();
  41058. } else {
  41059. key = identifier();
  41060. }
  41061. white();
  41062. next(':');
  41063. object[key] = value();
  41064. white();
  41065. // If there's no comma after this pair, this needs to be
  41066. // the end of the object.
  41067. if (ch !== ',') {
  41068. next('}');
  41069. return object;
  41070. }
  41071. next(',');
  41072. white();
  41073. }
  41074. }
  41075. error("Bad object");
  41076. };
  41077. value = function value() {
  41078. // Parse a JSON value. It could be an object, an array, a string, a number,
  41079. // or a word.
  41080. white();
  41081. switch (ch) {
  41082. case '{':
  41083. return object();
  41084. case '[':
  41085. return array();
  41086. case '"':
  41087. case "'":
  41088. return string();
  41089. case '-':
  41090. case '+':
  41091. case '.':
  41092. return number();
  41093. default:
  41094. return ch >= '0' && ch <= '9' ? number() : word();
  41095. }
  41096. };
  41097. // Return the json_parse function. It will have access to all of the above
  41098. // functions and variables.
  41099. return function (source, reviver) {
  41100. var result;
  41101. text = String(source);
  41102. at = 0;
  41103. lineNumber = 1;
  41104. columnNumber = 1;
  41105. ch = ' ';
  41106. result = value();
  41107. white();
  41108. if (ch) {
  41109. error("Syntax error");
  41110. }
  41111. // If there is a reviver function, we recursively walk the new structure,
  41112. // passing each name/value pair to the reviver function for possible
  41113. // transformation, starting with a temporary root object that holds the result
  41114. // in an empty key. If there is not a reviver function, we simply return the
  41115. // result.
  41116. return typeof reviver === 'function' ? function walk(holder, key) {
  41117. var k,
  41118. v,
  41119. value = holder[key];
  41120. if (value && (typeof value === "undefined" ? "undefined" : _typeof(value)) === 'object') {
  41121. for (k in value) {
  41122. if (Object.prototype.hasOwnProperty.call(value, k)) {
  41123. v = walk(value, k);
  41124. if (v !== undefined) {
  41125. value[k] = v;
  41126. } else {
  41127. delete value[k];
  41128. }
  41129. }
  41130. }
  41131. }
  41132. return reviver.call(holder, key, value);
  41133. }({ '': result }, '') : result;
  41134. };
  41135. }();
  41136. // JSON5 stringify will not quote keys where appropriate
  41137. JSON5.stringify = function (obj, replacer, space) {
  41138. if (replacer && typeof replacer !== "function" && !isArray(replacer)) {
  41139. throw new Error('Replacer must be a function or an array');
  41140. }
  41141. var getReplacedValueOrUndefined = function getReplacedValueOrUndefined(holder, key, isTopLevel) {
  41142. var value = holder[key];
  41143. // Replace the value with its toJSON value first, if possible
  41144. if (value && value.toJSON && typeof value.toJSON === "function") {
  41145. value = value.toJSON();
  41146. }
  41147. // If the user-supplied replacer if a function, call it. If it's an array, check objects' string keys for
  41148. // presence in the array (removing the key/value pair from the resulting JSON if the key is missing).
  41149. if (typeof replacer === "function") {
  41150. return replacer.call(holder, key, value);
  41151. } else if (replacer) {
  41152. if (isTopLevel || isArray(holder) || replacer.indexOf(key) >= 0) {
  41153. return value;
  41154. } else {
  41155. return undefined;
  41156. }
  41157. } else {
  41158. return value;
  41159. }
  41160. };
  41161. function isWordChar(c) {
  41162. return c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z' || c >= '0' && c <= '9' || c === '_' || c === '$';
  41163. }
  41164. function isWordStart(c) {
  41165. return c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z' || c === '_' || c === '$';
  41166. }
  41167. function isWord(key) {
  41168. if (typeof key !== 'string') {
  41169. return false;
  41170. }
  41171. if (!isWordStart(key[0])) {
  41172. return false;
  41173. }
  41174. var i = 1,
  41175. length = key.length;
  41176. while (i < length) {
  41177. if (!isWordChar(key[i])) {
  41178. return false;
  41179. }
  41180. i++;
  41181. }
  41182. return true;
  41183. }
  41184. // export for use in tests
  41185. JSON5.isWord = isWord;
  41186. // polyfills
  41187. function isArray(obj) {
  41188. if (Array.isArray) {
  41189. return Array.isArray(obj);
  41190. } else {
  41191. return Object.prototype.toString.call(obj) === '[object Array]';
  41192. }
  41193. }
  41194. function isDate(obj) {
  41195. return Object.prototype.toString.call(obj) === '[object Date]';
  41196. }
  41197. var objStack = [];
  41198. function checkForCircular(obj) {
  41199. for (var i = 0; i < objStack.length; i++) {
  41200. if (objStack[i] === obj) {
  41201. throw new TypeError("Converting circular structure to JSON");
  41202. }
  41203. }
  41204. }
  41205. function makeIndent(str, num, noNewLine) {
  41206. if (!str) {
  41207. return "";
  41208. }
  41209. // indentation no more than 10 chars
  41210. if (str.length > 10) {
  41211. str = str.substring(0, 10);
  41212. }
  41213. var indent = noNewLine ? "" : "\n";
  41214. for (var i = 0; i < num; i++) {
  41215. indent += str;
  41216. }
  41217. return indent;
  41218. }
  41219. var indentStr;
  41220. if (space) {
  41221. if (typeof space === "string") {
  41222. indentStr = space;
  41223. } else if (typeof space === "number" && space >= 0) {
  41224. indentStr = makeIndent(" ", space, true);
  41225. } else {
  41226. // ignore space parameter
  41227. }
  41228. }
  41229. // Copied from Crokford's implementation of JSON
  41230. // See https://github.com/douglascrockford/JSON-js/blob/e39db4b7e6249f04a195e7dd0840e610cc9e941e/json2.js#L195
  41231. // Begin
  41232. var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
  41233. escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
  41234. meta = { // table of character substitutions
  41235. '\b': '\\b',
  41236. '\t': '\\t',
  41237. '\n': '\\n',
  41238. '\f': '\\f',
  41239. '\r': '\\r',
  41240. '"': '\\"',
  41241. '\\': '\\\\'
  41242. };
  41243. function escapeString(string) {
  41244. // If the string contains no control characters, no quote characters, and no
  41245. // backslash characters, then we can safely slap some quotes around it.
  41246. // Otherwise we must also replace the offending characters with safe escape
  41247. // sequences.
  41248. escapable.lastIndex = 0;
  41249. return escapable.test(string) ? '"' + string.replace(escapable, function (a) {
  41250. var c = meta[a];
  41251. return typeof c === 'string' ? c : "\\u" + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
  41252. }) + '"' : '"' + string + '"';
  41253. }
  41254. // End
  41255. function internalStringify(holder, key, isTopLevel) {
  41256. var buffer, res;
  41257. // Replace the value, if necessary
  41258. var obj_part = getReplacedValueOrUndefined(holder, key, isTopLevel);
  41259. if (obj_part && !isDate(obj_part)) {
  41260. // unbox objects
  41261. // don't unbox dates, since will turn it into number
  41262. obj_part = obj_part.valueOf();
  41263. }
  41264. switch (typeof obj_part === "undefined" ? "undefined" : _typeof(obj_part)) {
  41265. case "boolean":
  41266. return obj_part.toString();
  41267. case "number":
  41268. if (isNaN(obj_part) || !isFinite(obj_part)) {
  41269. return "null";
  41270. }
  41271. return obj_part.toString();
  41272. case "string":
  41273. return escapeString(obj_part.toString());
  41274. case "object":
  41275. if (obj_part === null) {
  41276. return "null";
  41277. } else if (isArray(obj_part)) {
  41278. checkForCircular(obj_part);
  41279. buffer = "[";
  41280. objStack.push(obj_part);
  41281. for (var i = 0; i < obj_part.length; i++) {
  41282. res = internalStringify(obj_part, i, false);
  41283. buffer += makeIndent(indentStr, objStack.length);
  41284. if (res === null || typeof res === "undefined") {
  41285. buffer += "null";
  41286. } else {
  41287. buffer += res;
  41288. }
  41289. if (i < obj_part.length - 1) {
  41290. buffer += ",";
  41291. } else if (indentStr) {
  41292. buffer += "\n";
  41293. }
  41294. }
  41295. objStack.pop();
  41296. if (obj_part.length) {
  41297. buffer += makeIndent(indentStr, objStack.length, true);
  41298. }
  41299. buffer += "]";
  41300. } else {
  41301. checkForCircular(obj_part);
  41302. buffer = "{";
  41303. var nonEmpty = false;
  41304. objStack.push(obj_part);
  41305. for (var prop in obj_part) {
  41306. if (obj_part.hasOwnProperty(prop)) {
  41307. var value = internalStringify(obj_part, prop, false);
  41308. isTopLevel = false;
  41309. if (typeof value !== "undefined" && value !== null) {
  41310. buffer += makeIndent(indentStr, objStack.length);
  41311. nonEmpty = true;
  41312. key = isWord(prop) ? prop : escapeString(prop);
  41313. buffer += key + ":" + (indentStr ? ' ' : '') + value + ",";
  41314. }
  41315. }
  41316. }
  41317. objStack.pop();
  41318. if (nonEmpty) {
  41319. buffer = buffer.substring(0, buffer.length - 1) + makeIndent(indentStr, objStack.length) + "}";
  41320. } else {
  41321. buffer = '{}';
  41322. }
  41323. }
  41324. return buffer;
  41325. default:
  41326. // functions and undefined should be ignored
  41327. return undefined;
  41328. }
  41329. }
  41330. // special case...when undefined is used inside of
  41331. // a compound object/array, return null.
  41332. // but when top-level, return undefined
  41333. var topLevelHolder = { "": obj };
  41334. if (obj === undefined) {
  41335. return getReplacedValueOrUndefined(topLevelHolder, '', true);
  41336. }
  41337. return internalStringify(topLevelHolder, '', true);
  41338. };
  41339. /***/ }),
  41340. /* 471 */
  41341. /***/ (function(module, exports) {
  41342. 'use strict';
  41343. var arr = [];
  41344. var charCodeCache = [];
  41345. module.exports = function (a, b) {
  41346. if (a === b) {
  41347. return 0;
  41348. }
  41349. var aLen = a.length;
  41350. var bLen = b.length;
  41351. if (aLen === 0) {
  41352. return bLen;
  41353. }
  41354. if (bLen === 0) {
  41355. return aLen;
  41356. }
  41357. var bCharCode;
  41358. var ret;
  41359. var tmp;
  41360. var tmp2;
  41361. var i = 0;
  41362. var j = 0;
  41363. while (i < aLen) {
  41364. charCodeCache[i] = a.charCodeAt(i);
  41365. arr[i] = ++i;
  41366. }
  41367. while (j < bLen) {
  41368. bCharCode = b.charCodeAt(j);
  41369. tmp = j++;
  41370. ret = j;
  41371. for (i = 0; i < aLen; i++) {
  41372. tmp2 = bCharCode === charCodeCache[i] ? tmp : tmp + 1;
  41373. tmp = arr[i];
  41374. ret = arr[i] = tmp > ret ? tmp2 > ret ? ret + 1 : tmp2 : tmp2 > tmp ? tmp + 1 : tmp2;
  41375. }
  41376. }
  41377. return ret;
  41378. };
  41379. /***/ }),
  41380. /* 472 */
  41381. /***/ (function(module, exports, __webpack_require__) {
  41382. 'use strict';
  41383. var getNative = __webpack_require__(38),
  41384. root = __webpack_require__(17);
  41385. /* Built-in method references that are verified to be native. */
  41386. var DataView = getNative(root, 'DataView');
  41387. module.exports = DataView;
  41388. /***/ }),
  41389. /* 473 */
  41390. /***/ (function(module, exports, __webpack_require__) {
  41391. 'use strict';
  41392. var hashClear = __webpack_require__(536),
  41393. hashDelete = __webpack_require__(537),
  41394. hashGet = __webpack_require__(538),
  41395. hashHas = __webpack_require__(539),
  41396. hashSet = __webpack_require__(540);
  41397. /**
  41398. * Creates a hash object.
  41399. *
  41400. * @private
  41401. * @constructor
  41402. * @param {Array} [entries] The key-value pairs to cache.
  41403. */
  41404. function Hash(entries) {
  41405. var index = -1,
  41406. length = entries == null ? 0 : entries.length;
  41407. this.clear();
  41408. while (++index < length) {
  41409. var entry = entries[index];
  41410. this.set(entry[0], entry[1]);
  41411. }
  41412. }
  41413. // Add methods to `Hash`.
  41414. Hash.prototype.clear = hashClear;
  41415. Hash.prototype['delete'] = hashDelete;
  41416. Hash.prototype.get = hashGet;
  41417. Hash.prototype.has = hashHas;
  41418. Hash.prototype.set = hashSet;
  41419. module.exports = Hash;
  41420. /***/ }),
  41421. /* 474 */
  41422. /***/ (function(module, exports, __webpack_require__) {
  41423. 'use strict';
  41424. var getNative = __webpack_require__(38),
  41425. root = __webpack_require__(17);
  41426. /* Built-in method references that are verified to be native. */
  41427. var Promise = getNative(root, 'Promise');
  41428. module.exports = Promise;
  41429. /***/ }),
  41430. /* 475 */
  41431. /***/ (function(module, exports, __webpack_require__) {
  41432. 'use strict';
  41433. var getNative = __webpack_require__(38),
  41434. root = __webpack_require__(17);
  41435. /* Built-in method references that are verified to be native. */
  41436. var WeakMap = getNative(root, 'WeakMap');
  41437. module.exports = WeakMap;
  41438. /***/ }),
  41439. /* 476 */
  41440. /***/ (function(module, exports) {
  41441. "use strict";
  41442. /**
  41443. * Adds the key-value `pair` to `map`.
  41444. *
  41445. * @private
  41446. * @param {Object} map The map to modify.
  41447. * @param {Array} pair The key-value pair to add.
  41448. * @returns {Object} Returns `map`.
  41449. */
  41450. function addMapEntry(map, pair) {
  41451. // Don't return `map.set` because it's not chainable in IE 11.
  41452. map.set(pair[0], pair[1]);
  41453. return map;
  41454. }
  41455. module.exports = addMapEntry;
  41456. /***/ }),
  41457. /* 477 */
  41458. /***/ (function(module, exports) {
  41459. "use strict";
  41460. /**
  41461. * Adds `value` to `set`.
  41462. *
  41463. * @private
  41464. * @param {Object} set The set to modify.
  41465. * @param {*} value The value to add.
  41466. * @returns {Object} Returns `set`.
  41467. */
  41468. function addSetEntry(set, value) {
  41469. // Don't return `set.add` because it's not chainable in IE 11.
  41470. set.add(value);
  41471. return set;
  41472. }
  41473. module.exports = addSetEntry;
  41474. /***/ }),
  41475. /* 478 */
  41476. /***/ (function(module, exports) {
  41477. "use strict";
  41478. /**
  41479. * A specialized version of `_.forEach` for arrays without support for
  41480. * iteratee shorthands.
  41481. *
  41482. * @private
  41483. * @param {Array} [array] The array to iterate over.
  41484. * @param {Function} iteratee The function invoked per iteration.
  41485. * @returns {Array} Returns `array`.
  41486. */
  41487. function arrayEach(array, iteratee) {
  41488. var index = -1,
  41489. length = array == null ? 0 : array.length;
  41490. while (++index < length) {
  41491. if (iteratee(array[index], index, array) === false) {
  41492. break;
  41493. }
  41494. }
  41495. return array;
  41496. }
  41497. module.exports = arrayEach;
  41498. /***/ }),
  41499. /* 479 */
  41500. /***/ (function(module, exports) {
  41501. "use strict";
  41502. /**
  41503. * A specialized version of `_.filter` for arrays without support for
  41504. * iteratee shorthands.
  41505. *
  41506. * @private
  41507. * @param {Array} [array] The array to iterate over.
  41508. * @param {Function} predicate The function invoked per iteration.
  41509. * @returns {Array} Returns the new filtered array.
  41510. */
  41511. function arrayFilter(array, predicate) {
  41512. var index = -1,
  41513. length = array == null ? 0 : array.length,
  41514. resIndex = 0,
  41515. result = [];
  41516. while (++index < length) {
  41517. var value = array[index];
  41518. if (predicate(value, index, array)) {
  41519. result[resIndex++] = value;
  41520. }
  41521. }
  41522. return result;
  41523. }
  41524. module.exports = arrayFilter;
  41525. /***/ }),
  41526. /* 480 */
  41527. /***/ (function(module, exports, __webpack_require__) {
  41528. 'use strict';
  41529. var baseIndexOf = __webpack_require__(166);
  41530. /**
  41531. * A specialized version of `_.includes` for arrays without support for
  41532. * specifying an index to search from.
  41533. *
  41534. * @private
  41535. * @param {Array} [array] The array to inspect.
  41536. * @param {*} target The value to search for.
  41537. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  41538. */
  41539. function arrayIncludes(array, value) {
  41540. var length = array == null ? 0 : array.length;
  41541. return !!length && baseIndexOf(array, value, 0) > -1;
  41542. }
  41543. module.exports = arrayIncludes;
  41544. /***/ }),
  41545. /* 481 */
  41546. /***/ (function(module, exports) {
  41547. "use strict";
  41548. /**
  41549. * This function is like `arrayIncludes` except that it accepts a comparator.
  41550. *
  41551. * @private
  41552. * @param {Array} [array] The array to inspect.
  41553. * @param {*} target The value to search for.
  41554. * @param {Function} comparator The comparator invoked per element.
  41555. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  41556. */
  41557. function arrayIncludesWith(array, value, comparator) {
  41558. var index = -1,
  41559. length = array == null ? 0 : array.length;
  41560. while (++index < length) {
  41561. if (comparator(value, array[index])) {
  41562. return true;
  41563. }
  41564. }
  41565. return false;
  41566. }
  41567. module.exports = arrayIncludesWith;
  41568. /***/ }),
  41569. /* 482 */
  41570. /***/ (function(module, exports) {
  41571. "use strict";
  41572. /**
  41573. * A specialized version of `_.some` for arrays without support for iteratee
  41574. * shorthands.
  41575. *
  41576. * @private
  41577. * @param {Array} [array] The array to iterate over.
  41578. * @param {Function} predicate The function invoked per iteration.
  41579. * @returns {boolean} Returns `true` if any element passes the predicate check,
  41580. * else `false`.
  41581. */
  41582. function arraySome(array, predicate) {
  41583. var index = -1,
  41584. length = array == null ? 0 : array.length;
  41585. while (++index < length) {
  41586. if (predicate(array[index], index, array)) {
  41587. return true;
  41588. }
  41589. }
  41590. return false;
  41591. }
  41592. module.exports = arraySome;
  41593. /***/ }),
  41594. /* 483 */
  41595. /***/ (function(module, exports, __webpack_require__) {
  41596. 'use strict';
  41597. var copyObject = __webpack_require__(31),
  41598. keys = __webpack_require__(32);
  41599. /**
  41600. * The base implementation of `_.assign` without support for multiple sources
  41601. * or `customizer` functions.
  41602. *
  41603. * @private
  41604. * @param {Object} object The destination object.
  41605. * @param {Object} source The source object.
  41606. * @returns {Object} Returns `object`.
  41607. */
  41608. function baseAssign(object, source) {
  41609. return object && copyObject(source, keys(source), object);
  41610. }
  41611. module.exports = baseAssign;
  41612. /***/ }),
  41613. /* 484 */
  41614. /***/ (function(module, exports, __webpack_require__) {
  41615. 'use strict';
  41616. var copyObject = __webpack_require__(31),
  41617. keysIn = __webpack_require__(47);
  41618. /**
  41619. * The base implementation of `_.assignIn` without support for multiple sources
  41620. * or `customizer` functions.
  41621. *
  41622. * @private
  41623. * @param {Object} object The destination object.
  41624. * @param {Object} source The source object.
  41625. * @returns {Object} Returns `object`.
  41626. */
  41627. function baseAssignIn(object, source) {
  41628. return object && copyObject(source, keysIn(source), object);
  41629. }
  41630. module.exports = baseAssignIn;
  41631. /***/ }),
  41632. /* 485 */
  41633. /***/ (function(module, exports) {
  41634. "use strict";
  41635. /**
  41636. * The base implementation of `_.clamp` which doesn't coerce arguments.
  41637. *
  41638. * @private
  41639. * @param {number} number The number to clamp.
  41640. * @param {number} [lower] The lower bound.
  41641. * @param {number} upper The upper bound.
  41642. * @returns {number} Returns the clamped number.
  41643. */
  41644. function baseClamp(number, lower, upper) {
  41645. if (number === number) {
  41646. if (upper !== undefined) {
  41647. number = number <= upper ? number : upper;
  41648. }
  41649. if (lower !== undefined) {
  41650. number = number >= lower ? number : lower;
  41651. }
  41652. }
  41653. return number;
  41654. }
  41655. module.exports = baseClamp;
  41656. /***/ }),
  41657. /* 486 */
  41658. /***/ (function(module, exports, __webpack_require__) {
  41659. 'use strict';
  41660. var isObject = __webpack_require__(18);
  41661. /** Built-in value references. */
  41662. var objectCreate = Object.create;
  41663. /**
  41664. * The base implementation of `_.create` without support for assigning
  41665. * properties to the created object.
  41666. *
  41667. * @private
  41668. * @param {Object} proto The object to inherit from.
  41669. * @returns {Object} Returns the new object.
  41670. */
  41671. var baseCreate = function () {
  41672. function object() {}
  41673. return function (proto) {
  41674. if (!isObject(proto)) {
  41675. return {};
  41676. }
  41677. if (objectCreate) {
  41678. return objectCreate(proto);
  41679. }
  41680. object.prototype = proto;
  41681. var result = new object();
  41682. object.prototype = undefined;
  41683. return result;
  41684. };
  41685. }();
  41686. module.exports = baseCreate;
  41687. /***/ }),
  41688. /* 487 */
  41689. /***/ (function(module, exports, __webpack_require__) {
  41690. 'use strict';
  41691. var baseForOwn = __webpack_require__(489),
  41692. createBaseEach = __webpack_require__(526);
  41693. /**
  41694. * The base implementation of `_.forEach` without support for iteratee shorthands.
  41695. *
  41696. * @private
  41697. * @param {Array|Object} collection The collection to iterate over.
  41698. * @param {Function} iteratee The function invoked per iteration.
  41699. * @returns {Array|Object} Returns `collection`.
  41700. */
  41701. var baseEach = createBaseEach(baseForOwn);
  41702. module.exports = baseEach;
  41703. /***/ }),
  41704. /* 488 */
  41705. /***/ (function(module, exports, __webpack_require__) {
  41706. 'use strict';
  41707. var arrayPush = __webpack_require__(161),
  41708. isFlattenable = __webpack_require__(543);
  41709. /**
  41710. * The base implementation of `_.flatten` with support for restricting flattening.
  41711. *
  41712. * @private
  41713. * @param {Array} array The array to flatten.
  41714. * @param {number} depth The maximum recursion depth.
  41715. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  41716. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  41717. * @param {Array} [result=[]] The initial result value.
  41718. * @returns {Array} Returns the new flattened array.
  41719. */
  41720. function baseFlatten(array, depth, predicate, isStrict, result) {
  41721. var index = -1,
  41722. length = array.length;
  41723. predicate || (predicate = isFlattenable);
  41724. result || (result = []);
  41725. while (++index < length) {
  41726. var value = array[index];
  41727. if (depth > 0 && predicate(value)) {
  41728. if (depth > 1) {
  41729. // Recursively flatten arrays (susceptible to call stack limits).
  41730. baseFlatten(value, depth - 1, predicate, isStrict, result);
  41731. } else {
  41732. arrayPush(result, value);
  41733. }
  41734. } else if (!isStrict) {
  41735. result[result.length] = value;
  41736. }
  41737. }
  41738. return result;
  41739. }
  41740. module.exports = baseFlatten;
  41741. /***/ }),
  41742. /* 489 */
  41743. /***/ (function(module, exports, __webpack_require__) {
  41744. 'use strict';
  41745. var baseFor = __webpack_require__(248),
  41746. keys = __webpack_require__(32);
  41747. /**
  41748. * The base implementation of `_.forOwn` without support for iteratee shorthands.
  41749. *
  41750. * @private
  41751. * @param {Object} object The object to iterate over.
  41752. * @param {Function} iteratee The function invoked per iteration.
  41753. * @returns {Object} Returns `object`.
  41754. */
  41755. function baseForOwn(object, iteratee) {
  41756. return object && baseFor(object, iteratee, keys);
  41757. }
  41758. module.exports = baseForOwn;
  41759. /***/ }),
  41760. /* 490 */
  41761. /***/ (function(module, exports) {
  41762. "use strict";
  41763. /** Used for built-in method references. */
  41764. var objectProto = Object.prototype;
  41765. /** Used to check objects for own properties. */
  41766. var hasOwnProperty = objectProto.hasOwnProperty;
  41767. /**
  41768. * The base implementation of `_.has` without support for deep paths.
  41769. *
  41770. * @private
  41771. * @param {Object} [object] The object to query.
  41772. * @param {Array|string} key The key to check.
  41773. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  41774. */
  41775. function baseHas(object, key) {
  41776. return object != null && hasOwnProperty.call(object, key);
  41777. }
  41778. module.exports = baseHas;
  41779. /***/ }),
  41780. /* 491 */
  41781. /***/ (function(module, exports) {
  41782. "use strict";
  41783. /**
  41784. * The base implementation of `_.hasIn` without support for deep paths.
  41785. *
  41786. * @private
  41787. * @param {Object} [object] The object to query.
  41788. * @param {Array|string} key The key to check.
  41789. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  41790. */
  41791. function baseHasIn(object, key) {
  41792. return object != null && key in Object(object);
  41793. }
  41794. module.exports = baseHasIn;
  41795. /***/ }),
  41796. /* 492 */
  41797. /***/ (function(module, exports) {
  41798. "use strict";
  41799. /**
  41800. * This function is like `baseIndexOf` except that it accepts a comparator.
  41801. *
  41802. * @private
  41803. * @param {Array} array The array to inspect.
  41804. * @param {*} value The value to search for.
  41805. * @param {number} fromIndex The index to search from.
  41806. * @param {Function} comparator The comparator invoked per element.
  41807. * @returns {number} Returns the index of the matched value, else `-1`.
  41808. */
  41809. function baseIndexOfWith(array, value, fromIndex, comparator) {
  41810. var index = fromIndex - 1,
  41811. length = array.length;
  41812. while (++index < length) {
  41813. if (comparator(array[index], value)) {
  41814. return index;
  41815. }
  41816. }
  41817. return -1;
  41818. }
  41819. module.exports = baseIndexOfWith;
  41820. /***/ }),
  41821. /* 493 */
  41822. /***/ (function(module, exports, __webpack_require__) {
  41823. 'use strict';
  41824. var baseGetTag = __webpack_require__(30),
  41825. isObjectLike = __webpack_require__(25);
  41826. /** `Object#toString` result references. */
  41827. var argsTag = '[object Arguments]';
  41828. /**
  41829. * The base implementation of `_.isArguments`.
  41830. *
  41831. * @private
  41832. * @param {*} value The value to check.
  41833. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  41834. */
  41835. function baseIsArguments(value) {
  41836. return isObjectLike(value) && baseGetTag(value) == argsTag;
  41837. }
  41838. module.exports = baseIsArguments;
  41839. /***/ }),
  41840. /* 494 */
  41841. /***/ (function(module, exports, __webpack_require__) {
  41842. 'use strict';
  41843. var Stack = __webpack_require__(99),
  41844. equalArrays = __webpack_require__(260),
  41845. equalByTag = __webpack_require__(530),
  41846. equalObjects = __webpack_require__(531),
  41847. getTag = __webpack_require__(264),
  41848. isArray = __webpack_require__(6),
  41849. isBuffer = __webpack_require__(113),
  41850. isTypedArray = __webpack_require__(177);
  41851. /** Used to compose bitmasks for value comparisons. */
  41852. var COMPARE_PARTIAL_FLAG = 1;
  41853. /** `Object#toString` result references. */
  41854. var argsTag = '[object Arguments]',
  41855. arrayTag = '[object Array]',
  41856. objectTag = '[object Object]';
  41857. /** Used for built-in method references. */
  41858. var objectProto = Object.prototype;
  41859. /** Used to check objects for own properties. */
  41860. var hasOwnProperty = objectProto.hasOwnProperty;
  41861. /**
  41862. * A specialized version of `baseIsEqual` for arrays and objects which performs
  41863. * deep comparisons and tracks traversed objects enabling objects with circular
  41864. * references to be compared.
  41865. *
  41866. * @private
  41867. * @param {Object} object The object to compare.
  41868. * @param {Object} other The other object to compare.
  41869. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  41870. * @param {Function} customizer The function to customize comparisons.
  41871. * @param {Function} equalFunc The function to determine equivalents of values.
  41872. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  41873. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  41874. */
  41875. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  41876. var objIsArr = isArray(object),
  41877. othIsArr = isArray(other),
  41878. objTag = objIsArr ? arrayTag : getTag(object),
  41879. othTag = othIsArr ? arrayTag : getTag(other);
  41880. objTag = objTag == argsTag ? objectTag : objTag;
  41881. othTag = othTag == argsTag ? objectTag : othTag;
  41882. var objIsObj = objTag == objectTag,
  41883. othIsObj = othTag == objectTag,
  41884. isSameTag = objTag == othTag;
  41885. if (isSameTag && isBuffer(object)) {
  41886. if (!isBuffer(other)) {
  41887. return false;
  41888. }
  41889. objIsArr = true;
  41890. objIsObj = false;
  41891. }
  41892. if (isSameTag && !objIsObj) {
  41893. stack || (stack = new Stack());
  41894. return objIsArr || isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  41895. }
  41896. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  41897. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  41898. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  41899. if (objIsWrapped || othIsWrapped) {
  41900. var objUnwrapped = objIsWrapped ? object.value() : object,
  41901. othUnwrapped = othIsWrapped ? other.value() : other;
  41902. stack || (stack = new Stack());
  41903. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  41904. }
  41905. }
  41906. if (!isSameTag) {
  41907. return false;
  41908. }
  41909. stack || (stack = new Stack());
  41910. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  41911. }
  41912. module.exports = baseIsEqualDeep;
  41913. /***/ }),
  41914. /* 495 */
  41915. /***/ (function(module, exports, __webpack_require__) {
  41916. 'use strict';
  41917. var Stack = __webpack_require__(99),
  41918. baseIsEqual = __webpack_require__(251);
  41919. /** Used to compose bitmasks for value comparisons. */
  41920. var COMPARE_PARTIAL_FLAG = 1,
  41921. COMPARE_UNORDERED_FLAG = 2;
  41922. /**
  41923. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  41924. *
  41925. * @private
  41926. * @param {Object} object The object to inspect.
  41927. * @param {Object} source The object of property values to match.
  41928. * @param {Array} matchData The property names, values, and compare flags to match.
  41929. * @param {Function} [customizer] The function to customize comparisons.
  41930. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  41931. */
  41932. function baseIsMatch(object, source, matchData, customizer) {
  41933. var index = matchData.length,
  41934. length = index,
  41935. noCustomizer = !customizer;
  41936. if (object == null) {
  41937. return !length;
  41938. }
  41939. object = Object(object);
  41940. while (index--) {
  41941. var data = matchData[index];
  41942. if (noCustomizer && data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) {
  41943. return false;
  41944. }
  41945. }
  41946. while (++index < length) {
  41947. data = matchData[index];
  41948. var key = data[0],
  41949. objValue = object[key],
  41950. srcValue = data[1];
  41951. if (noCustomizer && data[2]) {
  41952. if (objValue === undefined && !(key in object)) {
  41953. return false;
  41954. }
  41955. } else {
  41956. var stack = new Stack();
  41957. if (customizer) {
  41958. var result = customizer(objValue, srcValue, key, object, source, stack);
  41959. }
  41960. if (!(result === undefined ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) : result)) {
  41961. return false;
  41962. }
  41963. }
  41964. }
  41965. return true;
  41966. }
  41967. module.exports = baseIsMatch;
  41968. /***/ }),
  41969. /* 496 */
  41970. /***/ (function(module, exports) {
  41971. "use strict";
  41972. /**
  41973. * The base implementation of `_.isNaN` without support for number objects.
  41974. *
  41975. * @private
  41976. * @param {*} value The value to check.
  41977. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  41978. */
  41979. function baseIsNaN(value) {
  41980. return value !== value;
  41981. }
  41982. module.exports = baseIsNaN;
  41983. /***/ }),
  41984. /* 497 */
  41985. /***/ (function(module, exports, __webpack_require__) {
  41986. 'use strict';
  41987. var isFunction = __webpack_require__(175),
  41988. isMasked = __webpack_require__(545),
  41989. isObject = __webpack_require__(18),
  41990. toSource = __webpack_require__(272);
  41991. /**
  41992. * Used to match `RegExp`
  41993. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  41994. */
  41995. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  41996. /** Used to detect host constructors (Safari). */
  41997. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  41998. /** Used for built-in method references. */
  41999. var funcProto = Function.prototype,
  42000. objectProto = Object.prototype;
  42001. /** Used to resolve the decompiled source of functions. */
  42002. var funcToString = funcProto.toString;
  42003. /** Used to check objects for own properties. */
  42004. var hasOwnProperty = objectProto.hasOwnProperty;
  42005. /** Used to detect if a method is native. */
  42006. var reIsNative = RegExp('^' + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&').replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
  42007. /**
  42008. * The base implementation of `_.isNative` without bad shim checks.
  42009. *
  42010. * @private
  42011. * @param {*} value The value to check.
  42012. * @returns {boolean} Returns `true` if `value` is a native function,
  42013. * else `false`.
  42014. */
  42015. function baseIsNative(value) {
  42016. if (!isObject(value) || isMasked(value)) {
  42017. return false;
  42018. }
  42019. var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  42020. return pattern.test(toSource(value));
  42021. }
  42022. module.exports = baseIsNative;
  42023. /***/ }),
  42024. /* 498 */
  42025. /***/ (function(module, exports, __webpack_require__) {
  42026. 'use strict';
  42027. var baseGetTag = __webpack_require__(30),
  42028. isObjectLike = __webpack_require__(25);
  42029. /** `Object#toString` result references. */
  42030. var regexpTag = '[object RegExp]';
  42031. /**
  42032. * The base implementation of `_.isRegExp` without Node.js optimizations.
  42033. *
  42034. * @private
  42035. * @param {*} value The value to check.
  42036. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  42037. */
  42038. function baseIsRegExp(value) {
  42039. return isObjectLike(value) && baseGetTag(value) == regexpTag;
  42040. }
  42041. module.exports = baseIsRegExp;
  42042. /***/ }),
  42043. /* 499 */
  42044. /***/ (function(module, exports, __webpack_require__) {
  42045. 'use strict';
  42046. var baseGetTag = __webpack_require__(30),
  42047. isLength = __webpack_require__(176),
  42048. isObjectLike = __webpack_require__(25);
  42049. /** `Object#toString` result references. */
  42050. var argsTag = '[object Arguments]',
  42051. arrayTag = '[object Array]',
  42052. boolTag = '[object Boolean]',
  42053. dateTag = '[object Date]',
  42054. errorTag = '[object Error]',
  42055. funcTag = '[object Function]',
  42056. mapTag = '[object Map]',
  42057. numberTag = '[object Number]',
  42058. objectTag = '[object Object]',
  42059. regexpTag = '[object RegExp]',
  42060. setTag = '[object Set]',
  42061. stringTag = '[object String]',
  42062. weakMapTag = '[object WeakMap]';
  42063. var arrayBufferTag = '[object ArrayBuffer]',
  42064. dataViewTag = '[object DataView]',
  42065. float32Tag = '[object Float32Array]',
  42066. float64Tag = '[object Float64Array]',
  42067. int8Tag = '[object Int8Array]',
  42068. int16Tag = '[object Int16Array]',
  42069. int32Tag = '[object Int32Array]',
  42070. uint8Tag = '[object Uint8Array]',
  42071. uint8ClampedTag = '[object Uint8ClampedArray]',
  42072. uint16Tag = '[object Uint16Array]',
  42073. uint32Tag = '[object Uint32Array]';
  42074. /** Used to identify `toStringTag` values of typed arrays. */
  42075. var typedArrayTags = {};
  42076. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
  42077. typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
  42078. /**
  42079. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  42080. *
  42081. * @private
  42082. * @param {*} value The value to check.
  42083. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  42084. */
  42085. function baseIsTypedArray(value) {
  42086. return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  42087. }
  42088. module.exports = baseIsTypedArray;
  42089. /***/ }),
  42090. /* 500 */
  42091. /***/ (function(module, exports, __webpack_require__) {
  42092. 'use strict';
  42093. var isPrototype = __webpack_require__(105),
  42094. nativeKeys = __webpack_require__(557);
  42095. /** Used for built-in method references. */
  42096. var objectProto = Object.prototype;
  42097. /** Used to check objects for own properties. */
  42098. var hasOwnProperty = objectProto.hasOwnProperty;
  42099. /**
  42100. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  42101. *
  42102. * @private
  42103. * @param {Object} object The object to query.
  42104. * @returns {Array} Returns the array of property names.
  42105. */
  42106. function baseKeys(object) {
  42107. if (!isPrototype(object)) {
  42108. return nativeKeys(object);
  42109. }
  42110. var result = [];
  42111. for (var key in Object(object)) {
  42112. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  42113. result.push(key);
  42114. }
  42115. }
  42116. return result;
  42117. }
  42118. module.exports = baseKeys;
  42119. /***/ }),
  42120. /* 501 */
  42121. /***/ (function(module, exports, __webpack_require__) {
  42122. 'use strict';
  42123. var isObject = __webpack_require__(18),
  42124. isPrototype = __webpack_require__(105),
  42125. nativeKeysIn = __webpack_require__(558);
  42126. /** Used for built-in method references. */
  42127. var objectProto = Object.prototype;
  42128. /** Used to check objects for own properties. */
  42129. var hasOwnProperty = objectProto.hasOwnProperty;
  42130. /**
  42131. * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
  42132. *
  42133. * @private
  42134. * @param {Object} object The object to query.
  42135. * @returns {Array} Returns the array of property names.
  42136. */
  42137. function baseKeysIn(object) {
  42138. if (!isObject(object)) {
  42139. return nativeKeysIn(object);
  42140. }
  42141. var isProto = isPrototype(object),
  42142. result = [];
  42143. for (var key in object) {
  42144. if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
  42145. result.push(key);
  42146. }
  42147. }
  42148. return result;
  42149. }
  42150. module.exports = baseKeysIn;
  42151. /***/ }),
  42152. /* 502 */
  42153. /***/ (function(module, exports, __webpack_require__) {
  42154. 'use strict';
  42155. var baseIsMatch = __webpack_require__(495),
  42156. getMatchData = __webpack_require__(533),
  42157. matchesStrictComparable = __webpack_require__(269);
  42158. /**
  42159. * The base implementation of `_.matches` which doesn't clone `source`.
  42160. *
  42161. * @private
  42162. * @param {Object} source The object of property values to match.
  42163. * @returns {Function} Returns the new spec function.
  42164. */
  42165. function baseMatches(source) {
  42166. var matchData = getMatchData(source);
  42167. if (matchData.length == 1 && matchData[0][2]) {
  42168. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  42169. }
  42170. return function (object) {
  42171. return object === source || baseIsMatch(object, source, matchData);
  42172. };
  42173. }
  42174. module.exports = baseMatches;
  42175. /***/ }),
  42176. /* 503 */
  42177. /***/ (function(module, exports, __webpack_require__) {
  42178. 'use strict';
  42179. var baseIsEqual = __webpack_require__(251),
  42180. get = __webpack_require__(583),
  42181. hasIn = __webpack_require__(584),
  42182. isKey = __webpack_require__(173),
  42183. isStrictComparable = __webpack_require__(267),
  42184. matchesStrictComparable = __webpack_require__(269),
  42185. toKey = __webpack_require__(108);
  42186. /** Used to compose bitmasks for value comparisons. */
  42187. var COMPARE_PARTIAL_FLAG = 1,
  42188. COMPARE_UNORDERED_FLAG = 2;
  42189. /**
  42190. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  42191. *
  42192. * @private
  42193. * @param {string} path The path of the property to get.
  42194. * @param {*} srcValue The value to match.
  42195. * @returns {Function} Returns the new spec function.
  42196. */
  42197. function baseMatchesProperty(path, srcValue) {
  42198. if (isKey(path) && isStrictComparable(srcValue)) {
  42199. return matchesStrictComparable(toKey(path), srcValue);
  42200. }
  42201. return function (object) {
  42202. var objValue = get(object, path);
  42203. return objValue === undefined && objValue === srcValue ? hasIn(object, path) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  42204. };
  42205. }
  42206. module.exports = baseMatchesProperty;
  42207. /***/ }),
  42208. /* 504 */
  42209. /***/ (function(module, exports, __webpack_require__) {
  42210. 'use strict';
  42211. var Stack = __webpack_require__(99),
  42212. assignMergeValue = __webpack_require__(247),
  42213. baseFor = __webpack_require__(248),
  42214. baseMergeDeep = __webpack_require__(505),
  42215. isObject = __webpack_require__(18),
  42216. keysIn = __webpack_require__(47);
  42217. /**
  42218. * The base implementation of `_.merge` without support for multiple sources.
  42219. *
  42220. * @private
  42221. * @param {Object} object The destination object.
  42222. * @param {Object} source The source object.
  42223. * @param {number} srcIndex The index of `source`.
  42224. * @param {Function} [customizer] The function to customize merged values.
  42225. * @param {Object} [stack] Tracks traversed source values and their merged
  42226. * counterparts.
  42227. */
  42228. function baseMerge(object, source, srcIndex, customizer, stack) {
  42229. if (object === source) {
  42230. return;
  42231. }
  42232. baseFor(source, function (srcValue, key) {
  42233. if (isObject(srcValue)) {
  42234. stack || (stack = new Stack());
  42235. baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
  42236. } else {
  42237. var newValue = customizer ? customizer(object[key], srcValue, key + '', object, source, stack) : undefined;
  42238. if (newValue === undefined) {
  42239. newValue = srcValue;
  42240. }
  42241. assignMergeValue(object, key, newValue);
  42242. }
  42243. }, keysIn);
  42244. }
  42245. module.exports = baseMerge;
  42246. /***/ }),
  42247. /* 505 */
  42248. /***/ (function(module, exports, __webpack_require__) {
  42249. 'use strict';
  42250. var assignMergeValue = __webpack_require__(247),
  42251. cloneBuffer = __webpack_require__(256),
  42252. cloneTypedArray = __webpack_require__(257),
  42253. copyArray = __webpack_require__(168),
  42254. initCloneObject = __webpack_require__(266),
  42255. isArguments = __webpack_require__(112),
  42256. isArray = __webpack_require__(6),
  42257. isArrayLikeObject = __webpack_require__(585),
  42258. isBuffer = __webpack_require__(113),
  42259. isFunction = __webpack_require__(175),
  42260. isObject = __webpack_require__(18),
  42261. isPlainObject = __webpack_require__(275),
  42262. isTypedArray = __webpack_require__(177),
  42263. toPlainObject = __webpack_require__(599);
  42264. /**
  42265. * A specialized version of `baseMerge` for arrays and objects which performs
  42266. * deep merges and tracks traversed objects enabling objects with circular
  42267. * references to be merged.
  42268. *
  42269. * @private
  42270. * @param {Object} object The destination object.
  42271. * @param {Object} source The source object.
  42272. * @param {string} key The key of the value to merge.
  42273. * @param {number} srcIndex The index of `source`.
  42274. * @param {Function} mergeFunc The function to merge values.
  42275. * @param {Function} [customizer] The function to customize assigned values.
  42276. * @param {Object} [stack] Tracks traversed source values and their merged
  42277. * counterparts.
  42278. */
  42279. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  42280. var objValue = object[key],
  42281. srcValue = source[key],
  42282. stacked = stack.get(srcValue);
  42283. if (stacked) {
  42284. assignMergeValue(object, key, stacked);
  42285. return;
  42286. }
  42287. var newValue = customizer ? customizer(objValue, srcValue, key + '', object, source, stack) : undefined;
  42288. var isCommon = newValue === undefined;
  42289. if (isCommon) {
  42290. var isArr = isArray(srcValue),
  42291. isBuff = !isArr && isBuffer(srcValue),
  42292. isTyped = !isArr && !isBuff && isTypedArray(srcValue);
  42293. newValue = srcValue;
  42294. if (isArr || isBuff || isTyped) {
  42295. if (isArray(objValue)) {
  42296. newValue = objValue;
  42297. } else if (isArrayLikeObject(objValue)) {
  42298. newValue = copyArray(objValue);
  42299. } else if (isBuff) {
  42300. isCommon = false;
  42301. newValue = cloneBuffer(srcValue, true);
  42302. } else if (isTyped) {
  42303. isCommon = false;
  42304. newValue = cloneTypedArray(srcValue, true);
  42305. } else {
  42306. newValue = [];
  42307. }
  42308. } else if (isPlainObject(srcValue) || isArguments(srcValue)) {
  42309. newValue = objValue;
  42310. if (isArguments(objValue)) {
  42311. newValue = toPlainObject(objValue);
  42312. } else if (!isObject(objValue) || srcIndex && isFunction(objValue)) {
  42313. newValue = initCloneObject(srcValue);
  42314. }
  42315. } else {
  42316. isCommon = false;
  42317. }
  42318. }
  42319. if (isCommon) {
  42320. // Recursively merge objects and arrays (susceptible to call stack limits).
  42321. stack.set(srcValue, newValue);
  42322. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  42323. stack['delete'](srcValue);
  42324. }
  42325. assignMergeValue(object, key, newValue);
  42326. }
  42327. module.exports = baseMergeDeep;
  42328. /***/ }),
  42329. /* 506 */
  42330. /***/ (function(module, exports, __webpack_require__) {
  42331. 'use strict';
  42332. var arrayMap = __webpack_require__(60),
  42333. baseIteratee = __webpack_require__(61),
  42334. baseMap = __webpack_require__(252),
  42335. baseSortBy = __webpack_require__(512),
  42336. baseUnary = __webpack_require__(102),
  42337. compareMultiple = __webpack_require__(522),
  42338. identity = __webpack_require__(110);
  42339. /**
  42340. * The base implementation of `_.orderBy` without param guards.
  42341. *
  42342. * @private
  42343. * @param {Array|Object} collection The collection to iterate over.
  42344. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
  42345. * @param {string[]} orders The sort orders of `iteratees`.
  42346. * @returns {Array} Returns the new sorted array.
  42347. */
  42348. function baseOrderBy(collection, iteratees, orders) {
  42349. var index = -1;
  42350. iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(baseIteratee));
  42351. var result = baseMap(collection, function (value, key, collection) {
  42352. var criteria = arrayMap(iteratees, function (iteratee) {
  42353. return iteratee(value);
  42354. });
  42355. return { 'criteria': criteria, 'index': ++index, 'value': value };
  42356. });
  42357. return baseSortBy(result, function (object, other) {
  42358. return compareMultiple(object, other, orders);
  42359. });
  42360. }
  42361. module.exports = baseOrderBy;
  42362. /***/ }),
  42363. /* 507 */
  42364. /***/ (function(module, exports) {
  42365. "use strict";
  42366. /**
  42367. * The base implementation of `_.property` without support for deep paths.
  42368. *
  42369. * @private
  42370. * @param {string} key The key of the property to get.
  42371. * @returns {Function} Returns the new accessor function.
  42372. */
  42373. function baseProperty(key) {
  42374. return function (object) {
  42375. return object == null ? undefined : object[key];
  42376. };
  42377. }
  42378. module.exports = baseProperty;
  42379. /***/ }),
  42380. /* 508 */
  42381. /***/ (function(module, exports, __webpack_require__) {
  42382. 'use strict';
  42383. var baseGet = __webpack_require__(249);
  42384. /**
  42385. * A specialized version of `baseProperty` which supports deep paths.
  42386. *
  42387. * @private
  42388. * @param {Array|string} path The path of the property to get.
  42389. * @returns {Function} Returns the new accessor function.
  42390. */
  42391. function basePropertyDeep(path) {
  42392. return function (object) {
  42393. return baseGet(object, path);
  42394. };
  42395. }
  42396. module.exports = basePropertyDeep;
  42397. /***/ }),
  42398. /* 509 */
  42399. /***/ (function(module, exports, __webpack_require__) {
  42400. 'use strict';
  42401. var arrayMap = __webpack_require__(60),
  42402. baseIndexOf = __webpack_require__(166),
  42403. baseIndexOfWith = __webpack_require__(492),
  42404. baseUnary = __webpack_require__(102),
  42405. copyArray = __webpack_require__(168);
  42406. /** Used for built-in method references. */
  42407. var arrayProto = Array.prototype;
  42408. /** Built-in value references. */
  42409. var splice = arrayProto.splice;
  42410. /**
  42411. * The base implementation of `_.pullAllBy` without support for iteratee
  42412. * shorthands.
  42413. *
  42414. * @private
  42415. * @param {Array} array The array to modify.
  42416. * @param {Array} values The values to remove.
  42417. * @param {Function} [iteratee] The iteratee invoked per element.
  42418. * @param {Function} [comparator] The comparator invoked per element.
  42419. * @returns {Array} Returns `array`.
  42420. */
  42421. function basePullAll(array, values, iteratee, comparator) {
  42422. var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
  42423. index = -1,
  42424. length = values.length,
  42425. seen = array;
  42426. if (array === values) {
  42427. values = copyArray(values);
  42428. }
  42429. if (iteratee) {
  42430. seen = arrayMap(array, baseUnary(iteratee));
  42431. }
  42432. while (++index < length) {
  42433. var fromIndex = 0,
  42434. value = values[index],
  42435. computed = iteratee ? iteratee(value) : value;
  42436. while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
  42437. if (seen !== array) {
  42438. splice.call(seen, fromIndex, 1);
  42439. }
  42440. splice.call(array, fromIndex, 1);
  42441. }
  42442. }
  42443. return array;
  42444. }
  42445. module.exports = basePullAll;
  42446. /***/ }),
  42447. /* 510 */
  42448. /***/ (function(module, exports) {
  42449. 'use strict';
  42450. /** Used as references for various `Number` constants. */
  42451. var MAX_SAFE_INTEGER = 9007199254740991;
  42452. /* Built-in method references for those with the same name as other `lodash` methods. */
  42453. var nativeFloor = Math.floor;
  42454. /**
  42455. * The base implementation of `_.repeat` which doesn't coerce arguments.
  42456. *
  42457. * @private
  42458. * @param {string} string The string to repeat.
  42459. * @param {number} n The number of times to repeat the string.
  42460. * @returns {string} Returns the repeated string.
  42461. */
  42462. function baseRepeat(string, n) {
  42463. var result = '';
  42464. if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
  42465. return result;
  42466. }
  42467. // Leverage the exponentiation by squaring algorithm for a faster repeat.
  42468. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
  42469. do {
  42470. if (n % 2) {
  42471. result += string;
  42472. }
  42473. n = nativeFloor(n / 2);
  42474. if (n) {
  42475. string += string;
  42476. }
  42477. } while (n);
  42478. return result;
  42479. }
  42480. module.exports = baseRepeat;
  42481. /***/ }),
  42482. /* 511 */
  42483. /***/ (function(module, exports, __webpack_require__) {
  42484. 'use strict';
  42485. var constant = __webpack_require__(576),
  42486. defineProperty = __webpack_require__(259),
  42487. identity = __webpack_require__(110);
  42488. /**
  42489. * The base implementation of `setToString` without support for hot loop shorting.
  42490. *
  42491. * @private
  42492. * @param {Function} func The function to modify.
  42493. * @param {Function} string The `toString` result.
  42494. * @returns {Function} Returns `func`.
  42495. */
  42496. var baseSetToString = !defineProperty ? identity : function (func, string) {
  42497. return defineProperty(func, 'toString', {
  42498. 'configurable': true,
  42499. 'enumerable': false,
  42500. 'value': constant(string),
  42501. 'writable': true
  42502. });
  42503. };
  42504. module.exports = baseSetToString;
  42505. /***/ }),
  42506. /* 512 */
  42507. /***/ (function(module, exports) {
  42508. "use strict";
  42509. /**
  42510. * The base implementation of `_.sortBy` which uses `comparer` to define the
  42511. * sort order of `array` and replaces criteria objects with their corresponding
  42512. * values.
  42513. *
  42514. * @private
  42515. * @param {Array} array The array to sort.
  42516. * @param {Function} comparer The function to define sort order.
  42517. * @returns {Array} Returns `array`.
  42518. */
  42519. function baseSortBy(array, comparer) {
  42520. var length = array.length;
  42521. array.sort(comparer);
  42522. while (length--) {
  42523. array[length] = array[length].value;
  42524. }
  42525. return array;
  42526. }
  42527. module.exports = baseSortBy;
  42528. /***/ }),
  42529. /* 513 */
  42530. /***/ (function(module, exports) {
  42531. "use strict";
  42532. /**
  42533. * The base implementation of `_.times` without support for iteratee shorthands
  42534. * or max array length checks.
  42535. *
  42536. * @private
  42537. * @param {number} n The number of times to invoke `iteratee`.
  42538. * @param {Function} iteratee The function invoked per iteration.
  42539. * @returns {Array} Returns the array of results.
  42540. */
  42541. function baseTimes(n, iteratee) {
  42542. var index = -1,
  42543. result = Array(n);
  42544. while (++index < n) {
  42545. result[index] = iteratee(index);
  42546. }
  42547. return result;
  42548. }
  42549. module.exports = baseTimes;
  42550. /***/ }),
  42551. /* 514 */
  42552. /***/ (function(module, exports, __webpack_require__) {
  42553. 'use strict';
  42554. var SetCache = __webpack_require__(242),
  42555. arrayIncludes = __webpack_require__(480),
  42556. arrayIncludesWith = __webpack_require__(481),
  42557. cacheHas = __webpack_require__(254),
  42558. createSet = __webpack_require__(528),
  42559. setToArray = __webpack_require__(107);
  42560. /** Used as the size to enable large array optimizations. */
  42561. var LARGE_ARRAY_SIZE = 200;
  42562. /**
  42563. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  42564. *
  42565. * @private
  42566. * @param {Array} array The array to inspect.
  42567. * @param {Function} [iteratee] The iteratee invoked per element.
  42568. * @param {Function} [comparator] The comparator invoked per element.
  42569. * @returns {Array} Returns the new duplicate free array.
  42570. */
  42571. function baseUniq(array, iteratee, comparator) {
  42572. var index = -1,
  42573. includes = arrayIncludes,
  42574. length = array.length,
  42575. isCommon = true,
  42576. result = [],
  42577. seen = result;
  42578. if (comparator) {
  42579. isCommon = false;
  42580. includes = arrayIncludesWith;
  42581. } else if (length >= LARGE_ARRAY_SIZE) {
  42582. var set = iteratee ? null : createSet(array);
  42583. if (set) {
  42584. return setToArray(set);
  42585. }
  42586. isCommon = false;
  42587. includes = cacheHas;
  42588. seen = new SetCache();
  42589. } else {
  42590. seen = iteratee ? [] : result;
  42591. }
  42592. outer: while (++index < length) {
  42593. var value = array[index],
  42594. computed = iteratee ? iteratee(value) : value;
  42595. value = comparator || value !== 0 ? value : 0;
  42596. if (isCommon && computed === computed) {
  42597. var seenIndex = seen.length;
  42598. while (seenIndex--) {
  42599. if (seen[seenIndex] === computed) {
  42600. continue outer;
  42601. }
  42602. }
  42603. if (iteratee) {
  42604. seen.push(computed);
  42605. }
  42606. result.push(value);
  42607. } else if (!includes(seen, computed, comparator)) {
  42608. if (seen !== result) {
  42609. seen.push(computed);
  42610. }
  42611. result.push(value);
  42612. }
  42613. }
  42614. return result;
  42615. }
  42616. module.exports = baseUniq;
  42617. /***/ }),
  42618. /* 515 */
  42619. /***/ (function(module, exports, __webpack_require__) {
  42620. 'use strict';
  42621. var arrayMap = __webpack_require__(60);
  42622. /**
  42623. * The base implementation of `_.values` and `_.valuesIn` which creates an
  42624. * array of `object` property values corresponding to the property names
  42625. * of `props`.
  42626. *
  42627. * @private
  42628. * @param {Object} object The object to query.
  42629. * @param {Array} props The property names to get values for.
  42630. * @returns {Object} Returns the array of property values.
  42631. */
  42632. function baseValues(object, props) {
  42633. return arrayMap(props, function (key) {
  42634. return object[key];
  42635. });
  42636. }
  42637. module.exports = baseValues;
  42638. /***/ }),
  42639. /* 516 */
  42640. /***/ (function(module, exports, __webpack_require__) {
  42641. 'use strict';
  42642. var cloneArrayBuffer = __webpack_require__(167);
  42643. /**
  42644. * Creates a clone of `dataView`.
  42645. *
  42646. * @private
  42647. * @param {Object} dataView The data view to clone.
  42648. * @param {boolean} [isDeep] Specify a deep clone.
  42649. * @returns {Object} Returns the cloned data view.
  42650. */
  42651. function cloneDataView(dataView, isDeep) {
  42652. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  42653. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  42654. }
  42655. module.exports = cloneDataView;
  42656. /***/ }),
  42657. /* 517 */
  42658. /***/ (function(module, exports, __webpack_require__) {
  42659. 'use strict';
  42660. var addMapEntry = __webpack_require__(476),
  42661. arrayReduce = __webpack_require__(246),
  42662. mapToArray = __webpack_require__(268);
  42663. /** Used to compose bitmasks for cloning. */
  42664. var CLONE_DEEP_FLAG = 1;
  42665. /**
  42666. * Creates a clone of `map`.
  42667. *
  42668. * @private
  42669. * @param {Object} map The map to clone.
  42670. * @param {Function} cloneFunc The function to clone values.
  42671. * @param {boolean} [isDeep] Specify a deep clone.
  42672. * @returns {Object} Returns the cloned map.
  42673. */
  42674. function cloneMap(map, isDeep, cloneFunc) {
  42675. var array = isDeep ? cloneFunc(mapToArray(map), CLONE_DEEP_FLAG) : mapToArray(map);
  42676. return arrayReduce(array, addMapEntry, new map.constructor());
  42677. }
  42678. module.exports = cloneMap;
  42679. /***/ }),
  42680. /* 518 */
  42681. /***/ (function(module, exports) {
  42682. "use strict";
  42683. /** Used to match `RegExp` flags from their coerced string values. */
  42684. var reFlags = /\w*$/;
  42685. /**
  42686. * Creates a clone of `regexp`.
  42687. *
  42688. * @private
  42689. * @param {Object} regexp The regexp to clone.
  42690. * @returns {Object} Returns the cloned regexp.
  42691. */
  42692. function cloneRegExp(regexp) {
  42693. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  42694. result.lastIndex = regexp.lastIndex;
  42695. return result;
  42696. }
  42697. module.exports = cloneRegExp;
  42698. /***/ }),
  42699. /* 519 */
  42700. /***/ (function(module, exports, __webpack_require__) {
  42701. 'use strict';
  42702. var addSetEntry = __webpack_require__(477),
  42703. arrayReduce = __webpack_require__(246),
  42704. setToArray = __webpack_require__(107);
  42705. /** Used to compose bitmasks for cloning. */
  42706. var CLONE_DEEP_FLAG = 1;
  42707. /**
  42708. * Creates a clone of `set`.
  42709. *
  42710. * @private
  42711. * @param {Object} set The set to clone.
  42712. * @param {Function} cloneFunc The function to clone values.
  42713. * @param {boolean} [isDeep] Specify a deep clone.
  42714. * @returns {Object} Returns the cloned set.
  42715. */
  42716. function cloneSet(set, isDeep, cloneFunc) {
  42717. var array = isDeep ? cloneFunc(setToArray(set), CLONE_DEEP_FLAG) : setToArray(set);
  42718. return arrayReduce(array, addSetEntry, new set.constructor());
  42719. }
  42720. module.exports = cloneSet;
  42721. /***/ }),
  42722. /* 520 */
  42723. /***/ (function(module, exports, __webpack_require__) {
  42724. 'use strict';
  42725. var _Symbol = __webpack_require__(45);
  42726. /** Used to convert symbols to primitives and strings. */
  42727. var symbolProto = _Symbol ? _Symbol.prototype : undefined,
  42728. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
  42729. /**
  42730. * Creates a clone of the `symbol` object.
  42731. *
  42732. * @private
  42733. * @param {Object} symbol The symbol object to clone.
  42734. * @returns {Object} Returns the cloned symbol object.
  42735. */
  42736. function cloneSymbol(symbol) {
  42737. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  42738. }
  42739. module.exports = cloneSymbol;
  42740. /***/ }),
  42741. /* 521 */
  42742. /***/ (function(module, exports, __webpack_require__) {
  42743. 'use strict';
  42744. var isSymbol = __webpack_require__(62);
  42745. /**
  42746. * Compares values to sort them in ascending order.
  42747. *
  42748. * @private
  42749. * @param {*} value The value to compare.
  42750. * @param {*} other The other value to compare.
  42751. * @returns {number} Returns the sort order indicator for `value`.
  42752. */
  42753. function compareAscending(value, other) {
  42754. if (value !== other) {
  42755. var valIsDefined = value !== undefined,
  42756. valIsNull = value === null,
  42757. valIsReflexive = value === value,
  42758. valIsSymbol = isSymbol(value);
  42759. var othIsDefined = other !== undefined,
  42760. othIsNull = other === null,
  42761. othIsReflexive = other === other,
  42762. othIsSymbol = isSymbol(other);
  42763. if (!othIsNull && !othIsSymbol && !valIsSymbol && value > other || valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol || valIsNull && othIsDefined && othIsReflexive || !valIsDefined && othIsReflexive || !valIsReflexive) {
  42764. return 1;
  42765. }
  42766. if (!valIsNull && !valIsSymbol && !othIsSymbol && value < other || othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol || othIsNull && valIsDefined && valIsReflexive || !othIsDefined && valIsReflexive || !othIsReflexive) {
  42767. return -1;
  42768. }
  42769. }
  42770. return 0;
  42771. }
  42772. module.exports = compareAscending;
  42773. /***/ }),
  42774. /* 522 */
  42775. /***/ (function(module, exports, __webpack_require__) {
  42776. 'use strict';
  42777. var compareAscending = __webpack_require__(521);
  42778. /**
  42779. * Used by `_.orderBy` to compare multiple properties of a value to another
  42780. * and stable sort them.
  42781. *
  42782. * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
  42783. * specify an order of "desc" for descending or "asc" for ascending sort order
  42784. * of corresponding values.
  42785. *
  42786. * @private
  42787. * @param {Object} object The object to compare.
  42788. * @param {Object} other The other object to compare.
  42789. * @param {boolean[]|string[]} orders The order to sort by for each property.
  42790. * @returns {number} Returns the sort order indicator for `object`.
  42791. */
  42792. function compareMultiple(object, other, orders) {
  42793. var index = -1,
  42794. objCriteria = object.criteria,
  42795. othCriteria = other.criteria,
  42796. length = objCriteria.length,
  42797. ordersLength = orders.length;
  42798. while (++index < length) {
  42799. var result = compareAscending(objCriteria[index], othCriteria[index]);
  42800. if (result) {
  42801. if (index >= ordersLength) {
  42802. return result;
  42803. }
  42804. var order = orders[index];
  42805. return result * (order == 'desc' ? -1 : 1);
  42806. }
  42807. }
  42808. // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
  42809. // that causes it, under certain circumstances, to provide the same value for
  42810. // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
  42811. // for more details.
  42812. //
  42813. // This also ensures a stable sort in V8 and other engines.
  42814. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
  42815. return object.index - other.index;
  42816. }
  42817. module.exports = compareMultiple;
  42818. /***/ }),
  42819. /* 523 */
  42820. /***/ (function(module, exports, __webpack_require__) {
  42821. 'use strict';
  42822. var copyObject = __webpack_require__(31),
  42823. getSymbols = __webpack_require__(170);
  42824. /**
  42825. * Copies own symbols of `source` to `object`.
  42826. *
  42827. * @private
  42828. * @param {Object} source The object to copy symbols from.
  42829. * @param {Object} [object={}] The object to copy symbols to.
  42830. * @returns {Object} Returns `object`.
  42831. */
  42832. function copySymbols(source, object) {
  42833. return copyObject(source, getSymbols(source), object);
  42834. }
  42835. module.exports = copySymbols;
  42836. /***/ }),
  42837. /* 524 */
  42838. /***/ (function(module, exports, __webpack_require__) {
  42839. 'use strict';
  42840. var copyObject = __webpack_require__(31),
  42841. getSymbolsIn = __webpack_require__(263);
  42842. /**
  42843. * Copies own and inherited symbols of `source` to `object`.
  42844. *
  42845. * @private
  42846. * @param {Object} source The object to copy symbols from.
  42847. * @param {Object} [object={}] The object to copy symbols to.
  42848. * @returns {Object} Returns `object`.
  42849. */
  42850. function copySymbolsIn(source, object) {
  42851. return copyObject(source, getSymbolsIn(source), object);
  42852. }
  42853. module.exports = copySymbolsIn;
  42854. /***/ }),
  42855. /* 525 */
  42856. /***/ (function(module, exports, __webpack_require__) {
  42857. 'use strict';
  42858. var root = __webpack_require__(17);
  42859. /** Used to detect overreaching core-js shims. */
  42860. var coreJsData = root['__core-js_shared__'];
  42861. module.exports = coreJsData;
  42862. /***/ }),
  42863. /* 526 */
  42864. /***/ (function(module, exports, __webpack_require__) {
  42865. 'use strict';
  42866. var isArrayLike = __webpack_require__(24);
  42867. /**
  42868. * Creates a `baseEach` or `baseEachRight` function.
  42869. *
  42870. * @private
  42871. * @param {Function} eachFunc The function to iterate over a collection.
  42872. * @param {boolean} [fromRight] Specify iterating from right to left.
  42873. * @returns {Function} Returns the new base function.
  42874. */
  42875. function createBaseEach(eachFunc, fromRight) {
  42876. return function (collection, iteratee) {
  42877. if (collection == null) {
  42878. return collection;
  42879. }
  42880. if (!isArrayLike(collection)) {
  42881. return eachFunc(collection, iteratee);
  42882. }
  42883. var length = collection.length,
  42884. index = fromRight ? length : -1,
  42885. iterable = Object(collection);
  42886. while (fromRight ? index-- : ++index < length) {
  42887. if (iteratee(iterable[index], index, iterable) === false) {
  42888. break;
  42889. }
  42890. }
  42891. return collection;
  42892. };
  42893. }
  42894. module.exports = createBaseEach;
  42895. /***/ }),
  42896. /* 527 */
  42897. /***/ (function(module, exports) {
  42898. "use strict";
  42899. /**
  42900. * Creates a base function for methods like `_.forIn` and `_.forOwn`.
  42901. *
  42902. * @private
  42903. * @param {boolean} [fromRight] Specify iterating from right to left.
  42904. * @returns {Function} Returns the new base function.
  42905. */
  42906. function createBaseFor(fromRight) {
  42907. return function (object, iteratee, keysFunc) {
  42908. var index = -1,
  42909. iterable = Object(object),
  42910. props = keysFunc(object),
  42911. length = props.length;
  42912. while (length--) {
  42913. var key = props[fromRight ? length : ++index];
  42914. if (iteratee(iterable[key], key, iterable) === false) {
  42915. break;
  42916. }
  42917. }
  42918. return object;
  42919. };
  42920. }
  42921. module.exports = createBaseFor;
  42922. /***/ }),
  42923. /* 528 */
  42924. /***/ (function(module, exports, __webpack_require__) {
  42925. 'use strict';
  42926. var Set = __webpack_require__(241),
  42927. noop = __webpack_require__(591),
  42928. setToArray = __webpack_require__(107);
  42929. /** Used as references for various `Number` constants. */
  42930. var INFINITY = 1 / 0;
  42931. /**
  42932. * Creates a set object of `values`.
  42933. *
  42934. * @private
  42935. * @param {Array} values The values to add to the set.
  42936. * @returns {Object} Returns the new set.
  42937. */
  42938. var createSet = !(Set && 1 / setToArray(new Set([, -0]))[1] == INFINITY) ? noop : function (values) {
  42939. return new Set(values);
  42940. };
  42941. module.exports = createSet;
  42942. /***/ }),
  42943. /* 529 */
  42944. /***/ (function(module, exports, __webpack_require__) {
  42945. 'use strict';
  42946. var eq = __webpack_require__(46);
  42947. /** Used for built-in method references. */
  42948. var objectProto = Object.prototype;
  42949. /** Used to check objects for own properties. */
  42950. var hasOwnProperty = objectProto.hasOwnProperty;
  42951. /**
  42952. * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
  42953. * of source objects to the destination object for all destination properties
  42954. * that resolve to `undefined`.
  42955. *
  42956. * @private
  42957. * @param {*} objValue The destination value.
  42958. * @param {*} srcValue The source value.
  42959. * @param {string} key The key of the property to assign.
  42960. * @param {Object} object The parent object of `objValue`.
  42961. * @returns {*} Returns the value to assign.
  42962. */
  42963. function customDefaultsAssignIn(objValue, srcValue, key, object) {
  42964. if (objValue === undefined || eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key)) {
  42965. return srcValue;
  42966. }
  42967. return objValue;
  42968. }
  42969. module.exports = customDefaultsAssignIn;
  42970. /***/ }),
  42971. /* 530 */
  42972. /***/ (function(module, exports, __webpack_require__) {
  42973. 'use strict';
  42974. var _Symbol = __webpack_require__(45),
  42975. Uint8Array = __webpack_require__(243),
  42976. eq = __webpack_require__(46),
  42977. equalArrays = __webpack_require__(260),
  42978. mapToArray = __webpack_require__(268),
  42979. setToArray = __webpack_require__(107);
  42980. /** Used to compose bitmasks for value comparisons. */
  42981. var COMPARE_PARTIAL_FLAG = 1,
  42982. COMPARE_UNORDERED_FLAG = 2;
  42983. /** `Object#toString` result references. */
  42984. var boolTag = '[object Boolean]',
  42985. dateTag = '[object Date]',
  42986. errorTag = '[object Error]',
  42987. mapTag = '[object Map]',
  42988. numberTag = '[object Number]',
  42989. regexpTag = '[object RegExp]',
  42990. setTag = '[object Set]',
  42991. stringTag = '[object String]',
  42992. symbolTag = '[object Symbol]';
  42993. var arrayBufferTag = '[object ArrayBuffer]',
  42994. dataViewTag = '[object DataView]';
  42995. /** Used to convert symbols to primitives and strings. */
  42996. var symbolProto = _Symbol ? _Symbol.prototype : undefined,
  42997. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
  42998. /**
  42999. * A specialized version of `baseIsEqualDeep` for comparing objects of
  43000. * the same `toStringTag`.
  43001. *
  43002. * **Note:** This function only supports comparing values with tags of
  43003. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  43004. *
  43005. * @private
  43006. * @param {Object} object The object to compare.
  43007. * @param {Object} other The other object to compare.
  43008. * @param {string} tag The `toStringTag` of the objects to compare.
  43009. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  43010. * @param {Function} customizer The function to customize comparisons.
  43011. * @param {Function} equalFunc The function to determine equivalents of values.
  43012. * @param {Object} stack Tracks traversed `object` and `other` objects.
  43013. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  43014. */
  43015. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  43016. switch (tag) {
  43017. case dataViewTag:
  43018. if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
  43019. return false;
  43020. }
  43021. object = object.buffer;
  43022. other = other.buffer;
  43023. case arrayBufferTag:
  43024. if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
  43025. return false;
  43026. }
  43027. return true;
  43028. case boolTag:
  43029. case dateTag:
  43030. case numberTag:
  43031. // Coerce booleans to `1` or `0` and dates to milliseconds.
  43032. // Invalid dates are coerced to `NaN`.
  43033. return eq(+object, +other);
  43034. case errorTag:
  43035. return object.name == other.name && object.message == other.message;
  43036. case regexpTag:
  43037. case stringTag:
  43038. // Coerce regexes to strings and treat strings, primitives and objects,
  43039. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  43040. // for more details.
  43041. return object == other + '';
  43042. case mapTag:
  43043. var convert = mapToArray;
  43044. case setTag:
  43045. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  43046. convert || (convert = setToArray);
  43047. if (object.size != other.size && !isPartial) {
  43048. return false;
  43049. }
  43050. // Assume cyclic values are equal.
  43051. var stacked = stack.get(object);
  43052. if (stacked) {
  43053. return stacked == other;
  43054. }
  43055. bitmask |= COMPARE_UNORDERED_FLAG;
  43056. // Recursively compare objects (susceptible to call stack limits).
  43057. stack.set(object, other);
  43058. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  43059. stack['delete'](object);
  43060. return result;
  43061. case symbolTag:
  43062. if (symbolValueOf) {
  43063. return symbolValueOf.call(object) == symbolValueOf.call(other);
  43064. }
  43065. }
  43066. return false;
  43067. }
  43068. module.exports = equalByTag;
  43069. /***/ }),
  43070. /* 531 */
  43071. /***/ (function(module, exports, __webpack_require__) {
  43072. 'use strict';
  43073. var getAllKeys = __webpack_require__(262);
  43074. /** Used to compose bitmasks for value comparisons. */
  43075. var COMPARE_PARTIAL_FLAG = 1;
  43076. /** Used for built-in method references. */
  43077. var objectProto = Object.prototype;
  43078. /** Used to check objects for own properties. */
  43079. var hasOwnProperty = objectProto.hasOwnProperty;
  43080. /**
  43081. * A specialized version of `baseIsEqualDeep` for objects with support for
  43082. * partial deep comparisons.
  43083. *
  43084. * @private
  43085. * @param {Object} object The object to compare.
  43086. * @param {Object} other The other object to compare.
  43087. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  43088. * @param {Function} customizer The function to customize comparisons.
  43089. * @param {Function} equalFunc The function to determine equivalents of values.
  43090. * @param {Object} stack Tracks traversed `object` and `other` objects.
  43091. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  43092. */
  43093. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  43094. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  43095. objProps = getAllKeys(object),
  43096. objLength = objProps.length,
  43097. othProps = getAllKeys(other),
  43098. othLength = othProps.length;
  43099. if (objLength != othLength && !isPartial) {
  43100. return false;
  43101. }
  43102. var index = objLength;
  43103. while (index--) {
  43104. var key = objProps[index];
  43105. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  43106. return false;
  43107. }
  43108. }
  43109. // Assume cyclic values are equal.
  43110. var stacked = stack.get(object);
  43111. if (stacked && stack.get(other)) {
  43112. return stacked == other;
  43113. }
  43114. var result = true;
  43115. stack.set(object, other);
  43116. stack.set(other, object);
  43117. var skipCtor = isPartial;
  43118. while (++index < objLength) {
  43119. key = objProps[index];
  43120. var objValue = object[key],
  43121. othValue = other[key];
  43122. if (customizer) {
  43123. var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
  43124. }
  43125. // Recursively compare objects (susceptible to call stack limits).
  43126. if (!(compared === undefined ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
  43127. result = false;
  43128. break;
  43129. }
  43130. skipCtor || (skipCtor = key == 'constructor');
  43131. }
  43132. if (result && !skipCtor) {
  43133. var objCtor = object.constructor,
  43134. othCtor = other.constructor;
  43135. // Non `Object` object instances with different constructors are not equal.
  43136. if (objCtor != othCtor && 'constructor' in object && 'constructor' in other && !(typeof objCtor == 'function' && objCtor instanceof objCtor && typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  43137. result = false;
  43138. }
  43139. }
  43140. stack['delete'](object);
  43141. stack['delete'](other);
  43142. return result;
  43143. }
  43144. module.exports = equalObjects;
  43145. /***/ }),
  43146. /* 532 */
  43147. /***/ (function(module, exports, __webpack_require__) {
  43148. 'use strict';
  43149. var baseGetAllKeys = __webpack_require__(250),
  43150. getSymbolsIn = __webpack_require__(263),
  43151. keysIn = __webpack_require__(47);
  43152. /**
  43153. * Creates an array of own and inherited enumerable property names and
  43154. * symbols of `object`.
  43155. *
  43156. * @private
  43157. * @param {Object} object The object to query.
  43158. * @returns {Array} Returns the array of property names and symbols.
  43159. */
  43160. function getAllKeysIn(object) {
  43161. return baseGetAllKeys(object, keysIn, getSymbolsIn);
  43162. }
  43163. module.exports = getAllKeysIn;
  43164. /***/ }),
  43165. /* 533 */
  43166. /***/ (function(module, exports, __webpack_require__) {
  43167. 'use strict';
  43168. var isStrictComparable = __webpack_require__(267),
  43169. keys = __webpack_require__(32);
  43170. /**
  43171. * Gets the property names, values, and compare flags of `object`.
  43172. *
  43173. * @private
  43174. * @param {Object} object The object to query.
  43175. * @returns {Array} Returns the match data of `object`.
  43176. */
  43177. function getMatchData(object) {
  43178. var result = keys(object),
  43179. length = result.length;
  43180. while (length--) {
  43181. var key = result[length],
  43182. value = object[key];
  43183. result[length] = [key, value, isStrictComparable(value)];
  43184. }
  43185. return result;
  43186. }
  43187. module.exports = getMatchData;
  43188. /***/ }),
  43189. /* 534 */
  43190. /***/ (function(module, exports, __webpack_require__) {
  43191. 'use strict';
  43192. var _Symbol = __webpack_require__(45);
  43193. /** Used for built-in method references. */
  43194. var objectProto = Object.prototype;
  43195. /** Used to check objects for own properties. */
  43196. var hasOwnProperty = objectProto.hasOwnProperty;
  43197. /**
  43198. * Used to resolve the
  43199. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  43200. * of values.
  43201. */
  43202. var nativeObjectToString = objectProto.toString;
  43203. /** Built-in value references. */
  43204. var symToStringTag = _Symbol ? _Symbol.toStringTag : undefined;
  43205. /**
  43206. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  43207. *
  43208. * @private
  43209. * @param {*} value The value to query.
  43210. * @returns {string} Returns the raw `toStringTag`.
  43211. */
  43212. function getRawTag(value) {
  43213. var isOwn = hasOwnProperty.call(value, symToStringTag),
  43214. tag = value[symToStringTag];
  43215. try {
  43216. value[symToStringTag] = undefined;
  43217. var unmasked = true;
  43218. } catch (e) {}
  43219. var result = nativeObjectToString.call(value);
  43220. if (unmasked) {
  43221. if (isOwn) {
  43222. value[symToStringTag] = tag;
  43223. } else {
  43224. delete value[symToStringTag];
  43225. }
  43226. }
  43227. return result;
  43228. }
  43229. module.exports = getRawTag;
  43230. /***/ }),
  43231. /* 535 */
  43232. /***/ (function(module, exports) {
  43233. "use strict";
  43234. /**
  43235. * Gets the value at `key` of `object`.
  43236. *
  43237. * @private
  43238. * @param {Object} [object] The object to query.
  43239. * @param {string} key The key of the property to get.
  43240. * @returns {*} Returns the property value.
  43241. */
  43242. function getValue(object, key) {
  43243. return object == null ? undefined : object[key];
  43244. }
  43245. module.exports = getValue;
  43246. /***/ }),
  43247. /* 536 */
  43248. /***/ (function(module, exports, __webpack_require__) {
  43249. 'use strict';
  43250. var nativeCreate = __webpack_require__(106);
  43251. /**
  43252. * Removes all key-value entries from the hash.
  43253. *
  43254. * @private
  43255. * @name clear
  43256. * @memberOf Hash
  43257. */
  43258. function hashClear() {
  43259. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  43260. this.size = 0;
  43261. }
  43262. module.exports = hashClear;
  43263. /***/ }),
  43264. /* 537 */
  43265. /***/ (function(module, exports) {
  43266. "use strict";
  43267. /**
  43268. * Removes `key` and its value from the hash.
  43269. *
  43270. * @private
  43271. * @name delete
  43272. * @memberOf Hash
  43273. * @param {Object} hash The hash to modify.
  43274. * @param {string} key The key of the value to remove.
  43275. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  43276. */
  43277. function hashDelete(key) {
  43278. var result = this.has(key) && delete this.__data__[key];
  43279. this.size -= result ? 1 : 0;
  43280. return result;
  43281. }
  43282. module.exports = hashDelete;
  43283. /***/ }),
  43284. /* 538 */
  43285. /***/ (function(module, exports, __webpack_require__) {
  43286. 'use strict';
  43287. var nativeCreate = __webpack_require__(106);
  43288. /** Used to stand-in for `undefined` hash values. */
  43289. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  43290. /** Used for built-in method references. */
  43291. var objectProto = Object.prototype;
  43292. /** Used to check objects for own properties. */
  43293. var hasOwnProperty = objectProto.hasOwnProperty;
  43294. /**
  43295. * Gets the hash value for `key`.
  43296. *
  43297. * @private
  43298. * @name get
  43299. * @memberOf Hash
  43300. * @param {string} key The key of the value to get.
  43301. * @returns {*} Returns the entry value.
  43302. */
  43303. function hashGet(key) {
  43304. var data = this.__data__;
  43305. if (nativeCreate) {
  43306. var result = data[key];
  43307. return result === HASH_UNDEFINED ? undefined : result;
  43308. }
  43309. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  43310. }
  43311. module.exports = hashGet;
  43312. /***/ }),
  43313. /* 539 */
  43314. /***/ (function(module, exports, __webpack_require__) {
  43315. 'use strict';
  43316. var nativeCreate = __webpack_require__(106);
  43317. /** Used for built-in method references. */
  43318. var objectProto = Object.prototype;
  43319. /** Used to check objects for own properties. */
  43320. var hasOwnProperty = objectProto.hasOwnProperty;
  43321. /**
  43322. * Checks if a hash value for `key` exists.
  43323. *
  43324. * @private
  43325. * @name has
  43326. * @memberOf Hash
  43327. * @param {string} key The key of the entry to check.
  43328. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  43329. */
  43330. function hashHas(key) {
  43331. var data = this.__data__;
  43332. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  43333. }
  43334. module.exports = hashHas;
  43335. /***/ }),
  43336. /* 540 */
  43337. /***/ (function(module, exports, __webpack_require__) {
  43338. 'use strict';
  43339. var nativeCreate = __webpack_require__(106);
  43340. /** Used to stand-in for `undefined` hash values. */
  43341. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  43342. /**
  43343. * Sets the hash `key` to `value`.
  43344. *
  43345. * @private
  43346. * @name set
  43347. * @memberOf Hash
  43348. * @param {string} key The key of the value to set.
  43349. * @param {*} value The value to set.
  43350. * @returns {Object} Returns the hash instance.
  43351. */
  43352. function hashSet(key, value) {
  43353. var data = this.__data__;
  43354. this.size += this.has(key) ? 0 : 1;
  43355. data[key] = nativeCreate && value === undefined ? HASH_UNDEFINED : value;
  43356. return this;
  43357. }
  43358. module.exports = hashSet;
  43359. /***/ }),
  43360. /* 541 */
  43361. /***/ (function(module, exports) {
  43362. 'use strict';
  43363. /** Used for built-in method references. */
  43364. var objectProto = Object.prototype;
  43365. /** Used to check objects for own properties. */
  43366. var hasOwnProperty = objectProto.hasOwnProperty;
  43367. /**
  43368. * Initializes an array clone.
  43369. *
  43370. * @private
  43371. * @param {Array} array The array to clone.
  43372. * @returns {Array} Returns the initialized clone.
  43373. */
  43374. function initCloneArray(array) {
  43375. var length = array.length,
  43376. result = array.constructor(length);
  43377. // Add properties assigned by `RegExp#exec`.
  43378. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  43379. result.index = array.index;
  43380. result.input = array.input;
  43381. }
  43382. return result;
  43383. }
  43384. module.exports = initCloneArray;
  43385. /***/ }),
  43386. /* 542 */
  43387. /***/ (function(module, exports, __webpack_require__) {
  43388. 'use strict';
  43389. var cloneArrayBuffer = __webpack_require__(167),
  43390. cloneDataView = __webpack_require__(516),
  43391. cloneMap = __webpack_require__(517),
  43392. cloneRegExp = __webpack_require__(518),
  43393. cloneSet = __webpack_require__(519),
  43394. cloneSymbol = __webpack_require__(520),
  43395. cloneTypedArray = __webpack_require__(257);
  43396. /** `Object#toString` result references. */
  43397. var boolTag = '[object Boolean]',
  43398. dateTag = '[object Date]',
  43399. mapTag = '[object Map]',
  43400. numberTag = '[object Number]',
  43401. regexpTag = '[object RegExp]',
  43402. setTag = '[object Set]',
  43403. stringTag = '[object String]',
  43404. symbolTag = '[object Symbol]';
  43405. var arrayBufferTag = '[object ArrayBuffer]',
  43406. dataViewTag = '[object DataView]',
  43407. float32Tag = '[object Float32Array]',
  43408. float64Tag = '[object Float64Array]',
  43409. int8Tag = '[object Int8Array]',
  43410. int16Tag = '[object Int16Array]',
  43411. int32Tag = '[object Int32Array]',
  43412. uint8Tag = '[object Uint8Array]',
  43413. uint8ClampedTag = '[object Uint8ClampedArray]',
  43414. uint16Tag = '[object Uint16Array]',
  43415. uint32Tag = '[object Uint32Array]';
  43416. /**
  43417. * Initializes an object clone based on its `toStringTag`.
  43418. *
  43419. * **Note:** This function only supports cloning values with tags of
  43420. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  43421. *
  43422. * @private
  43423. * @param {Object} object The object to clone.
  43424. * @param {string} tag The `toStringTag` of the object to clone.
  43425. * @param {Function} cloneFunc The function to clone values.
  43426. * @param {boolean} [isDeep] Specify a deep clone.
  43427. * @returns {Object} Returns the initialized clone.
  43428. */
  43429. function initCloneByTag(object, tag, cloneFunc, isDeep) {
  43430. var Ctor = object.constructor;
  43431. switch (tag) {
  43432. case arrayBufferTag:
  43433. return cloneArrayBuffer(object);
  43434. case boolTag:
  43435. case dateTag:
  43436. return new Ctor(+object);
  43437. case dataViewTag:
  43438. return cloneDataView(object, isDeep);
  43439. case float32Tag:case float64Tag:
  43440. case int8Tag:case int16Tag:case int32Tag:
  43441. case uint8Tag:case uint8ClampedTag:case uint16Tag:case uint32Tag:
  43442. return cloneTypedArray(object, isDeep);
  43443. case mapTag:
  43444. return cloneMap(object, isDeep, cloneFunc);
  43445. case numberTag:
  43446. case stringTag:
  43447. return new Ctor(object);
  43448. case regexpTag:
  43449. return cloneRegExp(object);
  43450. case setTag:
  43451. return cloneSet(object, isDeep, cloneFunc);
  43452. case symbolTag:
  43453. return cloneSymbol(object);
  43454. }
  43455. }
  43456. module.exports = initCloneByTag;
  43457. /***/ }),
  43458. /* 543 */
  43459. /***/ (function(module, exports, __webpack_require__) {
  43460. 'use strict';
  43461. var _Symbol = __webpack_require__(45),
  43462. isArguments = __webpack_require__(112),
  43463. isArray = __webpack_require__(6);
  43464. /** Built-in value references. */
  43465. var spreadableSymbol = _Symbol ? _Symbol.isConcatSpreadable : undefined;
  43466. /**
  43467. * Checks if `value` is a flattenable `arguments` object or array.
  43468. *
  43469. * @private
  43470. * @param {*} value The value to check.
  43471. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  43472. */
  43473. function isFlattenable(value) {
  43474. return isArray(value) || isArguments(value) || !!(spreadableSymbol && value && value[spreadableSymbol]);
  43475. }
  43476. module.exports = isFlattenable;
  43477. /***/ }),
  43478. /* 544 */
  43479. /***/ (function(module, exports) {
  43480. 'use strict';
  43481. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  43482. /**
  43483. * Checks if `value` is suitable for use as unique object key.
  43484. *
  43485. * @private
  43486. * @param {*} value The value to check.
  43487. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  43488. */
  43489. function isKeyable(value) {
  43490. var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);
  43491. return type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean' ? value !== '__proto__' : value === null;
  43492. }
  43493. module.exports = isKeyable;
  43494. /***/ }),
  43495. /* 545 */
  43496. /***/ (function(module, exports, __webpack_require__) {
  43497. 'use strict';
  43498. var coreJsData = __webpack_require__(525);
  43499. /** Used to detect methods masquerading as native. */
  43500. var maskSrcKey = function () {
  43501. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  43502. return uid ? 'Symbol(src)_1.' + uid : '';
  43503. }();
  43504. /**
  43505. * Checks if `func` has its source masked.
  43506. *
  43507. * @private
  43508. * @param {Function} func The function to check.
  43509. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  43510. */
  43511. function isMasked(func) {
  43512. return !!maskSrcKey && maskSrcKey in func;
  43513. }
  43514. module.exports = isMasked;
  43515. /***/ }),
  43516. /* 546 */
  43517. /***/ (function(module, exports) {
  43518. "use strict";
  43519. /**
  43520. * Removes all key-value entries from the list cache.
  43521. *
  43522. * @private
  43523. * @name clear
  43524. * @memberOf ListCache
  43525. */
  43526. function listCacheClear() {
  43527. this.__data__ = [];
  43528. this.size = 0;
  43529. }
  43530. module.exports = listCacheClear;
  43531. /***/ }),
  43532. /* 547 */
  43533. /***/ (function(module, exports, __webpack_require__) {
  43534. 'use strict';
  43535. var assocIndexOf = __webpack_require__(100);
  43536. /** Used for built-in method references. */
  43537. var arrayProto = Array.prototype;
  43538. /** Built-in value references. */
  43539. var splice = arrayProto.splice;
  43540. /**
  43541. * Removes `key` and its value from the list cache.
  43542. *
  43543. * @private
  43544. * @name delete
  43545. * @memberOf ListCache
  43546. * @param {string} key The key of the value to remove.
  43547. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  43548. */
  43549. function listCacheDelete(key) {
  43550. var data = this.__data__,
  43551. index = assocIndexOf(data, key);
  43552. if (index < 0) {
  43553. return false;
  43554. }
  43555. var lastIndex = data.length - 1;
  43556. if (index == lastIndex) {
  43557. data.pop();
  43558. } else {
  43559. splice.call(data, index, 1);
  43560. }
  43561. --this.size;
  43562. return true;
  43563. }
  43564. module.exports = listCacheDelete;
  43565. /***/ }),
  43566. /* 548 */
  43567. /***/ (function(module, exports, __webpack_require__) {
  43568. 'use strict';
  43569. var assocIndexOf = __webpack_require__(100);
  43570. /**
  43571. * Gets the list cache value for `key`.
  43572. *
  43573. * @private
  43574. * @name get
  43575. * @memberOf ListCache
  43576. * @param {string} key The key of the value to get.
  43577. * @returns {*} Returns the entry value.
  43578. */
  43579. function listCacheGet(key) {
  43580. var data = this.__data__,
  43581. index = assocIndexOf(data, key);
  43582. return index < 0 ? undefined : data[index][1];
  43583. }
  43584. module.exports = listCacheGet;
  43585. /***/ }),
  43586. /* 549 */
  43587. /***/ (function(module, exports, __webpack_require__) {
  43588. 'use strict';
  43589. var assocIndexOf = __webpack_require__(100);
  43590. /**
  43591. * Checks if a list cache value for `key` exists.
  43592. *
  43593. * @private
  43594. * @name has
  43595. * @memberOf ListCache
  43596. * @param {string} key The key of the entry to check.
  43597. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  43598. */
  43599. function listCacheHas(key) {
  43600. return assocIndexOf(this.__data__, key) > -1;
  43601. }
  43602. module.exports = listCacheHas;
  43603. /***/ }),
  43604. /* 550 */
  43605. /***/ (function(module, exports, __webpack_require__) {
  43606. 'use strict';
  43607. var assocIndexOf = __webpack_require__(100);
  43608. /**
  43609. * Sets the list cache `key` to `value`.
  43610. *
  43611. * @private
  43612. * @name set
  43613. * @memberOf ListCache
  43614. * @param {string} key The key of the value to set.
  43615. * @param {*} value The value to set.
  43616. * @returns {Object} Returns the list cache instance.
  43617. */
  43618. function listCacheSet(key, value) {
  43619. var data = this.__data__,
  43620. index = assocIndexOf(data, key);
  43621. if (index < 0) {
  43622. ++this.size;
  43623. data.push([key, value]);
  43624. } else {
  43625. data[index][1] = value;
  43626. }
  43627. return this;
  43628. }
  43629. module.exports = listCacheSet;
  43630. /***/ }),
  43631. /* 551 */
  43632. /***/ (function(module, exports, __webpack_require__) {
  43633. 'use strict';
  43634. var Hash = __webpack_require__(473),
  43635. ListCache = __webpack_require__(98),
  43636. Map = __webpack_require__(159);
  43637. /**
  43638. * Removes all key-value entries from the map.
  43639. *
  43640. * @private
  43641. * @name clear
  43642. * @memberOf MapCache
  43643. */
  43644. function mapCacheClear() {
  43645. this.size = 0;
  43646. this.__data__ = {
  43647. 'hash': new Hash(),
  43648. 'map': new (Map || ListCache)(),
  43649. 'string': new Hash()
  43650. };
  43651. }
  43652. module.exports = mapCacheClear;
  43653. /***/ }),
  43654. /* 552 */
  43655. /***/ (function(module, exports, __webpack_require__) {
  43656. 'use strict';
  43657. var getMapData = __webpack_require__(104);
  43658. /**
  43659. * Removes `key` and its value from the map.
  43660. *
  43661. * @private
  43662. * @name delete
  43663. * @memberOf MapCache
  43664. * @param {string} key The key of the value to remove.
  43665. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  43666. */
  43667. function mapCacheDelete(key) {
  43668. var result = getMapData(this, key)['delete'](key);
  43669. this.size -= result ? 1 : 0;
  43670. return result;
  43671. }
  43672. module.exports = mapCacheDelete;
  43673. /***/ }),
  43674. /* 553 */
  43675. /***/ (function(module, exports, __webpack_require__) {
  43676. 'use strict';
  43677. var getMapData = __webpack_require__(104);
  43678. /**
  43679. * Gets the map value for `key`.
  43680. *
  43681. * @private
  43682. * @name get
  43683. * @memberOf MapCache
  43684. * @param {string} key The key of the value to get.
  43685. * @returns {*} Returns the entry value.
  43686. */
  43687. function mapCacheGet(key) {
  43688. return getMapData(this, key).get(key);
  43689. }
  43690. module.exports = mapCacheGet;
  43691. /***/ }),
  43692. /* 554 */
  43693. /***/ (function(module, exports, __webpack_require__) {
  43694. 'use strict';
  43695. var getMapData = __webpack_require__(104);
  43696. /**
  43697. * Checks if a map value for `key` exists.
  43698. *
  43699. * @private
  43700. * @name has
  43701. * @memberOf MapCache
  43702. * @param {string} key The key of the entry to check.
  43703. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  43704. */
  43705. function mapCacheHas(key) {
  43706. return getMapData(this, key).has(key);
  43707. }
  43708. module.exports = mapCacheHas;
  43709. /***/ }),
  43710. /* 555 */
  43711. /***/ (function(module, exports, __webpack_require__) {
  43712. 'use strict';
  43713. var getMapData = __webpack_require__(104);
  43714. /**
  43715. * Sets the map `key` to `value`.
  43716. *
  43717. * @private
  43718. * @name set
  43719. * @memberOf MapCache
  43720. * @param {string} key The key of the value to set.
  43721. * @param {*} value The value to set.
  43722. * @returns {Object} Returns the map cache instance.
  43723. */
  43724. function mapCacheSet(key, value) {
  43725. var data = getMapData(this, key),
  43726. size = data.size;
  43727. data.set(key, value);
  43728. this.size += data.size == size ? 0 : 1;
  43729. return this;
  43730. }
  43731. module.exports = mapCacheSet;
  43732. /***/ }),
  43733. /* 556 */
  43734. /***/ (function(module, exports, __webpack_require__) {
  43735. 'use strict';
  43736. var memoize = __webpack_require__(589);
  43737. /** Used as the maximum memoize cache size. */
  43738. var MAX_MEMOIZE_SIZE = 500;
  43739. /**
  43740. * A specialized version of `_.memoize` which clears the memoized function's
  43741. * cache when it exceeds `MAX_MEMOIZE_SIZE`.
  43742. *
  43743. * @private
  43744. * @param {Function} func The function to have its output memoized.
  43745. * @returns {Function} Returns the new memoized function.
  43746. */
  43747. function memoizeCapped(func) {
  43748. var result = memoize(func, function (key) {
  43749. if (cache.size === MAX_MEMOIZE_SIZE) {
  43750. cache.clear();
  43751. }
  43752. return key;
  43753. });
  43754. var cache = result.cache;
  43755. return result;
  43756. }
  43757. module.exports = memoizeCapped;
  43758. /***/ }),
  43759. /* 557 */
  43760. /***/ (function(module, exports, __webpack_require__) {
  43761. 'use strict';
  43762. var overArg = __webpack_require__(271);
  43763. /* Built-in method references for those with the same name as other `lodash` methods. */
  43764. var nativeKeys = overArg(Object.keys, Object);
  43765. module.exports = nativeKeys;
  43766. /***/ }),
  43767. /* 558 */
  43768. /***/ (function(module, exports) {
  43769. "use strict";
  43770. /**
  43771. * This function is like
  43772. * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  43773. * except that it includes inherited enumerable properties.
  43774. *
  43775. * @private
  43776. * @param {Object} object The object to query.
  43777. * @returns {Array} Returns the array of property names.
  43778. */
  43779. function nativeKeysIn(object) {
  43780. var result = [];
  43781. if (object != null) {
  43782. for (var key in Object(object)) {
  43783. result.push(key);
  43784. }
  43785. }
  43786. return result;
  43787. }
  43788. module.exports = nativeKeysIn;
  43789. /***/ }),
  43790. /* 559 */
  43791. /***/ (function(module, exports) {
  43792. "use strict";
  43793. /** Used for built-in method references. */
  43794. var objectProto = Object.prototype;
  43795. /**
  43796. * Used to resolve the
  43797. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  43798. * of values.
  43799. */
  43800. var nativeObjectToString = objectProto.toString;
  43801. /**
  43802. * Converts `value` to a string using `Object.prototype.toString`.
  43803. *
  43804. * @private
  43805. * @param {*} value The value to convert.
  43806. * @returns {string} Returns the converted string.
  43807. */
  43808. function objectToString(value) {
  43809. return nativeObjectToString.call(value);
  43810. }
  43811. module.exports = objectToString;
  43812. /***/ }),
  43813. /* 560 */
  43814. /***/ (function(module, exports, __webpack_require__) {
  43815. 'use strict';
  43816. var apply = __webpack_require__(244);
  43817. /* Built-in method references for those with the same name as other `lodash` methods. */
  43818. var nativeMax = Math.max;
  43819. /**
  43820. * A specialized version of `baseRest` which transforms the rest array.
  43821. *
  43822. * @private
  43823. * @param {Function} func The function to apply a rest parameter to.
  43824. * @param {number} [start=func.length-1] The start position of the rest parameter.
  43825. * @param {Function} transform The rest array transform.
  43826. * @returns {Function} Returns the new function.
  43827. */
  43828. function overRest(func, start, transform) {
  43829. start = nativeMax(start === undefined ? func.length - 1 : start, 0);
  43830. return function () {
  43831. var args = arguments,
  43832. index = -1,
  43833. length = nativeMax(args.length - start, 0),
  43834. array = Array(length);
  43835. while (++index < length) {
  43836. array[index] = args[start + index];
  43837. }
  43838. index = -1;
  43839. var otherArgs = Array(start + 1);
  43840. while (++index < start) {
  43841. otherArgs[index] = args[index];
  43842. }
  43843. otherArgs[start] = transform(array);
  43844. return apply(func, this, otherArgs);
  43845. };
  43846. }
  43847. module.exports = overRest;
  43848. /***/ }),
  43849. /* 561 */
  43850. /***/ (function(module, exports) {
  43851. 'use strict';
  43852. /** Used to stand-in for `undefined` hash values. */
  43853. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  43854. /**
  43855. * Adds `value` to the array cache.
  43856. *
  43857. * @private
  43858. * @name add
  43859. * @memberOf SetCache
  43860. * @alias push
  43861. * @param {*} value The value to cache.
  43862. * @returns {Object} Returns the cache instance.
  43863. */
  43864. function setCacheAdd(value) {
  43865. this.__data__.set(value, HASH_UNDEFINED);
  43866. return this;
  43867. }
  43868. module.exports = setCacheAdd;
  43869. /***/ }),
  43870. /* 562 */
  43871. /***/ (function(module, exports) {
  43872. "use strict";
  43873. /**
  43874. * Checks if `value` is in the array cache.
  43875. *
  43876. * @private
  43877. * @name has
  43878. * @memberOf SetCache
  43879. * @param {*} value The value to search for.
  43880. * @returns {number} Returns `true` if `value` is found, else `false`.
  43881. */
  43882. function setCacheHas(value) {
  43883. return this.__data__.has(value);
  43884. }
  43885. module.exports = setCacheHas;
  43886. /***/ }),
  43887. /* 563 */
  43888. /***/ (function(module, exports, __webpack_require__) {
  43889. 'use strict';
  43890. var baseSetToString = __webpack_require__(511),
  43891. shortOut = __webpack_require__(564);
  43892. /**
  43893. * Sets the `toString` method of `func` to return `string`.
  43894. *
  43895. * @private
  43896. * @param {Function} func The function to modify.
  43897. * @param {Function} string The `toString` result.
  43898. * @returns {Function} Returns `func`.
  43899. */
  43900. var setToString = shortOut(baseSetToString);
  43901. module.exports = setToString;
  43902. /***/ }),
  43903. /* 564 */
  43904. /***/ (function(module, exports) {
  43905. "use strict";
  43906. /** Used to detect hot functions by number of calls within a span of milliseconds. */
  43907. var HOT_COUNT = 800,
  43908. HOT_SPAN = 16;
  43909. /* Built-in method references for those with the same name as other `lodash` methods. */
  43910. var nativeNow = Date.now;
  43911. /**
  43912. * Creates a function that'll short out and invoke `identity` instead
  43913. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  43914. * milliseconds.
  43915. *
  43916. * @private
  43917. * @param {Function} func The function to restrict.
  43918. * @returns {Function} Returns the new shortable function.
  43919. */
  43920. function shortOut(func) {
  43921. var count = 0,
  43922. lastCalled = 0;
  43923. return function () {
  43924. var stamp = nativeNow(),
  43925. remaining = HOT_SPAN - (stamp - lastCalled);
  43926. lastCalled = stamp;
  43927. if (remaining > 0) {
  43928. if (++count >= HOT_COUNT) {
  43929. return arguments[0];
  43930. }
  43931. } else {
  43932. count = 0;
  43933. }
  43934. return func.apply(undefined, arguments);
  43935. };
  43936. }
  43937. module.exports = shortOut;
  43938. /***/ }),
  43939. /* 565 */
  43940. /***/ (function(module, exports, __webpack_require__) {
  43941. 'use strict';
  43942. var ListCache = __webpack_require__(98);
  43943. /**
  43944. * Removes all key-value entries from the stack.
  43945. *
  43946. * @private
  43947. * @name clear
  43948. * @memberOf Stack
  43949. */
  43950. function stackClear() {
  43951. this.__data__ = new ListCache();
  43952. this.size = 0;
  43953. }
  43954. module.exports = stackClear;
  43955. /***/ }),
  43956. /* 566 */
  43957. /***/ (function(module, exports) {
  43958. 'use strict';
  43959. /**
  43960. * Removes `key` and its value from the stack.
  43961. *
  43962. * @private
  43963. * @name delete
  43964. * @memberOf Stack
  43965. * @param {string} key The key of the value to remove.
  43966. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  43967. */
  43968. function stackDelete(key) {
  43969. var data = this.__data__,
  43970. result = data['delete'](key);
  43971. this.size = data.size;
  43972. return result;
  43973. }
  43974. module.exports = stackDelete;
  43975. /***/ }),
  43976. /* 567 */
  43977. /***/ (function(module, exports) {
  43978. "use strict";
  43979. /**
  43980. * Gets the stack value for `key`.
  43981. *
  43982. * @private
  43983. * @name get
  43984. * @memberOf Stack
  43985. * @param {string} key The key of the value to get.
  43986. * @returns {*} Returns the entry value.
  43987. */
  43988. function stackGet(key) {
  43989. return this.__data__.get(key);
  43990. }
  43991. module.exports = stackGet;
  43992. /***/ }),
  43993. /* 568 */
  43994. /***/ (function(module, exports) {
  43995. "use strict";
  43996. /**
  43997. * Checks if a stack value for `key` exists.
  43998. *
  43999. * @private
  44000. * @name has
  44001. * @memberOf Stack
  44002. * @param {string} key The key of the entry to check.
  44003. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  44004. */
  44005. function stackHas(key) {
  44006. return this.__data__.has(key);
  44007. }
  44008. module.exports = stackHas;
  44009. /***/ }),
  44010. /* 569 */
  44011. /***/ (function(module, exports, __webpack_require__) {
  44012. 'use strict';
  44013. var ListCache = __webpack_require__(98),
  44014. Map = __webpack_require__(159),
  44015. MapCache = __webpack_require__(160);
  44016. /** Used as the size to enable large array optimizations. */
  44017. var LARGE_ARRAY_SIZE = 200;
  44018. /**
  44019. * Sets the stack `key` to `value`.
  44020. *
  44021. * @private
  44022. * @name set
  44023. * @memberOf Stack
  44024. * @param {string} key The key of the value to set.
  44025. * @param {*} value The value to set.
  44026. * @returns {Object} Returns the stack cache instance.
  44027. */
  44028. function stackSet(key, value) {
  44029. var data = this.__data__;
  44030. if (data instanceof ListCache) {
  44031. var pairs = data.__data__;
  44032. if (!Map || pairs.length < LARGE_ARRAY_SIZE - 1) {
  44033. pairs.push([key, value]);
  44034. this.size = ++data.size;
  44035. return this;
  44036. }
  44037. data = this.__data__ = new MapCache(pairs);
  44038. }
  44039. data.set(key, value);
  44040. this.size = data.size;
  44041. return this;
  44042. }
  44043. module.exports = stackSet;
  44044. /***/ }),
  44045. /* 570 */
  44046. /***/ (function(module, exports) {
  44047. "use strict";
  44048. /**
  44049. * A specialized version of `_.indexOf` which performs strict equality
  44050. * comparisons of values, i.e. `===`.
  44051. *
  44052. * @private
  44053. * @param {Array} array The array to inspect.
  44054. * @param {*} value The value to search for.
  44055. * @param {number} fromIndex The index to search from.
  44056. * @returns {number} Returns the index of the matched value, else `-1`.
  44057. */
  44058. function strictIndexOf(array, value, fromIndex) {
  44059. var index = fromIndex - 1,
  44060. length = array.length;
  44061. while (++index < length) {
  44062. if (array[index] === value) {
  44063. return index;
  44064. }
  44065. }
  44066. return -1;
  44067. }
  44068. module.exports = strictIndexOf;
  44069. /***/ }),
  44070. /* 571 */
  44071. /***/ (function(module, exports, __webpack_require__) {
  44072. 'use strict';
  44073. var memoizeCapped = __webpack_require__(556);
  44074. /** Used to match property names within property paths. */
  44075. var reLeadingDot = /^\./,
  44076. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  44077. /** Used to match backslashes in property paths. */
  44078. var reEscapeChar = /\\(\\)?/g;
  44079. /**
  44080. * Converts `string` to a property path array.
  44081. *
  44082. * @private
  44083. * @param {string} string The string to convert.
  44084. * @returns {Array} Returns the property path array.
  44085. */
  44086. var stringToPath = memoizeCapped(function (string) {
  44087. var result = [];
  44088. if (reLeadingDot.test(string)) {
  44089. result.push('');
  44090. }
  44091. string.replace(rePropName, function (match, number, quote, string) {
  44092. result.push(quote ? string.replace(reEscapeChar, '$1') : number || match);
  44093. });
  44094. return result;
  44095. });
  44096. module.exports = stringToPath;
  44097. /***/ }),
  44098. /* 572 */
  44099. /***/ (function(module, exports, __webpack_require__) {
  44100. 'use strict';
  44101. var copyObject = __webpack_require__(31),
  44102. createAssigner = __webpack_require__(103),
  44103. keysIn = __webpack_require__(47);
  44104. /**
  44105. * This method is like `_.assign` except that it iterates over own and
  44106. * inherited source properties.
  44107. *
  44108. * **Note:** This method mutates `object`.
  44109. *
  44110. * @static
  44111. * @memberOf _
  44112. * @since 4.0.0
  44113. * @alias extend
  44114. * @category Object
  44115. * @param {Object} object The destination object.
  44116. * @param {...Object} [sources] The source objects.
  44117. * @returns {Object} Returns `object`.
  44118. * @see _.assign
  44119. * @example
  44120. *
  44121. * function Foo() {
  44122. * this.a = 1;
  44123. * }
  44124. *
  44125. * function Bar() {
  44126. * this.c = 3;
  44127. * }
  44128. *
  44129. * Foo.prototype.b = 2;
  44130. * Bar.prototype.d = 4;
  44131. *
  44132. * _.assignIn({ 'a': 0 }, new Foo, new Bar);
  44133. * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
  44134. */
  44135. var assignIn = createAssigner(function (object, source) {
  44136. copyObject(source, keysIn(source), object);
  44137. });
  44138. module.exports = assignIn;
  44139. /***/ }),
  44140. /* 573 */
  44141. /***/ (function(module, exports, __webpack_require__) {
  44142. 'use strict';
  44143. var copyObject = __webpack_require__(31),
  44144. createAssigner = __webpack_require__(103),
  44145. keysIn = __webpack_require__(47);
  44146. /**
  44147. * This method is like `_.assignIn` except that it accepts `customizer`
  44148. * which is invoked to produce the assigned values. If `customizer` returns
  44149. * `undefined`, assignment is handled by the method instead. The `customizer`
  44150. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  44151. *
  44152. * **Note:** This method mutates `object`.
  44153. *
  44154. * @static
  44155. * @memberOf _
  44156. * @since 4.0.0
  44157. * @alias extendWith
  44158. * @category Object
  44159. * @param {Object} object The destination object.
  44160. * @param {...Object} sources The source objects.
  44161. * @param {Function} [customizer] The function to customize assigned values.
  44162. * @returns {Object} Returns `object`.
  44163. * @see _.assignWith
  44164. * @example
  44165. *
  44166. * function customizer(objValue, srcValue) {
  44167. * return _.isUndefined(objValue) ? srcValue : objValue;
  44168. * }
  44169. *
  44170. * var defaults = _.partialRight(_.assignInWith, customizer);
  44171. *
  44172. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  44173. * // => { 'a': 1, 'b': 2 }
  44174. */
  44175. var assignInWith = createAssigner(function (object, source, srcIndex, customizer) {
  44176. copyObject(source, keysIn(source), object, customizer);
  44177. });
  44178. module.exports = assignInWith;
  44179. /***/ }),
  44180. /* 574 */
  44181. /***/ (function(module, exports, __webpack_require__) {
  44182. 'use strict';
  44183. var baseClone = __webpack_require__(164);
  44184. /** Used to compose bitmasks for cloning. */
  44185. var CLONE_DEEP_FLAG = 1,
  44186. CLONE_SYMBOLS_FLAG = 4;
  44187. /**
  44188. * This method is like `_.clone` except that it recursively clones `value`.
  44189. *
  44190. * @static
  44191. * @memberOf _
  44192. * @since 1.0.0
  44193. * @category Lang
  44194. * @param {*} value The value to recursively clone.
  44195. * @returns {*} Returns the deep cloned value.
  44196. * @see _.clone
  44197. * @example
  44198. *
  44199. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  44200. *
  44201. * var deep = _.cloneDeep(objects);
  44202. * console.log(deep[0] === objects[0]);
  44203. * // => false
  44204. */
  44205. function cloneDeep(value) {
  44206. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
  44207. }
  44208. module.exports = cloneDeep;
  44209. /***/ }),
  44210. /* 575 */
  44211. /***/ (function(module, exports, __webpack_require__) {
  44212. 'use strict';
  44213. var baseClone = __webpack_require__(164);
  44214. /** Used to compose bitmasks for cloning. */
  44215. var CLONE_DEEP_FLAG = 1,
  44216. CLONE_SYMBOLS_FLAG = 4;
  44217. /**
  44218. * This method is like `_.cloneWith` except that it recursively clones `value`.
  44219. *
  44220. * @static
  44221. * @memberOf _
  44222. * @since 4.0.0
  44223. * @category Lang
  44224. * @param {*} value The value to recursively clone.
  44225. * @param {Function} [customizer] The function to customize cloning.
  44226. * @returns {*} Returns the deep cloned value.
  44227. * @see _.cloneWith
  44228. * @example
  44229. *
  44230. * function customizer(value) {
  44231. * if (_.isElement(value)) {
  44232. * return value.cloneNode(true);
  44233. * }
  44234. * }
  44235. *
  44236. * var el = _.cloneDeepWith(document.body, customizer);
  44237. *
  44238. * console.log(el === document.body);
  44239. * // => false
  44240. * console.log(el.nodeName);
  44241. * // => 'BODY'
  44242. * console.log(el.childNodes.length);
  44243. * // => 20
  44244. */
  44245. function cloneDeepWith(value, customizer) {
  44246. customizer = typeof customizer == 'function' ? customizer : undefined;
  44247. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
  44248. }
  44249. module.exports = cloneDeepWith;
  44250. /***/ }),
  44251. /* 576 */
  44252. /***/ (function(module, exports) {
  44253. "use strict";
  44254. /**
  44255. * Creates a function that returns `value`.
  44256. *
  44257. * @static
  44258. * @memberOf _
  44259. * @since 2.4.0
  44260. * @category Util
  44261. * @param {*} value The value to return from the new function.
  44262. * @returns {Function} Returns the new constant function.
  44263. * @example
  44264. *
  44265. * var objects = _.times(2, _.constant({ 'a': 1 }));
  44266. *
  44267. * console.log(objects);
  44268. * // => [{ 'a': 1 }, { 'a': 1 }]
  44269. *
  44270. * console.log(objects[0] === objects[1]);
  44271. * // => true
  44272. */
  44273. function constant(value) {
  44274. return function () {
  44275. return value;
  44276. };
  44277. }
  44278. module.exports = constant;
  44279. /***/ }),
  44280. /* 577 */
  44281. /***/ (function(module, exports, __webpack_require__) {
  44282. 'use strict';
  44283. var toString = __webpack_require__(114);
  44284. /**
  44285. * Used to match `RegExp`
  44286. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  44287. */
  44288. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
  44289. reHasRegExpChar = RegExp(reRegExpChar.source);
  44290. /**
  44291. * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
  44292. * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
  44293. *
  44294. * @static
  44295. * @memberOf _
  44296. * @since 3.0.0
  44297. * @category String
  44298. * @param {string} [string=''] The string to escape.
  44299. * @returns {string} Returns the escaped string.
  44300. * @example
  44301. *
  44302. * _.escapeRegExp('[lodash](https://lodash.com/)');
  44303. * // => '\[lodash\]\(https://lodash\.com/\)'
  44304. */
  44305. function escapeRegExp(string) {
  44306. string = toString(string);
  44307. return string && reHasRegExpChar.test(string) ? string.replace(reRegExpChar, '\\$&') : string;
  44308. }
  44309. module.exports = escapeRegExp;
  44310. /***/ }),
  44311. /* 578 */
  44312. /***/ (function(module, exports, __webpack_require__) {
  44313. 'use strict';
  44314. module.exports = __webpack_require__(572);
  44315. /***/ }),
  44316. /* 579 */
  44317. /***/ (function(module, exports, __webpack_require__) {
  44318. 'use strict';
  44319. var createFind = __webpack_require__(258),
  44320. findIndex = __webpack_require__(580);
  44321. /**
  44322. * Iterates over elements of `collection`, returning the first element
  44323. * `predicate` returns truthy for. The predicate is invoked with three
  44324. * arguments: (value, index|key, collection).
  44325. *
  44326. * @static
  44327. * @memberOf _
  44328. * @since 0.1.0
  44329. * @category Collection
  44330. * @param {Array|Object} collection The collection to inspect.
  44331. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  44332. * @param {number} [fromIndex=0] The index to search from.
  44333. * @returns {*} Returns the matched element, else `undefined`.
  44334. * @example
  44335. *
  44336. * var users = [
  44337. * { 'user': 'barney', 'age': 36, 'active': true },
  44338. * { 'user': 'fred', 'age': 40, 'active': false },
  44339. * { 'user': 'pebbles', 'age': 1, 'active': true }
  44340. * ];
  44341. *
  44342. * _.find(users, function(o) { return o.age < 40; });
  44343. * // => object for 'barney'
  44344. *
  44345. * // The `_.matches` iteratee shorthand.
  44346. * _.find(users, { 'age': 1, 'active': true });
  44347. * // => object for 'pebbles'
  44348. *
  44349. * // The `_.matchesProperty` iteratee shorthand.
  44350. * _.find(users, ['active', false]);
  44351. * // => object for 'fred'
  44352. *
  44353. * // The `_.property` iteratee shorthand.
  44354. * _.find(users, 'active');
  44355. * // => object for 'barney'
  44356. */
  44357. var find = createFind(findIndex);
  44358. module.exports = find;
  44359. /***/ }),
  44360. /* 580 */
  44361. /***/ (function(module, exports, __webpack_require__) {
  44362. 'use strict';
  44363. var baseFindIndex = __webpack_require__(165),
  44364. baseIteratee = __webpack_require__(61),
  44365. toInteger = __webpack_require__(48);
  44366. /* Built-in method references for those with the same name as other `lodash` methods. */
  44367. var nativeMax = Math.max;
  44368. /**
  44369. * This method is like `_.find` except that it returns the index of the first
  44370. * element `predicate` returns truthy for instead of the element itself.
  44371. *
  44372. * @static
  44373. * @memberOf _
  44374. * @since 1.1.0
  44375. * @category Array
  44376. * @param {Array} array The array to inspect.
  44377. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  44378. * @param {number} [fromIndex=0] The index to search from.
  44379. * @returns {number} Returns the index of the found element, else `-1`.
  44380. * @example
  44381. *
  44382. * var users = [
  44383. * { 'user': 'barney', 'active': false },
  44384. * { 'user': 'fred', 'active': false },
  44385. * { 'user': 'pebbles', 'active': true }
  44386. * ];
  44387. *
  44388. * _.findIndex(users, function(o) { return o.user == 'barney'; });
  44389. * // => 0
  44390. *
  44391. * // The `_.matches` iteratee shorthand.
  44392. * _.findIndex(users, { 'user': 'fred', 'active': false });
  44393. * // => 1
  44394. *
  44395. * // The `_.matchesProperty` iteratee shorthand.
  44396. * _.findIndex(users, ['active', false]);
  44397. * // => 0
  44398. *
  44399. * // The `_.property` iteratee shorthand.
  44400. * _.findIndex(users, 'active');
  44401. * // => 2
  44402. */
  44403. function findIndex(array, predicate, fromIndex) {
  44404. var length = array == null ? 0 : array.length;
  44405. if (!length) {
  44406. return -1;
  44407. }
  44408. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  44409. if (index < 0) {
  44410. index = nativeMax(length + index, 0);
  44411. }
  44412. return baseFindIndex(array, baseIteratee(predicate, 3), index);
  44413. }
  44414. module.exports = findIndex;
  44415. /***/ }),
  44416. /* 581 */
  44417. /***/ (function(module, exports, __webpack_require__) {
  44418. 'use strict';
  44419. var createFind = __webpack_require__(258),
  44420. findLastIndex = __webpack_require__(582);
  44421. /**
  44422. * This method is like `_.find` except that it iterates over elements of
  44423. * `collection` from right to left.
  44424. *
  44425. * @static
  44426. * @memberOf _
  44427. * @since 2.0.0
  44428. * @category Collection
  44429. * @param {Array|Object} collection The collection to inspect.
  44430. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  44431. * @param {number} [fromIndex=collection.length-1] The index to search from.
  44432. * @returns {*} Returns the matched element, else `undefined`.
  44433. * @example
  44434. *
  44435. * _.findLast([1, 2, 3, 4], function(n) {
  44436. * return n % 2 == 1;
  44437. * });
  44438. * // => 3
  44439. */
  44440. var findLast = createFind(findLastIndex);
  44441. module.exports = findLast;
  44442. /***/ }),
  44443. /* 582 */
  44444. /***/ (function(module, exports, __webpack_require__) {
  44445. 'use strict';
  44446. var baseFindIndex = __webpack_require__(165),
  44447. baseIteratee = __webpack_require__(61),
  44448. toInteger = __webpack_require__(48);
  44449. /* Built-in method references for those with the same name as other `lodash` methods. */
  44450. var nativeMax = Math.max,
  44451. nativeMin = Math.min;
  44452. /**
  44453. * This method is like `_.findIndex` except that it iterates over elements
  44454. * of `collection` from right to left.
  44455. *
  44456. * @static
  44457. * @memberOf _
  44458. * @since 2.0.0
  44459. * @category Array
  44460. * @param {Array} array The array to inspect.
  44461. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  44462. * @param {number} [fromIndex=array.length-1] The index to search from.
  44463. * @returns {number} Returns the index of the found element, else `-1`.
  44464. * @example
  44465. *
  44466. * var users = [
  44467. * { 'user': 'barney', 'active': true },
  44468. * { 'user': 'fred', 'active': false },
  44469. * { 'user': 'pebbles', 'active': false }
  44470. * ];
  44471. *
  44472. * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
  44473. * // => 2
  44474. *
  44475. * // The `_.matches` iteratee shorthand.
  44476. * _.findLastIndex(users, { 'user': 'barney', 'active': true });
  44477. * // => 0
  44478. *
  44479. * // The `_.matchesProperty` iteratee shorthand.
  44480. * _.findLastIndex(users, ['active', false]);
  44481. * // => 2
  44482. *
  44483. * // The `_.property` iteratee shorthand.
  44484. * _.findLastIndex(users, 'active');
  44485. * // => 0
  44486. */
  44487. function findLastIndex(array, predicate, fromIndex) {
  44488. var length = array == null ? 0 : array.length;
  44489. if (!length) {
  44490. return -1;
  44491. }
  44492. var index = length - 1;
  44493. if (fromIndex !== undefined) {
  44494. index = toInteger(fromIndex);
  44495. index = fromIndex < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
  44496. }
  44497. return baseFindIndex(array, baseIteratee(predicate, 3), index, true);
  44498. }
  44499. module.exports = findLastIndex;
  44500. /***/ }),
  44501. /* 583 */
  44502. /***/ (function(module, exports, __webpack_require__) {
  44503. 'use strict';
  44504. var baseGet = __webpack_require__(249);
  44505. /**
  44506. * Gets the value at `path` of `object`. If the resolved value is
  44507. * `undefined`, the `defaultValue` is returned in its place.
  44508. *
  44509. * @static
  44510. * @memberOf _
  44511. * @since 3.7.0
  44512. * @category Object
  44513. * @param {Object} object The object to query.
  44514. * @param {Array|string} path The path of the property to get.
  44515. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  44516. * @returns {*} Returns the resolved value.
  44517. * @example
  44518. *
  44519. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  44520. *
  44521. * _.get(object, 'a[0].b.c');
  44522. * // => 3
  44523. *
  44524. * _.get(object, ['a', '0', 'b', 'c']);
  44525. * // => 3
  44526. *
  44527. * _.get(object, 'a.b.c', 'default');
  44528. * // => 'default'
  44529. */
  44530. function get(object, path, defaultValue) {
  44531. var result = object == null ? undefined : baseGet(object, path);
  44532. return result === undefined ? defaultValue : result;
  44533. }
  44534. module.exports = get;
  44535. /***/ }),
  44536. /* 584 */
  44537. /***/ (function(module, exports, __webpack_require__) {
  44538. 'use strict';
  44539. var baseHasIn = __webpack_require__(491),
  44540. hasPath = __webpack_require__(265);
  44541. /**
  44542. * Checks if `path` is a direct or inherited property of `object`.
  44543. *
  44544. * @static
  44545. * @memberOf _
  44546. * @since 4.0.0
  44547. * @category Object
  44548. * @param {Object} object The object to query.
  44549. * @param {Array|string} path The path to check.
  44550. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  44551. * @example
  44552. *
  44553. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  44554. *
  44555. * _.hasIn(object, 'a');
  44556. * // => true
  44557. *
  44558. * _.hasIn(object, 'a.b');
  44559. * // => true
  44560. *
  44561. * _.hasIn(object, ['a', 'b']);
  44562. * // => true
  44563. *
  44564. * _.hasIn(object, 'b');
  44565. * // => false
  44566. */
  44567. function hasIn(object, path) {
  44568. return object != null && hasPath(object, path, baseHasIn);
  44569. }
  44570. module.exports = hasIn;
  44571. /***/ }),
  44572. /* 585 */
  44573. /***/ (function(module, exports, __webpack_require__) {
  44574. 'use strict';
  44575. var isArrayLike = __webpack_require__(24),
  44576. isObjectLike = __webpack_require__(25);
  44577. /**
  44578. * This method is like `_.isArrayLike` except that it also checks if `value`
  44579. * is an object.
  44580. *
  44581. * @static
  44582. * @memberOf _
  44583. * @since 4.0.0
  44584. * @category Lang
  44585. * @param {*} value The value to check.
  44586. * @returns {boolean} Returns `true` if `value` is an array-like object,
  44587. * else `false`.
  44588. * @example
  44589. *
  44590. * _.isArrayLikeObject([1, 2, 3]);
  44591. * // => true
  44592. *
  44593. * _.isArrayLikeObject(document.body.children);
  44594. * // => true
  44595. *
  44596. * _.isArrayLikeObject('abc');
  44597. * // => false
  44598. *
  44599. * _.isArrayLikeObject(_.noop);
  44600. * // => false
  44601. */
  44602. function isArrayLikeObject(value) {
  44603. return isObjectLike(value) && isArrayLike(value);
  44604. }
  44605. module.exports = isArrayLikeObject;
  44606. /***/ }),
  44607. /* 586 */
  44608. /***/ (function(module, exports, __webpack_require__) {
  44609. 'use strict';
  44610. var toInteger = __webpack_require__(48);
  44611. /**
  44612. * Checks if `value` is an integer.
  44613. *
  44614. * **Note:** This method is based on
  44615. * [`Number.isInteger`](https://mdn.io/Number/isInteger).
  44616. *
  44617. * @static
  44618. * @memberOf _
  44619. * @since 4.0.0
  44620. * @category Lang
  44621. * @param {*} value The value to check.
  44622. * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
  44623. * @example
  44624. *
  44625. * _.isInteger(3);
  44626. * // => true
  44627. *
  44628. * _.isInteger(Number.MIN_VALUE);
  44629. * // => false
  44630. *
  44631. * _.isInteger(Infinity);
  44632. * // => false
  44633. *
  44634. * _.isInteger('3');
  44635. * // => false
  44636. */
  44637. function isInteger(value) {
  44638. return typeof value == 'number' && value == toInteger(value);
  44639. }
  44640. module.exports = isInteger;
  44641. /***/ }),
  44642. /* 587 */
  44643. /***/ (function(module, exports, __webpack_require__) {
  44644. 'use strict';
  44645. var baseGetTag = __webpack_require__(30),
  44646. isArray = __webpack_require__(6),
  44647. isObjectLike = __webpack_require__(25);
  44648. /** `Object#toString` result references. */
  44649. var stringTag = '[object String]';
  44650. /**
  44651. * Checks if `value` is classified as a `String` primitive or object.
  44652. *
  44653. * @static
  44654. * @since 0.1.0
  44655. * @memberOf _
  44656. * @category Lang
  44657. * @param {*} value The value to check.
  44658. * @returns {boolean} Returns `true` if `value` is a string, else `false`.
  44659. * @example
  44660. *
  44661. * _.isString('abc');
  44662. * // => true
  44663. *
  44664. * _.isString(1);
  44665. * // => false
  44666. */
  44667. function isString(value) {
  44668. return typeof value == 'string' || !isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag;
  44669. }
  44670. module.exports = isString;
  44671. /***/ }),
  44672. /* 588 */
  44673. /***/ (function(module, exports, __webpack_require__) {
  44674. 'use strict';
  44675. var arrayMap = __webpack_require__(60),
  44676. baseIteratee = __webpack_require__(61),
  44677. baseMap = __webpack_require__(252),
  44678. isArray = __webpack_require__(6);
  44679. /**
  44680. * Creates an array of values by running each element in `collection` thru
  44681. * `iteratee`. The iteratee is invoked with three arguments:
  44682. * (value, index|key, collection).
  44683. *
  44684. * Many lodash methods are guarded to work as iteratees for methods like
  44685. * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
  44686. *
  44687. * The guarded methods are:
  44688. * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
  44689. * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
  44690. * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
  44691. * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
  44692. *
  44693. * @static
  44694. * @memberOf _
  44695. * @since 0.1.0
  44696. * @category Collection
  44697. * @param {Array|Object} collection The collection to iterate over.
  44698. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  44699. * @returns {Array} Returns the new mapped array.
  44700. * @example
  44701. *
  44702. * function square(n) {
  44703. * return n * n;
  44704. * }
  44705. *
  44706. * _.map([4, 8], square);
  44707. * // => [16, 64]
  44708. *
  44709. * _.map({ 'a': 4, 'b': 8 }, square);
  44710. * // => [16, 64] (iteration order is not guaranteed)
  44711. *
  44712. * var users = [
  44713. * { 'user': 'barney' },
  44714. * { 'user': 'fred' }
  44715. * ];
  44716. *
  44717. * // The `_.property` iteratee shorthand.
  44718. * _.map(users, 'user');
  44719. * // => ['barney', 'fred']
  44720. */
  44721. function map(collection, iteratee) {
  44722. var func = isArray(collection) ? arrayMap : baseMap;
  44723. return func(collection, baseIteratee(iteratee, 3));
  44724. }
  44725. module.exports = map;
  44726. /***/ }),
  44727. /* 589 */
  44728. /***/ (function(module, exports, __webpack_require__) {
  44729. 'use strict';
  44730. var MapCache = __webpack_require__(160);
  44731. /** Error message constants. */
  44732. var FUNC_ERROR_TEXT = 'Expected a function';
  44733. /**
  44734. * Creates a function that memoizes the result of `func`. If `resolver` is
  44735. * provided, it determines the cache key for storing the result based on the
  44736. * arguments provided to the memoized function. By default, the first argument
  44737. * provided to the memoized function is used as the map cache key. The `func`
  44738. * is invoked with the `this` binding of the memoized function.
  44739. *
  44740. * **Note:** The cache is exposed as the `cache` property on the memoized
  44741. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  44742. * constructor with one whose instances implement the
  44743. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  44744. * method interface of `clear`, `delete`, `get`, `has`, and `set`.
  44745. *
  44746. * @static
  44747. * @memberOf _
  44748. * @since 0.1.0
  44749. * @category Function
  44750. * @param {Function} func The function to have its output memoized.
  44751. * @param {Function} [resolver] The function to resolve the cache key.
  44752. * @returns {Function} Returns the new memoized function.
  44753. * @example
  44754. *
  44755. * var object = { 'a': 1, 'b': 2 };
  44756. * var other = { 'c': 3, 'd': 4 };
  44757. *
  44758. * var values = _.memoize(_.values);
  44759. * values(object);
  44760. * // => [1, 2]
  44761. *
  44762. * values(other);
  44763. * // => [3, 4]
  44764. *
  44765. * object.a = 2;
  44766. * values(object);
  44767. * // => [1, 2]
  44768. *
  44769. * // Modify the result cache.
  44770. * values.cache.set(object, ['a', 'b']);
  44771. * values(object);
  44772. * // => ['a', 'b']
  44773. *
  44774. * // Replace `_.memoize.Cache`.
  44775. * _.memoize.Cache = WeakMap;
  44776. */
  44777. function memoize(func, resolver) {
  44778. if (typeof func != 'function' || resolver != null && typeof resolver != 'function') {
  44779. throw new TypeError(FUNC_ERROR_TEXT);
  44780. }
  44781. var memoized = function memoized() {
  44782. var args = arguments,
  44783. key = resolver ? resolver.apply(this, args) : args[0],
  44784. cache = memoized.cache;
  44785. if (cache.has(key)) {
  44786. return cache.get(key);
  44787. }
  44788. var result = func.apply(this, args);
  44789. memoized.cache = cache.set(key, result) || cache;
  44790. return result;
  44791. };
  44792. memoized.cache = new (memoize.Cache || MapCache)();
  44793. return memoized;
  44794. }
  44795. // Expose `MapCache`.
  44796. memoize.Cache = MapCache;
  44797. module.exports = memoize;
  44798. /***/ }),
  44799. /* 590 */
  44800. /***/ (function(module, exports, __webpack_require__) {
  44801. 'use strict';
  44802. var baseMerge = __webpack_require__(504),
  44803. createAssigner = __webpack_require__(103);
  44804. /**
  44805. * This method is like `_.merge` except that it accepts `customizer` which
  44806. * is invoked to produce the merged values of the destination and source
  44807. * properties. If `customizer` returns `undefined`, merging is handled by the
  44808. * method instead. The `customizer` is invoked with six arguments:
  44809. * (objValue, srcValue, key, object, source, stack).
  44810. *
  44811. * **Note:** This method mutates `object`.
  44812. *
  44813. * @static
  44814. * @memberOf _
  44815. * @since 4.0.0
  44816. * @category Object
  44817. * @param {Object} object The destination object.
  44818. * @param {...Object} sources The source objects.
  44819. * @param {Function} customizer The function to customize assigned values.
  44820. * @returns {Object} Returns `object`.
  44821. * @example
  44822. *
  44823. * function customizer(objValue, srcValue) {
  44824. * if (_.isArray(objValue)) {
  44825. * return objValue.concat(srcValue);
  44826. * }
  44827. * }
  44828. *
  44829. * var object = { 'a': [1], 'b': [2] };
  44830. * var other = { 'a': [3], 'b': [4] };
  44831. *
  44832. * _.mergeWith(object, other, customizer);
  44833. * // => { 'a': [1, 3], 'b': [2, 4] }
  44834. */
  44835. var mergeWith = createAssigner(function (object, source, srcIndex, customizer) {
  44836. baseMerge(object, source, srcIndex, customizer);
  44837. });
  44838. module.exports = mergeWith;
  44839. /***/ }),
  44840. /* 591 */
  44841. /***/ (function(module, exports) {
  44842. "use strict";
  44843. /**
  44844. * This method returns `undefined`.
  44845. *
  44846. * @static
  44847. * @memberOf _
  44848. * @since 2.3.0
  44849. * @category Util
  44850. * @example
  44851. *
  44852. * _.times(2, _.noop);
  44853. * // => [undefined, undefined]
  44854. */
  44855. function noop() {
  44856. // No operation performed.
  44857. }
  44858. module.exports = noop;
  44859. /***/ }),
  44860. /* 592 */
  44861. /***/ (function(module, exports, __webpack_require__) {
  44862. 'use strict';
  44863. var baseProperty = __webpack_require__(507),
  44864. basePropertyDeep = __webpack_require__(508),
  44865. isKey = __webpack_require__(173),
  44866. toKey = __webpack_require__(108);
  44867. /**
  44868. * Creates a function that returns the value at `path` of a given object.
  44869. *
  44870. * @static
  44871. * @memberOf _
  44872. * @since 2.4.0
  44873. * @category Util
  44874. * @param {Array|string} path The path of the property to get.
  44875. * @returns {Function} Returns the new accessor function.
  44876. * @example
  44877. *
  44878. * var objects = [
  44879. * { 'a': { 'b': 2 } },
  44880. * { 'a': { 'b': 1 } }
  44881. * ];
  44882. *
  44883. * _.map(objects, _.property('a.b'));
  44884. * // => [2, 1]
  44885. *
  44886. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  44887. * // => [1, 2]
  44888. */
  44889. function property(path) {
  44890. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  44891. }
  44892. module.exports = property;
  44893. /***/ }),
  44894. /* 593 */
  44895. /***/ (function(module, exports, __webpack_require__) {
  44896. 'use strict';
  44897. var basePullAll = __webpack_require__(509);
  44898. /**
  44899. * This method is like `_.pull` except that it accepts an array of values to remove.
  44900. *
  44901. * **Note:** Unlike `_.difference`, this method mutates `array`.
  44902. *
  44903. * @static
  44904. * @memberOf _
  44905. * @since 4.0.0
  44906. * @category Array
  44907. * @param {Array} array The array to modify.
  44908. * @param {Array} values The values to remove.
  44909. * @returns {Array} Returns `array`.
  44910. * @example
  44911. *
  44912. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  44913. *
  44914. * _.pullAll(array, ['a', 'c']);
  44915. * console.log(array);
  44916. * // => ['b', 'b']
  44917. */
  44918. function pullAll(array, values) {
  44919. return array && array.length && values && values.length ? basePullAll(array, values) : array;
  44920. }
  44921. module.exports = pullAll;
  44922. /***/ }),
  44923. /* 594 */
  44924. /***/ (function(module, exports, __webpack_require__) {
  44925. 'use strict';
  44926. var baseFlatten = __webpack_require__(488),
  44927. baseOrderBy = __webpack_require__(506),
  44928. baseRest = __webpack_require__(101),
  44929. isIterateeCall = __webpack_require__(172);
  44930. /**
  44931. * Creates an array of elements, sorted in ascending order by the results of
  44932. * running each element in a collection thru each iteratee. This method
  44933. * performs a stable sort, that is, it preserves the original sort order of
  44934. * equal elements. The iteratees are invoked with one argument: (value).
  44935. *
  44936. * @static
  44937. * @memberOf _
  44938. * @since 0.1.0
  44939. * @category Collection
  44940. * @param {Array|Object} collection The collection to iterate over.
  44941. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  44942. * The iteratees to sort by.
  44943. * @returns {Array} Returns the new sorted array.
  44944. * @example
  44945. *
  44946. * var users = [
  44947. * { 'user': 'fred', 'age': 48 },
  44948. * { 'user': 'barney', 'age': 36 },
  44949. * { 'user': 'fred', 'age': 40 },
  44950. * { 'user': 'barney', 'age': 34 }
  44951. * ];
  44952. *
  44953. * _.sortBy(users, [function(o) { return o.user; }]);
  44954. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  44955. *
  44956. * _.sortBy(users, ['user', 'age']);
  44957. * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]]
  44958. */
  44959. var sortBy = baseRest(function (collection, iteratees) {
  44960. if (collection == null) {
  44961. return [];
  44962. }
  44963. var length = iteratees.length;
  44964. if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
  44965. iteratees = [];
  44966. } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
  44967. iteratees = [iteratees[0]];
  44968. }
  44969. return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
  44970. });
  44971. module.exports = sortBy;
  44972. /***/ }),
  44973. /* 595 */
  44974. /***/ (function(module, exports, __webpack_require__) {
  44975. 'use strict';
  44976. var baseClamp = __webpack_require__(485),
  44977. baseToString = __webpack_require__(253),
  44978. toInteger = __webpack_require__(48),
  44979. toString = __webpack_require__(114);
  44980. /**
  44981. * Checks if `string` starts with the given target string.
  44982. *
  44983. * @static
  44984. * @memberOf _
  44985. * @since 3.0.0
  44986. * @category String
  44987. * @param {string} [string=''] The string to inspect.
  44988. * @param {string} [target] The string to search for.
  44989. * @param {number} [position=0] The position to search from.
  44990. * @returns {boolean} Returns `true` if `string` starts with `target`,
  44991. * else `false`.
  44992. * @example
  44993. *
  44994. * _.startsWith('abc', 'a');
  44995. * // => true
  44996. *
  44997. * _.startsWith('abc', 'b');
  44998. * // => false
  44999. *
  45000. * _.startsWith('abc', 'b', 1);
  45001. * // => true
  45002. */
  45003. function startsWith(string, target, position) {
  45004. string = toString(string);
  45005. position = position == null ? 0 : baseClamp(toInteger(position), 0, string.length);
  45006. target = baseToString(target);
  45007. return string.slice(position, position + target.length) == target;
  45008. }
  45009. module.exports = startsWith;
  45010. /***/ }),
  45011. /* 596 */
  45012. /***/ (function(module, exports) {
  45013. "use strict";
  45014. /**
  45015. * This method returns `false`.
  45016. *
  45017. * @static
  45018. * @memberOf _
  45019. * @since 4.13.0
  45020. * @category Util
  45021. * @returns {boolean} Returns `false`.
  45022. * @example
  45023. *
  45024. * _.times(2, _.stubFalse);
  45025. * // => [false, false]
  45026. */
  45027. function stubFalse() {
  45028. return false;
  45029. }
  45030. module.exports = stubFalse;
  45031. /***/ }),
  45032. /* 597 */
  45033. /***/ (function(module, exports, __webpack_require__) {
  45034. 'use strict';
  45035. var toNumber = __webpack_require__(598);
  45036. /** Used as references for various `Number` constants. */
  45037. var INFINITY = 1 / 0,
  45038. MAX_INTEGER = 1.7976931348623157e+308;
  45039. /**
  45040. * Converts `value` to a finite number.
  45041. *
  45042. * @static
  45043. * @memberOf _
  45044. * @since 4.12.0
  45045. * @category Lang
  45046. * @param {*} value The value to convert.
  45047. * @returns {number} Returns the converted number.
  45048. * @example
  45049. *
  45050. * _.toFinite(3.2);
  45051. * // => 3.2
  45052. *
  45053. * _.toFinite(Number.MIN_VALUE);
  45054. * // => 5e-324
  45055. *
  45056. * _.toFinite(Infinity);
  45057. * // => 1.7976931348623157e+308
  45058. *
  45059. * _.toFinite('3.2');
  45060. * // => 3.2
  45061. */
  45062. function toFinite(value) {
  45063. if (!value) {
  45064. return value === 0 ? value : 0;
  45065. }
  45066. value = toNumber(value);
  45067. if (value === INFINITY || value === -INFINITY) {
  45068. var sign = value < 0 ? -1 : 1;
  45069. return sign * MAX_INTEGER;
  45070. }
  45071. return value === value ? value : 0;
  45072. }
  45073. module.exports = toFinite;
  45074. /***/ }),
  45075. /* 598 */
  45076. /***/ (function(module, exports, __webpack_require__) {
  45077. 'use strict';
  45078. var isObject = __webpack_require__(18),
  45079. isSymbol = __webpack_require__(62);
  45080. /** Used as references for various `Number` constants. */
  45081. var NAN = 0 / 0;
  45082. /** Used to match leading and trailing whitespace. */
  45083. var reTrim = /^\s+|\s+$/g;
  45084. /** Used to detect bad signed hexadecimal string values. */
  45085. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  45086. /** Used to detect binary string values. */
  45087. var reIsBinary = /^0b[01]+$/i;
  45088. /** Used to detect octal string values. */
  45089. var reIsOctal = /^0o[0-7]+$/i;
  45090. /** Built-in method references without a dependency on `root`. */
  45091. var freeParseInt = parseInt;
  45092. /**
  45093. * Converts `value` to a number.
  45094. *
  45095. * @static
  45096. * @memberOf _
  45097. * @since 4.0.0
  45098. * @category Lang
  45099. * @param {*} value The value to process.
  45100. * @returns {number} Returns the number.
  45101. * @example
  45102. *
  45103. * _.toNumber(3.2);
  45104. * // => 3.2
  45105. *
  45106. * _.toNumber(Number.MIN_VALUE);
  45107. * // => 5e-324
  45108. *
  45109. * _.toNumber(Infinity);
  45110. * // => Infinity
  45111. *
  45112. * _.toNumber('3.2');
  45113. * // => 3.2
  45114. */
  45115. function toNumber(value) {
  45116. if (typeof value == 'number') {
  45117. return value;
  45118. }
  45119. if (isSymbol(value)) {
  45120. return NAN;
  45121. }
  45122. if (isObject(value)) {
  45123. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  45124. value = isObject(other) ? other + '' : other;
  45125. }
  45126. if (typeof value != 'string') {
  45127. return value === 0 ? value : +value;
  45128. }
  45129. value = value.replace(reTrim, '');
  45130. var isBinary = reIsBinary.test(value);
  45131. return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
  45132. }
  45133. module.exports = toNumber;
  45134. /***/ }),
  45135. /* 599 */
  45136. /***/ (function(module, exports, __webpack_require__) {
  45137. 'use strict';
  45138. var copyObject = __webpack_require__(31),
  45139. keysIn = __webpack_require__(47);
  45140. /**
  45141. * Converts `value` to a plain object flattening inherited enumerable string
  45142. * keyed properties of `value` to own properties of the plain object.
  45143. *
  45144. * @static
  45145. * @memberOf _
  45146. * @since 3.0.0
  45147. * @category Lang
  45148. * @param {*} value The value to convert.
  45149. * @returns {Object} Returns the converted plain object.
  45150. * @example
  45151. *
  45152. * function Foo() {
  45153. * this.b = 2;
  45154. * }
  45155. *
  45156. * Foo.prototype.c = 3;
  45157. *
  45158. * _.assign({ 'a': 1 }, new Foo);
  45159. * // => { 'a': 1, 'b': 2 }
  45160. *
  45161. * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
  45162. * // => { 'a': 1, 'b': 2, 'c': 3 }
  45163. */
  45164. function toPlainObject(value) {
  45165. return copyObject(value, keysIn(value));
  45166. }
  45167. module.exports = toPlainObject;
  45168. /***/ }),
  45169. /* 600 */
  45170. /***/ (function(module, exports, __webpack_require__) {
  45171. 'use strict';
  45172. var baseUniq = __webpack_require__(514);
  45173. /**
  45174. * Creates a duplicate-free version of an array, using
  45175. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  45176. * for equality comparisons, in which only the first occurrence of each element
  45177. * is kept. The order of result values is determined by the order they occur
  45178. * in the array.
  45179. *
  45180. * @static
  45181. * @memberOf _
  45182. * @since 0.1.0
  45183. * @category Array
  45184. * @param {Array} array The array to inspect.
  45185. * @returns {Array} Returns the new duplicate free array.
  45186. * @example
  45187. *
  45188. * _.uniq([2, 1, 2]);
  45189. * // => [2, 1]
  45190. */
  45191. function uniq(array) {
  45192. return array && array.length ? baseUniq(array) : [];
  45193. }
  45194. module.exports = uniq;
  45195. /***/ }),
  45196. /* 601 */
  45197. /***/ (function(module, exports, __webpack_require__) {
  45198. 'use strict';
  45199. module.exports = minimatch;
  45200. minimatch.Minimatch = Minimatch;
  45201. var path = { sep: '/' };
  45202. try {
  45203. path = __webpack_require__(19);
  45204. } catch (er) {}
  45205. var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {};
  45206. var expand = __webpack_require__(398);
  45207. var plTypes = {
  45208. '!': { open: '(?:(?!(?:', close: '))[^/]*?)' },
  45209. '?': { open: '(?:', close: ')?' },
  45210. '+': { open: '(?:', close: ')+' },
  45211. '*': { open: '(?:', close: ')*' },
  45212. '@': { open: '(?:', close: ')' }
  45213. // any single thing other than /
  45214. // don't need to escape / when using new RegExp()
  45215. };var qmark = '[^/]';
  45216. // * => any number of characters
  45217. var star = qmark + '*?';
  45218. // ** when dots are allowed. Anything goes, except .. and .
  45219. // not (^ or / followed by one or two dots followed by $ or /),
  45220. // followed by anything, any number of times.
  45221. var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?';
  45222. // not a ^ or / followed by a dot,
  45223. // followed by anything, any number of times.
  45224. var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?';
  45225. // characters that need to be escaped in RegExp.
  45226. var reSpecials = charSet('().*{}+?[]^$\\!');
  45227. // "abc" -> { a:true, b:true, c:true }
  45228. function charSet(s) {
  45229. return s.split('').reduce(function (set, c) {
  45230. set[c] = true;
  45231. return set;
  45232. }, {});
  45233. }
  45234. // normalizes slashes.
  45235. var slashSplit = /\/+/;
  45236. minimatch.filter = filter;
  45237. function filter(pattern, options) {
  45238. options = options || {};
  45239. return function (p, i, list) {
  45240. return minimatch(p, pattern, options);
  45241. };
  45242. }
  45243. function ext(a, b) {
  45244. a = a || {};
  45245. b = b || {};
  45246. var t = {};
  45247. Object.keys(b).forEach(function (k) {
  45248. t[k] = b[k];
  45249. });
  45250. Object.keys(a).forEach(function (k) {
  45251. t[k] = a[k];
  45252. });
  45253. return t;
  45254. }
  45255. minimatch.defaults = function (def) {
  45256. if (!def || !Object.keys(def).length) return minimatch;
  45257. var orig = minimatch;
  45258. var m = function minimatch(p, pattern, options) {
  45259. return orig.minimatch(p, pattern, ext(def, options));
  45260. };
  45261. m.Minimatch = function Minimatch(pattern, options) {
  45262. return new orig.Minimatch(pattern, ext(def, options));
  45263. };
  45264. return m;
  45265. };
  45266. Minimatch.defaults = function (def) {
  45267. if (!def || !Object.keys(def).length) return Minimatch;
  45268. return minimatch.defaults(def).Minimatch;
  45269. };
  45270. function minimatch(p, pattern, options) {
  45271. if (typeof pattern !== 'string') {
  45272. throw new TypeError('glob pattern string required');
  45273. }
  45274. if (!options) options = {};
  45275. // shortcut: comments match nothing.
  45276. if (!options.nocomment && pattern.charAt(0) === '#') {
  45277. return false;
  45278. }
  45279. // "" only matches ""
  45280. if (pattern.trim() === '') return p === '';
  45281. return new Minimatch(pattern, options).match(p);
  45282. }
  45283. function Minimatch(pattern, options) {
  45284. if (!(this instanceof Minimatch)) {
  45285. return new Minimatch(pattern, options);
  45286. }
  45287. if (typeof pattern !== 'string') {
  45288. throw new TypeError('glob pattern string required');
  45289. }
  45290. if (!options) options = {};
  45291. pattern = pattern.trim();
  45292. // windows support: need to use /, not \
  45293. if (path.sep !== '/') {
  45294. pattern = pattern.split(path.sep).join('/');
  45295. }
  45296. this.options = options;
  45297. this.set = [];
  45298. this.pattern = pattern;
  45299. this.regexp = null;
  45300. this.negate = false;
  45301. this.comment = false;
  45302. this.empty = false;
  45303. // make the set of regexps etc.
  45304. this.make();
  45305. }
  45306. Minimatch.prototype.debug = function () {};
  45307. Minimatch.prototype.make = make;
  45308. function make() {
  45309. // don't do it more than once.
  45310. if (this._made) return;
  45311. var pattern = this.pattern;
  45312. var options = this.options;
  45313. // empty patterns and comments match nothing.
  45314. if (!options.nocomment && pattern.charAt(0) === '#') {
  45315. this.comment = true;
  45316. return;
  45317. }
  45318. if (!pattern) {
  45319. this.empty = true;
  45320. return;
  45321. }
  45322. // step 1: figure out negation, etc.
  45323. this.parseNegate();
  45324. // step 2: expand braces
  45325. var set = this.globSet = this.braceExpand();
  45326. if (options.debug) this.debug = console.error;
  45327. this.debug(this.pattern, set);
  45328. // step 3: now we have a set, so turn each one into a series of path-portion
  45329. // matching patterns.
  45330. // These will be regexps, except in the case of "**", which is
  45331. // set to the GLOBSTAR object for globstar behavior,
  45332. // and will not contain any / characters
  45333. set = this.globParts = set.map(function (s) {
  45334. return s.split(slashSplit);
  45335. });
  45336. this.debug(this.pattern, set);
  45337. // glob --> regexps
  45338. set = set.map(function (s, si, set) {
  45339. return s.map(this.parse, this);
  45340. }, this);
  45341. this.debug(this.pattern, set);
  45342. // filter out everything that didn't compile properly.
  45343. set = set.filter(function (s) {
  45344. return s.indexOf(false) === -1;
  45345. });
  45346. this.debug(this.pattern, set);
  45347. this.set = set;
  45348. }
  45349. Minimatch.prototype.parseNegate = parseNegate;
  45350. function parseNegate() {
  45351. var pattern = this.pattern;
  45352. var negate = false;
  45353. var options = this.options;
  45354. var negateOffset = 0;
  45355. if (options.nonegate) return;
  45356. for (var i = 0, l = pattern.length; i < l && pattern.charAt(i) === '!'; i++) {
  45357. negate = !negate;
  45358. negateOffset++;
  45359. }
  45360. if (negateOffset) this.pattern = pattern.substr(negateOffset);
  45361. this.negate = negate;
  45362. }
  45363. // Brace expansion:
  45364. // a{b,c}d -> abd acd
  45365. // a{b,}c -> abc ac
  45366. // a{0..3}d -> a0d a1d a2d a3d
  45367. // a{b,c{d,e}f}g -> abg acdfg acefg
  45368. // a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg
  45369. //
  45370. // Invalid sets are not expanded.
  45371. // a{2..}b -> a{2..}b
  45372. // a{b}c -> a{b}c
  45373. minimatch.braceExpand = function (pattern, options) {
  45374. return braceExpand(pattern, options);
  45375. };
  45376. Minimatch.prototype.braceExpand = braceExpand;
  45377. function braceExpand(pattern, options) {
  45378. if (!options) {
  45379. if (this instanceof Minimatch) {
  45380. options = this.options;
  45381. } else {
  45382. options = {};
  45383. }
  45384. }
  45385. pattern = typeof pattern === 'undefined' ? this.pattern : pattern;
  45386. if (typeof pattern === 'undefined') {
  45387. throw new TypeError('undefined pattern');
  45388. }
  45389. if (options.nobrace || !pattern.match(/\{.*\}/)) {
  45390. // shortcut. no need to expand.
  45391. return [pattern];
  45392. }
  45393. return expand(pattern);
  45394. }
  45395. // parse a component of the expanded set.
  45396. // At this point, no pattern may contain "/" in it
  45397. // so we're going to return a 2d array, where each entry is the full
  45398. // pattern, split on '/', and then turned into a regular expression.
  45399. // A regexp is made at the end which joins each array with an
  45400. // escaped /, and another full one which joins each regexp with |.
  45401. //
  45402. // Following the lead of Bash 4.1, note that "**" only has special meaning
  45403. // when it is the *only* thing in a path portion. Otherwise, any series
  45404. // of * is equivalent to a single *. Globstar behavior is enabled by
  45405. // default, and can be disabled by setting options.noglobstar.
  45406. Minimatch.prototype.parse = parse;
  45407. var SUBPARSE = {};
  45408. function parse(pattern, isSub) {
  45409. if (pattern.length > 1024 * 64) {
  45410. throw new TypeError('pattern is too long');
  45411. }
  45412. var options = this.options;
  45413. // shortcuts
  45414. if (!options.noglobstar && pattern === '**') return GLOBSTAR;
  45415. if (pattern === '') return '';
  45416. var re = '';
  45417. var hasMagic = !!options.nocase;
  45418. var escaping = false;
  45419. // ? => one single character
  45420. var patternListStack = [];
  45421. var negativeLists = [];
  45422. var stateChar;
  45423. var inClass = false;
  45424. var reClassStart = -1;
  45425. var classStart = -1;
  45426. // . and .. never match anything that doesn't start with .,
  45427. // even when options.dot is set.
  45428. var patternStart = pattern.charAt(0) === '.' ? '' // anything
  45429. // not (start or / followed by . or .. followed by / or end)
  45430. : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))' : '(?!\\.)';
  45431. var self = this;
  45432. function clearStateChar() {
  45433. if (stateChar) {
  45434. // we had some state-tracking character
  45435. // that wasn't consumed by this pass.
  45436. switch (stateChar) {
  45437. case '*':
  45438. re += star;
  45439. hasMagic = true;
  45440. break;
  45441. case '?':
  45442. re += qmark;
  45443. hasMagic = true;
  45444. break;
  45445. default:
  45446. re += '\\' + stateChar;
  45447. break;
  45448. }
  45449. self.debug('clearStateChar %j %j', stateChar, re);
  45450. stateChar = false;
  45451. }
  45452. }
  45453. for (var i = 0, len = pattern.length, c; i < len && (c = pattern.charAt(i)); i++) {
  45454. this.debug('%s\t%s %s %j', pattern, i, re, c);
  45455. // skip over any that are escaped.
  45456. if (escaping && reSpecials[c]) {
  45457. re += '\\' + c;
  45458. escaping = false;
  45459. continue;
  45460. }
  45461. switch (c) {
  45462. case '/':
  45463. // completely not allowed, even escaped.
  45464. // Should already be path-split by now.
  45465. return false;
  45466. case '\\':
  45467. clearStateChar();
  45468. escaping = true;
  45469. continue;
  45470. // the various stateChar values
  45471. // for the "extglob" stuff.
  45472. case '?':
  45473. case '*':
  45474. case '+':
  45475. case '@':
  45476. case '!':
  45477. this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c);
  45478. // all of those are literals inside a class, except that
  45479. // the glob [!a] means [^a] in regexp
  45480. if (inClass) {
  45481. this.debug(' in class');
  45482. if (c === '!' && i === classStart + 1) c = '^';
  45483. re += c;
  45484. continue;
  45485. }
  45486. // if we already have a stateChar, then it means
  45487. // that there was something like ** or +? in there.
  45488. // Handle the stateChar, then proceed with this one.
  45489. self.debug('call clearStateChar %j', stateChar);
  45490. clearStateChar();
  45491. stateChar = c;
  45492. // if extglob is disabled, then +(asdf|foo) isn't a thing.
  45493. // just clear the statechar *now*, rather than even diving into
  45494. // the patternList stuff.
  45495. if (options.noext) clearStateChar();
  45496. continue;
  45497. case '(':
  45498. if (inClass) {
  45499. re += '(';
  45500. continue;
  45501. }
  45502. if (!stateChar) {
  45503. re += '\\(';
  45504. continue;
  45505. }
  45506. patternListStack.push({
  45507. type: stateChar,
  45508. start: i - 1,
  45509. reStart: re.length,
  45510. open: plTypes[stateChar].open,
  45511. close: plTypes[stateChar].close
  45512. });
  45513. // negation is (?:(?!js)[^/]*)
  45514. re += stateChar === '!' ? '(?:(?!(?:' : '(?:';
  45515. this.debug('plType %j %j', stateChar, re);
  45516. stateChar = false;
  45517. continue;
  45518. case ')':
  45519. if (inClass || !patternListStack.length) {
  45520. re += '\\)';
  45521. continue;
  45522. }
  45523. clearStateChar();
  45524. hasMagic = true;
  45525. var pl = patternListStack.pop();
  45526. // negation is (?:(?!js)[^/]*)
  45527. // The others are (?:<pattern>)<type>
  45528. re += pl.close;
  45529. if (pl.type === '!') {
  45530. negativeLists.push(pl);
  45531. }
  45532. pl.reEnd = re.length;
  45533. continue;
  45534. case '|':
  45535. if (inClass || !patternListStack.length || escaping) {
  45536. re += '\\|';
  45537. escaping = false;
  45538. continue;
  45539. }
  45540. clearStateChar();
  45541. re += '|';
  45542. continue;
  45543. // these are mostly the same in regexp and glob
  45544. case '[':
  45545. // swallow any state-tracking char before the [
  45546. clearStateChar();
  45547. if (inClass) {
  45548. re += '\\' + c;
  45549. continue;
  45550. }
  45551. inClass = true;
  45552. classStart = i;
  45553. reClassStart = re.length;
  45554. re += c;
  45555. continue;
  45556. case ']':
  45557. // a right bracket shall lose its special
  45558. // meaning and represent itself in
  45559. // a bracket expression if it occurs
  45560. // first in the list. -- POSIX.2 2.8.3.2
  45561. if (i === classStart + 1 || !inClass) {
  45562. re += '\\' + c;
  45563. escaping = false;
  45564. continue;
  45565. }
  45566. // handle the case where we left a class open.
  45567. // "[z-a]" is valid, equivalent to "\[z-a\]"
  45568. if (inClass) {
  45569. // split where the last [ was, make sure we don't have
  45570. // an invalid re. if so, re-walk the contents of the
  45571. // would-be class to re-translate any characters that
  45572. // were passed through as-is
  45573. // TODO: It would probably be faster to determine this
  45574. // without a try/catch and a new RegExp, but it's tricky
  45575. // to do safely. For now, this is safe and works.
  45576. var cs = pattern.substring(classStart + 1, i);
  45577. try {
  45578. RegExp('[' + cs + ']');
  45579. } catch (er) {
  45580. // not a valid class!
  45581. var sp = this.parse(cs, SUBPARSE);
  45582. re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]';
  45583. hasMagic = hasMagic || sp[1];
  45584. inClass = false;
  45585. continue;
  45586. }
  45587. }
  45588. // finish up the class.
  45589. hasMagic = true;
  45590. inClass = false;
  45591. re += c;
  45592. continue;
  45593. default:
  45594. // swallow any state char that wasn't consumed
  45595. clearStateChar();
  45596. if (escaping) {
  45597. // no need
  45598. escaping = false;
  45599. } else if (reSpecials[c] && !(c === '^' && inClass)) {
  45600. re += '\\';
  45601. }
  45602. re += c;
  45603. } // switch
  45604. } // for
  45605. // handle the case where we left a class open.
  45606. // "[abc" is valid, equivalent to "\[abc"
  45607. if (inClass) {
  45608. // split where the last [ was, and escape it
  45609. // this is a huge pita. We now have to re-walk
  45610. // the contents of the would-be class to re-translate
  45611. // any characters that were passed through as-is
  45612. cs = pattern.substr(classStart + 1);
  45613. sp = this.parse(cs, SUBPARSE);
  45614. re = re.substr(0, reClassStart) + '\\[' + sp[0];
  45615. hasMagic = hasMagic || sp[1];
  45616. }
  45617. // handle the case where we had a +( thing at the *end*
  45618. // of the pattern.
  45619. // each pattern list stack adds 3 chars, and we need to go through
  45620. // and escape any | chars that were passed through as-is for the regexp.
  45621. // Go through and escape them, taking care not to double-escape any
  45622. // | chars that were already escaped.
  45623. for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) {
  45624. var tail = re.slice(pl.reStart + pl.open.length);
  45625. this.debug('setting tail', re, pl);
  45626. // maybe some even number of \, then maybe 1 \, followed by a |
  45627. tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) {
  45628. if (!$2) {
  45629. // the | isn't already escaped, so escape it.
  45630. $2 = '\\';
  45631. }
  45632. // need to escape all those slashes *again*, without escaping the
  45633. // one that we need for escaping the | character. As it works out,
  45634. // escaping an even number of slashes can be done by simply repeating
  45635. // it exactly after itself. That's why this trick works.
  45636. //
  45637. // I am sorry that you have to see this.
  45638. return $1 + $1 + $2 + '|';
  45639. });
  45640. this.debug('tail=%j\n %s', tail, tail, pl, re);
  45641. var t = pl.type === '*' ? star : pl.type === '?' ? qmark : '\\' + pl.type;
  45642. hasMagic = true;
  45643. re = re.slice(0, pl.reStart) + t + '\\(' + tail;
  45644. }
  45645. // handle trailing things that only matter at the very end.
  45646. clearStateChar();
  45647. if (escaping) {
  45648. // trailing \\
  45649. re += '\\\\';
  45650. }
  45651. // only need to apply the nodot start if the re starts with
  45652. // something that could conceivably capture a dot
  45653. var addPatternStart = false;
  45654. switch (re.charAt(0)) {
  45655. case '.':
  45656. case '[':
  45657. case '(':
  45658. addPatternStart = true;
  45659. }
  45660. // Hack to work around lack of negative lookbehind in JS
  45661. // A pattern like: *.!(x).!(y|z) needs to ensure that a name
  45662. // like 'a.xyz.yz' doesn't match. So, the first negative
  45663. // lookahead, has to look ALL the way ahead, to the end of
  45664. // the pattern.
  45665. for (var n = negativeLists.length - 1; n > -1; n--) {
  45666. var nl = negativeLists[n];
  45667. var nlBefore = re.slice(0, nl.reStart);
  45668. var nlFirst = re.slice(nl.reStart, nl.reEnd - 8);
  45669. var nlLast = re.slice(nl.reEnd - 8, nl.reEnd);
  45670. var nlAfter = re.slice(nl.reEnd);
  45671. nlLast += nlAfter;
  45672. // Handle nested stuff like *(*.js|!(*.json)), where open parens
  45673. // mean that we should *not* include the ) in the bit that is considered
  45674. // "after" the negated section.
  45675. var openParensBefore = nlBefore.split('(').length - 1;
  45676. var cleanAfter = nlAfter;
  45677. for (i = 0; i < openParensBefore; i++) {
  45678. cleanAfter = cleanAfter.replace(/\)[+*?]?/, '');
  45679. }
  45680. nlAfter = cleanAfter;
  45681. var dollar = '';
  45682. if (nlAfter === '' && isSub !== SUBPARSE) {
  45683. dollar = '$';
  45684. }
  45685. var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast;
  45686. re = newRe;
  45687. }
  45688. // if the re is not "" at this point, then we need to make sure
  45689. // it doesn't match against an empty path part.
  45690. // Otherwise a/* will match a/, which it should not.
  45691. if (re !== '' && hasMagic) {
  45692. re = '(?=.)' + re;
  45693. }
  45694. if (addPatternStart) {
  45695. re = patternStart + re;
  45696. }
  45697. // parsing just a piece of a larger pattern.
  45698. if (isSub === SUBPARSE) {
  45699. return [re, hasMagic];
  45700. }
  45701. // skip the regexp for non-magical patterns
  45702. // unescape anything in it, though, so that it'll be
  45703. // an exact match against a file etc.
  45704. if (!hasMagic) {
  45705. return globUnescape(pattern);
  45706. }
  45707. var flags = options.nocase ? 'i' : '';
  45708. try {
  45709. var regExp = new RegExp('^' + re + '$', flags);
  45710. } catch (er) {
  45711. // If it was an invalid regular expression, then it can't match
  45712. // anything. This trick looks for a character after the end of
  45713. // the string, which is of course impossible, except in multi-line
  45714. // mode, but it's not a /m regex.
  45715. return new RegExp('$.');
  45716. }
  45717. regExp._glob = pattern;
  45718. regExp._src = re;
  45719. return regExp;
  45720. }
  45721. minimatch.makeRe = function (pattern, options) {
  45722. return new Minimatch(pattern, options || {}).makeRe();
  45723. };
  45724. Minimatch.prototype.makeRe = makeRe;
  45725. function makeRe() {
  45726. if (this.regexp || this.regexp === false) return this.regexp;
  45727. // at this point, this.set is a 2d array of partial
  45728. // pattern strings, or "**".
  45729. //
  45730. // It's better to use .match(). This function shouldn't
  45731. // be used, really, but it's pretty convenient sometimes,
  45732. // when you just want to work with a regex.
  45733. var set = this.set;
  45734. if (!set.length) {
  45735. this.regexp = false;
  45736. return this.regexp;
  45737. }
  45738. var options = this.options;
  45739. var twoStar = options.noglobstar ? star : options.dot ? twoStarDot : twoStarNoDot;
  45740. var flags = options.nocase ? 'i' : '';
  45741. var re = set.map(function (pattern) {
  45742. return pattern.map(function (p) {
  45743. return p === GLOBSTAR ? twoStar : typeof p === 'string' ? regExpEscape(p) : p._src;
  45744. }).join('\\\/');
  45745. }).join('|');
  45746. // must match entire pattern
  45747. // ending in a * or ** will make it less strict.
  45748. re = '^(?:' + re + ')$';
  45749. // can match anything, as long as it's not this.
  45750. if (this.negate) re = '^(?!' + re + ').*$';
  45751. try {
  45752. this.regexp = new RegExp(re, flags);
  45753. } catch (ex) {
  45754. this.regexp = false;
  45755. }
  45756. return this.regexp;
  45757. }
  45758. minimatch.match = function (list, pattern, options) {
  45759. options = options || {};
  45760. var mm = new Minimatch(pattern, options);
  45761. list = list.filter(function (f) {
  45762. return mm.match(f);
  45763. });
  45764. if (mm.options.nonull && !list.length) {
  45765. list.push(pattern);
  45766. }
  45767. return list;
  45768. };
  45769. Minimatch.prototype.match = match;
  45770. function match(f, partial) {
  45771. this.debug('match', f, this.pattern);
  45772. // short-circuit in the case of busted things.
  45773. // comments, etc.
  45774. if (this.comment) return false;
  45775. if (this.empty) return f === '';
  45776. if (f === '/' && partial) return true;
  45777. var options = this.options;
  45778. // windows: need to use /, not \
  45779. if (path.sep !== '/') {
  45780. f = f.split(path.sep).join('/');
  45781. }
  45782. // treat the test path as a set of pathparts.
  45783. f = f.split(slashSplit);
  45784. this.debug(this.pattern, 'split', f);
  45785. // just ONE of the pattern sets in this.set needs to match
  45786. // in order for it to be valid. If negating, then just one
  45787. // match means that we have failed.
  45788. // Either way, return on the first hit.
  45789. var set = this.set;
  45790. this.debug(this.pattern, 'set', set);
  45791. // Find the basename of the path by looking for the last non-empty segment
  45792. var filename;
  45793. var i;
  45794. for (i = f.length - 1; i >= 0; i--) {
  45795. filename = f[i];
  45796. if (filename) break;
  45797. }
  45798. for (i = 0; i < set.length; i++) {
  45799. var pattern = set[i];
  45800. var file = f;
  45801. if (options.matchBase && pattern.length === 1) {
  45802. file = [filename];
  45803. }
  45804. var hit = this.matchOne(file, pattern, partial);
  45805. if (hit) {
  45806. if (options.flipNegate) return true;
  45807. return !this.negate;
  45808. }
  45809. }
  45810. // didn't get any hits. this is success if it's a negative
  45811. // pattern, failure otherwise.
  45812. if (options.flipNegate) return false;
  45813. return this.negate;
  45814. }
  45815. // set partial to true to test if, for example,
  45816. // "/a/b" matches the start of "/*/b/*/d"
  45817. // Partial means, if you run out of file before you run
  45818. // out of pattern, then that's fine, as long as all
  45819. // the parts match.
  45820. Minimatch.prototype.matchOne = function (file, pattern, partial) {
  45821. var options = this.options;
  45822. this.debug('matchOne', { 'this': this, file: file, pattern: pattern });
  45823. this.debug('matchOne', file.length, pattern.length);
  45824. for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
  45825. this.debug('matchOne loop');
  45826. var p = pattern[pi];
  45827. var f = file[fi];
  45828. this.debug(pattern, p, f);
  45829. // should be impossible.
  45830. // some invalid regexp stuff in the set.
  45831. if (p === false) return false;
  45832. if (p === GLOBSTAR) {
  45833. this.debug('GLOBSTAR', [pattern, p, f]);
  45834. // "**"
  45835. // a/**/b/**/c would match the following:
  45836. // a/b/x/y/z/c
  45837. // a/x/y/z/b/c
  45838. // a/b/x/b/x/c
  45839. // a/b/c
  45840. // To do this, take the rest of the pattern after
  45841. // the **, and see if it would match the file remainder.
  45842. // If so, return success.
  45843. // If not, the ** "swallows" a segment, and try again.
  45844. // This is recursively awful.
  45845. //
  45846. // a/**/b/**/c matching a/b/x/y/z/c
  45847. // - a matches a
  45848. // - doublestar
  45849. // - matchOne(b/x/y/z/c, b/**/c)
  45850. // - b matches b
  45851. // - doublestar
  45852. // - matchOne(x/y/z/c, c) -> no
  45853. // - matchOne(y/z/c, c) -> no
  45854. // - matchOne(z/c, c) -> no
  45855. // - matchOne(c, c) yes, hit
  45856. var fr = fi;
  45857. var pr = pi + 1;
  45858. if (pr === pl) {
  45859. this.debug('** at the end');
  45860. // a ** at the end will just swallow the rest.
  45861. // We have found a match.
  45862. // however, it will not swallow /.x, unless
  45863. // options.dot is set.
  45864. // . and .. are *never* matched by **, for explosively
  45865. // exponential reasons.
  45866. for (; fi < fl; fi++) {
  45867. if (file[fi] === '.' || file[fi] === '..' || !options.dot && file[fi].charAt(0) === '.') return false;
  45868. }
  45869. return true;
  45870. }
  45871. // ok, let's see if we can swallow whatever we can.
  45872. while (fr < fl) {
  45873. var swallowee = file[fr];
  45874. this.debug('\nglobstar while', file, fr, pattern, pr, swallowee);
  45875. // XXX remove this slice. Just pass the start index.
  45876. if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
  45877. this.debug('globstar found match!', fr, fl, swallowee);
  45878. // found a match.
  45879. return true;
  45880. } else {
  45881. // can't swallow "." or ".." ever.
  45882. // can only swallow ".foo" when explicitly asked.
  45883. if (swallowee === '.' || swallowee === '..' || !options.dot && swallowee.charAt(0) === '.') {
  45884. this.debug('dot detected!', file, fr, pattern, pr);
  45885. break;
  45886. }
  45887. // ** swallows a segment, and continue.
  45888. this.debug('globstar swallow a segment, and continue');
  45889. fr++;
  45890. }
  45891. }
  45892. // no match was found.
  45893. // However, in partial mode, we can't say this is necessarily over.
  45894. // If there's more *pattern* left, then
  45895. if (partial) {
  45896. // ran out of file
  45897. this.debug('\n>>> no match, partial?', file, fr, pattern, pr);
  45898. if (fr === fl) return true;
  45899. }
  45900. return false;
  45901. }
  45902. // something other than **
  45903. // non-magic patterns just have to match exactly
  45904. // patterns with magic have been turned into regexps.
  45905. var hit;
  45906. if (typeof p === 'string') {
  45907. if (options.nocase) {
  45908. hit = f.toLowerCase() === p.toLowerCase();
  45909. } else {
  45910. hit = f === p;
  45911. }
  45912. this.debug('string match', p, f, hit);
  45913. } else {
  45914. hit = f.match(p);
  45915. this.debug('pattern match', p, f, hit);
  45916. }
  45917. if (!hit) return false;
  45918. }
  45919. // Note: ending in / means that we'll get a final ""
  45920. // at the end of the pattern. This can only match a
  45921. // corresponding "" at the end of the file.
  45922. // If the file ends in /, then it can only match a
  45923. // a pattern that ends in /, unless the pattern just
  45924. // doesn't have any more for it. But, a/b/ should *not*
  45925. // match "a/b/*", even though "" matches against the
  45926. // [^/]*? pattern, except in partial mode, where it might
  45927. // simply not be reached yet.
  45928. // However, a/b/ should still satisfy a/*
  45929. // now either we fell off the end of the pattern, or we're done.
  45930. if (fi === fl && pi === pl) {
  45931. // ran out of pattern and filename at the same time.
  45932. // an exact hit!
  45933. return true;
  45934. } else if (fi === fl) {
  45935. // ran out of file, but still had pattern left.
  45936. // this is ok if we're doing the match as part of
  45937. // a glob fs traversal.
  45938. return partial;
  45939. } else if (pi === pl) {
  45940. // ran out of pattern, still have file left.
  45941. // this is only acceptable if we're on the very last
  45942. // empty segment of a file with a trailing slash.
  45943. // a/* should match a/b/
  45944. var emptyFileEnd = fi === fl - 1 && file[fi] === '';
  45945. return emptyFileEnd;
  45946. }
  45947. // should be unreachable.
  45948. throw new Error('wtf?');
  45949. };
  45950. // replace stuff like \* with *
  45951. function globUnescape(s) {
  45952. return s.replace(/\\(.)/g, '$1');
  45953. }
  45954. function regExpEscape(s) {
  45955. return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
  45956. }
  45957. /***/ }),
  45958. /* 602 */
  45959. /***/ (function(module, exports) {
  45960. 'use strict';
  45961. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  45962. /**
  45963. * Helpers.
  45964. */
  45965. var s = 1000;
  45966. var m = s * 60;
  45967. var h = m * 60;
  45968. var d = h * 24;
  45969. var y = d * 365.25;
  45970. /**
  45971. * Parse or format the given `val`.
  45972. *
  45973. * Options:
  45974. *
  45975. * - `long` verbose formatting [false]
  45976. *
  45977. * @param {String|Number} val
  45978. * @param {Object} [options]
  45979. * @throws {Error} throw an error if val is not a non-empty string or a number
  45980. * @return {String|Number}
  45981. * @api public
  45982. */
  45983. module.exports = function (val, options) {
  45984. options = options || {};
  45985. var type = typeof val === 'undefined' ? 'undefined' : _typeof(val);
  45986. if (type === 'string' && val.length > 0) {
  45987. return parse(val);
  45988. } else if (type === 'number' && isNaN(val) === false) {
  45989. return options.long ? fmtLong(val) : fmtShort(val);
  45990. }
  45991. throw new Error('val is not a non-empty string or a valid number. val=' + JSON.stringify(val));
  45992. };
  45993. /**
  45994. * Parse the given `str` and return milliseconds.
  45995. *
  45996. * @param {String} str
  45997. * @return {Number}
  45998. * @api private
  45999. */
  46000. function parse(str) {
  46001. str = String(str);
  46002. if (str.length > 100) {
  46003. return;
  46004. }
  46005. var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str);
  46006. if (!match) {
  46007. return;
  46008. }
  46009. var n = parseFloat(match[1]);
  46010. var type = (match[2] || 'ms').toLowerCase();
  46011. switch (type) {
  46012. case 'years':
  46013. case 'year':
  46014. case 'yrs':
  46015. case 'yr':
  46016. case 'y':
  46017. return n * y;
  46018. case 'days':
  46019. case 'day':
  46020. case 'd':
  46021. return n * d;
  46022. case 'hours':
  46023. case 'hour':
  46024. case 'hrs':
  46025. case 'hr':
  46026. case 'h':
  46027. return n * h;
  46028. case 'minutes':
  46029. case 'minute':
  46030. case 'mins':
  46031. case 'min':
  46032. case 'm':
  46033. return n * m;
  46034. case 'seconds':
  46035. case 'second':
  46036. case 'secs':
  46037. case 'sec':
  46038. case 's':
  46039. return n * s;
  46040. case 'milliseconds':
  46041. case 'millisecond':
  46042. case 'msecs':
  46043. case 'msec':
  46044. case 'ms':
  46045. return n;
  46046. default:
  46047. return undefined;
  46048. }
  46049. }
  46050. /**
  46051. * Short format for `ms`.
  46052. *
  46053. * @param {Number} ms
  46054. * @return {String}
  46055. * @api private
  46056. */
  46057. function fmtShort(ms) {
  46058. if (ms >= d) {
  46059. return Math.round(ms / d) + 'd';
  46060. }
  46061. if (ms >= h) {
  46062. return Math.round(ms / h) + 'h';
  46063. }
  46064. if (ms >= m) {
  46065. return Math.round(ms / m) + 'm';
  46066. }
  46067. if (ms >= s) {
  46068. return Math.round(ms / s) + 's';
  46069. }
  46070. return ms + 'ms';
  46071. }
  46072. /**
  46073. * Long format for `ms`.
  46074. *
  46075. * @param {Number} ms
  46076. * @return {String}
  46077. * @api private
  46078. */
  46079. function fmtLong(ms) {
  46080. return plural(ms, d, 'day') || plural(ms, h, 'hour') || plural(ms, m, 'minute') || plural(ms, s, 'second') || ms + ' ms';
  46081. }
  46082. /**
  46083. * Pluralization helper.
  46084. */
  46085. function plural(ms, n, name) {
  46086. if (ms < n) {
  46087. return;
  46088. }
  46089. if (ms < n * 1.5) {
  46090. return Math.floor(ms / n) + ' ' + name;
  46091. }
  46092. return Math.ceil(ms / n) + ' ' + name + 's';
  46093. }
  46094. /***/ }),
  46095. /* 603 */
  46096. /***/ (function(module, exports) {
  46097. 'use strict';
  46098. module.exports = Number.isNaN || function (x) {
  46099. return x !== x;
  46100. };
  46101. /***/ }),
  46102. /* 604 */
  46103. /***/ (function(module, exports, __webpack_require__) {
  46104. /* WEBPACK VAR INJECTION */(function(process) {'use strict';
  46105. function posix(path) {
  46106. return path.charAt(0) === '/';
  46107. }
  46108. function win32(path) {
  46109. // https://github.com/nodejs/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56
  46110. var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/;
  46111. var result = splitDeviceRe.exec(path);
  46112. var device = result[1] || '';
  46113. var isUnc = Boolean(device && device.charAt(1) !== ':');
  46114. // UNC paths are always absolute
  46115. return Boolean(result[2] || isUnc);
  46116. }
  46117. module.exports = process.platform === 'win32' ? win32 : posix;
  46118. module.exports.posix = posix;
  46119. module.exports.win32 = win32;
  46120. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(8)))
  46121. /***/ }),
  46122. /* 605 */
  46123. /***/ (function(module, exports, __webpack_require__) {
  46124. "use strict";
  46125. var _keys = __webpack_require__(14);
  46126. var _keys2 = _interopRequireDefault(_keys);
  46127. var _babelTypes = __webpack_require__(1);
  46128. var t = _interopRequireWildcard(_babelTypes);
  46129. var _util = __webpack_require__(116);
  46130. var util = _interopRequireWildcard(_util);
  46131. function _interopRequireWildcard(obj) {
  46132. if (obj && obj.__esModule) {
  46133. return obj;
  46134. } else {
  46135. var newObj = {};if (obj != null) {
  46136. for (var key in obj) {
  46137. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  46138. }
  46139. }newObj.default = obj;return newObj;
  46140. }
  46141. }
  46142. function _interopRequireDefault(obj) {
  46143. return obj && obj.__esModule ? obj : { default: obj };
  46144. }
  46145. /**
  46146. * Copyright (c) 2014, Facebook, Inc.
  46147. * All rights reserved.
  46148. *
  46149. * This source code is licensed under the BSD-style license found in the
  46150. * https://raw.github.com/facebook/regenerator/master/LICENSE file. An
  46151. * additional grant of patent rights can be found in the PATENTS file in
  46152. * the same directory.
  46153. */
  46154. var hasOwn = Object.prototype.hasOwnProperty;
  46155. // The hoist function takes a FunctionExpression or FunctionDeclaration
  46156. // and replaces any Declaration nodes in its body with assignments, then
  46157. // returns a VariableDeclaration containing just the names of the removed
  46158. // declarations.
  46159. exports.hoist = function (funPath) {
  46160. t.assertFunction(funPath.node);
  46161. var vars = {};
  46162. function varDeclToExpr(vdec, includeIdentifiers) {
  46163. t.assertVariableDeclaration(vdec);
  46164. // TODO assert.equal(vdec.kind, "var");
  46165. var exprs = [];
  46166. vdec.declarations.forEach(function (dec) {
  46167. // Note: We duplicate 'dec.id' here to ensure that the variable declaration IDs don't
  46168. // have the same 'loc' value, since that can make sourcemaps and retainLines behave poorly.
  46169. vars[dec.id.name] = t.identifier(dec.id.name);
  46170. if (dec.init) {
  46171. exprs.push(t.assignmentExpression("=", dec.id, dec.init));
  46172. } else if (includeIdentifiers) {
  46173. exprs.push(dec.id);
  46174. }
  46175. });
  46176. if (exprs.length === 0) return null;
  46177. if (exprs.length === 1) return exprs[0];
  46178. return t.sequenceExpression(exprs);
  46179. }
  46180. funPath.get("body").traverse({
  46181. VariableDeclaration: {
  46182. exit: function exit(path) {
  46183. var expr = varDeclToExpr(path.node, false);
  46184. if (expr === null) {
  46185. path.remove();
  46186. } else {
  46187. // We don't need to traverse this expression any further because
  46188. // there can't be any new declarations inside an expression.
  46189. util.replaceWithOrRemove(path, t.expressionStatement(expr));
  46190. }
  46191. // Since the original node has been either removed or replaced,
  46192. // avoid traversing it any further.
  46193. path.skip();
  46194. }
  46195. },
  46196. ForStatement: function ForStatement(path) {
  46197. var init = path.node.init;
  46198. if (t.isVariableDeclaration(init)) {
  46199. util.replaceWithOrRemove(path.get("init"), varDeclToExpr(init, false));
  46200. }
  46201. },
  46202. ForXStatement: function ForXStatement(path) {
  46203. var left = path.get("left");
  46204. if (left.isVariableDeclaration()) {
  46205. util.replaceWithOrRemove(left, varDeclToExpr(left.node, true));
  46206. }
  46207. },
  46208. FunctionDeclaration: function FunctionDeclaration(path) {
  46209. var node = path.node;
  46210. vars[node.id.name] = node.id;
  46211. var assignment = t.expressionStatement(t.assignmentExpression("=", node.id, t.functionExpression(node.id, node.params, node.body, node.generator, node.expression)));
  46212. if (path.parentPath.isBlockStatement()) {
  46213. // Insert the assignment form before the first statement in the
  46214. // enclosing block.
  46215. path.parentPath.unshiftContainer("body", assignment);
  46216. // Remove the function declaration now that we've inserted the
  46217. // equivalent assignment form at the beginning of the block.
  46218. path.remove();
  46219. } else {
  46220. // If the parent node is not a block statement, then we can just
  46221. // replace the declaration with the equivalent assignment form
  46222. // without worrying about hoisting it.
  46223. util.replaceWithOrRemove(path, assignment);
  46224. }
  46225. // Don't hoist variables out of inner functions.
  46226. path.skip();
  46227. },
  46228. FunctionExpression: function FunctionExpression(path) {
  46229. // Don't descend into nested function expressions.
  46230. path.skip();
  46231. }
  46232. });
  46233. var paramNames = {};
  46234. funPath.get("params").forEach(function (paramPath) {
  46235. var param = paramPath.node;
  46236. if (t.isIdentifier(param)) {
  46237. paramNames[param.name] = param;
  46238. } else {
  46239. // Variables declared by destructuring parameter patterns will be
  46240. // harmlessly re-declared.
  46241. }
  46242. });
  46243. var declarations = [];
  46244. (0, _keys2.default)(vars).forEach(function (name) {
  46245. if (!hasOwn.call(paramNames, name)) {
  46246. declarations.push(t.variableDeclarator(vars[name], null));
  46247. }
  46248. });
  46249. if (declarations.length === 0) {
  46250. return null; // Be sure to handle this case!
  46251. }
  46252. return t.variableDeclaration("var", declarations);
  46253. };
  46254. /***/ }),
  46255. /* 606 */
  46256. /***/ (function(module, exports, __webpack_require__) {
  46257. "use strict";
  46258. exports.__esModule = true;
  46259. exports.default = function () {
  46260. return __webpack_require__(610);
  46261. };
  46262. /***/ }),
  46263. /* 607 */
  46264. /***/ (function(module, exports, __webpack_require__) {
  46265. "use strict";
  46266. var _assert = __webpack_require__(64);
  46267. var _assert2 = _interopRequireDefault(_assert);
  46268. var _babelTypes = __webpack_require__(1);
  46269. var t = _interopRequireWildcard(_babelTypes);
  46270. var _util = __webpack_require__(117);
  46271. function _interopRequireWildcard(obj) {
  46272. if (obj && obj.__esModule) {
  46273. return obj;
  46274. } else {
  46275. var newObj = {};if (obj != null) {
  46276. for (var key in obj) {
  46277. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  46278. }
  46279. }newObj.default = obj;return newObj;
  46280. }
  46281. }
  46282. function _interopRequireDefault(obj) {
  46283. return obj && obj.__esModule ? obj : { default: obj };
  46284. }
  46285. function Entry() {
  46286. _assert2.default.ok(this instanceof Entry);
  46287. } /**
  46288. * Copyright (c) 2014, Facebook, Inc.
  46289. * All rights reserved.
  46290. *
  46291. * This source code is licensed under the BSD-style license found in the
  46292. * https://raw.github.com/facebook/regenerator/master/LICENSE file. An
  46293. * additional grant of patent rights can be found in the PATENTS file in
  46294. * the same directory.
  46295. */
  46296. function FunctionEntry(returnLoc) {
  46297. Entry.call(this);
  46298. t.assertLiteral(returnLoc);
  46299. this.returnLoc = returnLoc;
  46300. }
  46301. (0, _util.inherits)(FunctionEntry, Entry);
  46302. exports.FunctionEntry = FunctionEntry;
  46303. function LoopEntry(breakLoc, continueLoc, label) {
  46304. Entry.call(this);
  46305. t.assertLiteral(breakLoc);
  46306. t.assertLiteral(continueLoc);
  46307. if (label) {
  46308. t.assertIdentifier(label);
  46309. } else {
  46310. label = null;
  46311. }
  46312. this.breakLoc = breakLoc;
  46313. this.continueLoc = continueLoc;
  46314. this.label = label;
  46315. }
  46316. (0, _util.inherits)(LoopEntry, Entry);
  46317. exports.LoopEntry = LoopEntry;
  46318. function SwitchEntry(breakLoc) {
  46319. Entry.call(this);
  46320. t.assertLiteral(breakLoc);
  46321. this.breakLoc = breakLoc;
  46322. }
  46323. (0, _util.inherits)(SwitchEntry, Entry);
  46324. exports.SwitchEntry = SwitchEntry;
  46325. function TryEntry(firstLoc, catchEntry, finallyEntry) {
  46326. Entry.call(this);
  46327. t.assertLiteral(firstLoc);
  46328. if (catchEntry) {
  46329. _assert2.default.ok(catchEntry instanceof CatchEntry);
  46330. } else {
  46331. catchEntry = null;
  46332. }
  46333. if (finallyEntry) {
  46334. _assert2.default.ok(finallyEntry instanceof FinallyEntry);
  46335. } else {
  46336. finallyEntry = null;
  46337. }
  46338. // Have to have one or the other (or both).
  46339. _assert2.default.ok(catchEntry || finallyEntry);
  46340. this.firstLoc = firstLoc;
  46341. this.catchEntry = catchEntry;
  46342. this.finallyEntry = finallyEntry;
  46343. }
  46344. (0, _util.inherits)(TryEntry, Entry);
  46345. exports.TryEntry = TryEntry;
  46346. function CatchEntry(firstLoc, paramId) {
  46347. Entry.call(this);
  46348. t.assertLiteral(firstLoc);
  46349. t.assertIdentifier(paramId);
  46350. this.firstLoc = firstLoc;
  46351. this.paramId = paramId;
  46352. }
  46353. (0, _util.inherits)(CatchEntry, Entry);
  46354. exports.CatchEntry = CatchEntry;
  46355. function FinallyEntry(firstLoc, afterLoc) {
  46356. Entry.call(this);
  46357. t.assertLiteral(firstLoc);
  46358. t.assertLiteral(afterLoc);
  46359. this.firstLoc = firstLoc;
  46360. this.afterLoc = afterLoc;
  46361. }
  46362. (0, _util.inherits)(FinallyEntry, Entry);
  46363. exports.FinallyEntry = FinallyEntry;
  46364. function LabeledEntry(breakLoc, label) {
  46365. Entry.call(this);
  46366. t.assertLiteral(breakLoc);
  46367. t.assertIdentifier(label);
  46368. this.breakLoc = breakLoc;
  46369. this.label = label;
  46370. }
  46371. (0, _util.inherits)(LabeledEntry, Entry);
  46372. exports.LabeledEntry = LabeledEntry;
  46373. function LeapManager(emitter) {
  46374. _assert2.default.ok(this instanceof LeapManager);
  46375. var Emitter = __webpack_require__(283).Emitter;
  46376. _assert2.default.ok(emitter instanceof Emitter);
  46377. this.emitter = emitter;
  46378. this.entryStack = [new FunctionEntry(emitter.finalLoc)];
  46379. }
  46380. var LMp = LeapManager.prototype;
  46381. exports.LeapManager = LeapManager;
  46382. LMp.withEntry = function (entry, callback) {
  46383. _assert2.default.ok(entry instanceof Entry);
  46384. this.entryStack.push(entry);
  46385. try {
  46386. callback.call(this.emitter);
  46387. } finally {
  46388. var popped = this.entryStack.pop();
  46389. _assert2.default.strictEqual(popped, entry);
  46390. }
  46391. };
  46392. LMp._findLeapLocation = function (property, label) {
  46393. for (var i = this.entryStack.length - 1; i >= 0; --i) {
  46394. var entry = this.entryStack[i];
  46395. var loc = entry[property];
  46396. if (loc) {
  46397. if (label) {
  46398. if (entry.label && entry.label.name === label.name) {
  46399. return loc;
  46400. }
  46401. } else if (entry instanceof LabeledEntry) {
  46402. // Ignore LabeledEntry entries unless we are actually breaking to
  46403. // a label.
  46404. } else {
  46405. return loc;
  46406. }
  46407. }
  46408. }
  46409. return null;
  46410. };
  46411. LMp.getBreakLoc = function (label) {
  46412. return this._findLeapLocation("breakLoc", label);
  46413. };
  46414. LMp.getContinueLoc = function (label) {
  46415. return this._findLeapLocation("continueLoc", label);
  46416. };
  46417. /***/ }),
  46418. /* 608 */
  46419. /***/ (function(module, exports, __webpack_require__) {
  46420. "use strict";
  46421. var _assert = __webpack_require__(64);
  46422. var _assert2 = _interopRequireDefault(_assert);
  46423. var _babelTypes = __webpack_require__(1);
  46424. var t = _interopRequireWildcard(_babelTypes);
  46425. function _interopRequireWildcard(obj) {
  46426. if (obj && obj.__esModule) {
  46427. return obj;
  46428. } else {
  46429. var newObj = {};if (obj != null) {
  46430. for (var key in obj) {
  46431. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  46432. }
  46433. }newObj.default = obj;return newObj;
  46434. }
  46435. }
  46436. function _interopRequireDefault(obj) {
  46437. return obj && obj.__esModule ? obj : { default: obj };
  46438. }
  46439. var m = __webpack_require__(281).makeAccessor(); /**
  46440. * Copyright (c) 2014, Facebook, Inc.
  46441. * All rights reserved.
  46442. *
  46443. * This source code is licensed under the BSD-style license found in the
  46444. * https://raw.github.com/facebook/regenerator/master/LICENSE file. An
  46445. * additional grant of patent rights can be found in the PATENTS file in
  46446. * the same directory.
  46447. */
  46448. var hasOwn = Object.prototype.hasOwnProperty;
  46449. function makePredicate(propertyName, knownTypes) {
  46450. function onlyChildren(node) {
  46451. t.assertNode(node);
  46452. // Assume no side effects until we find out otherwise.
  46453. var result = false;
  46454. function check(child) {
  46455. if (result) {
  46456. // Do nothing.
  46457. } else if (Array.isArray(child)) {
  46458. child.some(check);
  46459. } else if (t.isNode(child)) {
  46460. _assert2.default.strictEqual(result, false);
  46461. result = predicate(child);
  46462. }
  46463. return result;
  46464. }
  46465. var keys = t.VISITOR_KEYS[node.type];
  46466. if (keys) {
  46467. for (var i = 0; i < keys.length; i++) {
  46468. var key = keys[i];
  46469. var child = node[key];
  46470. check(child);
  46471. }
  46472. }
  46473. return result;
  46474. }
  46475. function predicate(node) {
  46476. t.assertNode(node);
  46477. var meta = m(node);
  46478. if (hasOwn.call(meta, propertyName)) return meta[propertyName];
  46479. // Certain types are "opaque," which means they have no side
  46480. // effects or leaps and we don't care about their subexpressions.
  46481. if (hasOwn.call(opaqueTypes, node.type)) return meta[propertyName] = false;
  46482. if (hasOwn.call(knownTypes, node.type)) return meta[propertyName] = true;
  46483. return meta[propertyName] = onlyChildren(node);
  46484. }
  46485. predicate.onlyChildren = onlyChildren;
  46486. return predicate;
  46487. }
  46488. var opaqueTypes = {
  46489. FunctionExpression: true,
  46490. ArrowFunctionExpression: true
  46491. };
  46492. // These types potentially have side effects regardless of what side
  46493. // effects their subexpressions have.
  46494. var sideEffectTypes = {
  46495. CallExpression: true, // Anything could happen!
  46496. ForInStatement: true, // Modifies the key variable.
  46497. UnaryExpression: true, // Think delete.
  46498. BinaryExpression: true, // Might invoke .toString() or .valueOf().
  46499. AssignmentExpression: true, // Side-effecting by definition.
  46500. UpdateExpression: true, // Updates are essentially assignments.
  46501. NewExpression: true // Similar to CallExpression.
  46502. };
  46503. // These types are the direct cause of all leaps in control flow.
  46504. var leapTypes = {
  46505. YieldExpression: true,
  46506. BreakStatement: true,
  46507. ContinueStatement: true,
  46508. ReturnStatement: true,
  46509. ThrowStatement: true
  46510. };
  46511. // All leap types are also side effect types.
  46512. for (var type in leapTypes) {
  46513. if (hasOwn.call(leapTypes, type)) {
  46514. sideEffectTypes[type] = leapTypes[type];
  46515. }
  46516. }
  46517. exports.hasSideEffects = makePredicate("hasSideEffects", sideEffectTypes);
  46518. exports.containsLeap = makePredicate("containsLeap", leapTypes);
  46519. /***/ }),
  46520. /* 609 */
  46521. /***/ (function(module, exports, __webpack_require__) {
  46522. "use strict";
  46523. exports.__esModule = true;
  46524. exports.default = replaceShorthandObjectMethod;
  46525. var _babelTypes = __webpack_require__(1);
  46526. var t = _interopRequireWildcard(_babelTypes);
  46527. var _util = __webpack_require__(116);
  46528. var util = _interopRequireWildcard(_util);
  46529. function _interopRequireWildcard(obj) {
  46530. if (obj && obj.__esModule) {
  46531. return obj;
  46532. } else {
  46533. var newObj = {};if (obj != null) {
  46534. for (var key in obj) {
  46535. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  46536. }
  46537. }newObj.default = obj;return newObj;
  46538. }
  46539. }
  46540. // this function converts a shorthand object generator method into a normal
  46541. // (non-shorthand) object property which is a generator function expression. for
  46542. // example, this:
  46543. //
  46544. // var foo = {
  46545. // *bar(baz) { return 5; }
  46546. // }
  46547. //
  46548. // should be replaced with:
  46549. //
  46550. // var foo = {
  46551. // bar: function*(baz) { return 5; }
  46552. // }
  46553. //
  46554. // to do this, it clones the parameter array and the body of the object generator
  46555. // method into a new FunctionExpression.
  46556. //
  46557. // this method can be passed any Function AST node path, and it will return
  46558. // either:
  46559. // a) the path that was passed in (iff the path did not need to be replaced) or
  46560. // b) the path of the new FunctionExpression that was created as a replacement
  46561. // (iff the path did need to be replaced)
  46562. //
  46563. // In either case, though, the caller can count on the fact that the return value
  46564. // is a Function AST node path.
  46565. //
  46566. // If this function is called with an AST node path that is not a Function (or with an
  46567. // argument that isn't an AST node path), it will throw an error.
  46568. function replaceShorthandObjectMethod(path) {
  46569. if (!path.node || !t.isFunction(path.node)) {
  46570. throw new Error("replaceShorthandObjectMethod can only be called on Function AST node paths.");
  46571. }
  46572. // this function only replaces shorthand object methods (called ObjectMethod
  46573. // in Babel-speak).
  46574. if (!t.isObjectMethod(path.node)) {
  46575. return path;
  46576. }
  46577. // this function only replaces generators.
  46578. if (!path.node.generator) {
  46579. return path;
  46580. }
  46581. var parameters = path.node.params.map(function (param) {
  46582. return t.cloneDeep(param);
  46583. });
  46584. var functionExpression = t.functionExpression(null, // id
  46585. parameters, // params
  46586. t.cloneDeep(path.node.body), // body
  46587. path.node.generator, path.node.async);
  46588. util.replaceWithOrRemove(path, t.objectProperty(t.cloneDeep(path.node.key), // key
  46589. functionExpression, //value
  46590. path.node.computed, // computed
  46591. false // shorthand
  46592. ));
  46593. // path now refers to the ObjectProperty AST node path, but we want to return a
  46594. // Function AST node path for the function expression we created. we know that
  46595. // the FunctionExpression we just created is the value of the ObjectProperty,
  46596. // so return the "value" path off of this path.
  46597. return path.get("value");
  46598. }
  46599. /***/ }),
  46600. /* 610 */
  46601. /***/ (function(module, exports, __webpack_require__) {
  46602. /**
  46603. * Copyright (c) 2014, Facebook, Inc.
  46604. * All rights reserved.
  46605. *
  46606. * This source code is licensed under the BSD-style license found in the
  46607. * https://raw.github.com/facebook/regenerator/master/LICENSE file. An
  46608. * additional grant of patent rights can be found in the PATENTS file in
  46609. * the same directory.
  46610. */
  46611. "use strict";
  46612. var _assert = __webpack_require__(64);
  46613. var _assert2 = _interopRequireDefault(_assert);
  46614. var _babelTypes = __webpack_require__(1);
  46615. var t = _interopRequireWildcard(_babelTypes);
  46616. var _hoist = __webpack_require__(605);
  46617. var _emit = __webpack_require__(283);
  46618. var _replaceShorthandObjectMethod = __webpack_require__(609);
  46619. var _replaceShorthandObjectMethod2 = _interopRequireDefault(_replaceShorthandObjectMethod);
  46620. var _util = __webpack_require__(116);
  46621. var util = _interopRequireWildcard(_util);
  46622. function _interopRequireWildcard(obj) {
  46623. if (obj && obj.__esModule) {
  46624. return obj;
  46625. } else {
  46626. var newObj = {};if (obj != null) {
  46627. for (var key in obj) {
  46628. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  46629. }
  46630. }newObj.default = obj;return newObj;
  46631. }
  46632. }
  46633. function _interopRequireDefault(obj) {
  46634. return obj && obj.__esModule ? obj : { default: obj };
  46635. }
  46636. exports.name = "regenerator-transform";
  46637. exports.visitor = {
  46638. Function: {
  46639. exit: function exit(path, state) {
  46640. var node = path.node;
  46641. if (node.generator) {
  46642. if (node.async) {
  46643. // Async generator
  46644. if (state.opts.asyncGenerators === false) return;
  46645. } else {
  46646. // Plain generator
  46647. if (state.opts.generators === false) return;
  46648. }
  46649. } else if (node.async) {
  46650. // Async function
  46651. if (state.opts.async === false) return;
  46652. } else {
  46653. // Not a generator or async function.
  46654. return;
  46655. }
  46656. // if this is an ObjectMethod, we need to convert it to an ObjectProperty
  46657. path = (0, _replaceShorthandObjectMethod2.default)(path);
  46658. node = path.node;
  46659. var contextId = path.scope.generateUidIdentifier("context");
  46660. var argsId = path.scope.generateUidIdentifier("args");
  46661. path.ensureBlock();
  46662. var bodyBlockPath = path.get("body");
  46663. if (node.async) {
  46664. bodyBlockPath.traverse(awaitVisitor);
  46665. }
  46666. bodyBlockPath.traverse(functionSentVisitor, {
  46667. context: contextId
  46668. });
  46669. var outerBody = [];
  46670. var innerBody = [];
  46671. bodyBlockPath.get("body").forEach(function (childPath) {
  46672. var node = childPath.node;
  46673. if (t.isExpressionStatement(node) && t.isStringLiteral(node.expression)) {
  46674. // Babylon represents directives like "use strict" as elements
  46675. // of a bodyBlockPath.node.directives array, but they could just
  46676. // as easily be represented (by other parsers) as traditional
  46677. // string-literal-valued expression statements, so we need to
  46678. // handle that here. (#248)
  46679. outerBody.push(node);
  46680. } else if (node && node._blockHoist != null) {
  46681. outerBody.push(node);
  46682. } else {
  46683. innerBody.push(node);
  46684. }
  46685. });
  46686. if (outerBody.length > 0) {
  46687. // Only replace the inner body if we actually hoisted any statements
  46688. // to the outer body.
  46689. bodyBlockPath.node.body = innerBody;
  46690. }
  46691. var outerFnExpr = getOuterFnExpr(path);
  46692. // Note that getOuterFnExpr has the side-effect of ensuring that the
  46693. // function has a name (so node.id will always be an Identifier), even
  46694. // if a temporary name has to be synthesized.
  46695. t.assertIdentifier(node.id);
  46696. var innerFnId = t.identifier(node.id.name + "$");
  46697. // Turn all declarations into vars, and replace the original
  46698. // declarations with equivalent assignment expressions.
  46699. var vars = (0, _hoist.hoist)(path);
  46700. var didRenameArguments = renameArguments(path, argsId);
  46701. if (didRenameArguments) {
  46702. vars = vars || t.variableDeclaration("var", []);
  46703. var argumentIdentifier = t.identifier("arguments");
  46704. // we need to do this as otherwise arguments in arrow functions gets hoisted
  46705. argumentIdentifier._shadowedFunctionLiteral = path;
  46706. vars.declarations.push(t.variableDeclarator(argsId, argumentIdentifier));
  46707. }
  46708. var emitter = new _emit.Emitter(contextId);
  46709. emitter.explode(path.get("body"));
  46710. if (vars && vars.declarations.length > 0) {
  46711. outerBody.push(vars);
  46712. }
  46713. var wrapArgs = [emitter.getContextFunction(innerFnId),
  46714. // Async functions that are not generators don't care about the
  46715. // outer function because they don't need it to be marked and don't
  46716. // inherit from its .prototype.
  46717. node.generator ? outerFnExpr : t.nullLiteral(), t.thisExpression()];
  46718. var tryLocsList = emitter.getTryLocsList();
  46719. if (tryLocsList) {
  46720. wrapArgs.push(tryLocsList);
  46721. }
  46722. var wrapCall = t.callExpression(util.runtimeProperty(node.async ? "async" : "wrap"), wrapArgs);
  46723. outerBody.push(t.returnStatement(wrapCall));
  46724. node.body = t.blockStatement(outerBody);
  46725. var oldDirectives = bodyBlockPath.node.directives;
  46726. if (oldDirectives) {
  46727. // Babylon represents directives like "use strict" as elements of
  46728. // a bodyBlockPath.node.directives array. (#248)
  46729. node.body.directives = oldDirectives;
  46730. }
  46731. var wasGeneratorFunction = node.generator;
  46732. if (wasGeneratorFunction) {
  46733. node.generator = false;
  46734. }
  46735. if (node.async) {
  46736. node.async = false;
  46737. }
  46738. if (wasGeneratorFunction && t.isExpression(node)) {
  46739. util.replaceWithOrRemove(path, t.callExpression(util.runtimeProperty("mark"), [node]));
  46740. path.addComment("leading", "#__PURE__");
  46741. }
  46742. // Generators are processed in 'exit' handlers so that regenerator only has to run on
  46743. // an ES5 AST, but that means traversal will not pick up newly inserted references
  46744. // to things like 'regeneratorRuntime'. To avoid this, we explicitly requeue.
  46745. path.requeue();
  46746. }
  46747. }
  46748. };
  46749. // Given a NodePath for a Function, return an Expression node that can be
  46750. // used to refer reliably to the function object from inside the function.
  46751. // This expression is essentially a replacement for arguments.callee, with
  46752. // the key advantage that it works in strict mode.
  46753. function getOuterFnExpr(funPath) {
  46754. var node = funPath.node;
  46755. t.assertFunction(node);
  46756. if (!node.id) {
  46757. // Default-exported function declarations, and function expressions may not
  46758. // have a name to reference, so we explicitly add one.
  46759. node.id = funPath.scope.parent.generateUidIdentifier("callee");
  46760. }
  46761. if (node.generator && // Non-generator functions don't need to be marked.
  46762. t.isFunctionDeclaration(node)) {
  46763. // Return the identifier returned by runtime.mark(<node.id>).
  46764. return getMarkedFunctionId(funPath);
  46765. }
  46766. return node.id;
  46767. }
  46768. var getMarkInfo = __webpack_require__(281).makeAccessor();
  46769. function getMarkedFunctionId(funPath) {
  46770. var node = funPath.node;
  46771. t.assertIdentifier(node.id);
  46772. var blockPath = funPath.findParent(function (path) {
  46773. return path.isProgram() || path.isBlockStatement();
  46774. });
  46775. if (!blockPath) {
  46776. return node.id;
  46777. }
  46778. var block = blockPath.node;
  46779. _assert2.default.ok(Array.isArray(block.body));
  46780. var info = getMarkInfo(block);
  46781. if (!info.decl) {
  46782. info.decl = t.variableDeclaration("var", []);
  46783. blockPath.unshiftContainer("body", info.decl);
  46784. info.declPath = blockPath.get("body.0");
  46785. }
  46786. _assert2.default.strictEqual(info.declPath.node, info.decl);
  46787. // Get a new unique identifier for our marked variable.
  46788. var markedId = blockPath.scope.generateUidIdentifier("marked");
  46789. var markCallExp = t.callExpression(util.runtimeProperty("mark"), [node.id]);
  46790. var index = info.decl.declarations.push(t.variableDeclarator(markedId, markCallExp)) - 1;
  46791. var markCallExpPath = info.declPath.get("declarations." + index + ".init");
  46792. _assert2.default.strictEqual(markCallExpPath.node, markCallExp);
  46793. markCallExpPath.addComment("leading", "#__PURE__");
  46794. return markedId;
  46795. }
  46796. function renameArguments(funcPath, argsId) {
  46797. var state = {
  46798. didRenameArguments: false,
  46799. argsId: argsId
  46800. };
  46801. funcPath.traverse(argumentsVisitor, state);
  46802. // If the traversal replaced any arguments references, then we need to
  46803. // alias the outer function's arguments binding (be it the implicit
  46804. // arguments object or some other parameter or variable) to the variable
  46805. // named by argsId.
  46806. return state.didRenameArguments;
  46807. }
  46808. var argumentsVisitor = {
  46809. "FunctionExpression|FunctionDeclaration": function FunctionExpressionFunctionDeclaration(path) {
  46810. path.skip();
  46811. },
  46812. Identifier: function Identifier(path, state) {
  46813. if (path.node.name === "arguments" && util.isReference(path)) {
  46814. util.replaceWithOrRemove(path, state.argsId);
  46815. state.didRenameArguments = true;
  46816. }
  46817. }
  46818. };
  46819. var functionSentVisitor = {
  46820. MetaProperty: function MetaProperty(path) {
  46821. var node = path.node;
  46822. if (node.meta.name === "function" && node.property.name === "sent") {
  46823. util.replaceWithOrRemove(path, t.memberExpression(this.context, t.identifier("_sent")));
  46824. }
  46825. }
  46826. };
  46827. var awaitVisitor = {
  46828. Function: function Function(path) {
  46829. path.skip(); // Don't descend into nested function scopes.
  46830. },
  46831. AwaitExpression: function AwaitExpression(path) {
  46832. // Convert await expressions to yield expressions.
  46833. var argument = path.node.argument;
  46834. // Transforming `await x` to `yield regeneratorRuntime.awrap(x)`
  46835. // causes the argument to be wrapped in such a way that the runtime
  46836. // can distinguish between awaited and merely yielded values.
  46837. util.replaceWithOrRemove(path, t.yieldExpression(t.callExpression(util.runtimeProperty("awrap"), [argument]), false));
  46838. }
  46839. };
  46840. /***/ }),
  46841. /* 611 */
  46842. /***/ (function(module, exports, __webpack_require__) {
  46843. 'use strict';
  46844. // Generated by `/scripts/character-class-escape-sets.js`. Do not edit.
  46845. var regenerate = __webpack_require__(282);
  46846. exports.REGULAR = {
  46847. 'd': regenerate().addRange(0x30, 0x39),
  46848. 'D': regenerate().addRange(0x0, 0x2F).addRange(0x3A, 0xFFFF),
  46849. 's': regenerate(0x20, 0xA0, 0x1680, 0x202F, 0x205F, 0x3000, 0xFEFF).addRange(0x9, 0xD).addRange(0x2000, 0x200A).addRange(0x2028, 0x2029),
  46850. 'S': regenerate().addRange(0x0, 0x8).addRange(0xE, 0x1F).addRange(0x21, 0x9F).addRange(0xA1, 0x167F).addRange(0x1681, 0x1FFF).addRange(0x200B, 0x2027).addRange(0x202A, 0x202E).addRange(0x2030, 0x205E).addRange(0x2060, 0x2FFF).addRange(0x3001, 0xFEFE).addRange(0xFF00, 0xFFFF),
  46851. 'w': regenerate(0x5F).addRange(0x30, 0x39).addRange(0x41, 0x5A).addRange(0x61, 0x7A),
  46852. 'W': regenerate(0x60).addRange(0x0, 0x2F).addRange(0x3A, 0x40).addRange(0x5B, 0x5E).addRange(0x7B, 0xFFFF)
  46853. };
  46854. exports.UNICODE = {
  46855. 'd': regenerate().addRange(0x30, 0x39),
  46856. 'D': regenerate().addRange(0x0, 0x2F).addRange(0x3A, 0x10FFFF),
  46857. 's': regenerate(0x20, 0xA0, 0x1680, 0x202F, 0x205F, 0x3000, 0xFEFF).addRange(0x9, 0xD).addRange(0x2000, 0x200A).addRange(0x2028, 0x2029),
  46858. 'S': regenerate().addRange(0x0, 0x8).addRange(0xE, 0x1F).addRange(0x21, 0x9F).addRange(0xA1, 0x167F).addRange(0x1681, 0x1FFF).addRange(0x200B, 0x2027).addRange(0x202A, 0x202E).addRange(0x2030, 0x205E).addRange(0x2060, 0x2FFF).addRange(0x3001, 0xFEFE).addRange(0xFF00, 0x10FFFF),
  46859. 'w': regenerate(0x5F).addRange(0x30, 0x39).addRange(0x41, 0x5A).addRange(0x61, 0x7A),
  46860. 'W': regenerate(0x60).addRange(0x0, 0x2F).addRange(0x3A, 0x40).addRange(0x5B, 0x5E).addRange(0x7B, 0x10FFFF)
  46861. };
  46862. exports.UNICODE_IGNORE_CASE = {
  46863. 'd': regenerate().addRange(0x30, 0x39),
  46864. 'D': regenerate().addRange(0x0, 0x2F).addRange(0x3A, 0x10FFFF),
  46865. 's': regenerate(0x20, 0xA0, 0x1680, 0x202F, 0x205F, 0x3000, 0xFEFF).addRange(0x9, 0xD).addRange(0x2000, 0x200A).addRange(0x2028, 0x2029),
  46866. 'S': regenerate().addRange(0x0, 0x8).addRange(0xE, 0x1F).addRange(0x21, 0x9F).addRange(0xA1, 0x167F).addRange(0x1681, 0x1FFF).addRange(0x200B, 0x2027).addRange(0x202A, 0x202E).addRange(0x2030, 0x205E).addRange(0x2060, 0x2FFF).addRange(0x3001, 0xFEFE).addRange(0xFF00, 0x10FFFF),
  46867. 'w': regenerate(0x5F, 0x17F, 0x212A).addRange(0x30, 0x39).addRange(0x41, 0x5A).addRange(0x61, 0x7A),
  46868. 'W': regenerate(0x4B, 0x53, 0x60).addRange(0x0, 0x2F).addRange(0x3A, 0x40).addRange(0x5B, 0x5E).addRange(0x7B, 0x10FFFF)
  46869. };
  46870. /***/ }),
  46871. /* 612 */
  46872. /***/ (function(module, exports, __webpack_require__) {
  46873. 'use strict';
  46874. var generate = __webpack_require__(613).generate;
  46875. var parse = __webpack_require__(614).parse;
  46876. var regenerate = __webpack_require__(282);
  46877. var iuMappings = __webpack_require__(631);
  46878. var ESCAPE_SETS = __webpack_require__(611);
  46879. function getCharacterClassEscapeSet(character) {
  46880. if (unicode) {
  46881. if (ignoreCase) {
  46882. return ESCAPE_SETS.UNICODE_IGNORE_CASE[character];
  46883. }
  46884. return ESCAPE_SETS.UNICODE[character];
  46885. }
  46886. return ESCAPE_SETS.REGULAR[character];
  46887. }
  46888. var object = {};
  46889. var hasOwnProperty = object.hasOwnProperty;
  46890. function has(object, property) {
  46891. return hasOwnProperty.call(object, property);
  46892. }
  46893. // Prepare a Regenerate set containing all code points, used for negative
  46894. // character classes (if any).
  46895. var UNICODE_SET = regenerate().addRange(0x0, 0x10FFFF);
  46896. // Without the `u` flag, the range stops at 0xFFFF.
  46897. // https://mths.be/es6#sec-pattern-semantics
  46898. var BMP_SET = regenerate().addRange(0x0, 0xFFFF);
  46899. // Prepare a Regenerate set containing all code points that are supposed to be
  46900. // matched by `/./u`. https://mths.be/es6#sec-atom
  46901. var DOT_SET_UNICODE = UNICODE_SET.clone() // all Unicode code points
  46902. .remove(
  46903. // minus `LineTerminator`s (https://mths.be/es6#sec-line-terminators):
  46904. 0x000A, // Line Feed <LF>
  46905. 0x000D, // Carriage Return <CR>
  46906. 0x2028, // Line Separator <LS>
  46907. 0x2029 // Paragraph Separator <PS>
  46908. );
  46909. // Prepare a Regenerate set containing all code points that are supposed to be
  46910. // matched by `/./` (only BMP code points).
  46911. var DOT_SET = DOT_SET_UNICODE.clone().intersection(BMP_SET);
  46912. // Add a range of code points + any case-folded code points in that range to a
  46913. // set.
  46914. regenerate.prototype.iuAddRange = function (min, max) {
  46915. var $this = this;
  46916. do {
  46917. var folded = caseFold(min);
  46918. if (folded) {
  46919. $this.add(folded);
  46920. }
  46921. } while (++min <= max);
  46922. return $this;
  46923. };
  46924. function assign(target, source) {
  46925. for (var key in source) {
  46926. // Note: `hasOwnProperty` is not needed here.
  46927. target[key] = source[key];
  46928. }
  46929. }
  46930. function update(item, pattern) {
  46931. // TODO: Test if memoizing `pattern` here is worth the effort.
  46932. if (!pattern) {
  46933. return;
  46934. }
  46935. var tree = parse(pattern, '');
  46936. switch (tree.type) {
  46937. case 'characterClass':
  46938. case 'group':
  46939. case 'value':
  46940. // No wrapping needed.
  46941. break;
  46942. default:
  46943. // Wrap the pattern in a non-capturing group.
  46944. tree = wrap(tree, pattern);
  46945. }
  46946. assign(item, tree);
  46947. }
  46948. function wrap(tree, pattern) {
  46949. // Wrap the pattern in a non-capturing group.
  46950. return {
  46951. 'type': 'group',
  46952. 'behavior': 'ignore',
  46953. 'body': [tree],
  46954. 'raw': '(?:' + pattern + ')'
  46955. };
  46956. }
  46957. function caseFold(codePoint) {
  46958. return has(iuMappings, codePoint) ? iuMappings[codePoint] : false;
  46959. }
  46960. var ignoreCase = false;
  46961. var unicode = false;
  46962. function processCharacterClass(characterClassItem) {
  46963. var set = regenerate();
  46964. var body = characterClassItem.body.forEach(function (item) {
  46965. switch (item.type) {
  46966. case 'value':
  46967. set.add(item.codePoint);
  46968. if (ignoreCase && unicode) {
  46969. var folded = caseFold(item.codePoint);
  46970. if (folded) {
  46971. set.add(folded);
  46972. }
  46973. }
  46974. break;
  46975. case 'characterClassRange':
  46976. var min = item.min.codePoint;
  46977. var max = item.max.codePoint;
  46978. set.addRange(min, max);
  46979. if (ignoreCase && unicode) {
  46980. set.iuAddRange(min, max);
  46981. }
  46982. break;
  46983. case 'characterClassEscape':
  46984. set.add(getCharacterClassEscapeSet(item.value));
  46985. break;
  46986. // The `default` clause is only here as a safeguard; it should never be
  46987. // reached. Code coverage tools should ignore it.
  46988. /* istanbul ignore next */
  46989. default:
  46990. throw Error('Unknown term type: ' + item.type);
  46991. }
  46992. });
  46993. if (characterClassItem.negative) {
  46994. set = (unicode ? UNICODE_SET : BMP_SET).clone().remove(set);
  46995. }
  46996. update(characterClassItem, set.toString());
  46997. return characterClassItem;
  46998. }
  46999. function processTerm(item) {
  47000. switch (item.type) {
  47001. case 'dot':
  47002. update(item, (unicode ? DOT_SET_UNICODE : DOT_SET).toString());
  47003. break;
  47004. case 'characterClass':
  47005. item = processCharacterClass(item);
  47006. break;
  47007. case 'characterClassEscape':
  47008. update(item, getCharacterClassEscapeSet(item.value).toString());
  47009. break;
  47010. case 'alternative':
  47011. case 'disjunction':
  47012. case 'group':
  47013. case 'quantifier':
  47014. item.body = item.body.map(processTerm);
  47015. break;
  47016. case 'value':
  47017. var codePoint = item.codePoint;
  47018. var set = regenerate(codePoint);
  47019. if (ignoreCase && unicode) {
  47020. var folded = caseFold(codePoint);
  47021. if (folded) {
  47022. set.add(folded);
  47023. }
  47024. }
  47025. update(item, set.toString());
  47026. break;
  47027. case 'anchor':
  47028. case 'empty':
  47029. case 'group':
  47030. case 'reference':
  47031. // Nothing to do here.
  47032. break;
  47033. // The `default` clause is only here as a safeguard; it should never be
  47034. // reached. Code coverage tools should ignore it.
  47035. /* istanbul ignore next */
  47036. default:
  47037. throw Error('Unknown term type: ' + item.type);
  47038. }
  47039. return item;
  47040. };
  47041. module.exports = function (pattern, flags) {
  47042. var tree = parse(pattern, flags);
  47043. ignoreCase = flags ? flags.indexOf('i') > -1 : false;
  47044. unicode = flags ? flags.indexOf('u') > -1 : false;
  47045. assign(tree, processTerm(tree));
  47046. return generate(tree);
  47047. };
  47048. /***/ }),
  47049. /* 613 */
  47050. /***/ (function(module, exports, __webpack_require__) {
  47051. var __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(module, global) {'use strict';
  47052. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  47053. /*!
  47054. * RegJSGen
  47055. * Copyright 2014 Benjamin Tan <https://d10.github.io/>
  47056. * Available under MIT license <http://d10.mit-license.org/>
  47057. */
  47058. ;(function () {
  47059. 'use strict';
  47060. /** Used to determine if values are of the language type `Object` */
  47061. var objectTypes = {
  47062. 'function': true,
  47063. 'object': true
  47064. };
  47065. /** Used as a reference to the global object */
  47066. var root = objectTypes[typeof window === 'undefined' ? 'undefined' : _typeof(window)] && window || this;
  47067. /** Backup possible global object */
  47068. var oldRoot = root;
  47069. /** Detect free variable `exports` */
  47070. var freeExports = objectTypes[ false ? 'undefined' : _typeof(exports)] && exports;
  47071. /** Detect free variable `module` */
  47072. var freeModule = objectTypes[ false ? 'undefined' : _typeof(module)] && module && !module.nodeType && module;
  47073. /** Detect free variable `global` from Node.js or Browserified code and use it as `root` */
  47074. var freeGlobal = freeExports && freeModule && (typeof global === 'undefined' ? 'undefined' : _typeof(global)) == 'object' && global;
  47075. if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal || freeGlobal.self === freeGlobal)) {
  47076. root = freeGlobal;
  47077. }
  47078. /*--------------------------------------------------------------------------*/
  47079. /*! Based on https://mths.be/fromcodepoint v0.2.0 by @mathias */
  47080. var stringFromCharCode = String.fromCharCode;
  47081. var floor = Math.floor;
  47082. function fromCodePoint() {
  47083. var MAX_SIZE = 0x4000;
  47084. var codeUnits = [];
  47085. var highSurrogate;
  47086. var lowSurrogate;
  47087. var index = -1;
  47088. var length = arguments.length;
  47089. if (!length) {
  47090. return '';
  47091. }
  47092. var result = '';
  47093. while (++index < length) {
  47094. var codePoint = Number(arguments[index]);
  47095. if (!isFinite(codePoint) || // `NaN`, `+Infinity`, or `-Infinity`
  47096. codePoint < 0 || // not a valid Unicode code point
  47097. codePoint > 0x10FFFF || // not a valid Unicode code point
  47098. floor(codePoint) != codePoint // not an integer
  47099. ) {
  47100. throw RangeError('Invalid code point: ' + codePoint);
  47101. }
  47102. if (codePoint <= 0xFFFF) {
  47103. // BMP code point
  47104. codeUnits.push(codePoint);
  47105. } else {
  47106. // Astral code point; split in surrogate halves
  47107. // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
  47108. codePoint -= 0x10000;
  47109. highSurrogate = (codePoint >> 10) + 0xD800;
  47110. lowSurrogate = codePoint % 0x400 + 0xDC00;
  47111. codeUnits.push(highSurrogate, lowSurrogate);
  47112. }
  47113. if (index + 1 == length || codeUnits.length > MAX_SIZE) {
  47114. result += stringFromCharCode.apply(null, codeUnits);
  47115. codeUnits.length = 0;
  47116. }
  47117. }
  47118. return result;
  47119. }
  47120. function assertType(type, expected) {
  47121. if (expected.indexOf('|') == -1) {
  47122. if (type == expected) {
  47123. return;
  47124. }
  47125. throw Error('Invalid node type: ' + type);
  47126. }
  47127. expected = assertType.hasOwnProperty(expected) ? assertType[expected] : assertType[expected] = RegExp('^(?:' + expected + ')$');
  47128. if (expected.test(type)) {
  47129. return;
  47130. }
  47131. throw Error('Invalid node type: ' + type);
  47132. }
  47133. /*--------------------------------------------------------------------------*/
  47134. function generate(node) {
  47135. var type = node.type;
  47136. if (generate.hasOwnProperty(type) && typeof generate[type] == 'function') {
  47137. return generate[type](node);
  47138. }
  47139. throw Error('Invalid node type: ' + type);
  47140. }
  47141. /*--------------------------------------------------------------------------*/
  47142. function generateAlternative(node) {
  47143. assertType(node.type, 'alternative');
  47144. var terms = node.body,
  47145. length = terms ? terms.length : 0;
  47146. if (length == 1) {
  47147. return generateTerm(terms[0]);
  47148. } else {
  47149. var i = -1,
  47150. result = '';
  47151. while (++i < length) {
  47152. result += generateTerm(terms[i]);
  47153. }
  47154. return result;
  47155. }
  47156. }
  47157. function generateAnchor(node) {
  47158. assertType(node.type, 'anchor');
  47159. switch (node.kind) {
  47160. case 'start':
  47161. return '^';
  47162. case 'end':
  47163. return '$';
  47164. case 'boundary':
  47165. return '\\b';
  47166. case 'not-boundary':
  47167. return '\\B';
  47168. default:
  47169. throw Error('Invalid assertion');
  47170. }
  47171. }
  47172. function generateAtom(node) {
  47173. assertType(node.type, 'anchor|characterClass|characterClassEscape|dot|group|reference|value');
  47174. return generate(node);
  47175. }
  47176. function generateCharacterClass(node) {
  47177. assertType(node.type, 'characterClass');
  47178. var classRanges = node.body,
  47179. length = classRanges ? classRanges.length : 0;
  47180. var i = -1,
  47181. result = '[';
  47182. if (node.negative) {
  47183. result += '^';
  47184. }
  47185. while (++i < length) {
  47186. result += generateClassAtom(classRanges[i]);
  47187. }
  47188. result += ']';
  47189. return result;
  47190. }
  47191. function generateCharacterClassEscape(node) {
  47192. assertType(node.type, 'characterClassEscape');
  47193. return '\\' + node.value;
  47194. }
  47195. function generateCharacterClassRange(node) {
  47196. assertType(node.type, 'characterClassRange');
  47197. var min = node.min,
  47198. max = node.max;
  47199. if (min.type == 'characterClassRange' || max.type == 'characterClassRange') {
  47200. throw Error('Invalid character class range');
  47201. }
  47202. return generateClassAtom(min) + '-' + generateClassAtom(max);
  47203. }
  47204. function generateClassAtom(node) {
  47205. assertType(node.type, 'anchor|characterClassEscape|characterClassRange|dot|value');
  47206. return generate(node);
  47207. }
  47208. function generateDisjunction(node) {
  47209. assertType(node.type, 'disjunction');
  47210. var body = node.body,
  47211. length = body ? body.length : 0;
  47212. if (length == 0) {
  47213. throw Error('No body');
  47214. } else if (length == 1) {
  47215. return generate(body[0]);
  47216. } else {
  47217. var i = -1,
  47218. result = '';
  47219. while (++i < length) {
  47220. if (i != 0) {
  47221. result += '|';
  47222. }
  47223. result += generate(body[i]);
  47224. }
  47225. return result;
  47226. }
  47227. }
  47228. function generateDot(node) {
  47229. assertType(node.type, 'dot');
  47230. return '.';
  47231. }
  47232. function generateGroup(node) {
  47233. assertType(node.type, 'group');
  47234. var result = '(';
  47235. switch (node.behavior) {
  47236. case 'normal':
  47237. break;
  47238. case 'ignore':
  47239. result += '?:';
  47240. break;
  47241. case 'lookahead':
  47242. result += '?=';
  47243. break;
  47244. case 'negativeLookahead':
  47245. result += '?!';
  47246. break;
  47247. default:
  47248. throw Error('Invalid behaviour: ' + node.behaviour);
  47249. }
  47250. var body = node.body,
  47251. length = body ? body.length : 0;
  47252. if (length == 1) {
  47253. result += generate(body[0]);
  47254. } else {
  47255. var i = -1;
  47256. while (++i < length) {
  47257. result += generate(body[i]);
  47258. }
  47259. }
  47260. result += ')';
  47261. return result;
  47262. }
  47263. function generateQuantifier(node) {
  47264. assertType(node.type, 'quantifier');
  47265. var quantifier = '',
  47266. min = node.min,
  47267. max = node.max;
  47268. switch (max) {
  47269. case undefined:
  47270. case null:
  47271. switch (min) {
  47272. case 0:
  47273. quantifier = '*';
  47274. break;
  47275. case 1:
  47276. quantifier = '+';
  47277. break;
  47278. default:
  47279. quantifier = '{' + min + ',}';
  47280. break;
  47281. }
  47282. break;
  47283. default:
  47284. if (min == max) {
  47285. quantifier = '{' + min + '}';
  47286. } else if (min == 0 && max == 1) {
  47287. quantifier = '?';
  47288. } else {
  47289. quantifier = '{' + min + ',' + max + '}';
  47290. }
  47291. break;
  47292. }
  47293. if (!node.greedy) {
  47294. quantifier += '?';
  47295. }
  47296. return generateAtom(node.body[0]) + quantifier;
  47297. }
  47298. function generateReference(node) {
  47299. assertType(node.type, 'reference');
  47300. return '\\' + node.matchIndex;
  47301. }
  47302. function generateTerm(node) {
  47303. assertType(node.type, 'anchor|characterClass|characterClassEscape|empty|group|quantifier|reference|value');
  47304. return generate(node);
  47305. }
  47306. function generateValue(node) {
  47307. assertType(node.type, 'value');
  47308. var kind = node.kind,
  47309. codePoint = node.codePoint;
  47310. switch (kind) {
  47311. case 'controlLetter':
  47312. return '\\c' + fromCodePoint(codePoint + 64);
  47313. case 'hexadecimalEscape':
  47314. return '\\x' + ('00' + codePoint.toString(16).toUpperCase()).slice(-2);
  47315. case 'identifier':
  47316. return '\\' + fromCodePoint(codePoint);
  47317. case 'null':
  47318. return '\\' + codePoint;
  47319. case 'octal':
  47320. return '\\' + codePoint.toString(8);
  47321. case 'singleEscape':
  47322. switch (codePoint) {
  47323. case 0x0008:
  47324. return '\\b';
  47325. case 0x009:
  47326. return '\\t';
  47327. case 0x00A:
  47328. return '\\n';
  47329. case 0x00B:
  47330. return '\\v';
  47331. case 0x00C:
  47332. return '\\f';
  47333. case 0x00D:
  47334. return '\\r';
  47335. default:
  47336. throw Error('Invalid codepoint: ' + codePoint);
  47337. }
  47338. case 'symbol':
  47339. return fromCodePoint(codePoint);
  47340. case 'unicodeEscape':
  47341. return '\\u' + ('0000' + codePoint.toString(16).toUpperCase()).slice(-4);
  47342. case 'unicodeCodePointEscape':
  47343. return '\\u{' + codePoint.toString(16).toUpperCase() + '}';
  47344. default:
  47345. throw Error('Unsupported node kind: ' + kind);
  47346. }
  47347. }
  47348. /*--------------------------------------------------------------------------*/
  47349. generate.alternative = generateAlternative;
  47350. generate.anchor = generateAnchor;
  47351. generate.characterClass = generateCharacterClass;
  47352. generate.characterClassEscape = generateCharacterClassEscape;
  47353. generate.characterClassRange = generateCharacterClassRange;
  47354. generate.disjunction = generateDisjunction;
  47355. generate.dot = generateDot;
  47356. generate.group = generateGroup;
  47357. generate.quantifier = generateQuantifier;
  47358. generate.reference = generateReference;
  47359. generate.value = generateValue;
  47360. /*--------------------------------------------------------------------------*/
  47361. // export regjsgen
  47362. // some AMD build optimizers, like r.js, check for condition patterns like the following:
  47363. if ("function" == 'function' && _typeof(__webpack_require__(49)) == 'object' && __webpack_require__(49)) {
  47364. // define as an anonymous module so, through path mapping, it can be aliased
  47365. !(__WEBPACK_AMD_DEFINE_RESULT__ = function () {
  47366. return {
  47367. 'generate': generate
  47368. };
  47369. }.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  47370. }
  47371. // check for `exports` after `define` in case a build optimizer adds an `exports` object
  47372. else if (freeExports && freeModule) {
  47373. // in Narwhal, Node.js, Rhino -require, or RingoJS
  47374. freeExports.generate = generate;
  47375. }
  47376. // in a browser or Rhino
  47377. else {
  47378. root.regjsgen = {
  47379. 'generate': generate
  47380. };
  47381. }
  47382. }).call(undefined);
  47383. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(39)(module), (function() { return this; }())))
  47384. /***/ }),
  47385. /* 614 */
  47386. /***/ (function(module, exports) {
  47387. 'use strict';
  47388. // regjsparser
  47389. //
  47390. // ==================================================================
  47391. //
  47392. // See ECMA-262 Standard: 15.10.1
  47393. //
  47394. // NOTE: The ECMA-262 standard uses the term "Assertion" for /^/. Here the
  47395. // term "Anchor" is used.
  47396. //
  47397. // Pattern ::
  47398. // Disjunction
  47399. //
  47400. // Disjunction ::
  47401. // Alternative
  47402. // Alternative | Disjunction
  47403. //
  47404. // Alternative ::
  47405. // [empty]
  47406. // Alternative Term
  47407. //
  47408. // Term ::
  47409. // Anchor
  47410. // Atom
  47411. // Atom Quantifier
  47412. //
  47413. // Anchor ::
  47414. // ^
  47415. // $
  47416. // \ b
  47417. // \ B
  47418. // ( ? = Disjunction )
  47419. // ( ? ! Disjunction )
  47420. //
  47421. // Quantifier ::
  47422. // QuantifierPrefix
  47423. // QuantifierPrefix ?
  47424. //
  47425. // QuantifierPrefix ::
  47426. // *
  47427. // +
  47428. // ?
  47429. // { DecimalDigits }
  47430. // { DecimalDigits , }
  47431. // { DecimalDigits , DecimalDigits }
  47432. //
  47433. // Atom ::
  47434. // PatternCharacter
  47435. // .
  47436. // \ AtomEscape
  47437. // CharacterClass
  47438. // ( Disjunction )
  47439. // ( ? : Disjunction )
  47440. //
  47441. // PatternCharacter ::
  47442. // SourceCharacter but not any of: ^ $ \ . * + ? ( ) [ ] { } |
  47443. //
  47444. // AtomEscape ::
  47445. // DecimalEscape
  47446. // CharacterEscape
  47447. // CharacterClassEscape
  47448. //
  47449. // CharacterEscape[U] ::
  47450. // ControlEscape
  47451. // c ControlLetter
  47452. // HexEscapeSequence
  47453. // RegExpUnicodeEscapeSequence[?U] (ES6)
  47454. // IdentityEscape[?U]
  47455. //
  47456. // ControlEscape ::
  47457. // one of f n r t v
  47458. // ControlLetter ::
  47459. // one of
  47460. // a b c d e f g h i j k l m n o p q r s t u v w x y z
  47461. // A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
  47462. //
  47463. // IdentityEscape ::
  47464. // SourceCharacter but not IdentifierPart
  47465. // <ZWJ>
  47466. // <ZWNJ>
  47467. //
  47468. // DecimalEscape ::
  47469. // DecimalIntegerLiteral [lookahead ∉ DecimalDigit]
  47470. //
  47471. // CharacterClassEscape ::
  47472. // one of d D s S w W
  47473. //
  47474. // CharacterClass ::
  47475. // [ [lookahead ∉ {^}] ClassRanges ]
  47476. // [ ^ ClassRanges ]
  47477. //
  47478. // ClassRanges ::
  47479. // [empty]
  47480. // NonemptyClassRanges
  47481. //
  47482. // NonemptyClassRanges ::
  47483. // ClassAtom
  47484. // ClassAtom NonemptyClassRangesNoDash
  47485. // ClassAtom - ClassAtom ClassRanges
  47486. //
  47487. // NonemptyClassRangesNoDash ::
  47488. // ClassAtom
  47489. // ClassAtomNoDash NonemptyClassRangesNoDash
  47490. // ClassAtomNoDash - ClassAtom ClassRanges
  47491. //
  47492. // ClassAtom ::
  47493. // -
  47494. // ClassAtomNoDash
  47495. //
  47496. // ClassAtomNoDash ::
  47497. // SourceCharacter but not one of \ or ] or -
  47498. // \ ClassEscape
  47499. //
  47500. // ClassEscape ::
  47501. // DecimalEscape
  47502. // b
  47503. // CharacterEscape
  47504. // CharacterClassEscape
  47505. (function () {
  47506. function parse(str, flags) {
  47507. function addRaw(node) {
  47508. node.raw = str.substring(node.range[0], node.range[1]);
  47509. return node;
  47510. }
  47511. function updateRawStart(node, start) {
  47512. node.range[0] = start;
  47513. return addRaw(node);
  47514. }
  47515. function createAnchor(kind, rawLength) {
  47516. return addRaw({
  47517. type: 'anchor',
  47518. kind: kind,
  47519. range: [pos - rawLength, pos]
  47520. });
  47521. }
  47522. function createValue(kind, codePoint, from, to) {
  47523. return addRaw({
  47524. type: 'value',
  47525. kind: kind,
  47526. codePoint: codePoint,
  47527. range: [from, to]
  47528. });
  47529. }
  47530. function createEscaped(kind, codePoint, value, fromOffset) {
  47531. fromOffset = fromOffset || 0;
  47532. return createValue(kind, codePoint, pos - (value.length + fromOffset), pos);
  47533. }
  47534. function createCharacter(matches) {
  47535. var _char = matches[0];
  47536. var first = _char.charCodeAt(0);
  47537. if (hasUnicodeFlag) {
  47538. var second;
  47539. if (_char.length === 1 && first >= 0xD800 && first <= 0xDBFF) {
  47540. second = lookahead().charCodeAt(0);
  47541. if (second >= 0xDC00 && second <= 0xDFFF) {
  47542. // Unicode surrogate pair
  47543. pos++;
  47544. return createValue('symbol', (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000, pos - 2, pos);
  47545. }
  47546. }
  47547. }
  47548. return createValue('symbol', first, pos - 1, pos);
  47549. }
  47550. function createDisjunction(alternatives, from, to) {
  47551. return addRaw({
  47552. type: 'disjunction',
  47553. body: alternatives,
  47554. range: [from, to]
  47555. });
  47556. }
  47557. function createDot() {
  47558. return addRaw({
  47559. type: 'dot',
  47560. range: [pos - 1, pos]
  47561. });
  47562. }
  47563. function createCharacterClassEscape(value) {
  47564. return addRaw({
  47565. type: 'characterClassEscape',
  47566. value: value,
  47567. range: [pos - 2, pos]
  47568. });
  47569. }
  47570. function createReference(matchIndex) {
  47571. return addRaw({
  47572. type: 'reference',
  47573. matchIndex: parseInt(matchIndex, 10),
  47574. range: [pos - 1 - matchIndex.length, pos]
  47575. });
  47576. }
  47577. function createGroup(behavior, disjunction, from, to) {
  47578. return addRaw({
  47579. type: 'group',
  47580. behavior: behavior,
  47581. body: disjunction,
  47582. range: [from, to]
  47583. });
  47584. }
  47585. function createQuantifier(min, max, from, to) {
  47586. if (to == null) {
  47587. from = pos - 1;
  47588. to = pos;
  47589. }
  47590. return addRaw({
  47591. type: 'quantifier',
  47592. min: min,
  47593. max: max,
  47594. greedy: true,
  47595. body: null, // set later on
  47596. range: [from, to]
  47597. });
  47598. }
  47599. function createAlternative(terms, from, to) {
  47600. return addRaw({
  47601. type: 'alternative',
  47602. body: terms,
  47603. range: [from, to]
  47604. });
  47605. }
  47606. function createCharacterClass(classRanges, negative, from, to) {
  47607. return addRaw({
  47608. type: 'characterClass',
  47609. body: classRanges,
  47610. negative: negative,
  47611. range: [from, to]
  47612. });
  47613. }
  47614. function createClassRange(min, max, from, to) {
  47615. // See 15.10.2.15:
  47616. if (min.codePoint > max.codePoint) {
  47617. bail('invalid range in character class', min.raw + '-' + max.raw, from, to);
  47618. }
  47619. return addRaw({
  47620. type: 'characterClassRange',
  47621. min: min,
  47622. max: max,
  47623. range: [from, to]
  47624. });
  47625. }
  47626. function flattenBody(body) {
  47627. if (body.type === 'alternative') {
  47628. return body.body;
  47629. } else {
  47630. return [body];
  47631. }
  47632. }
  47633. function isEmpty(obj) {
  47634. return obj.type === 'empty';
  47635. }
  47636. function incr(amount) {
  47637. amount = amount || 1;
  47638. var res = str.substring(pos, pos + amount);
  47639. pos += amount || 1;
  47640. return res;
  47641. }
  47642. function skip(value) {
  47643. if (!match(value)) {
  47644. bail('character', value);
  47645. }
  47646. }
  47647. function match(value) {
  47648. if (str.indexOf(value, pos) === pos) {
  47649. return incr(value.length);
  47650. }
  47651. }
  47652. function lookahead() {
  47653. return str[pos];
  47654. }
  47655. function current(value) {
  47656. return str.indexOf(value, pos) === pos;
  47657. }
  47658. function next(value) {
  47659. return str[pos + 1] === value;
  47660. }
  47661. function matchReg(regExp) {
  47662. var subStr = str.substring(pos);
  47663. var res = subStr.match(regExp);
  47664. if (res) {
  47665. res.range = [];
  47666. res.range[0] = pos;
  47667. incr(res[0].length);
  47668. res.range[1] = pos;
  47669. }
  47670. return res;
  47671. }
  47672. function parseDisjunction() {
  47673. // Disjunction ::
  47674. // Alternative
  47675. // Alternative | Disjunction
  47676. var res = [],
  47677. from = pos;
  47678. res.push(parseAlternative());
  47679. while (match('|')) {
  47680. res.push(parseAlternative());
  47681. }
  47682. if (res.length === 1) {
  47683. return res[0];
  47684. }
  47685. return createDisjunction(res, from, pos);
  47686. }
  47687. function parseAlternative() {
  47688. var res = [],
  47689. from = pos;
  47690. var term;
  47691. // Alternative ::
  47692. // [empty]
  47693. // Alternative Term
  47694. while (term = parseTerm()) {
  47695. res.push(term);
  47696. }
  47697. if (res.length === 1) {
  47698. return res[0];
  47699. }
  47700. return createAlternative(res, from, pos);
  47701. }
  47702. function parseTerm() {
  47703. // Term ::
  47704. // Anchor
  47705. // Atom
  47706. // Atom Quantifier
  47707. if (pos >= str.length || current('|') || current(')')) {
  47708. return null; /* Means: The term is empty */
  47709. }
  47710. var anchor = parseAnchor();
  47711. if (anchor) {
  47712. return anchor;
  47713. }
  47714. var atom = parseAtom();
  47715. if (!atom) {
  47716. bail('Expected atom');
  47717. }
  47718. var quantifier = parseQuantifier() || false;
  47719. if (quantifier) {
  47720. quantifier.body = flattenBody(atom);
  47721. // The quantifier contains the atom. Therefore, the beginning of the
  47722. // quantifier range is given by the beginning of the atom.
  47723. updateRawStart(quantifier, atom.range[0]);
  47724. return quantifier;
  47725. }
  47726. return atom;
  47727. }
  47728. function parseGroup(matchA, typeA, matchB, typeB) {
  47729. var type = null,
  47730. from = pos;
  47731. if (match(matchA)) {
  47732. type = typeA;
  47733. } else if (match(matchB)) {
  47734. type = typeB;
  47735. } else {
  47736. return false;
  47737. }
  47738. var body = parseDisjunction();
  47739. if (!body) {
  47740. bail('Expected disjunction');
  47741. }
  47742. skip(')');
  47743. var group = createGroup(type, flattenBody(body), from, pos);
  47744. if (type == 'normal') {
  47745. // Keep track of the number of closed groups. This is required for
  47746. // parseDecimalEscape(). In case the string is parsed a second time the
  47747. // value already holds the total count and no incrementation is required.
  47748. if (firstIteration) {
  47749. closedCaptureCounter++;
  47750. }
  47751. }
  47752. return group;
  47753. }
  47754. function parseAnchor() {
  47755. // Anchor ::
  47756. // ^
  47757. // $
  47758. // \ b
  47759. // \ B
  47760. // ( ? = Disjunction )
  47761. // ( ? ! Disjunction )
  47762. var res,
  47763. from = pos;
  47764. if (match('^')) {
  47765. return createAnchor('start', 1 /* rawLength */);
  47766. } else if (match('$')) {
  47767. return createAnchor('end', 1 /* rawLength */);
  47768. } else if (match('\\b')) {
  47769. return createAnchor('boundary', 2 /* rawLength */);
  47770. } else if (match('\\B')) {
  47771. return createAnchor('not-boundary', 2 /* rawLength */);
  47772. } else {
  47773. return parseGroup('(?=', 'lookahead', '(?!', 'negativeLookahead');
  47774. }
  47775. }
  47776. function parseQuantifier() {
  47777. // Quantifier ::
  47778. // QuantifierPrefix
  47779. // QuantifierPrefix ?
  47780. //
  47781. // QuantifierPrefix ::
  47782. // *
  47783. // +
  47784. // ?
  47785. // { DecimalDigits }
  47786. // { DecimalDigits , }
  47787. // { DecimalDigits , DecimalDigits }
  47788. var res,
  47789. from = pos;
  47790. var quantifier;
  47791. var min, max;
  47792. if (match('*')) {
  47793. quantifier = createQuantifier(0);
  47794. } else if (match('+')) {
  47795. quantifier = createQuantifier(1);
  47796. } else if (match('?')) {
  47797. quantifier = createQuantifier(0, 1);
  47798. } else if (res = matchReg(/^\{([0-9]+)\}/)) {
  47799. min = parseInt(res[1], 10);
  47800. quantifier = createQuantifier(min, min, res.range[0], res.range[1]);
  47801. } else if (res = matchReg(/^\{([0-9]+),\}/)) {
  47802. min = parseInt(res[1], 10);
  47803. quantifier = createQuantifier(min, undefined, res.range[0], res.range[1]);
  47804. } else if (res = matchReg(/^\{([0-9]+),([0-9]+)\}/)) {
  47805. min = parseInt(res[1], 10);
  47806. max = parseInt(res[2], 10);
  47807. if (min > max) {
  47808. bail('numbers out of order in {} quantifier', '', from, pos);
  47809. }
  47810. quantifier = createQuantifier(min, max, res.range[0], res.range[1]);
  47811. }
  47812. if (quantifier) {
  47813. if (match('?')) {
  47814. quantifier.greedy = false;
  47815. quantifier.range[1] += 1;
  47816. }
  47817. }
  47818. return quantifier;
  47819. }
  47820. function parseAtom() {
  47821. // Atom ::
  47822. // PatternCharacter
  47823. // .
  47824. // \ AtomEscape
  47825. // CharacterClass
  47826. // ( Disjunction )
  47827. // ( ? : Disjunction )
  47828. var res;
  47829. // jviereck: allow ']', '}' here as well to be compatible with browser's
  47830. // implementations: ']'.match(/]/);
  47831. // if (res = matchReg(/^[^^$\\.*+?()[\]{}|]/)) {
  47832. if (res = matchReg(/^[^^$\\.*+?(){[|]/)) {
  47833. // PatternCharacter
  47834. return createCharacter(res);
  47835. } else if (match('.')) {
  47836. // .
  47837. return createDot();
  47838. } else if (match('\\')) {
  47839. // \ AtomEscape
  47840. res = parseAtomEscape();
  47841. if (!res) {
  47842. bail('atomEscape');
  47843. }
  47844. return res;
  47845. } else if (res = parseCharacterClass()) {
  47846. return res;
  47847. } else {
  47848. // ( Disjunction )
  47849. // ( ? : Disjunction )
  47850. return parseGroup('(?:', 'ignore', '(', 'normal');
  47851. }
  47852. }
  47853. function parseUnicodeSurrogatePairEscape(firstEscape) {
  47854. if (hasUnicodeFlag) {
  47855. var first, second;
  47856. if (firstEscape.kind == 'unicodeEscape' && (first = firstEscape.codePoint) >= 0xD800 && first <= 0xDBFF && current('\\') && next('u')) {
  47857. var prevPos = pos;
  47858. pos++;
  47859. var secondEscape = parseClassEscape();
  47860. if (secondEscape.kind == 'unicodeEscape' && (second = secondEscape.codePoint) >= 0xDC00 && second <= 0xDFFF) {
  47861. // Unicode surrogate pair
  47862. firstEscape.range[1] = secondEscape.range[1];
  47863. firstEscape.codePoint = (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;
  47864. firstEscape.type = 'value';
  47865. firstEscape.kind = 'unicodeCodePointEscape';
  47866. addRaw(firstEscape);
  47867. } else {
  47868. pos = prevPos;
  47869. }
  47870. }
  47871. }
  47872. return firstEscape;
  47873. }
  47874. function parseClassEscape() {
  47875. return parseAtomEscape(true);
  47876. }
  47877. function parseAtomEscape(insideCharacterClass) {
  47878. // AtomEscape ::
  47879. // DecimalEscape
  47880. // CharacterEscape
  47881. // CharacterClassEscape
  47882. var res,
  47883. from = pos;
  47884. res = parseDecimalEscape();
  47885. if (res) {
  47886. return res;
  47887. }
  47888. // For ClassEscape
  47889. if (insideCharacterClass) {
  47890. if (match('b')) {
  47891. // 15.10.2.19
  47892. // The production ClassEscape :: b evaluates by returning the
  47893. // CharSet containing the one character <BS> (Unicode value 0008).
  47894. return createEscaped('singleEscape', 0x0008, '\\b');
  47895. } else if (match('B')) {
  47896. bail('\\B not possible inside of CharacterClass', '', from);
  47897. }
  47898. }
  47899. res = parseCharacterEscape();
  47900. return res;
  47901. }
  47902. function parseDecimalEscape() {
  47903. // DecimalEscape ::
  47904. // DecimalIntegerLiteral [lookahead ∉ DecimalDigit]
  47905. // CharacterClassEscape :: one of d D s S w W
  47906. var res, match;
  47907. if (res = matchReg(/^(?!0)\d+/)) {
  47908. match = res[0];
  47909. var refIdx = parseInt(res[0], 10);
  47910. if (refIdx <= closedCaptureCounter) {
  47911. // If the number is smaller than the normal-groups found so
  47912. // far, then it is a reference...
  47913. return createReference(res[0]);
  47914. } else {
  47915. // ... otherwise it needs to be interpreted as a octal (if the
  47916. // number is in an octal format). If it is NOT octal format,
  47917. // then the slash is ignored and the number is matched later
  47918. // as normal characters.
  47919. // Recall the negative decision to decide if the input must be parsed
  47920. // a second time with the total normal-groups.
  47921. backrefDenied.push(refIdx);
  47922. // Reset the position again, as maybe only parts of the previous
  47923. // matched numbers are actual octal numbers. E.g. in '019' only
  47924. // the '01' should be matched.
  47925. incr(-res[0].length);
  47926. if (res = matchReg(/^[0-7]{1,3}/)) {
  47927. return createEscaped('octal', parseInt(res[0], 8), res[0], 1);
  47928. } else {
  47929. // If we end up here, we have a case like /\91/. Then the
  47930. // first slash is to be ignored and the 9 & 1 to be treated
  47931. // like ordinary characters. Create a character for the
  47932. // first number only here - other number-characters
  47933. // (if available) will be matched later.
  47934. res = createCharacter(matchReg(/^[89]/));
  47935. return updateRawStart(res, res.range[0] - 1);
  47936. }
  47937. }
  47938. }
  47939. // Only allow octal numbers in the following. All matched numbers start
  47940. // with a zero (if the do not, the previous if-branch is executed).
  47941. // If the number is not octal format and starts with zero (e.g. `091`)
  47942. // then only the zeros `0` is treated here and the `91` are ordinary
  47943. // characters.
  47944. // Example:
  47945. // /\091/.exec('\091')[0].length === 3
  47946. else if (res = matchReg(/^[0-7]{1,3}/)) {
  47947. match = res[0];
  47948. if (/^0{1,3}$/.test(match)) {
  47949. // If they are all zeros, then only take the first one.
  47950. return createEscaped('null', 0x0000, '0', match.length + 1);
  47951. } else {
  47952. return createEscaped('octal', parseInt(match, 8), match, 1);
  47953. }
  47954. } else if (res = matchReg(/^[dDsSwW]/)) {
  47955. return createCharacterClassEscape(res[0]);
  47956. }
  47957. return false;
  47958. }
  47959. function parseCharacterEscape() {
  47960. // CharacterEscape ::
  47961. // ControlEscape
  47962. // c ControlLetter
  47963. // HexEscapeSequence
  47964. // UnicodeEscapeSequence
  47965. // IdentityEscape
  47966. var res;
  47967. if (res = matchReg(/^[fnrtv]/)) {
  47968. // ControlEscape
  47969. var codePoint = 0;
  47970. switch (res[0]) {
  47971. case 't':
  47972. codePoint = 0x009;break;
  47973. case 'n':
  47974. codePoint = 0x00A;break;
  47975. case 'v':
  47976. codePoint = 0x00B;break;
  47977. case 'f':
  47978. codePoint = 0x00C;break;
  47979. case 'r':
  47980. codePoint = 0x00D;break;
  47981. }
  47982. return createEscaped('singleEscape', codePoint, '\\' + res[0]);
  47983. } else if (res = matchReg(/^c([a-zA-Z])/)) {
  47984. // c ControlLetter
  47985. return createEscaped('controlLetter', res[1].charCodeAt(0) % 32, res[1], 2);
  47986. } else if (res = matchReg(/^x([0-9a-fA-F]{2})/)) {
  47987. // HexEscapeSequence
  47988. return createEscaped('hexadecimalEscape', parseInt(res[1], 16), res[1], 2);
  47989. } else if (res = matchReg(/^u([0-9a-fA-F]{4})/)) {
  47990. // UnicodeEscapeSequence
  47991. return parseUnicodeSurrogatePairEscape(createEscaped('unicodeEscape', parseInt(res[1], 16), res[1], 2));
  47992. } else if (hasUnicodeFlag && (res = matchReg(/^u\{([0-9a-fA-F]+)\}/))) {
  47993. // RegExpUnicodeEscapeSequence (ES6 Unicode code point escape)
  47994. return createEscaped('unicodeCodePointEscape', parseInt(res[1], 16), res[1], 4);
  47995. } else {
  47996. // IdentityEscape
  47997. return parseIdentityEscape();
  47998. }
  47999. }
  48000. // Taken from the Esprima parser.
  48001. function isIdentifierPart(ch) {
  48002. // Generated by `tools/generate-identifier-regex.js`.
  48003. var NonAsciiIdentifierPart = new RegExp('[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B2\u08E4-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58\u0C59\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D60-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA69D\uA69F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2D\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]');
  48004. return ch === 36 || ch === 95 || // $ (dollar) and _ (underscore)
  48005. ch >= 65 && ch <= 90 || // A..Z
  48006. ch >= 97 && ch <= 122 || // a..z
  48007. ch >= 48 && ch <= 57 || // 0..9
  48008. ch === 92 || // \ (backslash)
  48009. ch >= 0x80 && NonAsciiIdentifierPart.test(String.fromCharCode(ch));
  48010. }
  48011. function parseIdentityEscape() {
  48012. // IdentityEscape ::
  48013. // SourceCharacter but not IdentifierPart
  48014. // <ZWJ>
  48015. // <ZWNJ>
  48016. var ZWJ = '\u200C';
  48017. var ZWNJ = '\u200D';
  48018. var tmp;
  48019. if (!isIdentifierPart(lookahead())) {
  48020. tmp = incr();
  48021. return createEscaped('identifier', tmp.charCodeAt(0), tmp, 1);
  48022. }
  48023. if (match(ZWJ)) {
  48024. // <ZWJ>
  48025. return createEscaped('identifier', 0x200C, ZWJ);
  48026. } else if (match(ZWNJ)) {
  48027. // <ZWNJ>
  48028. return createEscaped('identifier', 0x200D, ZWNJ);
  48029. }
  48030. return null;
  48031. }
  48032. function parseCharacterClass() {
  48033. // CharacterClass ::
  48034. // [ [lookahead ∉ {^}] ClassRanges ]
  48035. // [ ^ ClassRanges ]
  48036. var res,
  48037. from = pos;
  48038. if (res = matchReg(/^\[\^/)) {
  48039. res = parseClassRanges();
  48040. skip(']');
  48041. return createCharacterClass(res, true, from, pos);
  48042. } else if (match('[')) {
  48043. res = parseClassRanges();
  48044. skip(']');
  48045. return createCharacterClass(res, false, from, pos);
  48046. }
  48047. return null;
  48048. }
  48049. function parseClassRanges() {
  48050. // ClassRanges ::
  48051. // [empty]
  48052. // NonemptyClassRanges
  48053. var res;
  48054. if (current(']')) {
  48055. // Empty array means nothing insinde of the ClassRange.
  48056. return [];
  48057. } else {
  48058. res = parseNonemptyClassRanges();
  48059. if (!res) {
  48060. bail('nonEmptyClassRanges');
  48061. }
  48062. return res;
  48063. }
  48064. }
  48065. function parseHelperClassRanges(atom) {
  48066. var from, to, res;
  48067. if (current('-') && !next(']')) {
  48068. // ClassAtom - ClassAtom ClassRanges
  48069. skip('-');
  48070. res = parseClassAtom();
  48071. if (!res) {
  48072. bail('classAtom');
  48073. }
  48074. to = pos;
  48075. var classRanges = parseClassRanges();
  48076. if (!classRanges) {
  48077. bail('classRanges');
  48078. }
  48079. from = atom.range[0];
  48080. if (classRanges.type === 'empty') {
  48081. return [createClassRange(atom, res, from, to)];
  48082. }
  48083. return [createClassRange(atom, res, from, to)].concat(classRanges);
  48084. }
  48085. res = parseNonemptyClassRangesNoDash();
  48086. if (!res) {
  48087. bail('nonEmptyClassRangesNoDash');
  48088. }
  48089. return [atom].concat(res);
  48090. }
  48091. function parseNonemptyClassRanges() {
  48092. // NonemptyClassRanges ::
  48093. // ClassAtom
  48094. // ClassAtom NonemptyClassRangesNoDash
  48095. // ClassAtom - ClassAtom ClassRanges
  48096. var atom = parseClassAtom();
  48097. if (!atom) {
  48098. bail('classAtom');
  48099. }
  48100. if (current(']')) {
  48101. // ClassAtom
  48102. return [atom];
  48103. }
  48104. // ClassAtom NonemptyClassRangesNoDash
  48105. // ClassAtom - ClassAtom ClassRanges
  48106. return parseHelperClassRanges(atom);
  48107. }
  48108. function parseNonemptyClassRangesNoDash() {
  48109. // NonemptyClassRangesNoDash ::
  48110. // ClassAtom
  48111. // ClassAtomNoDash NonemptyClassRangesNoDash
  48112. // ClassAtomNoDash - ClassAtom ClassRanges
  48113. var res = parseClassAtom();
  48114. if (!res) {
  48115. bail('classAtom');
  48116. }
  48117. if (current(']')) {
  48118. // ClassAtom
  48119. return res;
  48120. }
  48121. // ClassAtomNoDash NonemptyClassRangesNoDash
  48122. // ClassAtomNoDash - ClassAtom ClassRanges
  48123. return parseHelperClassRanges(res);
  48124. }
  48125. function parseClassAtom() {
  48126. // ClassAtom ::
  48127. // -
  48128. // ClassAtomNoDash
  48129. if (match('-')) {
  48130. return createCharacter('-');
  48131. } else {
  48132. return parseClassAtomNoDash();
  48133. }
  48134. }
  48135. function parseClassAtomNoDash() {
  48136. // ClassAtomNoDash ::
  48137. // SourceCharacter but not one of \ or ] or -
  48138. // \ ClassEscape
  48139. var res;
  48140. if (res = matchReg(/^[^\\\]-]/)) {
  48141. return createCharacter(res[0]);
  48142. } else if (match('\\')) {
  48143. res = parseClassEscape();
  48144. if (!res) {
  48145. bail('classEscape');
  48146. }
  48147. return parseUnicodeSurrogatePairEscape(res);
  48148. }
  48149. }
  48150. function bail(message, details, from, to) {
  48151. from = from == null ? pos : from;
  48152. to = to == null ? from : to;
  48153. var contextStart = Math.max(0, from - 10);
  48154. var contextEnd = Math.min(to + 10, str.length);
  48155. // Output a bit of context and a line pointing to where our error is.
  48156. //
  48157. // We are assuming that there are no actual newlines in the content as this is a regular expression.
  48158. var context = ' ' + str.substring(contextStart, contextEnd);
  48159. var pointer = ' ' + new Array(from - contextStart + 1).join(' ') + '^';
  48160. throw SyntaxError(message + ' at position ' + from + (details ? ': ' + details : '') + '\n' + context + '\n' + pointer);
  48161. }
  48162. var backrefDenied = [];
  48163. var closedCaptureCounter = 0;
  48164. var firstIteration = true;
  48165. var hasUnicodeFlag = (flags || "").indexOf("u") !== -1;
  48166. var pos = 0;
  48167. // Convert the input to a string and treat the empty string special.
  48168. str = String(str);
  48169. if (str === '') {
  48170. str = '(?:)';
  48171. }
  48172. var result = parseDisjunction();
  48173. if (result.range[1] !== str.length) {
  48174. bail('Could not parse entire input - got stuck', '', result.range[1]);
  48175. }
  48176. // The spec requires to interpret the `\2` in `/\2()()/` as backreference.
  48177. // As the parser collects the number of capture groups as the string is
  48178. // parsed it is impossible to make these decisions at the point when the
  48179. // `\2` is handled. In case the local decision turns out to be wrong after
  48180. // the parsing has finished, the input string is parsed a second time with
  48181. // the total number of capture groups set.
  48182. //
  48183. // SEE: https://github.com/jviereck/regjsparser/issues/70
  48184. for (var i = 0; i < backrefDenied.length; i++) {
  48185. if (backrefDenied[i] <= closedCaptureCounter) {
  48186. // Parse the input a second time.
  48187. pos = 0;
  48188. firstIteration = false;
  48189. return parseDisjunction();
  48190. }
  48191. }
  48192. return result;
  48193. }
  48194. var regjsparser = {
  48195. parse: parse
  48196. };
  48197. if (typeof module !== 'undefined' && module.exports) {
  48198. module.exports = regjsparser;
  48199. } else {
  48200. window.regjsparser = regjsparser;
  48201. }
  48202. })();
  48203. /***/ }),
  48204. /* 615 */
  48205. /***/ (function(module, exports, __webpack_require__) {
  48206. 'use strict';
  48207. var isFinite = __webpack_require__(467);
  48208. module.exports = function (str, n) {
  48209. if (typeof str !== 'string') {
  48210. throw new TypeError('Expected `input` to be a string');
  48211. }
  48212. if (n < 0 || !isFinite(n)) {
  48213. throw new TypeError('Expected `count` to be a positive finite number');
  48214. }
  48215. var ret = '';
  48216. do {
  48217. if (n & 1) {
  48218. ret += str;
  48219. }
  48220. str += str;
  48221. } while (n >>= 1);
  48222. return ret;
  48223. };
  48224. /***/ }),
  48225. /* 616 */
  48226. /***/ (function(module, exports) {
  48227. 'use strict';
  48228. /* -*- Mode: js; js-indent-level: 2; -*- */
  48229. /*
  48230. * Copyright 2011 Mozilla Foundation and contributors
  48231. * Licensed under the New BSD license. See LICENSE or:
  48232. * http://opensource.org/licenses/BSD-3-Clause
  48233. */
  48234. var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');
  48235. /**
  48236. * Encode an integer in the range of 0 to 63 to a single base 64 digit.
  48237. */
  48238. exports.encode = function (number) {
  48239. if (0 <= number && number < intToCharMap.length) {
  48240. return intToCharMap[number];
  48241. }
  48242. throw new TypeError("Must be between 0 and 63: " + number);
  48243. };
  48244. /**
  48245. * Decode a single base 64 character code digit to an integer. Returns -1 on
  48246. * failure.
  48247. */
  48248. exports.decode = function (charCode) {
  48249. var bigA = 65; // 'A'
  48250. var bigZ = 90; // 'Z'
  48251. var littleA = 97; // 'a'
  48252. var littleZ = 122; // 'z'
  48253. var zero = 48; // '0'
  48254. var nine = 57; // '9'
  48255. var plus = 43; // '+'
  48256. var slash = 47; // '/'
  48257. var littleOffset = 26;
  48258. var numberOffset = 52;
  48259. // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ
  48260. if (bigA <= charCode && charCode <= bigZ) {
  48261. return charCode - bigA;
  48262. }
  48263. // 26 - 51: abcdefghijklmnopqrstuvwxyz
  48264. if (littleA <= charCode && charCode <= littleZ) {
  48265. return charCode - littleA + littleOffset;
  48266. }
  48267. // 52 - 61: 0123456789
  48268. if (zero <= charCode && charCode <= nine) {
  48269. return charCode - zero + numberOffset;
  48270. }
  48271. // 62: +
  48272. if (charCode == plus) {
  48273. return 62;
  48274. }
  48275. // 63: /
  48276. if (charCode == slash) {
  48277. return 63;
  48278. }
  48279. // Invalid base64 digit.
  48280. return -1;
  48281. };
  48282. /***/ }),
  48283. /* 617 */
  48284. /***/ (function(module, exports) {
  48285. "use strict";
  48286. /* -*- Mode: js; js-indent-level: 2; -*- */
  48287. /*
  48288. * Copyright 2011 Mozilla Foundation and contributors
  48289. * Licensed under the New BSD license. See LICENSE or:
  48290. * http://opensource.org/licenses/BSD-3-Clause
  48291. */
  48292. exports.GREATEST_LOWER_BOUND = 1;
  48293. exports.LEAST_UPPER_BOUND = 2;
  48294. /**
  48295. * Recursive implementation of binary search.
  48296. *
  48297. * @param aLow Indices here and lower do not contain the needle.
  48298. * @param aHigh Indices here and higher do not contain the needle.
  48299. * @param aNeedle The element being searched for.
  48300. * @param aHaystack The non-empty array being searched.
  48301. * @param aCompare Function which takes two elements and returns -1, 0, or 1.
  48302. * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
  48303. * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
  48304. * closest element that is smaller than or greater than the one we are
  48305. * searching for, respectively, if the exact element cannot be found.
  48306. */
  48307. function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {
  48308. // This function terminates when one of the following is true:
  48309. //
  48310. // 1. We find the exact element we are looking for.
  48311. //
  48312. // 2. We did not find the exact element, but we can return the index of
  48313. // the next-closest element.
  48314. //
  48315. // 3. We did not find the exact element, and there is no next-closest
  48316. // element than the one we are searching for, so we return -1.
  48317. var mid = Math.floor((aHigh - aLow) / 2) + aLow;
  48318. var cmp = aCompare(aNeedle, aHaystack[mid], true);
  48319. if (cmp === 0) {
  48320. // Found the element we are looking for.
  48321. return mid;
  48322. } else if (cmp > 0) {
  48323. // Our needle is greater than aHaystack[mid].
  48324. if (aHigh - mid > 1) {
  48325. // The element is in the upper half.
  48326. return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);
  48327. }
  48328. // The exact needle element was not found in this haystack. Determine if
  48329. // we are in termination case (3) or (2) and return the appropriate thing.
  48330. if (aBias == exports.LEAST_UPPER_BOUND) {
  48331. return aHigh < aHaystack.length ? aHigh : -1;
  48332. } else {
  48333. return mid;
  48334. }
  48335. } else {
  48336. // Our needle is less than aHaystack[mid].
  48337. if (mid - aLow > 1) {
  48338. // The element is in the lower half.
  48339. return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);
  48340. }
  48341. // we are in termination case (3) or (2) and return the appropriate thing.
  48342. if (aBias == exports.LEAST_UPPER_BOUND) {
  48343. return mid;
  48344. } else {
  48345. return aLow < 0 ? -1 : aLow;
  48346. }
  48347. }
  48348. }
  48349. /**
  48350. * This is an implementation of binary search which will always try and return
  48351. * the index of the closest element if there is no exact hit. This is because
  48352. * mappings between original and generated line/col pairs are single points,
  48353. * and there is an implicit region between each of them, so a miss just means
  48354. * that you aren't on the very start of a region.
  48355. *
  48356. * @param aNeedle The element you are looking for.
  48357. * @param aHaystack The array that is being searched.
  48358. * @param aCompare A function which takes the needle and an element in the
  48359. * array and returns -1, 0, or 1 depending on whether the needle is less
  48360. * than, equal to, or greater than the element, respectively.
  48361. * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
  48362. * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
  48363. * closest element that is smaller than or greater than the one we are
  48364. * searching for, respectively, if the exact element cannot be found.
  48365. * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'.
  48366. */
  48367. exports.search = function search(aNeedle, aHaystack, aCompare, aBias) {
  48368. if (aHaystack.length === 0) {
  48369. return -1;
  48370. }
  48371. var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, aCompare, aBias || exports.GREATEST_LOWER_BOUND);
  48372. if (index < 0) {
  48373. return -1;
  48374. }
  48375. // We have found either the exact element, or the next-closest element than
  48376. // the one we are searching for. However, there may be more than one such
  48377. // element. Make sure we always return the smallest of these.
  48378. while (index - 1 >= 0) {
  48379. if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {
  48380. break;
  48381. }
  48382. --index;
  48383. }
  48384. return index;
  48385. };
  48386. /***/ }),
  48387. /* 618 */
  48388. /***/ (function(module, exports, __webpack_require__) {
  48389. 'use strict';
  48390. /* -*- Mode: js; js-indent-level: 2; -*- */
  48391. /*
  48392. * Copyright 2014 Mozilla Foundation and contributors
  48393. * Licensed under the New BSD license. See LICENSE or:
  48394. * http://opensource.org/licenses/BSD-3-Clause
  48395. */
  48396. var util = __webpack_require__(63);
  48397. /**
  48398. * Determine whether mappingB is after mappingA with respect to generated
  48399. * position.
  48400. */
  48401. function generatedPositionAfter(mappingA, mappingB) {
  48402. // Optimized for most common case
  48403. var lineA = mappingA.generatedLine;
  48404. var lineB = mappingB.generatedLine;
  48405. var columnA = mappingA.generatedColumn;
  48406. var columnB = mappingB.generatedColumn;
  48407. return lineB > lineA || lineB == lineA && columnB >= columnA || util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;
  48408. }
  48409. /**
  48410. * A data structure to provide a sorted view of accumulated mappings in a
  48411. * performance conscious manner. It trades a neglibable overhead in general
  48412. * case for a large speedup in case of mappings being added in order.
  48413. */
  48414. function MappingList() {
  48415. this._array = [];
  48416. this._sorted = true;
  48417. // Serves as infimum
  48418. this._last = { generatedLine: -1, generatedColumn: 0 };
  48419. }
  48420. /**
  48421. * Iterate through internal items. This method takes the same arguments that
  48422. * `Array.prototype.forEach` takes.
  48423. *
  48424. * NOTE: The order of the mappings is NOT guaranteed.
  48425. */
  48426. MappingList.prototype.unsortedForEach = function MappingList_forEach(aCallback, aThisArg) {
  48427. this._array.forEach(aCallback, aThisArg);
  48428. };
  48429. /**
  48430. * Add the given source mapping.
  48431. *
  48432. * @param Object aMapping
  48433. */
  48434. MappingList.prototype.add = function MappingList_add(aMapping) {
  48435. if (generatedPositionAfter(this._last, aMapping)) {
  48436. this._last = aMapping;
  48437. this._array.push(aMapping);
  48438. } else {
  48439. this._sorted = false;
  48440. this._array.push(aMapping);
  48441. }
  48442. };
  48443. /**
  48444. * Returns the flat, sorted array of mappings. The mappings are sorted by
  48445. * generated position.
  48446. *
  48447. * WARNING: This method returns internal data without copying, for
  48448. * performance. The return value must NOT be mutated, and should be treated as
  48449. * an immutable borrow. If you want to take ownership, you must make your own
  48450. * copy.
  48451. */
  48452. MappingList.prototype.toArray = function MappingList_toArray() {
  48453. if (!this._sorted) {
  48454. this._array.sort(util.compareByGeneratedPositionsInflated);
  48455. this._sorted = true;
  48456. }
  48457. return this._array;
  48458. };
  48459. exports.MappingList = MappingList;
  48460. /***/ }),
  48461. /* 619 */
  48462. /***/ (function(module, exports) {
  48463. "use strict";
  48464. /* -*- Mode: js; js-indent-level: 2; -*- */
  48465. /*
  48466. * Copyright 2011 Mozilla Foundation and contributors
  48467. * Licensed under the New BSD license. See LICENSE or:
  48468. * http://opensource.org/licenses/BSD-3-Clause
  48469. */
  48470. // It turns out that some (most?) JavaScript engines don't self-host
  48471. // `Array.prototype.sort`. This makes sense because C++ will likely remain
  48472. // faster than JS when doing raw CPU-intensive sorting. However, when using a
  48473. // custom comparator function, calling back and forth between the VM's C++ and
  48474. // JIT'd JS is rather slow *and* loses JIT type information, resulting in
  48475. // worse generated code for the comparator function than would be optimal. In
  48476. // fact, when sorting with a comparator, these costs outweigh the benefits of
  48477. // sorting in C++. By using our own JS-implemented Quick Sort (below), we get
  48478. // a ~3500ms mean speed-up in `bench/bench.html`.
  48479. /**
  48480. * Swap the elements indexed by `x` and `y` in the array `ary`.
  48481. *
  48482. * @param {Array} ary
  48483. * The array.
  48484. * @param {Number} x
  48485. * The index of the first item.
  48486. * @param {Number} y
  48487. * The index of the second item.
  48488. */
  48489. function swap(ary, x, y) {
  48490. var temp = ary[x];
  48491. ary[x] = ary[y];
  48492. ary[y] = temp;
  48493. }
  48494. /**
  48495. * Returns a random integer within the range `low .. high` inclusive.
  48496. *
  48497. * @param {Number} low
  48498. * The lower bound on the range.
  48499. * @param {Number} high
  48500. * The upper bound on the range.
  48501. */
  48502. function randomIntInRange(low, high) {
  48503. return Math.round(low + Math.random() * (high - low));
  48504. }
  48505. /**
  48506. * The Quick Sort algorithm.
  48507. *
  48508. * @param {Array} ary
  48509. * An array to sort.
  48510. * @param {function} comparator
  48511. * Function to use to compare two items.
  48512. * @param {Number} p
  48513. * Start index of the array
  48514. * @param {Number} r
  48515. * End index of the array
  48516. */
  48517. function doQuickSort(ary, comparator, p, r) {
  48518. // If our lower bound is less than our upper bound, we (1) partition the
  48519. // array into two pieces and (2) recurse on each half. If it is not, this is
  48520. // the empty array and our base case.
  48521. if (p < r) {
  48522. // (1) Partitioning.
  48523. //
  48524. // The partitioning chooses a pivot between `p` and `r` and moves all
  48525. // elements that are less than or equal to the pivot to the before it, and
  48526. // all the elements that are greater than it after it. The effect is that
  48527. // once partition is done, the pivot is in the exact place it will be when
  48528. // the array is put in sorted order, and it will not need to be moved
  48529. // again. This runs in O(n) time.
  48530. // Always choose a random pivot so that an input array which is reverse
  48531. // sorted does not cause O(n^2) running time.
  48532. var pivotIndex = randomIntInRange(p, r);
  48533. var i = p - 1;
  48534. swap(ary, pivotIndex, r);
  48535. var pivot = ary[r];
  48536. // Immediately after `j` is incremented in this loop, the following hold
  48537. // true:
  48538. //
  48539. // * Every element in `ary[p .. i]` is less than or equal to the pivot.
  48540. //
  48541. // * Every element in `ary[i+1 .. j-1]` is greater than the pivot.
  48542. for (var j = p; j < r; j++) {
  48543. if (comparator(ary[j], pivot) <= 0) {
  48544. i += 1;
  48545. swap(ary, i, j);
  48546. }
  48547. }
  48548. swap(ary, i + 1, j);
  48549. var q = i + 1;
  48550. // (2) Recurse on each half.
  48551. doQuickSort(ary, comparator, p, q - 1);
  48552. doQuickSort(ary, comparator, q + 1, r);
  48553. }
  48554. }
  48555. /**
  48556. * Sort the given array in-place with the given comparator function.
  48557. *
  48558. * @param {Array} ary
  48559. * An array to sort.
  48560. * @param {function} comparator
  48561. * Function to use to compare two items.
  48562. */
  48563. exports.quickSort = function (ary, comparator) {
  48564. doQuickSort(ary, comparator, 0, ary.length - 1);
  48565. };
  48566. /***/ }),
  48567. /* 620 */
  48568. /***/ (function(module, exports, __webpack_require__) {
  48569. 'use strict';
  48570. /* -*- Mode: js; js-indent-level: 2; -*- */
  48571. /*
  48572. * Copyright 2011 Mozilla Foundation and contributors
  48573. * Licensed under the New BSD license. See LICENSE or:
  48574. * http://opensource.org/licenses/BSD-3-Clause
  48575. */
  48576. var util = __webpack_require__(63);
  48577. var binarySearch = __webpack_require__(617);
  48578. var ArraySet = __webpack_require__(285).ArraySet;
  48579. var base64VLQ = __webpack_require__(286);
  48580. var quickSort = __webpack_require__(619).quickSort;
  48581. function SourceMapConsumer(aSourceMap) {
  48582. var sourceMap = aSourceMap;
  48583. if (typeof aSourceMap === 'string') {
  48584. sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, ''));
  48585. }
  48586. return sourceMap.sections != null ? new IndexedSourceMapConsumer(sourceMap) : new BasicSourceMapConsumer(sourceMap);
  48587. }
  48588. SourceMapConsumer.fromSourceMap = function (aSourceMap) {
  48589. return BasicSourceMapConsumer.fromSourceMap(aSourceMap);
  48590. };
  48591. /**
  48592. * The version of the source mapping spec that we are consuming.
  48593. */
  48594. SourceMapConsumer.prototype._version = 3;
  48595. // `__generatedMappings` and `__originalMappings` are arrays that hold the
  48596. // parsed mapping coordinates from the source map's "mappings" attribute. They
  48597. // are lazily instantiated, accessed via the `_generatedMappings` and
  48598. // `_originalMappings` getters respectively, and we only parse the mappings
  48599. // and create these arrays once queried for a source location. We jump through
  48600. // these hoops because there can be many thousands of mappings, and parsing
  48601. // them is expensive, so we only want to do it if we must.
  48602. //
  48603. // Each object in the arrays is of the form:
  48604. //
  48605. // {
  48606. // generatedLine: The line number in the generated code,
  48607. // generatedColumn: The column number in the generated code,
  48608. // source: The path to the original source file that generated this
  48609. // chunk of code,
  48610. // originalLine: The line number in the original source that
  48611. // corresponds to this chunk of generated code,
  48612. // originalColumn: The column number in the original source that
  48613. // corresponds to this chunk of generated code,
  48614. // name: The name of the original symbol which generated this chunk of
  48615. // code.
  48616. // }
  48617. //
  48618. // All properties except for `generatedLine` and `generatedColumn` can be
  48619. // `null`.
  48620. //
  48621. // `_generatedMappings` is ordered by the generated positions.
  48622. //
  48623. // `_originalMappings` is ordered by the original positions.
  48624. SourceMapConsumer.prototype.__generatedMappings = null;
  48625. Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', {
  48626. get: function get() {
  48627. if (!this.__generatedMappings) {
  48628. this._parseMappings(this._mappings, this.sourceRoot);
  48629. }
  48630. return this.__generatedMappings;
  48631. }
  48632. });
  48633. SourceMapConsumer.prototype.__originalMappings = null;
  48634. Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', {
  48635. get: function get() {
  48636. if (!this.__originalMappings) {
  48637. this._parseMappings(this._mappings, this.sourceRoot);
  48638. }
  48639. return this.__originalMappings;
  48640. }
  48641. });
  48642. SourceMapConsumer.prototype._charIsMappingSeparator = function SourceMapConsumer_charIsMappingSeparator(aStr, index) {
  48643. var c = aStr.charAt(index);
  48644. return c === ";" || c === ",";
  48645. };
  48646. /**
  48647. * Parse the mappings in a string in to a data structure which we can easily
  48648. * query (the ordered arrays in the `this.__generatedMappings` and
  48649. * `this.__originalMappings` properties).
  48650. */
  48651. SourceMapConsumer.prototype._parseMappings = function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
  48652. throw new Error("Subclasses must implement _parseMappings");
  48653. };
  48654. SourceMapConsumer.GENERATED_ORDER = 1;
  48655. SourceMapConsumer.ORIGINAL_ORDER = 2;
  48656. SourceMapConsumer.GREATEST_LOWER_BOUND = 1;
  48657. SourceMapConsumer.LEAST_UPPER_BOUND = 2;
  48658. /**
  48659. * Iterate over each mapping between an original source/line/column and a
  48660. * generated line/column in this source map.
  48661. *
  48662. * @param Function aCallback
  48663. * The function that is called with each mapping.
  48664. * @param Object aContext
  48665. * Optional. If specified, this object will be the value of `this` every
  48666. * time that `aCallback` is called.
  48667. * @param aOrder
  48668. * Either `SourceMapConsumer.GENERATED_ORDER` or
  48669. * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to
  48670. * iterate over the mappings sorted by the generated file's line/column
  48671. * order or the original's source/line/column order, respectively. Defaults to
  48672. * `SourceMapConsumer.GENERATED_ORDER`.
  48673. */
  48674. SourceMapConsumer.prototype.eachMapping = function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {
  48675. var context = aContext || null;
  48676. var order = aOrder || SourceMapConsumer.GENERATED_ORDER;
  48677. var mappings;
  48678. switch (order) {
  48679. case SourceMapConsumer.GENERATED_ORDER:
  48680. mappings = this._generatedMappings;
  48681. break;
  48682. case SourceMapConsumer.ORIGINAL_ORDER:
  48683. mappings = this._originalMappings;
  48684. break;
  48685. default:
  48686. throw new Error("Unknown order of iteration.");
  48687. }
  48688. var sourceRoot = this.sourceRoot;
  48689. mappings.map(function (mapping) {
  48690. var source = mapping.source === null ? null : this._sources.at(mapping.source);
  48691. if (source != null && sourceRoot != null) {
  48692. source = util.join(sourceRoot, source);
  48693. }
  48694. return {
  48695. source: source,
  48696. generatedLine: mapping.generatedLine,
  48697. generatedColumn: mapping.generatedColumn,
  48698. originalLine: mapping.originalLine,
  48699. originalColumn: mapping.originalColumn,
  48700. name: mapping.name === null ? null : this._names.at(mapping.name)
  48701. };
  48702. }, this).forEach(aCallback, context);
  48703. };
  48704. /**
  48705. * Returns all generated line and column information for the original source,
  48706. * line, and column provided. If no column is provided, returns all mappings
  48707. * corresponding to a either the line we are searching for or the next
  48708. * closest line that has any mappings. Otherwise, returns all mappings
  48709. * corresponding to the given line and either the column we are searching for
  48710. * or the next closest column that has any offsets.
  48711. *
  48712. * The only argument is an object with the following properties:
  48713. *
  48714. * - source: The filename of the original source.
  48715. * - line: The line number in the original source.
  48716. * - column: Optional. the column number in the original source.
  48717. *
  48718. * and an array of objects is returned, each with the following properties:
  48719. *
  48720. * - line: The line number in the generated source, or null.
  48721. * - column: The column number in the generated source, or null.
  48722. */
  48723. SourceMapConsumer.prototype.allGeneratedPositionsFor = function SourceMapConsumer_allGeneratedPositionsFor(aArgs) {
  48724. var line = util.getArg(aArgs, 'line');
  48725. // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping
  48726. // returns the index of the closest mapping less than the needle. By
  48727. // setting needle.originalColumn to 0, we thus find the last mapping for
  48728. // the given line, provided such a mapping exists.
  48729. var needle = {
  48730. source: util.getArg(aArgs, 'source'),
  48731. originalLine: line,
  48732. originalColumn: util.getArg(aArgs, 'column', 0)
  48733. };
  48734. if (this.sourceRoot != null) {
  48735. needle.source = util.relative(this.sourceRoot, needle.source);
  48736. }
  48737. if (!this._sources.has(needle.source)) {
  48738. return [];
  48739. }
  48740. needle.source = this._sources.indexOf(needle.source);
  48741. var mappings = [];
  48742. var index = this._findMapping(needle, this._originalMappings, "originalLine", "originalColumn", util.compareByOriginalPositions, binarySearch.LEAST_UPPER_BOUND);
  48743. if (index >= 0) {
  48744. var mapping = this._originalMappings[index];
  48745. if (aArgs.column === undefined) {
  48746. var originalLine = mapping.originalLine;
  48747. // Iterate until either we run out of mappings, or we run into
  48748. // a mapping for a different line than the one we found. Since
  48749. // mappings are sorted, this is guaranteed to find all mappings for
  48750. // the line we found.
  48751. while (mapping && mapping.originalLine === originalLine) {
  48752. mappings.push({
  48753. line: util.getArg(mapping, 'generatedLine', null),
  48754. column: util.getArg(mapping, 'generatedColumn', null),
  48755. lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)
  48756. });
  48757. mapping = this._originalMappings[++index];
  48758. }
  48759. } else {
  48760. var originalColumn = mapping.originalColumn;
  48761. // Iterate until either we run out of mappings, or we run into
  48762. // a mapping for a different line than the one we were searching for.
  48763. // Since mappings are sorted, this is guaranteed to find all mappings for
  48764. // the line we are searching for.
  48765. while (mapping && mapping.originalLine === line && mapping.originalColumn == originalColumn) {
  48766. mappings.push({
  48767. line: util.getArg(mapping, 'generatedLine', null),
  48768. column: util.getArg(mapping, 'generatedColumn', null),
  48769. lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)
  48770. });
  48771. mapping = this._originalMappings[++index];
  48772. }
  48773. }
  48774. }
  48775. return mappings;
  48776. };
  48777. exports.SourceMapConsumer = SourceMapConsumer;
  48778. /**
  48779. * A BasicSourceMapConsumer instance represents a parsed source map which we can
  48780. * query for information about the original file positions by giving it a file
  48781. * position in the generated source.
  48782. *
  48783. * The only parameter is the raw source map (either as a JSON string, or
  48784. * already parsed to an object). According to the spec, source maps have the
  48785. * following attributes:
  48786. *
  48787. * - version: Which version of the source map spec this map is following.
  48788. * - sources: An array of URLs to the original source files.
  48789. * - names: An array of identifiers which can be referrenced by individual mappings.
  48790. * - sourceRoot: Optional. The URL root from which all sources are relative.
  48791. * - sourcesContent: Optional. An array of contents of the original source files.
  48792. * - mappings: A string of base64 VLQs which contain the actual mappings.
  48793. * - file: Optional. The generated file this source map is associated with.
  48794. *
  48795. * Here is an example source map, taken from the source map spec[0]:
  48796. *
  48797. * {
  48798. * version : 3,
  48799. * file: "out.js",
  48800. * sourceRoot : "",
  48801. * sources: ["foo.js", "bar.js"],
  48802. * names: ["src", "maps", "are", "fun"],
  48803. * mappings: "AA,AB;;ABCDE;"
  48804. * }
  48805. *
  48806. * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1#
  48807. */
  48808. function BasicSourceMapConsumer(aSourceMap) {
  48809. var sourceMap = aSourceMap;
  48810. if (typeof aSourceMap === 'string') {
  48811. sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, ''));
  48812. }
  48813. var version = util.getArg(sourceMap, 'version');
  48814. var sources = util.getArg(sourceMap, 'sources');
  48815. // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which
  48816. // requires the array) to play nice here.
  48817. var names = util.getArg(sourceMap, 'names', []);
  48818. var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null);
  48819. var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null);
  48820. var mappings = util.getArg(sourceMap, 'mappings');
  48821. var file = util.getArg(sourceMap, 'file', null);
  48822. // Once again, Sass deviates from the spec and supplies the version as a
  48823. // string rather than a number, so we use loose equality checking here.
  48824. if (version != this._version) {
  48825. throw new Error('Unsupported version: ' + version);
  48826. }
  48827. sources = sources.map(String)
  48828. // Some source maps produce relative source paths like "./foo.js" instead of
  48829. // "foo.js". Normalize these first so that future comparisons will succeed.
  48830. // See bugzil.la/1090768.
  48831. .map(util.normalize)
  48832. // Always ensure that absolute sources are internally stored relative to
  48833. // the source root, if the source root is absolute. Not doing this would
  48834. // be particularly problematic when the source root is a prefix of the
  48835. // source (valid, but why??). See github issue #199 and bugzil.la/1188982.
  48836. .map(function (source) {
  48837. return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source) ? util.relative(sourceRoot, source) : source;
  48838. });
  48839. // Pass `true` below to allow duplicate names and sources. While source maps
  48840. // are intended to be compressed and deduplicated, the TypeScript compiler
  48841. // sometimes generates source maps with duplicates in them. See Github issue
  48842. // #72 and bugzil.la/889492.
  48843. this._names = ArraySet.fromArray(names.map(String), true);
  48844. this._sources = ArraySet.fromArray(sources, true);
  48845. this.sourceRoot = sourceRoot;
  48846. this.sourcesContent = sourcesContent;
  48847. this._mappings = mappings;
  48848. this.file = file;
  48849. }
  48850. BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
  48851. BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer;
  48852. /**
  48853. * Create a BasicSourceMapConsumer from a SourceMapGenerator.
  48854. *
  48855. * @param SourceMapGenerator aSourceMap
  48856. * The source map that will be consumed.
  48857. * @returns BasicSourceMapConsumer
  48858. */
  48859. BasicSourceMapConsumer.fromSourceMap = function SourceMapConsumer_fromSourceMap(aSourceMap) {
  48860. var smc = Object.create(BasicSourceMapConsumer.prototype);
  48861. var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);
  48862. var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);
  48863. smc.sourceRoot = aSourceMap._sourceRoot;
  48864. smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(), smc.sourceRoot);
  48865. smc.file = aSourceMap._file;
  48866. // Because we are modifying the entries (by converting string sources and
  48867. // names to indices into the sources and names ArraySets), we have to make
  48868. // a copy of the entry or else bad things happen. Shared mutable state
  48869. // strikes again! See github issue #191.
  48870. var generatedMappings = aSourceMap._mappings.toArray().slice();
  48871. var destGeneratedMappings = smc.__generatedMappings = [];
  48872. var destOriginalMappings = smc.__originalMappings = [];
  48873. for (var i = 0, length = generatedMappings.length; i < length; i++) {
  48874. var srcMapping = generatedMappings[i];
  48875. var destMapping = new Mapping();
  48876. destMapping.generatedLine = srcMapping.generatedLine;
  48877. destMapping.generatedColumn = srcMapping.generatedColumn;
  48878. if (srcMapping.source) {
  48879. destMapping.source = sources.indexOf(srcMapping.source);
  48880. destMapping.originalLine = srcMapping.originalLine;
  48881. destMapping.originalColumn = srcMapping.originalColumn;
  48882. if (srcMapping.name) {
  48883. destMapping.name = names.indexOf(srcMapping.name);
  48884. }
  48885. destOriginalMappings.push(destMapping);
  48886. }
  48887. destGeneratedMappings.push(destMapping);
  48888. }
  48889. quickSort(smc.__originalMappings, util.compareByOriginalPositions);
  48890. return smc;
  48891. };
  48892. /**
  48893. * The version of the source mapping spec that we are consuming.
  48894. */
  48895. BasicSourceMapConsumer.prototype._version = 3;
  48896. /**
  48897. * The list of original sources.
  48898. */
  48899. Object.defineProperty(BasicSourceMapConsumer.prototype, 'sources', {
  48900. get: function get() {
  48901. return this._sources.toArray().map(function (s) {
  48902. return this.sourceRoot != null ? util.join(this.sourceRoot, s) : s;
  48903. }, this);
  48904. }
  48905. });
  48906. /**
  48907. * Provide the JIT with a nice shape / hidden class.
  48908. */
  48909. function Mapping() {
  48910. this.generatedLine = 0;
  48911. this.generatedColumn = 0;
  48912. this.source = null;
  48913. this.originalLine = null;
  48914. this.originalColumn = null;
  48915. this.name = null;
  48916. }
  48917. /**
  48918. * Parse the mappings in a string in to a data structure which we can easily
  48919. * query (the ordered arrays in the `this.__generatedMappings` and
  48920. * `this.__originalMappings` properties).
  48921. */
  48922. BasicSourceMapConsumer.prototype._parseMappings = function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
  48923. var generatedLine = 1;
  48924. var previousGeneratedColumn = 0;
  48925. var previousOriginalLine = 0;
  48926. var previousOriginalColumn = 0;
  48927. var previousSource = 0;
  48928. var previousName = 0;
  48929. var length = aStr.length;
  48930. var index = 0;
  48931. var cachedSegments = {};
  48932. var temp = {};
  48933. var originalMappings = [];
  48934. var generatedMappings = [];
  48935. var mapping, str, segment, end, value;
  48936. while (index < length) {
  48937. if (aStr.charAt(index) === ';') {
  48938. generatedLine++;
  48939. index++;
  48940. previousGeneratedColumn = 0;
  48941. } else if (aStr.charAt(index) === ',') {
  48942. index++;
  48943. } else {
  48944. mapping = new Mapping();
  48945. mapping.generatedLine = generatedLine;
  48946. // Because each offset is encoded relative to the previous one,
  48947. // many segments often have the same encoding. We can exploit this
  48948. // fact by caching the parsed variable length fields of each segment,
  48949. // allowing us to avoid a second parse if we encounter the same
  48950. // segment again.
  48951. for (end = index; end < length; end++) {
  48952. if (this._charIsMappingSeparator(aStr, end)) {
  48953. break;
  48954. }
  48955. }
  48956. str = aStr.slice(index, end);
  48957. segment = cachedSegments[str];
  48958. if (segment) {
  48959. index += str.length;
  48960. } else {
  48961. segment = [];
  48962. while (index < end) {
  48963. base64VLQ.decode(aStr, index, temp);
  48964. value = temp.value;
  48965. index = temp.rest;
  48966. segment.push(value);
  48967. }
  48968. if (segment.length === 2) {
  48969. throw new Error('Found a source, but no line and column');
  48970. }
  48971. if (segment.length === 3) {
  48972. throw new Error('Found a source and line, but no column');
  48973. }
  48974. cachedSegments[str] = segment;
  48975. }
  48976. // Generated column.
  48977. mapping.generatedColumn = previousGeneratedColumn + segment[0];
  48978. previousGeneratedColumn = mapping.generatedColumn;
  48979. if (segment.length > 1) {
  48980. // Original source.
  48981. mapping.source = previousSource + segment[1];
  48982. previousSource += segment[1];
  48983. // Original line.
  48984. mapping.originalLine = previousOriginalLine + segment[2];
  48985. previousOriginalLine = mapping.originalLine;
  48986. // Lines are stored 0-based
  48987. mapping.originalLine += 1;
  48988. // Original column.
  48989. mapping.originalColumn = previousOriginalColumn + segment[3];
  48990. previousOriginalColumn = mapping.originalColumn;
  48991. if (segment.length > 4) {
  48992. // Original name.
  48993. mapping.name = previousName + segment[4];
  48994. previousName += segment[4];
  48995. }
  48996. }
  48997. generatedMappings.push(mapping);
  48998. if (typeof mapping.originalLine === 'number') {
  48999. originalMappings.push(mapping);
  49000. }
  49001. }
  49002. }
  49003. quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated);
  49004. this.__generatedMappings = generatedMappings;
  49005. quickSort(originalMappings, util.compareByOriginalPositions);
  49006. this.__originalMappings = originalMappings;
  49007. };
  49008. /**
  49009. * Find the mapping that best matches the hypothetical "needle" mapping that
  49010. * we are searching for in the given "haystack" of mappings.
  49011. */
  49012. BasicSourceMapConsumer.prototype._findMapping = function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, aColumnName, aComparator, aBias) {
  49013. // To return the position we are searching for, we must first find the
  49014. // mapping for the given position and then return the opposite position it
  49015. // points to. Because the mappings are sorted, we can use binary search to
  49016. // find the best mapping.
  49017. if (aNeedle[aLineName] <= 0) {
  49018. throw new TypeError('Line must be greater than or equal to 1, got ' + aNeedle[aLineName]);
  49019. }
  49020. if (aNeedle[aColumnName] < 0) {
  49021. throw new TypeError('Column must be greater than or equal to 0, got ' + aNeedle[aColumnName]);
  49022. }
  49023. return binarySearch.search(aNeedle, aMappings, aComparator, aBias);
  49024. };
  49025. /**
  49026. * Compute the last column for each generated mapping. The last column is
  49027. * inclusive.
  49028. */
  49029. BasicSourceMapConsumer.prototype.computeColumnSpans = function SourceMapConsumer_computeColumnSpans() {
  49030. for (var index = 0; index < this._generatedMappings.length; ++index) {
  49031. var mapping = this._generatedMappings[index];
  49032. // Mappings do not contain a field for the last generated columnt. We
  49033. // can come up with an optimistic estimate, however, by assuming that
  49034. // mappings are contiguous (i.e. given two consecutive mappings, the
  49035. // first mapping ends where the second one starts).
  49036. if (index + 1 < this._generatedMappings.length) {
  49037. var nextMapping = this._generatedMappings[index + 1];
  49038. if (mapping.generatedLine === nextMapping.generatedLine) {
  49039. mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1;
  49040. continue;
  49041. }
  49042. }
  49043. // The last mapping for each line spans the entire line.
  49044. mapping.lastGeneratedColumn = Infinity;
  49045. }
  49046. };
  49047. /**
  49048. * Returns the original source, line, and column information for the generated
  49049. * source's line and column positions provided. The only argument is an object
  49050. * with the following properties:
  49051. *
  49052. * - line: The line number in the generated source.
  49053. * - column: The column number in the generated source.
  49054. * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or
  49055. * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the
  49056. * closest element that is smaller than or greater than the one we are
  49057. * searching for, respectively, if the exact element cannot be found.
  49058. * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.
  49059. *
  49060. * and an object is returned with the following properties:
  49061. *
  49062. * - source: The original source file, or null.
  49063. * - line: The line number in the original source, or null.
  49064. * - column: The column number in the original source, or null.
  49065. * - name: The original identifier, or null.
  49066. */
  49067. BasicSourceMapConsumer.prototype.originalPositionFor = function SourceMapConsumer_originalPositionFor(aArgs) {
  49068. var needle = {
  49069. generatedLine: util.getArg(aArgs, 'line'),
  49070. generatedColumn: util.getArg(aArgs, 'column')
  49071. };
  49072. var index = this._findMapping(needle, this._generatedMappings, "generatedLine", "generatedColumn", util.compareByGeneratedPositionsDeflated, util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND));
  49073. if (index >= 0) {
  49074. var mapping = this._generatedMappings[index];
  49075. if (mapping.generatedLine === needle.generatedLine) {
  49076. var source = util.getArg(mapping, 'source', null);
  49077. if (source !== null) {
  49078. source = this._sources.at(source);
  49079. if (this.sourceRoot != null) {
  49080. source = util.join(this.sourceRoot, source);
  49081. }
  49082. }
  49083. var name = util.getArg(mapping, 'name', null);
  49084. if (name !== null) {
  49085. name = this._names.at(name);
  49086. }
  49087. return {
  49088. source: source,
  49089. line: util.getArg(mapping, 'originalLine', null),
  49090. column: util.getArg(mapping, 'originalColumn', null),
  49091. name: name
  49092. };
  49093. }
  49094. }
  49095. return {
  49096. source: null,
  49097. line: null,
  49098. column: null,
  49099. name: null
  49100. };
  49101. };
  49102. /**
  49103. * Return true if we have the source content for every source in the source
  49104. * map, false otherwise.
  49105. */
  49106. BasicSourceMapConsumer.prototype.hasContentsOfAllSources = function BasicSourceMapConsumer_hasContentsOfAllSources() {
  49107. if (!this.sourcesContent) {
  49108. return false;
  49109. }
  49110. return this.sourcesContent.length >= this._sources.size() && !this.sourcesContent.some(function (sc) {
  49111. return sc == null;
  49112. });
  49113. };
  49114. /**
  49115. * Returns the original source content. The only argument is the url of the
  49116. * original source file. Returns null if no original source content is
  49117. * available.
  49118. */
  49119. BasicSourceMapConsumer.prototype.sourceContentFor = function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
  49120. if (!this.sourcesContent) {
  49121. return null;
  49122. }
  49123. if (this.sourceRoot != null) {
  49124. aSource = util.relative(this.sourceRoot, aSource);
  49125. }
  49126. if (this._sources.has(aSource)) {
  49127. return this.sourcesContent[this._sources.indexOf(aSource)];
  49128. }
  49129. var url;
  49130. if (this.sourceRoot != null && (url = util.urlParse(this.sourceRoot))) {
  49131. // XXX: file:// URIs and absolute paths lead to unexpected behavior for
  49132. // many users. We can help them out when they expect file:// URIs to
  49133. // behave like it would if they were running a local HTTP server. See
  49134. // https://bugzilla.mozilla.org/show_bug.cgi?id=885597.
  49135. var fileUriAbsPath = aSource.replace(/^file:\/\//, "");
  49136. if (url.scheme == "file" && this._sources.has(fileUriAbsPath)) {
  49137. return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)];
  49138. }
  49139. if ((!url.path || url.path == "/") && this._sources.has("/" + aSource)) {
  49140. return this.sourcesContent[this._sources.indexOf("/" + aSource)];
  49141. }
  49142. }
  49143. // This function is used recursively from
  49144. // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we
  49145. // don't want to throw if we can't find the source - we just want to
  49146. // return null, so we provide a flag to exit gracefully.
  49147. if (nullOnMissing) {
  49148. return null;
  49149. } else {
  49150. throw new Error('"' + aSource + '" is not in the SourceMap.');
  49151. }
  49152. };
  49153. /**
  49154. * Returns the generated line and column information for the original source,
  49155. * line, and column positions provided. The only argument is an object with
  49156. * the following properties:
  49157. *
  49158. * - source: The filename of the original source.
  49159. * - line: The line number in the original source.
  49160. * - column: The column number in the original source.
  49161. * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or
  49162. * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the
  49163. * closest element that is smaller than or greater than the one we are
  49164. * searching for, respectively, if the exact element cannot be found.
  49165. * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.
  49166. *
  49167. * and an object is returned with the following properties:
  49168. *
  49169. * - line: The line number in the generated source, or null.
  49170. * - column: The column number in the generated source, or null.
  49171. */
  49172. BasicSourceMapConsumer.prototype.generatedPositionFor = function SourceMapConsumer_generatedPositionFor(aArgs) {
  49173. var source = util.getArg(aArgs, 'source');
  49174. if (this.sourceRoot != null) {
  49175. source = util.relative(this.sourceRoot, source);
  49176. }
  49177. if (!this._sources.has(source)) {
  49178. return {
  49179. line: null,
  49180. column: null,
  49181. lastColumn: null
  49182. };
  49183. }
  49184. source = this._sources.indexOf(source);
  49185. var needle = {
  49186. source: source,
  49187. originalLine: util.getArg(aArgs, 'line'),
  49188. originalColumn: util.getArg(aArgs, 'column')
  49189. };
  49190. var index = this._findMapping(needle, this._originalMappings, "originalLine", "originalColumn", util.compareByOriginalPositions, util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND));
  49191. if (index >= 0) {
  49192. var mapping = this._originalMappings[index];
  49193. if (mapping.source === needle.source) {
  49194. return {
  49195. line: util.getArg(mapping, 'generatedLine', null),
  49196. column: util.getArg(mapping, 'generatedColumn', null),
  49197. lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)
  49198. };
  49199. }
  49200. }
  49201. return {
  49202. line: null,
  49203. column: null,
  49204. lastColumn: null
  49205. };
  49206. };
  49207. exports.BasicSourceMapConsumer = BasicSourceMapConsumer;
  49208. /**
  49209. * An IndexedSourceMapConsumer instance represents a parsed source map which
  49210. * we can query for information. It differs from BasicSourceMapConsumer in
  49211. * that it takes "indexed" source maps (i.e. ones with a "sections" field) as
  49212. * input.
  49213. *
  49214. * The only parameter is a raw source map (either as a JSON string, or already
  49215. * parsed to an object). According to the spec for indexed source maps, they
  49216. * have the following attributes:
  49217. *
  49218. * - version: Which version of the source map spec this map is following.
  49219. * - file: Optional. The generated file this source map is associated with.
  49220. * - sections: A list of section definitions.
  49221. *
  49222. * Each value under the "sections" field has two fields:
  49223. * - offset: The offset into the original specified at which this section
  49224. * begins to apply, defined as an object with a "line" and "column"
  49225. * field.
  49226. * - map: A source map definition. This source map could also be indexed,
  49227. * but doesn't have to be.
  49228. *
  49229. * Instead of the "map" field, it's also possible to have a "url" field
  49230. * specifying a URL to retrieve a source map from, but that's currently
  49231. * unsupported.
  49232. *
  49233. * Here's an example source map, taken from the source map spec[0], but
  49234. * modified to omit a section which uses the "url" field.
  49235. *
  49236. * {
  49237. * version : 3,
  49238. * file: "app.js",
  49239. * sections: [{
  49240. * offset: {line:100, column:10},
  49241. * map: {
  49242. * version : 3,
  49243. * file: "section.js",
  49244. * sources: ["foo.js", "bar.js"],
  49245. * names: ["src", "maps", "are", "fun"],
  49246. * mappings: "AAAA,E;;ABCDE;"
  49247. * }
  49248. * }],
  49249. * }
  49250. *
  49251. * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt
  49252. */
  49253. function IndexedSourceMapConsumer(aSourceMap) {
  49254. var sourceMap = aSourceMap;
  49255. if (typeof aSourceMap === 'string') {
  49256. sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, ''));
  49257. }
  49258. var version = util.getArg(sourceMap, 'version');
  49259. var sections = util.getArg(sourceMap, 'sections');
  49260. if (version != this._version) {
  49261. throw new Error('Unsupported version: ' + version);
  49262. }
  49263. this._sources = new ArraySet();
  49264. this._names = new ArraySet();
  49265. var lastOffset = {
  49266. line: -1,
  49267. column: 0
  49268. };
  49269. this._sections = sections.map(function (s) {
  49270. if (s.url) {
  49271. // The url field will require support for asynchronicity.
  49272. // See https://github.com/mozilla/source-map/issues/16
  49273. throw new Error('Support for url field in sections not implemented.');
  49274. }
  49275. var offset = util.getArg(s, 'offset');
  49276. var offsetLine = util.getArg(offset, 'line');
  49277. var offsetColumn = util.getArg(offset, 'column');
  49278. if (offsetLine < lastOffset.line || offsetLine === lastOffset.line && offsetColumn < lastOffset.column) {
  49279. throw new Error('Section offsets must be ordered and non-overlapping.');
  49280. }
  49281. lastOffset = offset;
  49282. return {
  49283. generatedOffset: {
  49284. // The offset fields are 0-based, but we use 1-based indices when
  49285. // encoding/decoding from VLQ.
  49286. generatedLine: offsetLine + 1,
  49287. generatedColumn: offsetColumn + 1
  49288. },
  49289. consumer: new SourceMapConsumer(util.getArg(s, 'map'))
  49290. };
  49291. });
  49292. }
  49293. IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
  49294. IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer;
  49295. /**
  49296. * The version of the source mapping spec that we are consuming.
  49297. */
  49298. IndexedSourceMapConsumer.prototype._version = 3;
  49299. /**
  49300. * The list of original sources.
  49301. */
  49302. Object.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', {
  49303. get: function get() {
  49304. var sources = [];
  49305. for (var i = 0; i < this._sections.length; i++) {
  49306. for (var j = 0; j < this._sections[i].consumer.sources.length; j++) {
  49307. sources.push(this._sections[i].consumer.sources[j]);
  49308. }
  49309. }
  49310. return sources;
  49311. }
  49312. });
  49313. /**
  49314. * Returns the original source, line, and column information for the generated
  49315. * source's line and column positions provided. The only argument is an object
  49316. * with the following properties:
  49317. *
  49318. * - line: The line number in the generated source.
  49319. * - column: The column number in the generated source.
  49320. *
  49321. * and an object is returned with the following properties:
  49322. *
  49323. * - source: The original source file, or null.
  49324. * - line: The line number in the original source, or null.
  49325. * - column: The column number in the original source, or null.
  49326. * - name: The original identifier, or null.
  49327. */
  49328. IndexedSourceMapConsumer.prototype.originalPositionFor = function IndexedSourceMapConsumer_originalPositionFor(aArgs) {
  49329. var needle = {
  49330. generatedLine: util.getArg(aArgs, 'line'),
  49331. generatedColumn: util.getArg(aArgs, 'column')
  49332. };
  49333. // Find the section containing the generated position we're trying to map
  49334. // to an original position.
  49335. var sectionIndex = binarySearch.search(needle, this._sections, function (needle, section) {
  49336. var cmp = needle.generatedLine - section.generatedOffset.generatedLine;
  49337. if (cmp) {
  49338. return cmp;
  49339. }
  49340. return needle.generatedColumn - section.generatedOffset.generatedColumn;
  49341. });
  49342. var section = this._sections[sectionIndex];
  49343. if (!section) {
  49344. return {
  49345. source: null,
  49346. line: null,
  49347. column: null,
  49348. name: null
  49349. };
  49350. }
  49351. return section.consumer.originalPositionFor({
  49352. line: needle.generatedLine - (section.generatedOffset.generatedLine - 1),
  49353. column: needle.generatedColumn - (section.generatedOffset.generatedLine === needle.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0),
  49354. bias: aArgs.bias
  49355. });
  49356. };
  49357. /**
  49358. * Return true if we have the source content for every source in the source
  49359. * map, false otherwise.
  49360. */
  49361. IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = function IndexedSourceMapConsumer_hasContentsOfAllSources() {
  49362. return this._sections.every(function (s) {
  49363. return s.consumer.hasContentsOfAllSources();
  49364. });
  49365. };
  49366. /**
  49367. * Returns the original source content. The only argument is the url of the
  49368. * original source file. Returns null if no original source content is
  49369. * available.
  49370. */
  49371. IndexedSourceMapConsumer.prototype.sourceContentFor = function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
  49372. for (var i = 0; i < this._sections.length; i++) {
  49373. var section = this._sections[i];
  49374. var content = section.consumer.sourceContentFor(aSource, true);
  49375. if (content) {
  49376. return content;
  49377. }
  49378. }
  49379. if (nullOnMissing) {
  49380. return null;
  49381. } else {
  49382. throw new Error('"' + aSource + '" is not in the SourceMap.');
  49383. }
  49384. };
  49385. /**
  49386. * Returns the generated line and column information for the original source,
  49387. * line, and column positions provided. The only argument is an object with
  49388. * the following properties:
  49389. *
  49390. * - source: The filename of the original source.
  49391. * - line: The line number in the original source.
  49392. * - column: The column number in the original source.
  49393. *
  49394. * and an object is returned with the following properties:
  49395. *
  49396. * - line: The line number in the generated source, or null.
  49397. * - column: The column number in the generated source, or null.
  49398. */
  49399. IndexedSourceMapConsumer.prototype.generatedPositionFor = function IndexedSourceMapConsumer_generatedPositionFor(aArgs) {
  49400. for (var i = 0; i < this._sections.length; i++) {
  49401. var section = this._sections[i];
  49402. // Only consider this section if the requested source is in the list of
  49403. // sources of the consumer.
  49404. if (section.consumer.sources.indexOf(util.getArg(aArgs, 'source')) === -1) {
  49405. continue;
  49406. }
  49407. var generatedPosition = section.consumer.generatedPositionFor(aArgs);
  49408. if (generatedPosition) {
  49409. var ret = {
  49410. line: generatedPosition.line + (section.generatedOffset.generatedLine - 1),
  49411. column: generatedPosition.column + (section.generatedOffset.generatedLine === generatedPosition.line ? section.generatedOffset.generatedColumn - 1 : 0)
  49412. };
  49413. return ret;
  49414. }
  49415. }
  49416. return {
  49417. line: null,
  49418. column: null
  49419. };
  49420. };
  49421. /**
  49422. * Parse the mappings in a string in to a data structure which we can easily
  49423. * query (the ordered arrays in the `this.__generatedMappings` and
  49424. * `this.__originalMappings` properties).
  49425. */
  49426. IndexedSourceMapConsumer.prototype._parseMappings = function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) {
  49427. this.__generatedMappings = [];
  49428. this.__originalMappings = [];
  49429. for (var i = 0; i < this._sections.length; i++) {
  49430. var section = this._sections[i];
  49431. var sectionMappings = section.consumer._generatedMappings;
  49432. for (var j = 0; j < sectionMappings.length; j++) {
  49433. var mapping = sectionMappings[j];
  49434. var source = section.consumer._sources.at(mapping.source);
  49435. if (section.consumer.sourceRoot !== null) {
  49436. source = util.join(section.consumer.sourceRoot, source);
  49437. }
  49438. this._sources.add(source);
  49439. source = this._sources.indexOf(source);
  49440. var name = section.consumer._names.at(mapping.name);
  49441. this._names.add(name);
  49442. name = this._names.indexOf(name);
  49443. // The mappings coming from the consumer for the section have
  49444. // generated positions relative to the start of the section, so we
  49445. // need to offset them to be relative to the start of the concatenated
  49446. // generated file.
  49447. var adjustedMapping = {
  49448. source: source,
  49449. generatedLine: mapping.generatedLine + (section.generatedOffset.generatedLine - 1),
  49450. generatedColumn: mapping.generatedColumn + (section.generatedOffset.generatedLine === mapping.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0),
  49451. originalLine: mapping.originalLine,
  49452. originalColumn: mapping.originalColumn,
  49453. name: name
  49454. };
  49455. this.__generatedMappings.push(adjustedMapping);
  49456. if (typeof adjustedMapping.originalLine === 'number') {
  49457. this.__originalMappings.push(adjustedMapping);
  49458. }
  49459. }
  49460. }
  49461. quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated);
  49462. quickSort(this.__originalMappings, util.compareByOriginalPositions);
  49463. };
  49464. exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer;
  49465. /***/ }),
  49466. /* 621 */
  49467. /***/ (function(module, exports, __webpack_require__) {
  49468. 'use strict';
  49469. /* -*- Mode: js; js-indent-level: 2; -*- */
  49470. /*
  49471. * Copyright 2011 Mozilla Foundation and contributors
  49472. * Licensed under the New BSD license. See LICENSE or:
  49473. * http://opensource.org/licenses/BSD-3-Clause
  49474. */
  49475. var SourceMapGenerator = __webpack_require__(287).SourceMapGenerator;
  49476. var util = __webpack_require__(63);
  49477. // Matches a Windows-style `\r\n` newline or a `\n` newline used by all other
  49478. // operating systems these days (capturing the result).
  49479. var REGEX_NEWLINE = /(\r?\n)/;
  49480. // Newline character code for charCodeAt() comparisons
  49481. var NEWLINE_CODE = 10;
  49482. // Private symbol for identifying `SourceNode`s when multiple versions of
  49483. // the source-map library are loaded. This MUST NOT CHANGE across
  49484. // versions!
  49485. var isSourceNode = "$$$isSourceNode$$$";
  49486. /**
  49487. * SourceNodes provide a way to abstract over interpolating/concatenating
  49488. * snippets of generated JavaScript source code while maintaining the line and
  49489. * column information associated with the original source code.
  49490. *
  49491. * @param aLine The original line number.
  49492. * @param aColumn The original column number.
  49493. * @param aSource The original source's filename.
  49494. * @param aChunks Optional. An array of strings which are snippets of
  49495. * generated JS, or other SourceNodes.
  49496. * @param aName The original identifier.
  49497. */
  49498. function SourceNode(aLine, aColumn, aSource, aChunks, aName) {
  49499. this.children = [];
  49500. this.sourceContents = {};
  49501. this.line = aLine == null ? null : aLine;
  49502. this.column = aColumn == null ? null : aColumn;
  49503. this.source = aSource == null ? null : aSource;
  49504. this.name = aName == null ? null : aName;
  49505. this[isSourceNode] = true;
  49506. if (aChunks != null) this.add(aChunks);
  49507. }
  49508. /**
  49509. * Creates a SourceNode from generated code and a SourceMapConsumer.
  49510. *
  49511. * @param aGeneratedCode The generated code
  49512. * @param aSourceMapConsumer The SourceMap for the generated code
  49513. * @param aRelativePath Optional. The path that relative sources in the
  49514. * SourceMapConsumer should be relative to.
  49515. */
  49516. SourceNode.fromStringWithSourceMap = function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {
  49517. // The SourceNode we want to fill with the generated code
  49518. // and the SourceMap
  49519. var node = new SourceNode();
  49520. // All even indices of this array are one line of the generated code,
  49521. // while all odd indices are the newlines between two adjacent lines
  49522. // (since `REGEX_NEWLINE` captures its match).
  49523. // Processed fragments are removed from this array, by calling `shiftNextLine`.
  49524. var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);
  49525. var shiftNextLine = function shiftNextLine() {
  49526. var lineContents = remainingLines.shift();
  49527. // The last line of a file might not have a newline.
  49528. var newLine = remainingLines.shift() || "";
  49529. return lineContents + newLine;
  49530. };
  49531. // We need to remember the position of "remainingLines"
  49532. var lastGeneratedLine = 1,
  49533. lastGeneratedColumn = 0;
  49534. // The generate SourceNodes we need a code range.
  49535. // To extract it current and last mapping is used.
  49536. // Here we store the last mapping.
  49537. var lastMapping = null;
  49538. aSourceMapConsumer.eachMapping(function (mapping) {
  49539. if (lastMapping !== null) {
  49540. // We add the code from "lastMapping" to "mapping":
  49541. // First check if there is a new line in between.
  49542. if (lastGeneratedLine < mapping.generatedLine) {
  49543. // Associate first line with "lastMapping"
  49544. addMappingWithCode(lastMapping, shiftNextLine());
  49545. lastGeneratedLine++;
  49546. lastGeneratedColumn = 0;
  49547. // The remaining code is added without mapping
  49548. } else {
  49549. // There is no new line in between.
  49550. // Associate the code between "lastGeneratedColumn" and
  49551. // "mapping.generatedColumn" with "lastMapping"
  49552. var nextLine = remainingLines[0];
  49553. var code = nextLine.substr(0, mapping.generatedColumn - lastGeneratedColumn);
  49554. remainingLines[0] = nextLine.substr(mapping.generatedColumn - lastGeneratedColumn);
  49555. lastGeneratedColumn = mapping.generatedColumn;
  49556. addMappingWithCode(lastMapping, code);
  49557. // No more remaining code, continue
  49558. lastMapping = mapping;
  49559. return;
  49560. }
  49561. }
  49562. // We add the generated code until the first mapping
  49563. // to the SourceNode without any mapping.
  49564. // Each line is added as separate string.
  49565. while (lastGeneratedLine < mapping.generatedLine) {
  49566. node.add(shiftNextLine());
  49567. lastGeneratedLine++;
  49568. }
  49569. if (lastGeneratedColumn < mapping.generatedColumn) {
  49570. var nextLine = remainingLines[0];
  49571. node.add(nextLine.substr(0, mapping.generatedColumn));
  49572. remainingLines[0] = nextLine.substr(mapping.generatedColumn);
  49573. lastGeneratedColumn = mapping.generatedColumn;
  49574. }
  49575. lastMapping = mapping;
  49576. }, this);
  49577. // We have processed all mappings.
  49578. if (remainingLines.length > 0) {
  49579. if (lastMapping) {
  49580. // Associate the remaining code in the current line with "lastMapping"
  49581. addMappingWithCode(lastMapping, shiftNextLine());
  49582. }
  49583. // and add the remaining lines without any mapping
  49584. node.add(remainingLines.join(""));
  49585. }
  49586. // Copy sourcesContent into SourceNode
  49587. aSourceMapConsumer.sources.forEach(function (sourceFile) {
  49588. var content = aSourceMapConsumer.sourceContentFor(sourceFile);
  49589. if (content != null) {
  49590. if (aRelativePath != null) {
  49591. sourceFile = util.join(aRelativePath, sourceFile);
  49592. }
  49593. node.setSourceContent(sourceFile, content);
  49594. }
  49595. });
  49596. return node;
  49597. function addMappingWithCode(mapping, code) {
  49598. if (mapping === null || mapping.source === undefined) {
  49599. node.add(code);
  49600. } else {
  49601. var source = aRelativePath ? util.join(aRelativePath, mapping.source) : mapping.source;
  49602. node.add(new SourceNode(mapping.originalLine, mapping.originalColumn, source, code, mapping.name));
  49603. }
  49604. }
  49605. };
  49606. /**
  49607. * Add a chunk of generated JS to this source node.
  49608. *
  49609. * @param aChunk A string snippet of generated JS code, another instance of
  49610. * SourceNode, or an array where each member is one of those things.
  49611. */
  49612. SourceNode.prototype.add = function SourceNode_add(aChunk) {
  49613. if (Array.isArray(aChunk)) {
  49614. aChunk.forEach(function (chunk) {
  49615. this.add(chunk);
  49616. }, this);
  49617. } else if (aChunk[isSourceNode] || typeof aChunk === "string") {
  49618. if (aChunk) {
  49619. this.children.push(aChunk);
  49620. }
  49621. } else {
  49622. throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk);
  49623. }
  49624. return this;
  49625. };
  49626. /**
  49627. * Add a chunk of generated JS to the beginning of this source node.
  49628. *
  49629. * @param aChunk A string snippet of generated JS code, another instance of
  49630. * SourceNode, or an array where each member is one of those things.
  49631. */
  49632. SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {
  49633. if (Array.isArray(aChunk)) {
  49634. for (var i = aChunk.length - 1; i >= 0; i--) {
  49635. this.prepend(aChunk[i]);
  49636. }
  49637. } else if (aChunk[isSourceNode] || typeof aChunk === "string") {
  49638. this.children.unshift(aChunk);
  49639. } else {
  49640. throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk);
  49641. }
  49642. return this;
  49643. };
  49644. /**
  49645. * Walk over the tree of JS snippets in this node and its children. The
  49646. * walking function is called once for each snippet of JS and is passed that
  49647. * snippet and the its original associated source's line/column location.
  49648. *
  49649. * @param aFn The traversal function.
  49650. */
  49651. SourceNode.prototype.walk = function SourceNode_walk(aFn) {
  49652. var chunk;
  49653. for (var i = 0, len = this.children.length; i < len; i++) {
  49654. chunk = this.children[i];
  49655. if (chunk[isSourceNode]) {
  49656. chunk.walk(aFn);
  49657. } else {
  49658. if (chunk !== '') {
  49659. aFn(chunk, { source: this.source,
  49660. line: this.line,
  49661. column: this.column,
  49662. name: this.name });
  49663. }
  49664. }
  49665. }
  49666. };
  49667. /**
  49668. * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between
  49669. * each of `this.children`.
  49670. *
  49671. * @param aSep The separator.
  49672. */
  49673. SourceNode.prototype.join = function SourceNode_join(aSep) {
  49674. var newChildren;
  49675. var i;
  49676. var len = this.children.length;
  49677. if (len > 0) {
  49678. newChildren = [];
  49679. for (i = 0; i < len - 1; i++) {
  49680. newChildren.push(this.children[i]);
  49681. newChildren.push(aSep);
  49682. }
  49683. newChildren.push(this.children[i]);
  49684. this.children = newChildren;
  49685. }
  49686. return this;
  49687. };
  49688. /**
  49689. * Call String.prototype.replace on the very right-most source snippet. Useful
  49690. * for trimming whitespace from the end of a source node, etc.
  49691. *
  49692. * @param aPattern The pattern to replace.
  49693. * @param aReplacement The thing to replace the pattern with.
  49694. */
  49695. SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {
  49696. var lastChild = this.children[this.children.length - 1];
  49697. if (lastChild[isSourceNode]) {
  49698. lastChild.replaceRight(aPattern, aReplacement);
  49699. } else if (typeof lastChild === 'string') {
  49700. this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);
  49701. } else {
  49702. this.children.push(''.replace(aPattern, aReplacement));
  49703. }
  49704. return this;
  49705. };
  49706. /**
  49707. * Set the source content for a source file. This will be added to the SourceMapGenerator
  49708. * in the sourcesContent field.
  49709. *
  49710. * @param aSourceFile The filename of the source file
  49711. * @param aSourceContent The content of the source file
  49712. */
  49713. SourceNode.prototype.setSourceContent = function SourceNode_setSourceContent(aSourceFile, aSourceContent) {
  49714. this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;
  49715. };
  49716. /**
  49717. * Walk over the tree of SourceNodes. The walking function is called for each
  49718. * source file content and is passed the filename and source content.
  49719. *
  49720. * @param aFn The traversal function.
  49721. */
  49722. SourceNode.prototype.walkSourceContents = function SourceNode_walkSourceContents(aFn) {
  49723. for (var i = 0, len = this.children.length; i < len; i++) {
  49724. if (this.children[i][isSourceNode]) {
  49725. this.children[i].walkSourceContents(aFn);
  49726. }
  49727. }
  49728. var sources = Object.keys(this.sourceContents);
  49729. for (var i = 0, len = sources.length; i < len; i++) {
  49730. aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);
  49731. }
  49732. };
  49733. /**
  49734. * Return the string representation of this source node. Walks over the tree
  49735. * and concatenates all the various snippets together to one string.
  49736. */
  49737. SourceNode.prototype.toString = function SourceNode_toString() {
  49738. var str = "";
  49739. this.walk(function (chunk) {
  49740. str += chunk;
  49741. });
  49742. return str;
  49743. };
  49744. /**
  49745. * Returns the string representation of this source node along with a source
  49746. * map.
  49747. */
  49748. SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {
  49749. var generated = {
  49750. code: "",
  49751. line: 1,
  49752. column: 0
  49753. };
  49754. var map = new SourceMapGenerator(aArgs);
  49755. var sourceMappingActive = false;
  49756. var lastOriginalSource = null;
  49757. var lastOriginalLine = null;
  49758. var lastOriginalColumn = null;
  49759. var lastOriginalName = null;
  49760. this.walk(function (chunk, original) {
  49761. generated.code += chunk;
  49762. if (original.source !== null && original.line !== null && original.column !== null) {
  49763. if (lastOriginalSource !== original.source || lastOriginalLine !== original.line || lastOriginalColumn !== original.column || lastOriginalName !== original.name) {
  49764. map.addMapping({
  49765. source: original.source,
  49766. original: {
  49767. line: original.line,
  49768. column: original.column
  49769. },
  49770. generated: {
  49771. line: generated.line,
  49772. column: generated.column
  49773. },
  49774. name: original.name
  49775. });
  49776. }
  49777. lastOriginalSource = original.source;
  49778. lastOriginalLine = original.line;
  49779. lastOriginalColumn = original.column;
  49780. lastOriginalName = original.name;
  49781. sourceMappingActive = true;
  49782. } else if (sourceMappingActive) {
  49783. map.addMapping({
  49784. generated: {
  49785. line: generated.line,
  49786. column: generated.column
  49787. }
  49788. });
  49789. lastOriginalSource = null;
  49790. sourceMappingActive = false;
  49791. }
  49792. for (var idx = 0, length = chunk.length; idx < length; idx++) {
  49793. if (chunk.charCodeAt(idx) === NEWLINE_CODE) {
  49794. generated.line++;
  49795. generated.column = 0;
  49796. // Mappings end at eol
  49797. if (idx + 1 === length) {
  49798. lastOriginalSource = null;
  49799. sourceMappingActive = false;
  49800. } else if (sourceMappingActive) {
  49801. map.addMapping({
  49802. source: original.source,
  49803. original: {
  49804. line: original.line,
  49805. column: original.column
  49806. },
  49807. generated: {
  49808. line: generated.line,
  49809. column: generated.column
  49810. },
  49811. name: original.name
  49812. });
  49813. }
  49814. } else {
  49815. generated.column++;
  49816. }
  49817. }
  49818. });
  49819. this.walkSourceContents(function (sourceFile, sourceContent) {
  49820. map.setSourceContent(sourceFile, sourceContent);
  49821. });
  49822. return { code: generated.code, map: map };
  49823. };
  49824. exports.SourceNode = SourceNode;
  49825. /***/ }),
  49826. /* 622 */
  49827. /***/ (function(module, exports, __webpack_require__) {
  49828. 'use strict';
  49829. var ansiRegex = __webpack_require__(180)();
  49830. module.exports = function (str) {
  49831. return typeof str === 'string' ? str.replace(ansiRegex, '') : str;
  49832. };
  49833. /***/ }),
  49834. /* 623 */
  49835. /***/ (function(module, exports, __webpack_require__) {
  49836. /* WEBPACK VAR INJECTION */(function(process) {'use strict';
  49837. var argv = process.argv;
  49838. var terminator = argv.indexOf('--');
  49839. var hasFlag = function hasFlag(flag) {
  49840. flag = '--' + flag;
  49841. var pos = argv.indexOf(flag);
  49842. return pos !== -1 && (terminator !== -1 ? pos < terminator : true);
  49843. };
  49844. module.exports = function () {
  49845. if ('FORCE_COLOR' in process.env) {
  49846. return true;
  49847. }
  49848. if (hasFlag('no-color') || hasFlag('no-colors') || hasFlag('color=false')) {
  49849. return false;
  49850. }
  49851. if (hasFlag('color') || hasFlag('colors') || hasFlag('color=true') || hasFlag('color=always')) {
  49852. return true;
  49853. }
  49854. if (process.stdout && !process.stdout.isTTY) {
  49855. return false;
  49856. }
  49857. if (process.platform === 'win32') {
  49858. return true;
  49859. }
  49860. if ('COLORTERM' in process.env) {
  49861. return true;
  49862. }
  49863. if (process.env.TERM === 'dumb') {
  49864. return false;
  49865. }
  49866. if (/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(process.env.TERM)) {
  49867. return true;
  49868. }
  49869. return false;
  49870. }();
  49871. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(8)))
  49872. /***/ }),
  49873. /* 624 */
  49874. /***/ (function(module, exports) {
  49875. 'use strict';
  49876. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  49877. module.exports = function toFastproperties(o) {
  49878. function Sub() {}
  49879. Sub.prototype = o;
  49880. var receiver = new Sub(); // create an instance
  49881. function ic() {
  49882. return _typeof(receiver.foo);
  49883. } // perform access
  49884. ic();
  49885. ic();
  49886. return o;
  49887. eval("o" + o); // ensure no dead code elimination
  49888. };
  49889. /***/ }),
  49890. /* 625 */
  49891. /***/ (function(module, exports) {
  49892. 'use strict';
  49893. module.exports = function (str) {
  49894. var tail = str.length;
  49895. while (/[\s\uFEFF\u00A0]/.test(str[tail - 1])) {
  49896. tail--;
  49897. }
  49898. return str.slice(0, tail);
  49899. };
  49900. /***/ }),
  49901. /* 626 */
  49902. /***/ (function(module, exports) {
  49903. 'use strict';
  49904. if (typeof Object.create === 'function') {
  49905. // implementation from standard node.js 'util' module
  49906. module.exports = function inherits(ctor, superCtor) {
  49907. ctor.super_ = superCtor;
  49908. ctor.prototype = Object.create(superCtor.prototype, {
  49909. constructor: {
  49910. value: ctor,
  49911. enumerable: false,
  49912. writable: true,
  49913. configurable: true
  49914. }
  49915. });
  49916. };
  49917. } else {
  49918. // old school shim for old browsers
  49919. module.exports = function inherits(ctor, superCtor) {
  49920. ctor.super_ = superCtor;
  49921. var TempCtor = function TempCtor() {};
  49922. TempCtor.prototype = superCtor.prototype;
  49923. ctor.prototype = new TempCtor();
  49924. ctor.prototype.constructor = ctor;
  49925. };
  49926. }
  49927. /***/ }),
  49928. /* 627 */
  49929. /***/ (function(module, exports) {
  49930. 'use strict';
  49931. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  49932. module.exports = function isBuffer(arg) {
  49933. return arg && (typeof arg === 'undefined' ? 'undefined' : _typeof(arg)) === 'object' && typeof arg.copy === 'function' && typeof arg.fill === 'function' && typeof arg.readUInt8 === 'function';
  49934. };
  49935. /***/ }),
  49936. /* 628 */
  49937. /***/ (function(module, exports, __webpack_require__) {
  49938. "use strict";
  49939. Object.defineProperty(exports, "__esModule", {
  49940. value: true
  49941. });
  49942. /**
  49943. * A shim that replaces Babel's require('package.json') statement.
  49944. * Babel requires the entire package.json file just to get the version number.
  49945. */
  49946. var version = exports.version = ("6.26.0");
  49947. /***/ }),
  49948. /* 629 */
  49949. /***/ (function(module, exports) {
  49950. 'use strict';
  49951. Object.defineProperty(exports, "__esModule", {
  49952. value: true
  49953. });
  49954. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  49955. exports.runScripts = runScripts;
  49956. /**
  49957. * Copyright 2013-2015, Facebook, Inc.
  49958. * All rights reserved.
  49959. *
  49960. * This source code is licensed under the BSD-style license found in the
  49961. * LICENSE file in the root directory of the React source tree. An additional
  49962. * grant of patent rights can be found in the PATENTS file in the same directory.
  49963. */
  49964. var scriptTypes = ['text/jsx', 'text/babel'];
  49965. var headEl = void 0;
  49966. var inlineScriptCount = 0;
  49967. /**
  49968. * Actually transform the code.
  49969. */
  49970. function transformCode(transformFn, script) {
  49971. var source = void 0;
  49972. if (script.url != null) {
  49973. source = script.url;
  49974. } else {
  49975. source = 'Inline Babel script';
  49976. inlineScriptCount++;
  49977. if (inlineScriptCount > 1) {
  49978. source += ' (' + inlineScriptCount + ')';
  49979. }
  49980. }
  49981. return transformFn(script.content, _extends({
  49982. filename: source
  49983. }, buildBabelOptions(script))).code;
  49984. }
  49985. /**
  49986. * Builds the Babel options for transforming the specified script, using some
  49987. * sensible default presets and plugins if none were explicitly provided.
  49988. */
  49989. function buildBabelOptions(script) {
  49990. return {
  49991. presets: script.presets || ['react', 'es2015'],
  49992. plugins: script.plugins || ['transform-class-properties', 'transform-object-rest-spread', 'transform-flow-strip-types'],
  49993. sourceMaps: 'inline'
  49994. };
  49995. }
  49996. /**
  49997. * Appends a script element at the end of the <head> with the content of code,
  49998. * after transforming it.
  49999. */
  50000. function run(transformFn, script) {
  50001. var scriptEl = document.createElement('script');
  50002. scriptEl.text = transformCode(transformFn, script);
  50003. headEl.appendChild(scriptEl);
  50004. }
  50005. /**
  50006. * Load script from the provided url and pass the content to the callback.
  50007. */
  50008. function load(url, successCallback, errorCallback) {
  50009. var xhr = new XMLHttpRequest();
  50010. // async, however scripts will be executed in the order they are in the
  50011. // DOM to mirror normal script loading.
  50012. xhr.open('GET', url, true);
  50013. if ('overrideMimeType' in xhr) {
  50014. xhr.overrideMimeType('text/plain');
  50015. }
  50016. xhr.onreadystatechange = function () {
  50017. if (xhr.readyState === 4) {
  50018. if (xhr.status === 0 || xhr.status === 200) {
  50019. successCallback(xhr.responseText);
  50020. } else {
  50021. errorCallback();
  50022. throw new Error('Could not load ' + url);
  50023. }
  50024. }
  50025. };
  50026. return xhr.send(null);
  50027. }
  50028. /**
  50029. * Converts a comma-separated data attribute string into an array of values. If
  50030. * the string is empty, returns an empty array. If the string is not defined,
  50031. * returns null.
  50032. */
  50033. function getPluginsOrPresetsFromScript(script, attributeName) {
  50034. var rawValue = script.getAttribute(attributeName);
  50035. if (rawValue === '') {
  50036. // Empty string means to not load ANY presets or plugins
  50037. return [];
  50038. }
  50039. if (!rawValue) {
  50040. // Any other falsy value (null, undefined) means we're not overriding this
  50041. // setting, and should use the default.
  50042. return null;
  50043. }
  50044. return rawValue.split(',').map(function (item) {
  50045. return item.trim();
  50046. });
  50047. }
  50048. /**
  50049. * Loop over provided script tags and get the content, via innerHTML if an
  50050. * inline script, or by using XHR. Transforms are applied if needed. The scripts
  50051. * are executed in the order they are found on the page.
  50052. */
  50053. function loadScripts(transformFn, scripts) {
  50054. var result = [];
  50055. var count = scripts.length;
  50056. function check() {
  50057. var script, i;
  50058. for (i = 0; i < count; i++) {
  50059. script = result[i];
  50060. if (script.loaded && !script.executed) {
  50061. script.executed = true;
  50062. run(transformFn, script);
  50063. } else if (!script.loaded && !script.error && !script.async) {
  50064. break;
  50065. }
  50066. }
  50067. }
  50068. scripts.forEach(function (script, i) {
  50069. var scriptData = {
  50070. // script.async is always true for non-JavaScript script tags
  50071. async: script.hasAttribute('async'),
  50072. error: false,
  50073. executed: false,
  50074. plugins: getPluginsOrPresetsFromScript(script, 'data-plugins'),
  50075. presets: getPluginsOrPresetsFromScript(script, 'data-presets')
  50076. };
  50077. if (script.src) {
  50078. result[i] = _extends({}, scriptData, {
  50079. content: null,
  50080. loaded: false,
  50081. url: script.src
  50082. });
  50083. load(script.src, function (content) {
  50084. result[i].loaded = true;
  50085. result[i].content = content;
  50086. check();
  50087. }, function () {
  50088. result[i].error = true;
  50089. check();
  50090. });
  50091. } else {
  50092. result[i] = _extends({}, scriptData, {
  50093. content: script.innerHTML,
  50094. loaded: true,
  50095. url: null
  50096. });
  50097. }
  50098. });
  50099. check();
  50100. }
  50101. /**
  50102. * Run script tags with type="text/jsx".
  50103. * @param {Array} scriptTags specify script tags to run, run all in the <head> if not given
  50104. */
  50105. function runScripts(transformFn, scripts) {
  50106. headEl = document.getElementsByTagName('head')[0];
  50107. if (!scripts) {
  50108. scripts = document.getElementsByTagName('script');
  50109. }
  50110. // Array.prototype.slice cannot be used on NodeList on IE8
  50111. var jsxScripts = [];
  50112. for (var i = 0; i < scripts.length; i++) {
  50113. var script = scripts.item(i);
  50114. // Support the old type="text/jsx;harmony=true"
  50115. var type = script.type.split(';')[0];
  50116. if (scriptTypes.indexOf(type) !== -1) {
  50117. jsxScripts.push(script);
  50118. }
  50119. }
  50120. if (jsxScripts.length === 0) {
  50121. return;
  50122. }
  50123. console.warn('You are using the in-browser Babel transformer. Be sure to precompile ' + 'your scripts for production - https://babeljs.io/docs/setup/');
  50124. loadScripts(transformFn, jsxScripts);
  50125. }
  50126. /***/ }),
  50127. /* 630 */
  50128. /***/ (function(module, exports) {
  50129. module.exports = {"builtin":{"Array":false,"ArrayBuffer":false,"Boolean":false,"constructor":false,"DataView":false,"Date":false,"decodeURI":false,"decodeURIComponent":false,"encodeURI":false,"encodeURIComponent":false,"Error":false,"escape":false,"eval":false,"EvalError":false,"Float32Array":false,"Float64Array":false,"Function":false,"hasOwnProperty":false,"Infinity":false,"Int16Array":false,"Int32Array":false,"Int8Array":false,"isFinite":false,"isNaN":false,"isPrototypeOf":false,"JSON":false,"Map":false,"Math":false,"NaN":false,"Number":false,"Object":false,"parseFloat":false,"parseInt":false,"Promise":false,"propertyIsEnumerable":false,"Proxy":false,"RangeError":false,"ReferenceError":false,"Reflect":false,"RegExp":false,"Set":false,"String":false,"Symbol":false,"SyntaxError":false,"System":false,"toLocaleString":false,"toString":false,"TypeError":false,"Uint16Array":false,"Uint32Array":false,"Uint8Array":false,"Uint8ClampedArray":false,"undefined":false,"unescape":false,"URIError":false,"valueOf":false,"WeakMap":false,"WeakSet":false},"es5":{"Array":false,"Boolean":false,"constructor":false,"Date":false,"decodeURI":false,"decodeURIComponent":false,"encodeURI":false,"encodeURIComponent":false,"Error":false,"escape":false,"eval":false,"EvalError":false,"Function":false,"hasOwnProperty":false,"Infinity":false,"isFinite":false,"isNaN":false,"isPrototypeOf":false,"JSON":false,"Math":false,"NaN":false,"Number":false,"Object":false,"parseFloat":false,"parseInt":false,"propertyIsEnumerable":false,"RangeError":false,"ReferenceError":false,"RegExp":false,"String":false,"SyntaxError":false,"toLocaleString":false,"toString":false,"TypeError":false,"undefined":false,"unescape":false,"URIError":false,"valueOf":false},"es6":{"Array":false,"ArrayBuffer":false,"Boolean":false,"constructor":false,"DataView":false,"Date":false,"decodeURI":false,"decodeURIComponent":false,"encodeURI":false,"encodeURIComponent":false,"Error":false,"escape":false,"eval":false,"EvalError":false,"Float32Array":false,"Float64Array":false,"Function":false,"hasOwnProperty":false,"Infinity":false,"Int16Array":false,"Int32Array":false,"Int8Array":false,"isFinite":false,"isNaN":false,"isPrototypeOf":false,"JSON":false,"Map":false,"Math":false,"NaN":false,"Number":false,"Object":false,"parseFloat":false,"parseInt":false,"Promise":false,"propertyIsEnumerable":false,"Proxy":false,"RangeError":false,"ReferenceError":false,"Reflect":false,"RegExp":false,"Set":false,"String":false,"Symbol":false,"SyntaxError":false,"System":false,"toLocaleString":false,"toString":false,"TypeError":false,"Uint16Array":false,"Uint32Array":false,"Uint8Array":false,"Uint8ClampedArray":false,"undefined":false,"unescape":false,"URIError":false,"valueOf":false,"WeakMap":false,"WeakSet":false},"browser":{"addEventListener":false,"alert":false,"AnalyserNode":false,"Animation":false,"AnimationEffectReadOnly":false,"AnimationEffectTiming":false,"AnimationEffectTimingReadOnly":false,"AnimationEvent":false,"AnimationPlaybackEvent":false,"AnimationTimeline":false,"applicationCache":false,"ApplicationCache":false,"ApplicationCacheErrorEvent":false,"atob":false,"Attr":false,"Audio":false,"AudioBuffer":false,"AudioBufferSourceNode":false,"AudioContext":false,"AudioDestinationNode":false,"AudioListener":false,"AudioNode":false,"AudioParam":false,"AudioProcessingEvent":false,"AutocompleteErrorEvent":false,"BarProp":false,"BatteryManager":false,"BeforeUnloadEvent":false,"BiquadFilterNode":false,"Blob":false,"blur":false,"btoa":false,"Cache":false,"caches":false,"CacheStorage":false,"cancelAnimationFrame":false,"cancelIdleCallback":false,"CanvasGradient":false,"CanvasPattern":false,"CanvasRenderingContext2D":false,"CDATASection":false,"ChannelMergerNode":false,"ChannelSplitterNode":false,"CharacterData":false,"clearInterval":false,"clearTimeout":false,"clientInformation":false,"ClientRect":false,"ClientRectList":false,"ClipboardEvent":false,"close":false,"closed":false,"CloseEvent":false,"Comment":false,"CompositionEvent":false,"confirm":false,"console":false,"ConvolverNode":false,"createImageBitmap":false,"Credential":false,"CredentialsContainer":false,"crypto":false,"Crypto":false,"CryptoKey":false,"CSS":false,"CSSAnimation":false,"CSSFontFaceRule":false,"CSSImportRule":false,"CSSKeyframeRule":false,"CSSKeyframesRule":false,"CSSMediaRule":false,"CSSPageRule":false,"CSSRule":false,"CSSRuleList":false,"CSSStyleDeclaration":false,"CSSStyleRule":false,"CSSStyleSheet":false,"CSSSupportsRule":false,"CSSTransition":false,"CSSUnknownRule":false,"CSSViewportRule":false,"customElements":false,"CustomEvent":false,"DataTransfer":false,"DataTransferItem":false,"DataTransferItemList":false,"Debug":false,"defaultStatus":false,"defaultstatus":false,"DelayNode":false,"DeviceMotionEvent":false,"DeviceOrientationEvent":false,"devicePixelRatio":false,"dispatchEvent":false,"document":false,"Document":false,"DocumentFragment":false,"DocumentTimeline":false,"DocumentType":false,"DOMError":false,"DOMException":false,"DOMImplementation":false,"DOMParser":false,"DOMSettableTokenList":false,"DOMStringList":false,"DOMStringMap":false,"DOMTokenList":false,"DragEvent":false,"DynamicsCompressorNode":false,"Element":false,"ElementTimeControl":false,"ErrorEvent":false,"event":false,"Event":false,"EventSource":false,"EventTarget":false,"external":false,"FederatedCredential":false,"fetch":false,"File":false,"FileError":false,"FileList":false,"FileReader":false,"find":false,"focus":false,"FocusEvent":false,"FontFace":false,"FormData":false,"frameElement":false,"frames":false,"GainNode":false,"Gamepad":false,"GamepadButton":false,"GamepadEvent":false,"getComputedStyle":false,"getSelection":false,"HashChangeEvent":false,"Headers":false,"history":false,"History":false,"HTMLAllCollection":false,"HTMLAnchorElement":false,"HTMLAppletElement":false,"HTMLAreaElement":false,"HTMLAudioElement":false,"HTMLBaseElement":false,"HTMLBlockquoteElement":false,"HTMLBodyElement":false,"HTMLBRElement":false,"HTMLButtonElement":false,"HTMLCanvasElement":false,"HTMLCollection":false,"HTMLContentElement":false,"HTMLDataListElement":false,"HTMLDetailsElement":false,"HTMLDialogElement":false,"HTMLDirectoryElement":false,"HTMLDivElement":false,"HTMLDListElement":false,"HTMLDocument":false,"HTMLElement":false,"HTMLEmbedElement":false,"HTMLFieldSetElement":false,"HTMLFontElement":false,"HTMLFormControlsCollection":false,"HTMLFormElement":false,"HTMLFrameElement":false,"HTMLFrameSetElement":false,"HTMLHeadElement":false,"HTMLHeadingElement":false,"HTMLHRElement":false,"HTMLHtmlElement":false,"HTMLIFrameElement":false,"HTMLImageElement":false,"HTMLInputElement":false,"HTMLIsIndexElement":false,"HTMLKeygenElement":false,"HTMLLabelElement":false,"HTMLLayerElement":false,"HTMLLegendElement":false,"HTMLLIElement":false,"HTMLLinkElement":false,"HTMLMapElement":false,"HTMLMarqueeElement":false,"HTMLMediaElement":false,"HTMLMenuElement":false,"HTMLMetaElement":false,"HTMLMeterElement":false,"HTMLModElement":false,"HTMLObjectElement":false,"HTMLOListElement":false,"HTMLOptGroupElement":false,"HTMLOptionElement":false,"HTMLOptionsCollection":false,"HTMLOutputElement":false,"HTMLParagraphElement":false,"HTMLParamElement":false,"HTMLPictureElement":false,"HTMLPreElement":false,"HTMLProgressElement":false,"HTMLQuoteElement":false,"HTMLScriptElement":false,"HTMLSelectElement":false,"HTMLShadowElement":false,"HTMLSourceElement":false,"HTMLSpanElement":false,"HTMLStyleElement":false,"HTMLTableCaptionElement":false,"HTMLTableCellElement":false,"HTMLTableColElement":false,"HTMLTableElement":false,"HTMLTableRowElement":false,"HTMLTableSectionElement":false,"HTMLTemplateElement":false,"HTMLTextAreaElement":false,"HTMLTitleElement":false,"HTMLTrackElement":false,"HTMLUListElement":false,"HTMLUnknownElement":false,"HTMLVideoElement":false,"IDBCursor":false,"IDBCursorWithValue":false,"IDBDatabase":false,"IDBEnvironment":false,"IDBFactory":false,"IDBIndex":false,"IDBKeyRange":false,"IDBObjectStore":false,"IDBOpenDBRequest":false,"IDBRequest":false,"IDBTransaction":false,"IDBVersionChangeEvent":false,"Image":false,"ImageBitmap":false,"ImageData":false,"indexedDB":false,"innerHeight":false,"innerWidth":false,"InputEvent":false,"InputMethodContext":false,"IntersectionObserver":false,"IntersectionObserverEntry":false,"Intl":false,"KeyboardEvent":false,"KeyframeEffect":false,"KeyframeEffectReadOnly":false,"length":false,"localStorage":false,"location":false,"Location":false,"locationbar":false,"matchMedia":false,"MediaElementAudioSourceNode":false,"MediaEncryptedEvent":false,"MediaError":false,"MediaKeyError":false,"MediaKeyEvent":false,"MediaKeyMessageEvent":false,"MediaKeys":false,"MediaKeySession":false,"MediaKeyStatusMap":false,"MediaKeySystemAccess":false,"MediaList":false,"MediaQueryList":false,"MediaQueryListEvent":false,"MediaSource":false,"MediaRecorder":false,"MediaStream":false,"MediaStreamAudioDestinationNode":false,"MediaStreamAudioSourceNode":false,"MediaStreamEvent":false,"MediaStreamTrack":false,"menubar":false,"MessageChannel":false,"MessageEvent":false,"MessagePort":false,"MIDIAccess":false,"MIDIConnectionEvent":false,"MIDIInput":false,"MIDIInputMap":false,"MIDIMessageEvent":false,"MIDIOutput":false,"MIDIOutputMap":false,"MIDIPort":false,"MimeType":false,"MimeTypeArray":false,"MouseEvent":false,"moveBy":false,"moveTo":false,"MutationEvent":false,"MutationObserver":false,"MutationRecord":false,"name":false,"NamedNodeMap":false,"navigator":false,"Navigator":false,"Node":false,"NodeFilter":false,"NodeIterator":false,"NodeList":false,"Notification":false,"OfflineAudioCompletionEvent":false,"OfflineAudioContext":false,"offscreenBuffering":false,"onbeforeunload":true,"onblur":true,"onerror":true,"onfocus":true,"onload":true,"onresize":true,"onunload":true,"open":false,"openDatabase":false,"opener":false,"opera":false,"Option":false,"OscillatorNode":false,"outerHeight":false,"outerWidth":false,"PageTransitionEvent":false,"pageXOffset":false,"pageYOffset":false,"parent":false,"PasswordCredential":false,"Path2D":false,"performance":false,"Performance":false,"PerformanceEntry":false,"PerformanceMark":false,"PerformanceMeasure":false,"PerformanceNavigation":false,"PerformanceResourceTiming":false,"PerformanceTiming":false,"PeriodicWave":false,"Permissions":false,"PermissionStatus":false,"personalbar":false,"Plugin":false,"PluginArray":false,"PopStateEvent":false,"postMessage":false,"print":false,"ProcessingInstruction":false,"ProgressEvent":false,"PromiseRejectionEvent":false,"prompt":false,"PushManager":false,"PushSubscription":false,"RadioNodeList":false,"Range":false,"ReadableByteStream":false,"ReadableStream":false,"removeEventListener":false,"Request":false,"requestAnimationFrame":false,"requestIdleCallback":false,"resizeBy":false,"resizeTo":false,"Response":false,"RTCIceCandidate":false,"RTCSessionDescription":false,"RTCPeerConnection":false,"screen":false,"Screen":false,"screenLeft":false,"ScreenOrientation":false,"screenTop":false,"screenX":false,"screenY":false,"ScriptProcessorNode":false,"scroll":false,"scrollbars":false,"scrollBy":false,"scrollTo":false,"scrollX":false,"scrollY":false,"SecurityPolicyViolationEvent":false,"Selection":false,"self":false,"ServiceWorker":false,"ServiceWorkerContainer":false,"ServiceWorkerRegistration":false,"sessionStorage":false,"setInterval":false,"setTimeout":false,"ShadowRoot":false,"SharedKeyframeList":false,"SharedWorker":false,"showModalDialog":false,"SiteBoundCredential":false,"speechSynthesis":false,"SpeechSynthesisEvent":false,"SpeechSynthesisUtterance":false,"status":false,"statusbar":false,"stop":false,"Storage":false,"StorageEvent":false,"styleMedia":false,"StyleSheet":false,"StyleSheetList":false,"SubtleCrypto":false,"SVGAElement":false,"SVGAltGlyphDefElement":false,"SVGAltGlyphElement":false,"SVGAltGlyphItemElement":false,"SVGAngle":false,"SVGAnimateColorElement":false,"SVGAnimatedAngle":false,"SVGAnimatedBoolean":false,"SVGAnimatedEnumeration":false,"SVGAnimatedInteger":false,"SVGAnimatedLength":false,"SVGAnimatedLengthList":false,"SVGAnimatedNumber":false,"SVGAnimatedNumberList":false,"SVGAnimatedPathData":false,"SVGAnimatedPoints":false,"SVGAnimatedPreserveAspectRatio":false,"SVGAnimatedRect":false,"SVGAnimatedString":false,"SVGAnimatedTransformList":false,"SVGAnimateElement":false,"SVGAnimateMotionElement":false,"SVGAnimateTransformElement":false,"SVGAnimationElement":false,"SVGCircleElement":false,"SVGClipPathElement":false,"SVGColor":false,"SVGColorProfileElement":false,"SVGColorProfileRule":false,"SVGComponentTransferFunctionElement":false,"SVGCSSRule":false,"SVGCursorElement":false,"SVGDefsElement":false,"SVGDescElement":false,"SVGDiscardElement":false,"SVGDocument":false,"SVGElement":false,"SVGElementInstance":false,"SVGElementInstanceList":false,"SVGEllipseElement":false,"SVGEvent":false,"SVGExternalResourcesRequired":false,"SVGFEBlendElement":false,"SVGFEColorMatrixElement":false,"SVGFEComponentTransferElement":false,"SVGFECompositeElement":false,"SVGFEConvolveMatrixElement":false,"SVGFEDiffuseLightingElement":false,"SVGFEDisplacementMapElement":false,"SVGFEDistantLightElement":false,"SVGFEDropShadowElement":false,"SVGFEFloodElement":false,"SVGFEFuncAElement":false,"SVGFEFuncBElement":false,"SVGFEFuncGElement":false,"SVGFEFuncRElement":false,"SVGFEGaussianBlurElement":false,"SVGFEImageElement":false,"SVGFEMergeElement":false,"SVGFEMergeNodeElement":false,"SVGFEMorphologyElement":false,"SVGFEOffsetElement":false,"SVGFEPointLightElement":false,"SVGFESpecularLightingElement":false,"SVGFESpotLightElement":false,"SVGFETileElement":false,"SVGFETurbulenceElement":false,"SVGFilterElement":false,"SVGFilterPrimitiveStandardAttributes":false,"SVGFitToViewBox":false,"SVGFontElement":false,"SVGFontFaceElement":false,"SVGFontFaceFormatElement":false,"SVGFontFaceNameElement":false,"SVGFontFaceSrcElement":false,"SVGFontFaceUriElement":false,"SVGForeignObjectElement":false,"SVGGElement":false,"SVGGeometryElement":false,"SVGGlyphElement":false,"SVGGlyphRefElement":false,"SVGGradientElement":false,"SVGGraphicsElement":false,"SVGHKernElement":false,"SVGICCColor":false,"SVGImageElement":false,"SVGLangSpace":false,"SVGLength":false,"SVGLengthList":false,"SVGLinearGradientElement":false,"SVGLineElement":false,"SVGLocatable":false,"SVGMarkerElement":false,"SVGMaskElement":false,"SVGMatrix":false,"SVGMetadataElement":false,"SVGMissingGlyphElement":false,"SVGMPathElement":false,"SVGNumber":false,"SVGNumberList":false,"SVGPaint":false,"SVGPathElement":false,"SVGPathSeg":false,"SVGPathSegArcAbs":false,"SVGPathSegArcRel":false,"SVGPathSegClosePath":false,"SVGPathSegCurvetoCubicAbs":false,"SVGPathSegCurvetoCubicRel":false,"SVGPathSegCurvetoCubicSmoothAbs":false,"SVGPathSegCurvetoCubicSmoothRel":false,"SVGPathSegCurvetoQuadraticAbs":false,"SVGPathSegCurvetoQuadraticRel":false,"SVGPathSegCurvetoQuadraticSmoothAbs":false,"SVGPathSegCurvetoQuadraticSmoothRel":false,"SVGPathSegLinetoAbs":false,"SVGPathSegLinetoHorizontalAbs":false,"SVGPathSegLinetoHorizontalRel":false,"SVGPathSegLinetoRel":false,"SVGPathSegLinetoVerticalAbs":false,"SVGPathSegLinetoVerticalRel":false,"SVGPathSegList":false,"SVGPathSegMovetoAbs":false,"SVGPathSegMovetoRel":false,"SVGPatternElement":false,"SVGPoint":false,"SVGPointList":false,"SVGPolygonElement":false,"SVGPolylineElement":false,"SVGPreserveAspectRatio":false,"SVGRadialGradientElement":false,"SVGRect":false,"SVGRectElement":false,"SVGRenderingIntent":false,"SVGScriptElement":false,"SVGSetElement":false,"SVGStopElement":false,"SVGStringList":false,"SVGStylable":false,"SVGStyleElement":false,"SVGSVGElement":false,"SVGSwitchElement":false,"SVGSymbolElement":false,"SVGTests":false,"SVGTextContentElement":false,"SVGTextElement":false,"SVGTextPathElement":false,"SVGTextPositioningElement":false,"SVGTitleElement":false,"SVGTransform":false,"SVGTransformable":false,"SVGTransformList":false,"SVGTRefElement":false,"SVGTSpanElement":false,"SVGUnitTypes":false,"SVGURIReference":false,"SVGUseElement":false,"SVGViewElement":false,"SVGViewSpec":false,"SVGVKernElement":false,"SVGZoomAndPan":false,"SVGZoomEvent":false,"Text":false,"TextDecoder":false,"TextEncoder":false,"TextEvent":false,"TextMetrics":false,"TextTrack":false,"TextTrackCue":false,"TextTrackCueList":false,"TextTrackList":false,"TimeEvent":false,"TimeRanges":false,"toolbar":false,"top":false,"Touch":false,"TouchEvent":false,"TouchList":false,"TrackEvent":false,"TransitionEvent":false,"TreeWalker":false,"UIEvent":false,"URL":false,"URLSearchParams":false,"ValidityState":false,"VTTCue":false,"WaveShaperNode":false,"WebGLActiveInfo":false,"WebGLBuffer":false,"WebGLContextEvent":false,"WebGLFramebuffer":false,"WebGLProgram":false,"WebGLRenderbuffer":false,"WebGLRenderingContext":false,"WebGLShader":false,"WebGLShaderPrecisionFormat":false,"WebGLTexture":false,"WebGLUniformLocation":false,"WebSocket":false,"WheelEvent":false,"window":false,"Window":false,"Worker":false,"XDomainRequest":false,"XMLDocument":false,"XMLHttpRequest":false,"XMLHttpRequestEventTarget":false,"XMLHttpRequestProgressEvent":false,"XMLHttpRequestUpload":false,"XMLSerializer":false,"XPathEvaluator":false,"XPathException":false,"XPathExpression":false,"XPathNamespace":false,"XPathNSResolver":false,"XPathResult":false,"XSLTProcessor":false},"worker":{"applicationCache":false,"atob":false,"Blob":false,"BroadcastChannel":false,"btoa":false,"Cache":false,"caches":false,"clearInterval":false,"clearTimeout":false,"close":true,"console":false,"fetch":false,"FileReaderSync":false,"FormData":false,"Headers":false,"IDBCursor":false,"IDBCursorWithValue":false,"IDBDatabase":false,"IDBFactory":false,"IDBIndex":false,"IDBKeyRange":false,"IDBObjectStore":false,"IDBOpenDBRequest":false,"IDBRequest":false,"IDBTransaction":false,"IDBVersionChangeEvent":false,"ImageData":false,"importScripts":true,"indexedDB":false,"location":false,"MessageChannel":false,"MessagePort":false,"name":false,"navigator":false,"Notification":false,"onclose":true,"onconnect":true,"onerror":true,"onlanguagechange":true,"onmessage":true,"onoffline":true,"ononline":true,"onrejectionhandled":true,"onunhandledrejection":true,"performance":false,"Performance":false,"PerformanceEntry":false,"PerformanceMark":false,"PerformanceMeasure":false,"PerformanceNavigation":false,"PerformanceResourceTiming":false,"PerformanceTiming":false,"postMessage":true,"Promise":false,"Request":false,"Response":false,"self":true,"ServiceWorkerRegistration":false,"setInterval":false,"setTimeout":false,"TextDecoder":false,"TextEncoder":false,"URL":false,"URLSearchParams":false,"WebSocket":false,"Worker":false,"XMLHttpRequest":false},"node":{"__dirname":false,"__filename":false,"arguments":false,"Buffer":false,"clearImmediate":false,"clearInterval":false,"clearTimeout":false,"console":false,"exports":true,"GLOBAL":false,"global":false,"Intl":false,"module":false,"process":false,"require":false,"root":false,"setImmediate":false,"setInterval":false,"setTimeout":false},"commonjs":{"exports":true,"module":false,"require":false,"global":false},"amd":{"define":false,"require":false},"mocha":{"after":false,"afterEach":false,"before":false,"beforeEach":false,"context":false,"describe":false,"it":false,"mocha":false,"run":false,"setup":false,"specify":false,"suite":false,"suiteSetup":false,"suiteTeardown":false,"teardown":false,"test":false,"xcontext":false,"xdescribe":false,"xit":false,"xspecify":false},"jasmine":{"afterAll":false,"afterEach":false,"beforeAll":false,"beforeEach":false,"describe":false,"expect":false,"fail":false,"fdescribe":false,"fit":false,"it":false,"jasmine":false,"pending":false,"runs":false,"spyOn":false,"spyOnProperty":false,"waits":false,"waitsFor":false,"xdescribe":false,"xit":false},"jest":{"afterAll":false,"afterEach":false,"beforeAll":false,"beforeEach":false,"check":false,"describe":false,"expect":false,"gen":false,"it":false,"fdescribe":false,"fit":false,"jest":false,"pit":false,"require":false,"test":false,"xdescribe":false,"xit":false,"xtest":false},"qunit":{"asyncTest":false,"deepEqual":false,"equal":false,"expect":false,"module":false,"notDeepEqual":false,"notEqual":false,"notOk":false,"notPropEqual":false,"notStrictEqual":false,"ok":false,"propEqual":false,"QUnit":false,"raises":false,"start":false,"stop":false,"strictEqual":false,"test":false,"throws":false},"phantomjs":{"console":true,"exports":true,"phantom":true,"require":true,"WebPage":true},"couch":{"emit":false,"exports":false,"getRow":false,"log":false,"module":false,"provides":false,"require":false,"respond":false,"send":false,"start":false,"sum":false},"rhino":{"defineClass":false,"deserialize":false,"gc":false,"help":false,"importClass":false,"importPackage":false,"java":false,"load":false,"loadClass":false,"Packages":false,"print":false,"quit":false,"readFile":false,"readUrl":false,"runCommand":false,"seal":false,"serialize":false,"spawn":false,"sync":false,"toint32":false,"version":false},"nashorn":{"__DIR__":false,"__FILE__":false,"__LINE__":false,"com":false,"edu":false,"exit":false,"Java":false,"java":false,"javafx":false,"JavaImporter":false,"javax":false,"JSAdapter":false,"load":false,"loadWithNewGlobal":false,"org":false,"Packages":false,"print":false,"quit":false},"wsh":{"ActiveXObject":true,"Enumerator":true,"GetObject":true,"ScriptEngine":true,"ScriptEngineBuildVersion":true,"ScriptEngineMajorVersion":true,"ScriptEngineMinorVersion":true,"VBArray":true,"WScript":true,"WSH":true,"XDomainRequest":true},"jquery":{"$":false,"jQuery":false},"yui":{"Y":false,"YUI":false,"YUI_config":false},"shelljs":{"cat":false,"cd":false,"chmod":false,"config":false,"cp":false,"dirs":false,"echo":false,"env":false,"error":false,"exec":false,"exit":false,"find":false,"grep":false,"ls":false,"ln":false,"mkdir":false,"mv":false,"popd":false,"pushd":false,"pwd":false,"rm":false,"sed":false,"set":false,"target":false,"tempdir":false,"test":false,"touch":false,"which":false},"prototypejs":{"$":false,"$$":false,"$A":false,"$break":false,"$continue":false,"$F":false,"$H":false,"$R":false,"$w":false,"Abstract":false,"Ajax":false,"Autocompleter":false,"Builder":false,"Class":false,"Control":false,"Draggable":false,"Draggables":false,"Droppables":false,"Effect":false,"Element":false,"Enumerable":false,"Event":false,"Field":false,"Form":false,"Hash":false,"Insertion":false,"ObjectRange":false,"PeriodicalExecuter":false,"Position":false,"Prototype":false,"Scriptaculous":false,"Selector":false,"Sortable":false,"SortableObserver":false,"Sound":false,"Template":false,"Toggle":false,"Try":false},"meteor":{"$":false,"_":false,"Accounts":false,"AccountsClient":false,"AccountsServer":false,"AccountsCommon":false,"App":false,"Assets":false,"Blaze":false,"check":false,"Cordova":false,"DDP":false,"DDPServer":false,"DDPRateLimiter":false,"Deps":false,"EJSON":false,"Email":false,"HTTP":false,"Log":false,"Match":false,"Meteor":false,"Mongo":false,"MongoInternals":false,"Npm":false,"Package":false,"Plugin":false,"process":false,"Random":false,"ReactiveDict":false,"ReactiveVar":false,"Router":false,"ServiceConfiguration":false,"Session":false,"share":false,"Spacebars":false,"Template":false,"Tinytest":false,"Tracker":false,"UI":false,"Utils":false,"WebApp":false,"WebAppInternals":false},"mongo":{"_isWindows":false,"_rand":false,"BulkWriteResult":false,"cat":false,"cd":false,"connect":false,"db":false,"getHostName":false,"getMemInfo":false,"hostname":false,"ISODate":false,"listFiles":false,"load":false,"ls":false,"md5sumFile":false,"mkdir":false,"Mongo":false,"NumberInt":false,"NumberLong":false,"ObjectId":false,"PlanCache":false,"print":false,"printjson":false,"pwd":false,"quit":false,"removeFile":false,"rs":false,"sh":false,"UUID":false,"version":false,"WriteResult":false},"applescript":{"$":false,"Application":false,"Automation":false,"console":false,"delay":false,"Library":false,"ObjC":false,"ObjectSpecifier":false,"Path":false,"Progress":false,"Ref":false},"serviceworker":{"caches":false,"Cache":false,"CacheStorage":false,"Client":false,"clients":false,"Clients":false,"ExtendableEvent":false,"ExtendableMessageEvent":false,"FetchEvent":false,"importScripts":false,"registration":false,"self":false,"ServiceWorker":false,"ServiceWorkerContainer":false,"ServiceWorkerGlobalScope":false,"ServiceWorkerMessageEvent":false,"ServiceWorkerRegistration":false,"skipWaiting":false,"WindowClient":false},"atomtest":{"advanceClock":false,"fakeClearInterval":false,"fakeClearTimeout":false,"fakeSetInterval":false,"fakeSetTimeout":false,"resetTimeouts":false,"waitsForPromise":false},"embertest":{"andThen":false,"click":false,"currentPath":false,"currentRouteName":false,"currentURL":false,"fillIn":false,"find":false,"findWithAssert":false,"keyEvent":false,"pauseTest":false,"resumeTest":false,"triggerEvent":false,"visit":false},"protractor":{"$":false,"$$":false,"browser":false,"By":false,"by":false,"DartObject":false,"element":false,"protractor":false},"shared-node-browser":{"clearInterval":false,"clearTimeout":false,"console":false,"setInterval":false,"setTimeout":false},"webextensions":{"browser":false,"chrome":false,"opr":false},"greasemonkey":{"GM_addStyle":false,"GM_deleteValue":false,"GM_getResourceText":false,"GM_getResourceURL":false,"GM_getValue":false,"GM_info":false,"GM_listValues":false,"GM_log":false,"GM_openInTab":false,"GM_registerMenuCommand":false,"GM_setClipboard":false,"GM_setValue":false,"GM_xmlhttpRequest":false,"unsafeWindow":false}}
  50130. /***/ }),
  50131. /* 631 */
  50132. /***/ (function(module, exports) {
  50133. module.exports = {"75":8490,"83":383,"107":8490,"115":383,"181":924,"197":8491,"383":83,"452":453,"453":452,"455":456,"456":455,"458":459,"459":458,"497":498,"498":497,"837":8126,"914":976,"917":1013,"920":1012,"921":8126,"922":1008,"924":181,"928":982,"929":1009,"931":962,"934":981,"937":8486,"962":931,"976":914,"977":1012,"981":934,"982":928,"1008":922,"1009":929,"1012":[920,977],"1013":917,"7776":7835,"7835":7776,"8126":[837,921],"8486":937,"8490":75,"8491":197,"66560":66600,"66561":66601,"66562":66602,"66563":66603,"66564":66604,"66565":66605,"66566":66606,"66567":66607,"66568":66608,"66569":66609,"66570":66610,"66571":66611,"66572":66612,"66573":66613,"66574":66614,"66575":66615,"66576":66616,"66577":66617,"66578":66618,"66579":66619,"66580":66620,"66581":66621,"66582":66622,"66583":66623,"66584":66624,"66585":66625,"66586":66626,"66587":66627,"66588":66628,"66589":66629,"66590":66630,"66591":66631,"66592":66632,"66593":66633,"66594":66634,"66595":66635,"66596":66636,"66597":66637,"66598":66638,"66599":66639,"66600":66560,"66601":66561,"66602":66562,"66603":66563,"66604":66564,"66605":66565,"66606":66566,"66607":66567,"66608":66568,"66609":66569,"66610":66570,"66611":66571,"66612":66572,"66613":66573,"66614":66574,"66615":66575,"66616":66576,"66617":66577,"66618":66578,"66619":66579,"66620":66580,"66621":66581,"66622":66582,"66623":66583,"66624":66584,"66625":66585,"66626":66586,"66627":66587,"66628":66588,"66629":66589,"66630":66590,"66631":66591,"66632":66592,"66633":66593,"66634":66594,"66635":66595,"66636":66596,"66637":66597,"66638":66598,"66639":66599,"68736":68800,"68737":68801,"68738":68802,"68739":68803,"68740":68804,"68741":68805,"68742":68806,"68743":68807,"68744":68808,"68745":68809,"68746":68810,"68747":68811,"68748":68812,"68749":68813,"68750":68814,"68751":68815,"68752":68816,"68753":68817,"68754":68818,"68755":68819,"68756":68820,"68757":68821,"68758":68822,"68759":68823,"68760":68824,"68761":68825,"68762":68826,"68763":68827,"68764":68828,"68765":68829,"68766":68830,"68767":68831,"68768":68832,"68769":68833,"68770":68834,"68771":68835,"68772":68836,"68773":68837,"68774":68838,"68775":68839,"68776":68840,"68777":68841,"68778":68842,"68779":68843,"68780":68844,"68781":68845,"68782":68846,"68783":68847,"68784":68848,"68785":68849,"68786":68850,"68800":68736,"68801":68737,"68802":68738,"68803":68739,"68804":68740,"68805":68741,"68806":68742,"68807":68743,"68808":68744,"68809":68745,"68810":68746,"68811":68747,"68812":68748,"68813":68749,"68814":68750,"68815":68751,"68816":68752,"68817":68753,"68818":68754,"68819":68755,"68820":68756,"68821":68757,"68822":68758,"68823":68759,"68824":68760,"68825":68761,"68826":68762,"68827":68763,"68828":68764,"68829":68765,"68830":68766,"68831":68767,"68832":68768,"68833":68769,"68834":68770,"68835":68771,"68836":68772,"68837":68773,"68838":68774,"68839":68775,"68840":68776,"68841":68777,"68842":68778,"68843":68779,"68844":68780,"68845":68781,"68846":68782,"68847":68783,"68848":68784,"68849":68785,"68850":68786,"71840":71872,"71841":71873,"71842":71874,"71843":71875,"71844":71876,"71845":71877,"71846":71878,"71847":71879,"71848":71880,"71849":71881,"71850":71882,"71851":71883,"71852":71884,"71853":71885,"71854":71886,"71855":71887,"71856":71888,"71857":71889,"71858":71890,"71859":71891,"71860":71892,"71861":71893,"71862":71894,"71863":71895,"71864":71896,"71865":71897,"71866":71898,"71867":71899,"71868":71900,"71869":71901,"71870":71902,"71871":71903,"71872":71840,"71873":71841,"71874":71842,"71875":71843,"71876":71844,"71877":71845,"71878":71846,"71879":71847,"71880":71848,"71881":71849,"71882":71850,"71883":71851,"71884":71852,"71885":71853,"71886":71854,"71887":71855,"71888":71856,"71889":71857,"71890":71858,"71891":71859,"71892":71860,"71893":71861,"71894":71862,"71895":71863,"71896":71864,"71897":71865,"71898":71866,"71899":71867,"71900":71868,"71901":71869,"71902":71870,"71903":71871}
  50134. /***/ })
  50135. /******/ ])))
  50136. });
  50137. ;