index.js 752 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079
  1. var require$$1 = require('path');
  2. var require$$0 = require('fs');
  3. var require$$0$1 = require('buffer');
  4. function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
  5. var require$$1__default = /*#__PURE__*/_interopDefaultLegacy(require$$1);
  6. var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0);
  7. var require$$0__default$1 = /*#__PURE__*/_interopDefaultLegacy(require$$0$1);
  8. var lib$3 = {};
  9. var lib$2 = {};
  10. Object.defineProperty(lib$2, "__esModule", {
  11. value: true
  12. });
  13. lib$2.declare = declare;
  14. lib$2.declarePreset = void 0;
  15. function declare(builder) {
  16. return function(api, options, dirname) {
  17. var _clonedApi2;
  18. var clonedApi;
  19. for(var _i = 0, _iter = Object.keys(apiPolyfills); _i < _iter.length; _i++){
  20. var name = _iter[_i];
  21. var _clonedApi;
  22. if (api[name]) continue;
  23. clonedApi = (_clonedApi = clonedApi) != null ? _clonedApi : copyApiObject(api);
  24. clonedApi[name] = apiPolyfills[name](clonedApi);
  25. }
  26. return builder((_clonedApi2 = clonedApi) != null ? _clonedApi2 : api, options || {}, dirname);
  27. };
  28. }
  29. var declarePreset = declare;
  30. lib$2.declarePreset = declarePreset;
  31. var apiPolyfills = {
  32. assertVersion: function(api) {
  33. return function(range) {
  34. throwVersionError(range, api.version);
  35. };
  36. },
  37. targets: function() {
  38. return function() {
  39. return {};
  40. };
  41. },
  42. assumption: function() {
  43. return function() {
  44. return undefined;
  45. };
  46. }
  47. };
  48. function copyApiObject(api) {
  49. var proto = null;
  50. if (typeof api.version === "string" && /^7\./.test(api.version)) {
  51. proto = Object.getPrototypeOf(api);
  52. if (proto && (!has$1(proto, "version") || !has$1(proto, "transform") || !has$1(proto, "template") || !has$1(proto, "types"))) {
  53. proto = null;
  54. }
  55. }
  56. return Object.assign({}, proto, api);
  57. }
  58. function has$1(obj, key) {
  59. return Object.prototype.hasOwnProperty.call(obj, key);
  60. }
  61. function throwVersionError(range, version) {
  62. if (typeof range === "number") {
  63. if (!Number.isInteger(range)) {
  64. throw new Error("Expected string or integer value.");
  65. }
  66. range = "^" + range + ".0.0-0";
  67. }
  68. if (typeof range !== "string") {
  69. throw new Error("Expected string or integer value.");
  70. }
  71. var limit = Error.stackTraceLimit;
  72. if (typeof limit === "number" && limit < 25) {
  73. Error.stackTraceLimit = 25;
  74. }
  75. var err;
  76. if (version.slice(0, 2) === "7.") {
  77. err = new Error('Requires Babel "^7.0.0-beta.41", but was loaded with "' + version + '". ' + "You'll need to update your @babel/core version.");
  78. } else {
  79. err = new Error('Requires Babel "' + range + '", but was loaded with "' + version + '". ' + "If you are sure you have a compatible version of @babel/core, " + "it is likely that something in your build process is loading the " + "wrong version. Inspect the stack trace of this error to look for " + 'the first entry that doesn\'t mention "@babel/core" or "babel-core" ' + "to see what is calling Babel.");
  80. }
  81. if (typeof limit === "number") {
  82. Error.stackTraceLimit = limit;
  83. }
  84. throw Object.assign(err, {
  85. code: "BABEL_VERSION_UNSUPPORTED",
  86. version: version,
  87. range: range
  88. });
  89. }
  90. Object.defineProperty(lib$3, "__esModule", {
  91. value: true
  92. });
  93. var default_1 = lib$3.default = void 0;
  94. var _helperPluginUtils = lib$2;
  95. var _default$5 = (0, _helperPluginUtils.declare)(function(api) {
  96. api.assertVersion(7);
  97. return {
  98. name: "syntax-jsx",
  99. manipulateOptions: function manipulateOptions(opts, parserOpts) {
  100. if (parserOpts.plugins.some(function(p) {
  101. return (Array.isArray(p) ? p[0] : p) === "typescript";
  102. })) {
  103. return;
  104. }
  105. parserOpts.plugins.push("jsx");
  106. }
  107. };
  108. });
  109. default_1 = lib$3.default = _default$5;
  110. var lib$1 = {};
  111. var isReactComponent$1 = {};
  112. var buildMatchMemberExpression$1 = {};
  113. var matchesPattern$1 = {};
  114. var generated$4 = {};
  115. var shallowEqual$1 = {};
  116. Object.defineProperty(shallowEqual$1, "__esModule", {
  117. value: true
  118. });
  119. shallowEqual$1.default = shallowEqual;
  120. function shallowEqual(actual, expected) {
  121. var keys = Object.keys(expected);
  122. for(var _i = 0; _i < keys.length; _i++){
  123. var key = keys[_i];
  124. if (actual[key] !== expected[key]) {
  125. return false;
  126. }
  127. }
  128. return true;
  129. }
  130. Object.defineProperty(generated$4, "__esModule", {
  131. value: true
  132. });
  133. generated$4.isArrayExpression = isArrayExpression;
  134. generated$4.isAssignmentExpression = isAssignmentExpression;
  135. generated$4.isBinaryExpression = isBinaryExpression;
  136. generated$4.isInterpreterDirective = isInterpreterDirective;
  137. generated$4.isDirective = isDirective;
  138. generated$4.isDirectiveLiteral = isDirectiveLiteral;
  139. generated$4.isBlockStatement = isBlockStatement;
  140. generated$4.isBreakStatement = isBreakStatement;
  141. generated$4.isCallExpression = isCallExpression;
  142. generated$4.isCatchClause = isCatchClause;
  143. generated$4.isConditionalExpression = isConditionalExpression;
  144. generated$4.isContinueStatement = isContinueStatement;
  145. generated$4.isDebuggerStatement = isDebuggerStatement;
  146. generated$4.isDoWhileStatement = isDoWhileStatement;
  147. generated$4.isEmptyStatement = isEmptyStatement;
  148. generated$4.isExpressionStatement = isExpressionStatement;
  149. generated$4.isFile = isFile;
  150. generated$4.isForInStatement = isForInStatement;
  151. generated$4.isForStatement = isForStatement;
  152. generated$4.isFunctionDeclaration = isFunctionDeclaration;
  153. generated$4.isFunctionExpression = isFunctionExpression;
  154. generated$4.isIdentifier = isIdentifier;
  155. generated$4.isIfStatement = isIfStatement;
  156. generated$4.isLabeledStatement = isLabeledStatement;
  157. generated$4.isStringLiteral = isStringLiteral;
  158. generated$4.isNumericLiteral = isNumericLiteral;
  159. generated$4.isNullLiteral = isNullLiteral;
  160. generated$4.isBooleanLiteral = isBooleanLiteral;
  161. generated$4.isRegExpLiteral = isRegExpLiteral;
  162. generated$4.isLogicalExpression = isLogicalExpression;
  163. generated$4.isMemberExpression = isMemberExpression;
  164. generated$4.isNewExpression = isNewExpression;
  165. generated$4.isProgram = isProgram;
  166. generated$4.isObjectExpression = isObjectExpression;
  167. generated$4.isObjectMethod = isObjectMethod;
  168. generated$4.isObjectProperty = isObjectProperty;
  169. generated$4.isRestElement = isRestElement;
  170. generated$4.isReturnStatement = isReturnStatement;
  171. generated$4.isSequenceExpression = isSequenceExpression;
  172. generated$4.isParenthesizedExpression = isParenthesizedExpression;
  173. generated$4.isSwitchCase = isSwitchCase;
  174. generated$4.isSwitchStatement = isSwitchStatement;
  175. generated$4.isThisExpression = isThisExpression;
  176. generated$4.isThrowStatement = isThrowStatement;
  177. generated$4.isTryStatement = isTryStatement;
  178. generated$4.isUnaryExpression = isUnaryExpression;
  179. generated$4.isUpdateExpression = isUpdateExpression;
  180. generated$4.isVariableDeclaration = isVariableDeclaration;
  181. generated$4.isVariableDeclarator = isVariableDeclarator;
  182. generated$4.isWhileStatement = isWhileStatement;
  183. generated$4.isWithStatement = isWithStatement;
  184. generated$4.isAssignmentPattern = isAssignmentPattern;
  185. generated$4.isArrayPattern = isArrayPattern;
  186. generated$4.isArrowFunctionExpression = isArrowFunctionExpression;
  187. generated$4.isClassBody = isClassBody;
  188. generated$4.isClassExpression = isClassExpression;
  189. generated$4.isClassDeclaration = isClassDeclaration;
  190. generated$4.isExportAllDeclaration = isExportAllDeclaration;
  191. generated$4.isExportDefaultDeclaration = isExportDefaultDeclaration;
  192. generated$4.isExportNamedDeclaration = isExportNamedDeclaration;
  193. generated$4.isExportSpecifier = isExportSpecifier;
  194. generated$4.isForOfStatement = isForOfStatement;
  195. generated$4.isImportDeclaration = isImportDeclaration;
  196. generated$4.isImportDefaultSpecifier = isImportDefaultSpecifier;
  197. generated$4.isImportNamespaceSpecifier = isImportNamespaceSpecifier;
  198. generated$4.isImportSpecifier = isImportSpecifier;
  199. generated$4.isMetaProperty = isMetaProperty;
  200. generated$4.isClassMethod = isClassMethod;
  201. generated$4.isObjectPattern = isObjectPattern;
  202. generated$4.isSpreadElement = isSpreadElement;
  203. generated$4.isSuper = isSuper;
  204. generated$4.isTaggedTemplateExpression = isTaggedTemplateExpression;
  205. generated$4.isTemplateElement = isTemplateElement;
  206. generated$4.isTemplateLiteral = isTemplateLiteral;
  207. generated$4.isYieldExpression = isYieldExpression;
  208. generated$4.isAwaitExpression = isAwaitExpression;
  209. generated$4.isImport = isImport;
  210. generated$4.isBigIntLiteral = isBigIntLiteral;
  211. generated$4.isExportNamespaceSpecifier = isExportNamespaceSpecifier;
  212. generated$4.isOptionalMemberExpression = isOptionalMemberExpression;
  213. generated$4.isOptionalCallExpression = isOptionalCallExpression;
  214. generated$4.isClassProperty = isClassProperty;
  215. generated$4.isClassPrivateProperty = isClassPrivateProperty;
  216. generated$4.isClassPrivateMethod = isClassPrivateMethod;
  217. generated$4.isPrivateName = isPrivateName;
  218. generated$4.isAnyTypeAnnotation = isAnyTypeAnnotation;
  219. generated$4.isArrayTypeAnnotation = isArrayTypeAnnotation;
  220. generated$4.isBooleanTypeAnnotation = isBooleanTypeAnnotation;
  221. generated$4.isBooleanLiteralTypeAnnotation = isBooleanLiteralTypeAnnotation;
  222. generated$4.isNullLiteralTypeAnnotation = isNullLiteralTypeAnnotation;
  223. generated$4.isClassImplements = isClassImplements;
  224. generated$4.isDeclareClass = isDeclareClass;
  225. generated$4.isDeclareFunction = isDeclareFunction;
  226. generated$4.isDeclareInterface = isDeclareInterface;
  227. generated$4.isDeclareModule = isDeclareModule;
  228. generated$4.isDeclareModuleExports = isDeclareModuleExports;
  229. generated$4.isDeclareTypeAlias = isDeclareTypeAlias;
  230. generated$4.isDeclareOpaqueType = isDeclareOpaqueType;
  231. generated$4.isDeclareVariable = isDeclareVariable;
  232. generated$4.isDeclareExportDeclaration = isDeclareExportDeclaration;
  233. generated$4.isDeclareExportAllDeclaration = isDeclareExportAllDeclaration;
  234. generated$4.isDeclaredPredicate = isDeclaredPredicate;
  235. generated$4.isExistsTypeAnnotation = isExistsTypeAnnotation;
  236. generated$4.isFunctionTypeAnnotation = isFunctionTypeAnnotation;
  237. generated$4.isFunctionTypeParam = isFunctionTypeParam;
  238. generated$4.isGenericTypeAnnotation = isGenericTypeAnnotation;
  239. generated$4.isInferredPredicate = isInferredPredicate;
  240. generated$4.isInterfaceExtends = isInterfaceExtends;
  241. generated$4.isInterfaceDeclaration = isInterfaceDeclaration;
  242. generated$4.isInterfaceTypeAnnotation = isInterfaceTypeAnnotation;
  243. generated$4.isIntersectionTypeAnnotation = isIntersectionTypeAnnotation;
  244. generated$4.isMixedTypeAnnotation = isMixedTypeAnnotation;
  245. generated$4.isEmptyTypeAnnotation = isEmptyTypeAnnotation;
  246. generated$4.isNullableTypeAnnotation = isNullableTypeAnnotation;
  247. generated$4.isNumberLiteralTypeAnnotation = isNumberLiteralTypeAnnotation;
  248. generated$4.isNumberTypeAnnotation = isNumberTypeAnnotation;
  249. generated$4.isObjectTypeAnnotation = isObjectTypeAnnotation;
  250. generated$4.isObjectTypeInternalSlot = isObjectTypeInternalSlot;
  251. generated$4.isObjectTypeCallProperty = isObjectTypeCallProperty;
  252. generated$4.isObjectTypeIndexer = isObjectTypeIndexer;
  253. generated$4.isObjectTypeProperty = isObjectTypeProperty;
  254. generated$4.isObjectTypeSpreadProperty = isObjectTypeSpreadProperty;
  255. generated$4.isOpaqueType = isOpaqueType;
  256. generated$4.isQualifiedTypeIdentifier = isQualifiedTypeIdentifier;
  257. generated$4.isStringLiteralTypeAnnotation = isStringLiteralTypeAnnotation;
  258. generated$4.isStringTypeAnnotation = isStringTypeAnnotation;
  259. generated$4.isSymbolTypeAnnotation = isSymbolTypeAnnotation;
  260. generated$4.isThisTypeAnnotation = isThisTypeAnnotation;
  261. generated$4.isTupleTypeAnnotation = isTupleTypeAnnotation;
  262. generated$4.isTypeofTypeAnnotation = isTypeofTypeAnnotation;
  263. generated$4.isTypeAlias = isTypeAlias;
  264. generated$4.isTypeAnnotation = isTypeAnnotation;
  265. generated$4.isTypeCastExpression = isTypeCastExpression;
  266. generated$4.isTypeParameter = isTypeParameter;
  267. generated$4.isTypeParameterDeclaration = isTypeParameterDeclaration;
  268. generated$4.isTypeParameterInstantiation = isTypeParameterInstantiation;
  269. generated$4.isUnionTypeAnnotation = isUnionTypeAnnotation;
  270. generated$4.isVariance = isVariance;
  271. generated$4.isVoidTypeAnnotation = isVoidTypeAnnotation;
  272. generated$4.isEnumDeclaration = isEnumDeclaration;
  273. generated$4.isEnumBooleanBody = isEnumBooleanBody;
  274. generated$4.isEnumNumberBody = isEnumNumberBody;
  275. generated$4.isEnumStringBody = isEnumStringBody;
  276. generated$4.isEnumSymbolBody = isEnumSymbolBody;
  277. generated$4.isEnumBooleanMember = isEnumBooleanMember;
  278. generated$4.isEnumNumberMember = isEnumNumberMember;
  279. generated$4.isEnumStringMember = isEnumStringMember;
  280. generated$4.isEnumDefaultedMember = isEnumDefaultedMember;
  281. generated$4.isIndexedAccessType = isIndexedAccessType;
  282. generated$4.isOptionalIndexedAccessType = isOptionalIndexedAccessType;
  283. generated$4.isJSXAttribute = isJSXAttribute;
  284. generated$4.isJSXClosingElement = isJSXClosingElement;
  285. generated$4.isJSXElement = isJSXElement;
  286. generated$4.isJSXEmptyExpression = isJSXEmptyExpression;
  287. generated$4.isJSXExpressionContainer = isJSXExpressionContainer;
  288. generated$4.isJSXSpreadChild = isJSXSpreadChild;
  289. generated$4.isJSXIdentifier = isJSXIdentifier;
  290. generated$4.isJSXMemberExpression = isJSXMemberExpression;
  291. generated$4.isJSXNamespacedName = isJSXNamespacedName;
  292. generated$4.isJSXOpeningElement = isJSXOpeningElement;
  293. generated$4.isJSXSpreadAttribute = isJSXSpreadAttribute;
  294. generated$4.isJSXText = isJSXText;
  295. generated$4.isJSXFragment = isJSXFragment;
  296. generated$4.isJSXOpeningFragment = isJSXOpeningFragment;
  297. generated$4.isJSXClosingFragment = isJSXClosingFragment;
  298. generated$4.isNoop = isNoop;
  299. generated$4.isPlaceholder = isPlaceholder;
  300. generated$4.isV8IntrinsicIdentifier = isV8IntrinsicIdentifier;
  301. generated$4.isArgumentPlaceholder = isArgumentPlaceholder;
  302. generated$4.isBindExpression = isBindExpression;
  303. generated$4.isImportAttribute = isImportAttribute;
  304. generated$4.isDecorator = isDecorator;
  305. generated$4.isDoExpression = isDoExpression;
  306. generated$4.isExportDefaultSpecifier = isExportDefaultSpecifier;
  307. generated$4.isRecordExpression = isRecordExpression;
  308. generated$4.isTupleExpression = isTupleExpression;
  309. generated$4.isDecimalLiteral = isDecimalLiteral;
  310. generated$4.isStaticBlock = isStaticBlock;
  311. generated$4.isModuleExpression = isModuleExpression;
  312. generated$4.isTopicReference = isTopicReference;
  313. generated$4.isPipelineTopicExpression = isPipelineTopicExpression;
  314. generated$4.isPipelineBareFunction = isPipelineBareFunction;
  315. generated$4.isPipelinePrimaryTopicReference = isPipelinePrimaryTopicReference;
  316. generated$4.isTSParameterProperty = isTSParameterProperty;
  317. generated$4.isTSDeclareFunction = isTSDeclareFunction;
  318. generated$4.isTSDeclareMethod = isTSDeclareMethod;
  319. generated$4.isTSQualifiedName = isTSQualifiedName;
  320. generated$4.isTSCallSignatureDeclaration = isTSCallSignatureDeclaration;
  321. generated$4.isTSConstructSignatureDeclaration = isTSConstructSignatureDeclaration;
  322. generated$4.isTSPropertySignature = isTSPropertySignature;
  323. generated$4.isTSMethodSignature = isTSMethodSignature;
  324. generated$4.isTSIndexSignature = isTSIndexSignature;
  325. generated$4.isTSAnyKeyword = isTSAnyKeyword;
  326. generated$4.isTSBooleanKeyword = isTSBooleanKeyword;
  327. generated$4.isTSBigIntKeyword = isTSBigIntKeyword;
  328. generated$4.isTSIntrinsicKeyword = isTSIntrinsicKeyword;
  329. generated$4.isTSNeverKeyword = isTSNeverKeyword;
  330. generated$4.isTSNullKeyword = isTSNullKeyword;
  331. generated$4.isTSNumberKeyword = isTSNumberKeyword;
  332. generated$4.isTSObjectKeyword = isTSObjectKeyword;
  333. generated$4.isTSStringKeyword = isTSStringKeyword;
  334. generated$4.isTSSymbolKeyword = isTSSymbolKeyword;
  335. generated$4.isTSUndefinedKeyword = isTSUndefinedKeyword;
  336. generated$4.isTSUnknownKeyword = isTSUnknownKeyword;
  337. generated$4.isTSVoidKeyword = isTSVoidKeyword;
  338. generated$4.isTSThisType = isTSThisType;
  339. generated$4.isTSFunctionType = isTSFunctionType;
  340. generated$4.isTSConstructorType = isTSConstructorType;
  341. generated$4.isTSTypeReference = isTSTypeReference;
  342. generated$4.isTSTypePredicate = isTSTypePredicate;
  343. generated$4.isTSTypeQuery = isTSTypeQuery;
  344. generated$4.isTSTypeLiteral = isTSTypeLiteral;
  345. generated$4.isTSArrayType = isTSArrayType;
  346. generated$4.isTSTupleType = isTSTupleType;
  347. generated$4.isTSOptionalType = isTSOptionalType;
  348. generated$4.isTSRestType = isTSRestType;
  349. generated$4.isTSNamedTupleMember = isTSNamedTupleMember;
  350. generated$4.isTSUnionType = isTSUnionType;
  351. generated$4.isTSIntersectionType = isTSIntersectionType;
  352. generated$4.isTSConditionalType = isTSConditionalType;
  353. generated$4.isTSInferType = isTSInferType;
  354. generated$4.isTSParenthesizedType = isTSParenthesizedType;
  355. generated$4.isTSTypeOperator = isTSTypeOperator;
  356. generated$4.isTSIndexedAccessType = isTSIndexedAccessType;
  357. generated$4.isTSMappedType = isTSMappedType;
  358. generated$4.isTSLiteralType = isTSLiteralType;
  359. generated$4.isTSExpressionWithTypeArguments = isTSExpressionWithTypeArguments;
  360. generated$4.isTSInterfaceDeclaration = isTSInterfaceDeclaration;
  361. generated$4.isTSInterfaceBody = isTSInterfaceBody;
  362. generated$4.isTSTypeAliasDeclaration = isTSTypeAliasDeclaration;
  363. generated$4.isTSAsExpression = isTSAsExpression;
  364. generated$4.isTSTypeAssertion = isTSTypeAssertion;
  365. generated$4.isTSEnumDeclaration = isTSEnumDeclaration;
  366. generated$4.isTSEnumMember = isTSEnumMember;
  367. generated$4.isTSModuleDeclaration = isTSModuleDeclaration;
  368. generated$4.isTSModuleBlock = isTSModuleBlock;
  369. generated$4.isTSImportType = isTSImportType;
  370. generated$4.isTSImportEqualsDeclaration = isTSImportEqualsDeclaration;
  371. generated$4.isTSExternalModuleReference = isTSExternalModuleReference;
  372. generated$4.isTSNonNullExpression = isTSNonNullExpression;
  373. generated$4.isTSExportAssignment = isTSExportAssignment;
  374. generated$4.isTSNamespaceExportDeclaration = isTSNamespaceExportDeclaration;
  375. generated$4.isTSTypeAnnotation = isTSTypeAnnotation;
  376. generated$4.isTSTypeParameterInstantiation = isTSTypeParameterInstantiation;
  377. generated$4.isTSTypeParameterDeclaration = isTSTypeParameterDeclaration;
  378. generated$4.isTSTypeParameter = isTSTypeParameter;
  379. generated$4.isExpression = isExpression;
  380. generated$4.isBinary = isBinary;
  381. generated$4.isScopable = isScopable;
  382. generated$4.isBlockParent = isBlockParent;
  383. generated$4.isBlock = isBlock;
  384. generated$4.isStatement = isStatement;
  385. generated$4.isTerminatorless = isTerminatorless;
  386. generated$4.isCompletionStatement = isCompletionStatement;
  387. generated$4.isConditional = isConditional;
  388. generated$4.isLoop = isLoop;
  389. generated$4.isWhile = isWhile;
  390. generated$4.isExpressionWrapper = isExpressionWrapper;
  391. generated$4.isFor = isFor;
  392. generated$4.isForXStatement = isForXStatement;
  393. generated$4.isFunction = isFunction;
  394. generated$4.isFunctionParent = isFunctionParent;
  395. generated$4.isPureish = isPureish;
  396. generated$4.isDeclaration = isDeclaration;
  397. generated$4.isPatternLike = isPatternLike;
  398. generated$4.isLVal = isLVal;
  399. generated$4.isTSEntityName = isTSEntityName;
  400. generated$4.isLiteral = isLiteral;
  401. generated$4.isImmutable = isImmutable$2;
  402. generated$4.isUserWhitespacable = isUserWhitespacable;
  403. generated$4.isMethod = isMethod;
  404. generated$4.isObjectMember = isObjectMember;
  405. generated$4.isProperty = isProperty;
  406. generated$4.isUnaryLike = isUnaryLike;
  407. generated$4.isPattern = isPattern;
  408. generated$4.isClass = isClass;
  409. generated$4.isModuleDeclaration = isModuleDeclaration;
  410. generated$4.isExportDeclaration = isExportDeclaration;
  411. generated$4.isModuleSpecifier = isModuleSpecifier;
  412. generated$4.isPrivate = isPrivate;
  413. generated$4.isFlow = isFlow;
  414. generated$4.isFlowType = isFlowType;
  415. generated$4.isFlowBaseAnnotation = isFlowBaseAnnotation;
  416. generated$4.isFlowDeclaration = isFlowDeclaration;
  417. generated$4.isFlowPredicate = isFlowPredicate;
  418. generated$4.isEnumBody = isEnumBody;
  419. generated$4.isEnumMember = isEnumMember;
  420. generated$4.isJSX = isJSX;
  421. generated$4.isTSTypeElement = isTSTypeElement;
  422. generated$4.isTSType = isTSType;
  423. generated$4.isTSBaseType = isTSBaseType;
  424. generated$4.isNumberLiteral = isNumberLiteral;
  425. generated$4.isRegexLiteral = isRegexLiteral;
  426. generated$4.isRestProperty = isRestProperty;
  427. generated$4.isSpreadProperty = isSpreadProperty;
  428. var _shallowEqual = shallowEqual$1;
  429. function isArrayExpression(node, opts) {
  430. if (!node) return false;
  431. var nodeType = node.type;
  432. if (nodeType === "ArrayExpression") {
  433. if (typeof opts === "undefined") {
  434. return true;
  435. } else {
  436. return (0, _shallowEqual.default)(node, opts);
  437. }
  438. }
  439. return false;
  440. }
  441. function isAssignmentExpression(node, opts) {
  442. if (!node) return false;
  443. var nodeType = node.type;
  444. if (nodeType === "AssignmentExpression") {
  445. if (typeof opts === "undefined") {
  446. return true;
  447. } else {
  448. return (0, _shallowEqual.default)(node, opts);
  449. }
  450. }
  451. return false;
  452. }
  453. function isBinaryExpression(node, opts) {
  454. if (!node) return false;
  455. var nodeType = node.type;
  456. if (nodeType === "BinaryExpression") {
  457. if (typeof opts === "undefined") {
  458. return true;
  459. } else {
  460. return (0, _shallowEqual.default)(node, opts);
  461. }
  462. }
  463. return false;
  464. }
  465. function isInterpreterDirective(node, opts) {
  466. if (!node) return false;
  467. var nodeType = node.type;
  468. if (nodeType === "InterpreterDirective") {
  469. if (typeof opts === "undefined") {
  470. return true;
  471. } else {
  472. return (0, _shallowEqual.default)(node, opts);
  473. }
  474. }
  475. return false;
  476. }
  477. function isDirective(node, opts) {
  478. if (!node) return false;
  479. var nodeType = node.type;
  480. if (nodeType === "Directive") {
  481. if (typeof opts === "undefined") {
  482. return true;
  483. } else {
  484. return (0, _shallowEqual.default)(node, opts);
  485. }
  486. }
  487. return false;
  488. }
  489. function isDirectiveLiteral(node, opts) {
  490. if (!node) return false;
  491. var nodeType = node.type;
  492. if (nodeType === "DirectiveLiteral") {
  493. if (typeof opts === "undefined") {
  494. return true;
  495. } else {
  496. return (0, _shallowEqual.default)(node, opts);
  497. }
  498. }
  499. return false;
  500. }
  501. function isBlockStatement(node, opts) {
  502. if (!node) return false;
  503. var nodeType = node.type;
  504. if (nodeType === "BlockStatement") {
  505. if (typeof opts === "undefined") {
  506. return true;
  507. } else {
  508. return (0, _shallowEqual.default)(node, opts);
  509. }
  510. }
  511. return false;
  512. }
  513. function isBreakStatement(node, opts) {
  514. if (!node) return false;
  515. var nodeType = node.type;
  516. if (nodeType === "BreakStatement") {
  517. if (typeof opts === "undefined") {
  518. return true;
  519. } else {
  520. return (0, _shallowEqual.default)(node, opts);
  521. }
  522. }
  523. return false;
  524. }
  525. function isCallExpression(node, opts) {
  526. if (!node) return false;
  527. var nodeType = node.type;
  528. if (nodeType === "CallExpression") {
  529. if (typeof opts === "undefined") {
  530. return true;
  531. } else {
  532. return (0, _shallowEqual.default)(node, opts);
  533. }
  534. }
  535. return false;
  536. }
  537. function isCatchClause(node, opts) {
  538. if (!node) return false;
  539. var nodeType = node.type;
  540. if (nodeType === "CatchClause") {
  541. if (typeof opts === "undefined") {
  542. return true;
  543. } else {
  544. return (0, _shallowEqual.default)(node, opts);
  545. }
  546. }
  547. return false;
  548. }
  549. function isConditionalExpression(node, opts) {
  550. if (!node) return false;
  551. var nodeType = node.type;
  552. if (nodeType === "ConditionalExpression") {
  553. if (typeof opts === "undefined") {
  554. return true;
  555. } else {
  556. return (0, _shallowEqual.default)(node, opts);
  557. }
  558. }
  559. return false;
  560. }
  561. function isContinueStatement(node, opts) {
  562. if (!node) return false;
  563. var nodeType = node.type;
  564. if (nodeType === "ContinueStatement") {
  565. if (typeof opts === "undefined") {
  566. return true;
  567. } else {
  568. return (0, _shallowEqual.default)(node, opts);
  569. }
  570. }
  571. return false;
  572. }
  573. function isDebuggerStatement(node, opts) {
  574. if (!node) return false;
  575. var nodeType = node.type;
  576. if (nodeType === "DebuggerStatement") {
  577. if (typeof opts === "undefined") {
  578. return true;
  579. } else {
  580. return (0, _shallowEqual.default)(node, opts);
  581. }
  582. }
  583. return false;
  584. }
  585. function isDoWhileStatement(node, opts) {
  586. if (!node) return false;
  587. var nodeType = node.type;
  588. if (nodeType === "DoWhileStatement") {
  589. if (typeof opts === "undefined") {
  590. return true;
  591. } else {
  592. return (0, _shallowEqual.default)(node, opts);
  593. }
  594. }
  595. return false;
  596. }
  597. function isEmptyStatement(node, opts) {
  598. if (!node) return false;
  599. var nodeType = node.type;
  600. if (nodeType === "EmptyStatement") {
  601. if (typeof opts === "undefined") {
  602. return true;
  603. } else {
  604. return (0, _shallowEqual.default)(node, opts);
  605. }
  606. }
  607. return false;
  608. }
  609. function isExpressionStatement(node, opts) {
  610. if (!node) return false;
  611. var nodeType = node.type;
  612. if (nodeType === "ExpressionStatement") {
  613. if (typeof opts === "undefined") {
  614. return true;
  615. } else {
  616. return (0, _shallowEqual.default)(node, opts);
  617. }
  618. }
  619. return false;
  620. }
  621. function isFile(node, opts) {
  622. if (!node) return false;
  623. var nodeType = node.type;
  624. if (nodeType === "File") {
  625. if (typeof opts === "undefined") {
  626. return true;
  627. } else {
  628. return (0, _shallowEqual.default)(node, opts);
  629. }
  630. }
  631. return false;
  632. }
  633. function isForInStatement(node, opts) {
  634. if (!node) return false;
  635. var nodeType = node.type;
  636. if (nodeType === "ForInStatement") {
  637. if (typeof opts === "undefined") {
  638. return true;
  639. } else {
  640. return (0, _shallowEqual.default)(node, opts);
  641. }
  642. }
  643. return false;
  644. }
  645. function isForStatement(node, opts) {
  646. if (!node) return false;
  647. var nodeType = node.type;
  648. if (nodeType === "ForStatement") {
  649. if (typeof opts === "undefined") {
  650. return true;
  651. } else {
  652. return (0, _shallowEqual.default)(node, opts);
  653. }
  654. }
  655. return false;
  656. }
  657. function isFunctionDeclaration(node, opts) {
  658. if (!node) return false;
  659. var nodeType = node.type;
  660. if (nodeType === "FunctionDeclaration") {
  661. if (typeof opts === "undefined") {
  662. return true;
  663. } else {
  664. return (0, _shallowEqual.default)(node, opts);
  665. }
  666. }
  667. return false;
  668. }
  669. function isFunctionExpression(node, opts) {
  670. if (!node) return false;
  671. var nodeType = node.type;
  672. if (nodeType === "FunctionExpression") {
  673. if (typeof opts === "undefined") {
  674. return true;
  675. } else {
  676. return (0, _shallowEqual.default)(node, opts);
  677. }
  678. }
  679. return false;
  680. }
  681. function isIdentifier(node, opts) {
  682. if (!node) return false;
  683. var nodeType = node.type;
  684. if (nodeType === "Identifier") {
  685. if (typeof opts === "undefined") {
  686. return true;
  687. } else {
  688. return (0, _shallowEqual.default)(node, opts);
  689. }
  690. }
  691. return false;
  692. }
  693. function isIfStatement(node, opts) {
  694. if (!node) return false;
  695. var nodeType = node.type;
  696. if (nodeType === "IfStatement") {
  697. if (typeof opts === "undefined") {
  698. return true;
  699. } else {
  700. return (0, _shallowEqual.default)(node, opts);
  701. }
  702. }
  703. return false;
  704. }
  705. function isLabeledStatement(node, opts) {
  706. if (!node) return false;
  707. var nodeType = node.type;
  708. if (nodeType === "LabeledStatement") {
  709. if (typeof opts === "undefined") {
  710. return true;
  711. } else {
  712. return (0, _shallowEqual.default)(node, opts);
  713. }
  714. }
  715. return false;
  716. }
  717. function isStringLiteral(node, opts) {
  718. if (!node) return false;
  719. var nodeType = node.type;
  720. if (nodeType === "StringLiteral") {
  721. if (typeof opts === "undefined") {
  722. return true;
  723. } else {
  724. return (0, _shallowEqual.default)(node, opts);
  725. }
  726. }
  727. return false;
  728. }
  729. function isNumericLiteral(node, opts) {
  730. if (!node) return false;
  731. var nodeType = node.type;
  732. if (nodeType === "NumericLiteral") {
  733. if (typeof opts === "undefined") {
  734. return true;
  735. } else {
  736. return (0, _shallowEqual.default)(node, opts);
  737. }
  738. }
  739. return false;
  740. }
  741. function isNullLiteral(node, opts) {
  742. if (!node) return false;
  743. var nodeType = node.type;
  744. if (nodeType === "NullLiteral") {
  745. if (typeof opts === "undefined") {
  746. return true;
  747. } else {
  748. return (0, _shallowEqual.default)(node, opts);
  749. }
  750. }
  751. return false;
  752. }
  753. function isBooleanLiteral(node, opts) {
  754. if (!node) return false;
  755. var nodeType = node.type;
  756. if (nodeType === "BooleanLiteral") {
  757. if (typeof opts === "undefined") {
  758. return true;
  759. } else {
  760. return (0, _shallowEqual.default)(node, opts);
  761. }
  762. }
  763. return false;
  764. }
  765. function isRegExpLiteral(node, opts) {
  766. if (!node) return false;
  767. var nodeType = node.type;
  768. if (nodeType === "RegExpLiteral") {
  769. if (typeof opts === "undefined") {
  770. return true;
  771. } else {
  772. return (0, _shallowEqual.default)(node, opts);
  773. }
  774. }
  775. return false;
  776. }
  777. function isLogicalExpression(node, opts) {
  778. if (!node) return false;
  779. var nodeType = node.type;
  780. if (nodeType === "LogicalExpression") {
  781. if (typeof opts === "undefined") {
  782. return true;
  783. } else {
  784. return (0, _shallowEqual.default)(node, opts);
  785. }
  786. }
  787. return false;
  788. }
  789. function isMemberExpression(node, opts) {
  790. if (!node) return false;
  791. var nodeType = node.type;
  792. if (nodeType === "MemberExpression") {
  793. if (typeof opts === "undefined") {
  794. return true;
  795. } else {
  796. return (0, _shallowEqual.default)(node, opts);
  797. }
  798. }
  799. return false;
  800. }
  801. function isNewExpression(node, opts) {
  802. if (!node) return false;
  803. var nodeType = node.type;
  804. if (nodeType === "NewExpression") {
  805. if (typeof opts === "undefined") {
  806. return true;
  807. } else {
  808. return (0, _shallowEqual.default)(node, opts);
  809. }
  810. }
  811. return false;
  812. }
  813. function isProgram(node, opts) {
  814. if (!node) return false;
  815. var nodeType = node.type;
  816. if (nodeType === "Program") {
  817. if (typeof opts === "undefined") {
  818. return true;
  819. } else {
  820. return (0, _shallowEqual.default)(node, opts);
  821. }
  822. }
  823. return false;
  824. }
  825. function isObjectExpression(node, opts) {
  826. if (!node) return false;
  827. var nodeType = node.type;
  828. if (nodeType === "ObjectExpression") {
  829. if (typeof opts === "undefined") {
  830. return true;
  831. } else {
  832. return (0, _shallowEqual.default)(node, opts);
  833. }
  834. }
  835. return false;
  836. }
  837. function isObjectMethod(node, opts) {
  838. if (!node) return false;
  839. var nodeType = node.type;
  840. if (nodeType === "ObjectMethod") {
  841. if (typeof opts === "undefined") {
  842. return true;
  843. } else {
  844. return (0, _shallowEqual.default)(node, opts);
  845. }
  846. }
  847. return false;
  848. }
  849. function isObjectProperty(node, opts) {
  850. if (!node) return false;
  851. var nodeType = node.type;
  852. if (nodeType === "ObjectProperty") {
  853. if (typeof opts === "undefined") {
  854. return true;
  855. } else {
  856. return (0, _shallowEqual.default)(node, opts);
  857. }
  858. }
  859. return false;
  860. }
  861. function isRestElement(node, opts) {
  862. if (!node) return false;
  863. var nodeType = node.type;
  864. if (nodeType === "RestElement") {
  865. if (typeof opts === "undefined") {
  866. return true;
  867. } else {
  868. return (0, _shallowEqual.default)(node, opts);
  869. }
  870. }
  871. return false;
  872. }
  873. function isReturnStatement(node, opts) {
  874. if (!node) return false;
  875. var nodeType = node.type;
  876. if (nodeType === "ReturnStatement") {
  877. if (typeof opts === "undefined") {
  878. return true;
  879. } else {
  880. return (0, _shallowEqual.default)(node, opts);
  881. }
  882. }
  883. return false;
  884. }
  885. function isSequenceExpression(node, opts) {
  886. if (!node) return false;
  887. var nodeType = node.type;
  888. if (nodeType === "SequenceExpression") {
  889. if (typeof opts === "undefined") {
  890. return true;
  891. } else {
  892. return (0, _shallowEqual.default)(node, opts);
  893. }
  894. }
  895. return false;
  896. }
  897. function isParenthesizedExpression(node, opts) {
  898. if (!node) return false;
  899. var nodeType = node.type;
  900. if (nodeType === "ParenthesizedExpression") {
  901. if (typeof opts === "undefined") {
  902. return true;
  903. } else {
  904. return (0, _shallowEqual.default)(node, opts);
  905. }
  906. }
  907. return false;
  908. }
  909. function isSwitchCase(node, opts) {
  910. if (!node) return false;
  911. var nodeType = node.type;
  912. if (nodeType === "SwitchCase") {
  913. if (typeof opts === "undefined") {
  914. return true;
  915. } else {
  916. return (0, _shallowEqual.default)(node, opts);
  917. }
  918. }
  919. return false;
  920. }
  921. function isSwitchStatement(node, opts) {
  922. if (!node) return false;
  923. var nodeType = node.type;
  924. if (nodeType === "SwitchStatement") {
  925. if (typeof opts === "undefined") {
  926. return true;
  927. } else {
  928. return (0, _shallowEqual.default)(node, opts);
  929. }
  930. }
  931. return false;
  932. }
  933. function isThisExpression(node, opts) {
  934. if (!node) return false;
  935. var nodeType = node.type;
  936. if (nodeType === "ThisExpression") {
  937. if (typeof opts === "undefined") {
  938. return true;
  939. } else {
  940. return (0, _shallowEqual.default)(node, opts);
  941. }
  942. }
  943. return false;
  944. }
  945. function isThrowStatement(node, opts) {
  946. if (!node) return false;
  947. var nodeType = node.type;
  948. if (nodeType === "ThrowStatement") {
  949. if (typeof opts === "undefined") {
  950. return true;
  951. } else {
  952. return (0, _shallowEqual.default)(node, opts);
  953. }
  954. }
  955. return false;
  956. }
  957. function isTryStatement(node, opts) {
  958. if (!node) return false;
  959. var nodeType = node.type;
  960. if (nodeType === "TryStatement") {
  961. if (typeof opts === "undefined") {
  962. return true;
  963. } else {
  964. return (0, _shallowEqual.default)(node, opts);
  965. }
  966. }
  967. return false;
  968. }
  969. function isUnaryExpression(node, opts) {
  970. if (!node) return false;
  971. var nodeType = node.type;
  972. if (nodeType === "UnaryExpression") {
  973. if (typeof opts === "undefined") {
  974. return true;
  975. } else {
  976. return (0, _shallowEqual.default)(node, opts);
  977. }
  978. }
  979. return false;
  980. }
  981. function isUpdateExpression(node, opts) {
  982. if (!node) return false;
  983. var nodeType = node.type;
  984. if (nodeType === "UpdateExpression") {
  985. if (typeof opts === "undefined") {
  986. return true;
  987. } else {
  988. return (0, _shallowEqual.default)(node, opts);
  989. }
  990. }
  991. return false;
  992. }
  993. function isVariableDeclaration(node, opts) {
  994. if (!node) return false;
  995. var nodeType = node.type;
  996. if (nodeType === "VariableDeclaration") {
  997. if (typeof opts === "undefined") {
  998. return true;
  999. } else {
  1000. return (0, _shallowEqual.default)(node, opts);
  1001. }
  1002. }
  1003. return false;
  1004. }
  1005. function isVariableDeclarator(node, opts) {
  1006. if (!node) return false;
  1007. var nodeType = node.type;
  1008. if (nodeType === "VariableDeclarator") {
  1009. if (typeof opts === "undefined") {
  1010. return true;
  1011. } else {
  1012. return (0, _shallowEqual.default)(node, opts);
  1013. }
  1014. }
  1015. return false;
  1016. }
  1017. function isWhileStatement(node, opts) {
  1018. if (!node) return false;
  1019. var nodeType = node.type;
  1020. if (nodeType === "WhileStatement") {
  1021. if (typeof opts === "undefined") {
  1022. return true;
  1023. } else {
  1024. return (0, _shallowEqual.default)(node, opts);
  1025. }
  1026. }
  1027. return false;
  1028. }
  1029. function isWithStatement(node, opts) {
  1030. if (!node) return false;
  1031. var nodeType = node.type;
  1032. if (nodeType === "WithStatement") {
  1033. if (typeof opts === "undefined") {
  1034. return true;
  1035. } else {
  1036. return (0, _shallowEqual.default)(node, opts);
  1037. }
  1038. }
  1039. return false;
  1040. }
  1041. function isAssignmentPattern(node, opts) {
  1042. if (!node) return false;
  1043. var nodeType = node.type;
  1044. if (nodeType === "AssignmentPattern") {
  1045. if (typeof opts === "undefined") {
  1046. return true;
  1047. } else {
  1048. return (0, _shallowEqual.default)(node, opts);
  1049. }
  1050. }
  1051. return false;
  1052. }
  1053. function isArrayPattern(node, opts) {
  1054. if (!node) return false;
  1055. var nodeType = node.type;
  1056. if (nodeType === "ArrayPattern") {
  1057. if (typeof opts === "undefined") {
  1058. return true;
  1059. } else {
  1060. return (0, _shallowEqual.default)(node, opts);
  1061. }
  1062. }
  1063. return false;
  1064. }
  1065. function isArrowFunctionExpression(node, opts) {
  1066. if (!node) return false;
  1067. var nodeType = node.type;
  1068. if (nodeType === "ArrowFunctionExpression") {
  1069. if (typeof opts === "undefined") {
  1070. return true;
  1071. } else {
  1072. return (0, _shallowEqual.default)(node, opts);
  1073. }
  1074. }
  1075. return false;
  1076. }
  1077. function isClassBody(node, opts) {
  1078. if (!node) return false;
  1079. var nodeType = node.type;
  1080. if (nodeType === "ClassBody") {
  1081. if (typeof opts === "undefined") {
  1082. return true;
  1083. } else {
  1084. return (0, _shallowEqual.default)(node, opts);
  1085. }
  1086. }
  1087. return false;
  1088. }
  1089. function isClassExpression(node, opts) {
  1090. if (!node) return false;
  1091. var nodeType = node.type;
  1092. if (nodeType === "ClassExpression") {
  1093. if (typeof opts === "undefined") {
  1094. return true;
  1095. } else {
  1096. return (0, _shallowEqual.default)(node, opts);
  1097. }
  1098. }
  1099. return false;
  1100. }
  1101. function isClassDeclaration(node, opts) {
  1102. if (!node) return false;
  1103. var nodeType = node.type;
  1104. if (nodeType === "ClassDeclaration") {
  1105. if (typeof opts === "undefined") {
  1106. return true;
  1107. } else {
  1108. return (0, _shallowEqual.default)(node, opts);
  1109. }
  1110. }
  1111. return false;
  1112. }
  1113. function isExportAllDeclaration(node, opts) {
  1114. if (!node) return false;
  1115. var nodeType = node.type;
  1116. if (nodeType === "ExportAllDeclaration") {
  1117. if (typeof opts === "undefined") {
  1118. return true;
  1119. } else {
  1120. return (0, _shallowEqual.default)(node, opts);
  1121. }
  1122. }
  1123. return false;
  1124. }
  1125. function isExportDefaultDeclaration(node, opts) {
  1126. if (!node) return false;
  1127. var nodeType = node.type;
  1128. if (nodeType === "ExportDefaultDeclaration") {
  1129. if (typeof opts === "undefined") {
  1130. return true;
  1131. } else {
  1132. return (0, _shallowEqual.default)(node, opts);
  1133. }
  1134. }
  1135. return false;
  1136. }
  1137. function isExportNamedDeclaration(node, opts) {
  1138. if (!node) return false;
  1139. var nodeType = node.type;
  1140. if (nodeType === "ExportNamedDeclaration") {
  1141. if (typeof opts === "undefined") {
  1142. return true;
  1143. } else {
  1144. return (0, _shallowEqual.default)(node, opts);
  1145. }
  1146. }
  1147. return false;
  1148. }
  1149. function isExportSpecifier(node, opts) {
  1150. if (!node) return false;
  1151. var nodeType = node.type;
  1152. if (nodeType === "ExportSpecifier") {
  1153. if (typeof opts === "undefined") {
  1154. return true;
  1155. } else {
  1156. return (0, _shallowEqual.default)(node, opts);
  1157. }
  1158. }
  1159. return false;
  1160. }
  1161. function isForOfStatement(node, opts) {
  1162. if (!node) return false;
  1163. var nodeType = node.type;
  1164. if (nodeType === "ForOfStatement") {
  1165. if (typeof opts === "undefined") {
  1166. return true;
  1167. } else {
  1168. return (0, _shallowEqual.default)(node, opts);
  1169. }
  1170. }
  1171. return false;
  1172. }
  1173. function isImportDeclaration(node, opts) {
  1174. if (!node) return false;
  1175. var nodeType = node.type;
  1176. if (nodeType === "ImportDeclaration") {
  1177. if (typeof opts === "undefined") {
  1178. return true;
  1179. } else {
  1180. return (0, _shallowEqual.default)(node, opts);
  1181. }
  1182. }
  1183. return false;
  1184. }
  1185. function isImportDefaultSpecifier(node, opts) {
  1186. if (!node) return false;
  1187. var nodeType = node.type;
  1188. if (nodeType === "ImportDefaultSpecifier") {
  1189. if (typeof opts === "undefined") {
  1190. return true;
  1191. } else {
  1192. return (0, _shallowEqual.default)(node, opts);
  1193. }
  1194. }
  1195. return false;
  1196. }
  1197. function isImportNamespaceSpecifier(node, opts) {
  1198. if (!node) return false;
  1199. var nodeType = node.type;
  1200. if (nodeType === "ImportNamespaceSpecifier") {
  1201. if (typeof opts === "undefined") {
  1202. return true;
  1203. } else {
  1204. return (0, _shallowEqual.default)(node, opts);
  1205. }
  1206. }
  1207. return false;
  1208. }
  1209. function isImportSpecifier(node, opts) {
  1210. if (!node) return false;
  1211. var nodeType = node.type;
  1212. if (nodeType === "ImportSpecifier") {
  1213. if (typeof opts === "undefined") {
  1214. return true;
  1215. } else {
  1216. return (0, _shallowEqual.default)(node, opts);
  1217. }
  1218. }
  1219. return false;
  1220. }
  1221. function isMetaProperty(node, opts) {
  1222. if (!node) return false;
  1223. var nodeType = node.type;
  1224. if (nodeType === "MetaProperty") {
  1225. if (typeof opts === "undefined") {
  1226. return true;
  1227. } else {
  1228. return (0, _shallowEqual.default)(node, opts);
  1229. }
  1230. }
  1231. return false;
  1232. }
  1233. function isClassMethod(node, opts) {
  1234. if (!node) return false;
  1235. var nodeType = node.type;
  1236. if (nodeType === "ClassMethod") {
  1237. if (typeof opts === "undefined") {
  1238. return true;
  1239. } else {
  1240. return (0, _shallowEqual.default)(node, opts);
  1241. }
  1242. }
  1243. return false;
  1244. }
  1245. function isObjectPattern(node, opts) {
  1246. if (!node) return false;
  1247. var nodeType = node.type;
  1248. if (nodeType === "ObjectPattern") {
  1249. if (typeof opts === "undefined") {
  1250. return true;
  1251. } else {
  1252. return (0, _shallowEqual.default)(node, opts);
  1253. }
  1254. }
  1255. return false;
  1256. }
  1257. function isSpreadElement(node, opts) {
  1258. if (!node) return false;
  1259. var nodeType = node.type;
  1260. if (nodeType === "SpreadElement") {
  1261. if (typeof opts === "undefined") {
  1262. return true;
  1263. } else {
  1264. return (0, _shallowEqual.default)(node, opts);
  1265. }
  1266. }
  1267. return false;
  1268. }
  1269. function isSuper(node, opts) {
  1270. if (!node) return false;
  1271. var nodeType = node.type;
  1272. if (nodeType === "Super") {
  1273. if (typeof opts === "undefined") {
  1274. return true;
  1275. } else {
  1276. return (0, _shallowEqual.default)(node, opts);
  1277. }
  1278. }
  1279. return false;
  1280. }
  1281. function isTaggedTemplateExpression(node, opts) {
  1282. if (!node) return false;
  1283. var nodeType = node.type;
  1284. if (nodeType === "TaggedTemplateExpression") {
  1285. if (typeof opts === "undefined") {
  1286. return true;
  1287. } else {
  1288. return (0, _shallowEqual.default)(node, opts);
  1289. }
  1290. }
  1291. return false;
  1292. }
  1293. function isTemplateElement(node, opts) {
  1294. if (!node) return false;
  1295. var nodeType = node.type;
  1296. if (nodeType === "TemplateElement") {
  1297. if (typeof opts === "undefined") {
  1298. return true;
  1299. } else {
  1300. return (0, _shallowEqual.default)(node, opts);
  1301. }
  1302. }
  1303. return false;
  1304. }
  1305. function isTemplateLiteral(node, opts) {
  1306. if (!node) return false;
  1307. var nodeType = node.type;
  1308. if (nodeType === "TemplateLiteral") {
  1309. if (typeof opts === "undefined") {
  1310. return true;
  1311. } else {
  1312. return (0, _shallowEqual.default)(node, opts);
  1313. }
  1314. }
  1315. return false;
  1316. }
  1317. function isYieldExpression(node, opts) {
  1318. if (!node) return false;
  1319. var nodeType = node.type;
  1320. if (nodeType === "YieldExpression") {
  1321. if (typeof opts === "undefined") {
  1322. return true;
  1323. } else {
  1324. return (0, _shallowEqual.default)(node, opts);
  1325. }
  1326. }
  1327. return false;
  1328. }
  1329. function isAwaitExpression(node, opts) {
  1330. if (!node) return false;
  1331. var nodeType = node.type;
  1332. if (nodeType === "AwaitExpression") {
  1333. if (typeof opts === "undefined") {
  1334. return true;
  1335. } else {
  1336. return (0, _shallowEqual.default)(node, opts);
  1337. }
  1338. }
  1339. return false;
  1340. }
  1341. function isImport(node, opts) {
  1342. if (!node) return false;
  1343. var nodeType = node.type;
  1344. if (nodeType === "Import") {
  1345. if (typeof opts === "undefined") {
  1346. return true;
  1347. } else {
  1348. return (0, _shallowEqual.default)(node, opts);
  1349. }
  1350. }
  1351. return false;
  1352. }
  1353. function isBigIntLiteral(node, opts) {
  1354. if (!node) return false;
  1355. var nodeType = node.type;
  1356. if (nodeType === "BigIntLiteral") {
  1357. if (typeof opts === "undefined") {
  1358. return true;
  1359. } else {
  1360. return (0, _shallowEqual.default)(node, opts);
  1361. }
  1362. }
  1363. return false;
  1364. }
  1365. function isExportNamespaceSpecifier(node, opts) {
  1366. if (!node) return false;
  1367. var nodeType = node.type;
  1368. if (nodeType === "ExportNamespaceSpecifier") {
  1369. if (typeof opts === "undefined") {
  1370. return true;
  1371. } else {
  1372. return (0, _shallowEqual.default)(node, opts);
  1373. }
  1374. }
  1375. return false;
  1376. }
  1377. function isOptionalMemberExpression(node, opts) {
  1378. if (!node) return false;
  1379. var nodeType = node.type;
  1380. if (nodeType === "OptionalMemberExpression") {
  1381. if (typeof opts === "undefined") {
  1382. return true;
  1383. } else {
  1384. return (0, _shallowEqual.default)(node, opts);
  1385. }
  1386. }
  1387. return false;
  1388. }
  1389. function isOptionalCallExpression(node, opts) {
  1390. if (!node) return false;
  1391. var nodeType = node.type;
  1392. if (nodeType === "OptionalCallExpression") {
  1393. if (typeof opts === "undefined") {
  1394. return true;
  1395. } else {
  1396. return (0, _shallowEqual.default)(node, opts);
  1397. }
  1398. }
  1399. return false;
  1400. }
  1401. function isClassProperty(node, opts) {
  1402. if (!node) return false;
  1403. var nodeType = node.type;
  1404. if (nodeType === "ClassProperty") {
  1405. if (typeof opts === "undefined") {
  1406. return true;
  1407. } else {
  1408. return (0, _shallowEqual.default)(node, opts);
  1409. }
  1410. }
  1411. return false;
  1412. }
  1413. function isClassPrivateProperty(node, opts) {
  1414. if (!node) return false;
  1415. var nodeType = node.type;
  1416. if (nodeType === "ClassPrivateProperty") {
  1417. if (typeof opts === "undefined") {
  1418. return true;
  1419. } else {
  1420. return (0, _shallowEqual.default)(node, opts);
  1421. }
  1422. }
  1423. return false;
  1424. }
  1425. function isClassPrivateMethod(node, opts) {
  1426. if (!node) return false;
  1427. var nodeType = node.type;
  1428. if (nodeType === "ClassPrivateMethod") {
  1429. if (typeof opts === "undefined") {
  1430. return true;
  1431. } else {
  1432. return (0, _shallowEqual.default)(node, opts);
  1433. }
  1434. }
  1435. return false;
  1436. }
  1437. function isPrivateName(node, opts) {
  1438. if (!node) return false;
  1439. var nodeType = node.type;
  1440. if (nodeType === "PrivateName") {
  1441. if (typeof opts === "undefined") {
  1442. return true;
  1443. } else {
  1444. return (0, _shallowEqual.default)(node, opts);
  1445. }
  1446. }
  1447. return false;
  1448. }
  1449. function isAnyTypeAnnotation(node, opts) {
  1450. if (!node) return false;
  1451. var nodeType = node.type;
  1452. if (nodeType === "AnyTypeAnnotation") {
  1453. if (typeof opts === "undefined") {
  1454. return true;
  1455. } else {
  1456. return (0, _shallowEqual.default)(node, opts);
  1457. }
  1458. }
  1459. return false;
  1460. }
  1461. function isArrayTypeAnnotation(node, opts) {
  1462. if (!node) return false;
  1463. var nodeType = node.type;
  1464. if (nodeType === "ArrayTypeAnnotation") {
  1465. if (typeof opts === "undefined") {
  1466. return true;
  1467. } else {
  1468. return (0, _shallowEqual.default)(node, opts);
  1469. }
  1470. }
  1471. return false;
  1472. }
  1473. function isBooleanTypeAnnotation(node, opts) {
  1474. if (!node) return false;
  1475. var nodeType = node.type;
  1476. if (nodeType === "BooleanTypeAnnotation") {
  1477. if (typeof opts === "undefined") {
  1478. return true;
  1479. } else {
  1480. return (0, _shallowEqual.default)(node, opts);
  1481. }
  1482. }
  1483. return false;
  1484. }
  1485. function isBooleanLiteralTypeAnnotation(node, opts) {
  1486. if (!node) return false;
  1487. var nodeType = node.type;
  1488. if (nodeType === "BooleanLiteralTypeAnnotation") {
  1489. if (typeof opts === "undefined") {
  1490. return true;
  1491. } else {
  1492. return (0, _shallowEqual.default)(node, opts);
  1493. }
  1494. }
  1495. return false;
  1496. }
  1497. function isNullLiteralTypeAnnotation(node, opts) {
  1498. if (!node) return false;
  1499. var nodeType = node.type;
  1500. if (nodeType === "NullLiteralTypeAnnotation") {
  1501. if (typeof opts === "undefined") {
  1502. return true;
  1503. } else {
  1504. return (0, _shallowEqual.default)(node, opts);
  1505. }
  1506. }
  1507. return false;
  1508. }
  1509. function isClassImplements(node, opts) {
  1510. if (!node) return false;
  1511. var nodeType = node.type;
  1512. if (nodeType === "ClassImplements") {
  1513. if (typeof opts === "undefined") {
  1514. return true;
  1515. } else {
  1516. return (0, _shallowEqual.default)(node, opts);
  1517. }
  1518. }
  1519. return false;
  1520. }
  1521. function isDeclareClass(node, opts) {
  1522. if (!node) return false;
  1523. var nodeType = node.type;
  1524. if (nodeType === "DeclareClass") {
  1525. if (typeof opts === "undefined") {
  1526. return true;
  1527. } else {
  1528. return (0, _shallowEqual.default)(node, opts);
  1529. }
  1530. }
  1531. return false;
  1532. }
  1533. function isDeclareFunction(node, opts) {
  1534. if (!node) return false;
  1535. var nodeType = node.type;
  1536. if (nodeType === "DeclareFunction") {
  1537. if (typeof opts === "undefined") {
  1538. return true;
  1539. } else {
  1540. return (0, _shallowEqual.default)(node, opts);
  1541. }
  1542. }
  1543. return false;
  1544. }
  1545. function isDeclareInterface(node, opts) {
  1546. if (!node) return false;
  1547. var nodeType = node.type;
  1548. if (nodeType === "DeclareInterface") {
  1549. if (typeof opts === "undefined") {
  1550. return true;
  1551. } else {
  1552. return (0, _shallowEqual.default)(node, opts);
  1553. }
  1554. }
  1555. return false;
  1556. }
  1557. function isDeclareModule(node, opts) {
  1558. if (!node) return false;
  1559. var nodeType = node.type;
  1560. if (nodeType === "DeclareModule") {
  1561. if (typeof opts === "undefined") {
  1562. return true;
  1563. } else {
  1564. return (0, _shallowEqual.default)(node, opts);
  1565. }
  1566. }
  1567. return false;
  1568. }
  1569. function isDeclareModuleExports(node, opts) {
  1570. if (!node) return false;
  1571. var nodeType = node.type;
  1572. if (nodeType === "DeclareModuleExports") {
  1573. if (typeof opts === "undefined") {
  1574. return true;
  1575. } else {
  1576. return (0, _shallowEqual.default)(node, opts);
  1577. }
  1578. }
  1579. return false;
  1580. }
  1581. function isDeclareTypeAlias(node, opts) {
  1582. if (!node) return false;
  1583. var nodeType = node.type;
  1584. if (nodeType === "DeclareTypeAlias") {
  1585. if (typeof opts === "undefined") {
  1586. return true;
  1587. } else {
  1588. return (0, _shallowEqual.default)(node, opts);
  1589. }
  1590. }
  1591. return false;
  1592. }
  1593. function isDeclareOpaqueType(node, opts) {
  1594. if (!node) return false;
  1595. var nodeType = node.type;
  1596. if (nodeType === "DeclareOpaqueType") {
  1597. if (typeof opts === "undefined") {
  1598. return true;
  1599. } else {
  1600. return (0, _shallowEqual.default)(node, opts);
  1601. }
  1602. }
  1603. return false;
  1604. }
  1605. function isDeclareVariable(node, opts) {
  1606. if (!node) return false;
  1607. var nodeType = node.type;
  1608. if (nodeType === "DeclareVariable") {
  1609. if (typeof opts === "undefined") {
  1610. return true;
  1611. } else {
  1612. return (0, _shallowEqual.default)(node, opts);
  1613. }
  1614. }
  1615. return false;
  1616. }
  1617. function isDeclareExportDeclaration(node, opts) {
  1618. if (!node) return false;
  1619. var nodeType = node.type;
  1620. if (nodeType === "DeclareExportDeclaration") {
  1621. if (typeof opts === "undefined") {
  1622. return true;
  1623. } else {
  1624. return (0, _shallowEqual.default)(node, opts);
  1625. }
  1626. }
  1627. return false;
  1628. }
  1629. function isDeclareExportAllDeclaration(node, opts) {
  1630. if (!node) return false;
  1631. var nodeType = node.type;
  1632. if (nodeType === "DeclareExportAllDeclaration") {
  1633. if (typeof opts === "undefined") {
  1634. return true;
  1635. } else {
  1636. return (0, _shallowEqual.default)(node, opts);
  1637. }
  1638. }
  1639. return false;
  1640. }
  1641. function isDeclaredPredicate(node, opts) {
  1642. if (!node) return false;
  1643. var nodeType = node.type;
  1644. if (nodeType === "DeclaredPredicate") {
  1645. if (typeof opts === "undefined") {
  1646. return true;
  1647. } else {
  1648. return (0, _shallowEqual.default)(node, opts);
  1649. }
  1650. }
  1651. return false;
  1652. }
  1653. function isExistsTypeAnnotation(node, opts) {
  1654. if (!node) return false;
  1655. var nodeType = node.type;
  1656. if (nodeType === "ExistsTypeAnnotation") {
  1657. if (typeof opts === "undefined") {
  1658. return true;
  1659. } else {
  1660. return (0, _shallowEqual.default)(node, opts);
  1661. }
  1662. }
  1663. return false;
  1664. }
  1665. function isFunctionTypeAnnotation(node, opts) {
  1666. if (!node) return false;
  1667. var nodeType = node.type;
  1668. if (nodeType === "FunctionTypeAnnotation") {
  1669. if (typeof opts === "undefined") {
  1670. return true;
  1671. } else {
  1672. return (0, _shallowEqual.default)(node, opts);
  1673. }
  1674. }
  1675. return false;
  1676. }
  1677. function isFunctionTypeParam(node, opts) {
  1678. if (!node) return false;
  1679. var nodeType = node.type;
  1680. if (nodeType === "FunctionTypeParam") {
  1681. if (typeof opts === "undefined") {
  1682. return true;
  1683. } else {
  1684. return (0, _shallowEqual.default)(node, opts);
  1685. }
  1686. }
  1687. return false;
  1688. }
  1689. function isGenericTypeAnnotation(node, opts) {
  1690. if (!node) return false;
  1691. var nodeType = node.type;
  1692. if (nodeType === "GenericTypeAnnotation") {
  1693. if (typeof opts === "undefined") {
  1694. return true;
  1695. } else {
  1696. return (0, _shallowEqual.default)(node, opts);
  1697. }
  1698. }
  1699. return false;
  1700. }
  1701. function isInferredPredicate(node, opts) {
  1702. if (!node) return false;
  1703. var nodeType = node.type;
  1704. if (nodeType === "InferredPredicate") {
  1705. if (typeof opts === "undefined") {
  1706. return true;
  1707. } else {
  1708. return (0, _shallowEqual.default)(node, opts);
  1709. }
  1710. }
  1711. return false;
  1712. }
  1713. function isInterfaceExtends(node, opts) {
  1714. if (!node) return false;
  1715. var nodeType = node.type;
  1716. if (nodeType === "InterfaceExtends") {
  1717. if (typeof opts === "undefined") {
  1718. return true;
  1719. } else {
  1720. return (0, _shallowEqual.default)(node, opts);
  1721. }
  1722. }
  1723. return false;
  1724. }
  1725. function isInterfaceDeclaration(node, opts) {
  1726. if (!node) return false;
  1727. var nodeType = node.type;
  1728. if (nodeType === "InterfaceDeclaration") {
  1729. if (typeof opts === "undefined") {
  1730. return true;
  1731. } else {
  1732. return (0, _shallowEqual.default)(node, opts);
  1733. }
  1734. }
  1735. return false;
  1736. }
  1737. function isInterfaceTypeAnnotation(node, opts) {
  1738. if (!node) return false;
  1739. var nodeType = node.type;
  1740. if (nodeType === "InterfaceTypeAnnotation") {
  1741. if (typeof opts === "undefined") {
  1742. return true;
  1743. } else {
  1744. return (0, _shallowEqual.default)(node, opts);
  1745. }
  1746. }
  1747. return false;
  1748. }
  1749. function isIntersectionTypeAnnotation(node, opts) {
  1750. if (!node) return false;
  1751. var nodeType = node.type;
  1752. if (nodeType === "IntersectionTypeAnnotation") {
  1753. if (typeof opts === "undefined") {
  1754. return true;
  1755. } else {
  1756. return (0, _shallowEqual.default)(node, opts);
  1757. }
  1758. }
  1759. return false;
  1760. }
  1761. function isMixedTypeAnnotation(node, opts) {
  1762. if (!node) return false;
  1763. var nodeType = node.type;
  1764. if (nodeType === "MixedTypeAnnotation") {
  1765. if (typeof opts === "undefined") {
  1766. return true;
  1767. } else {
  1768. return (0, _shallowEqual.default)(node, opts);
  1769. }
  1770. }
  1771. return false;
  1772. }
  1773. function isEmptyTypeAnnotation(node, opts) {
  1774. if (!node) return false;
  1775. var nodeType = node.type;
  1776. if (nodeType === "EmptyTypeAnnotation") {
  1777. if (typeof opts === "undefined") {
  1778. return true;
  1779. } else {
  1780. return (0, _shallowEqual.default)(node, opts);
  1781. }
  1782. }
  1783. return false;
  1784. }
  1785. function isNullableTypeAnnotation(node, opts) {
  1786. if (!node) return false;
  1787. var nodeType = node.type;
  1788. if (nodeType === "NullableTypeAnnotation") {
  1789. if (typeof opts === "undefined") {
  1790. return true;
  1791. } else {
  1792. return (0, _shallowEqual.default)(node, opts);
  1793. }
  1794. }
  1795. return false;
  1796. }
  1797. function isNumberLiteralTypeAnnotation(node, opts) {
  1798. if (!node) return false;
  1799. var nodeType = node.type;
  1800. if (nodeType === "NumberLiteralTypeAnnotation") {
  1801. if (typeof opts === "undefined") {
  1802. return true;
  1803. } else {
  1804. return (0, _shallowEqual.default)(node, opts);
  1805. }
  1806. }
  1807. return false;
  1808. }
  1809. function isNumberTypeAnnotation(node, opts) {
  1810. if (!node) return false;
  1811. var nodeType = node.type;
  1812. if (nodeType === "NumberTypeAnnotation") {
  1813. if (typeof opts === "undefined") {
  1814. return true;
  1815. } else {
  1816. return (0, _shallowEqual.default)(node, opts);
  1817. }
  1818. }
  1819. return false;
  1820. }
  1821. function isObjectTypeAnnotation(node, opts) {
  1822. if (!node) return false;
  1823. var nodeType = node.type;
  1824. if (nodeType === "ObjectTypeAnnotation") {
  1825. if (typeof opts === "undefined") {
  1826. return true;
  1827. } else {
  1828. return (0, _shallowEqual.default)(node, opts);
  1829. }
  1830. }
  1831. return false;
  1832. }
  1833. function isObjectTypeInternalSlot(node, opts) {
  1834. if (!node) return false;
  1835. var nodeType = node.type;
  1836. if (nodeType === "ObjectTypeInternalSlot") {
  1837. if (typeof opts === "undefined") {
  1838. return true;
  1839. } else {
  1840. return (0, _shallowEqual.default)(node, opts);
  1841. }
  1842. }
  1843. return false;
  1844. }
  1845. function isObjectTypeCallProperty(node, opts) {
  1846. if (!node) return false;
  1847. var nodeType = node.type;
  1848. if (nodeType === "ObjectTypeCallProperty") {
  1849. if (typeof opts === "undefined") {
  1850. return true;
  1851. } else {
  1852. return (0, _shallowEqual.default)(node, opts);
  1853. }
  1854. }
  1855. return false;
  1856. }
  1857. function isObjectTypeIndexer(node, opts) {
  1858. if (!node) return false;
  1859. var nodeType = node.type;
  1860. if (nodeType === "ObjectTypeIndexer") {
  1861. if (typeof opts === "undefined") {
  1862. return true;
  1863. } else {
  1864. return (0, _shallowEqual.default)(node, opts);
  1865. }
  1866. }
  1867. return false;
  1868. }
  1869. function isObjectTypeProperty(node, opts) {
  1870. if (!node) return false;
  1871. var nodeType = node.type;
  1872. if (nodeType === "ObjectTypeProperty") {
  1873. if (typeof opts === "undefined") {
  1874. return true;
  1875. } else {
  1876. return (0, _shallowEqual.default)(node, opts);
  1877. }
  1878. }
  1879. return false;
  1880. }
  1881. function isObjectTypeSpreadProperty(node, opts) {
  1882. if (!node) return false;
  1883. var nodeType = node.type;
  1884. if (nodeType === "ObjectTypeSpreadProperty") {
  1885. if (typeof opts === "undefined") {
  1886. return true;
  1887. } else {
  1888. return (0, _shallowEqual.default)(node, opts);
  1889. }
  1890. }
  1891. return false;
  1892. }
  1893. function isOpaqueType(node, opts) {
  1894. if (!node) return false;
  1895. var nodeType = node.type;
  1896. if (nodeType === "OpaqueType") {
  1897. if (typeof opts === "undefined") {
  1898. return true;
  1899. } else {
  1900. return (0, _shallowEqual.default)(node, opts);
  1901. }
  1902. }
  1903. return false;
  1904. }
  1905. function isQualifiedTypeIdentifier(node, opts) {
  1906. if (!node) return false;
  1907. var nodeType = node.type;
  1908. if (nodeType === "QualifiedTypeIdentifier") {
  1909. if (typeof opts === "undefined") {
  1910. return true;
  1911. } else {
  1912. return (0, _shallowEqual.default)(node, opts);
  1913. }
  1914. }
  1915. return false;
  1916. }
  1917. function isStringLiteralTypeAnnotation(node, opts) {
  1918. if (!node) return false;
  1919. var nodeType = node.type;
  1920. if (nodeType === "StringLiteralTypeAnnotation") {
  1921. if (typeof opts === "undefined") {
  1922. return true;
  1923. } else {
  1924. return (0, _shallowEqual.default)(node, opts);
  1925. }
  1926. }
  1927. return false;
  1928. }
  1929. function isStringTypeAnnotation(node, opts) {
  1930. if (!node) return false;
  1931. var nodeType = node.type;
  1932. if (nodeType === "StringTypeAnnotation") {
  1933. if (typeof opts === "undefined") {
  1934. return true;
  1935. } else {
  1936. return (0, _shallowEqual.default)(node, opts);
  1937. }
  1938. }
  1939. return false;
  1940. }
  1941. function isSymbolTypeAnnotation(node, opts) {
  1942. if (!node) return false;
  1943. var nodeType = node.type;
  1944. if (nodeType === "SymbolTypeAnnotation") {
  1945. if (typeof opts === "undefined") {
  1946. return true;
  1947. } else {
  1948. return (0, _shallowEqual.default)(node, opts);
  1949. }
  1950. }
  1951. return false;
  1952. }
  1953. function isThisTypeAnnotation(node, opts) {
  1954. if (!node) return false;
  1955. var nodeType = node.type;
  1956. if (nodeType === "ThisTypeAnnotation") {
  1957. if (typeof opts === "undefined") {
  1958. return true;
  1959. } else {
  1960. return (0, _shallowEqual.default)(node, opts);
  1961. }
  1962. }
  1963. return false;
  1964. }
  1965. function isTupleTypeAnnotation(node, opts) {
  1966. if (!node) return false;
  1967. var nodeType = node.type;
  1968. if (nodeType === "TupleTypeAnnotation") {
  1969. if (typeof opts === "undefined") {
  1970. return true;
  1971. } else {
  1972. return (0, _shallowEqual.default)(node, opts);
  1973. }
  1974. }
  1975. return false;
  1976. }
  1977. function isTypeofTypeAnnotation(node, opts) {
  1978. if (!node) return false;
  1979. var nodeType = node.type;
  1980. if (nodeType === "TypeofTypeAnnotation") {
  1981. if (typeof opts === "undefined") {
  1982. return true;
  1983. } else {
  1984. return (0, _shallowEqual.default)(node, opts);
  1985. }
  1986. }
  1987. return false;
  1988. }
  1989. function isTypeAlias(node, opts) {
  1990. if (!node) return false;
  1991. var nodeType = node.type;
  1992. if (nodeType === "TypeAlias") {
  1993. if (typeof opts === "undefined") {
  1994. return true;
  1995. } else {
  1996. return (0, _shallowEqual.default)(node, opts);
  1997. }
  1998. }
  1999. return false;
  2000. }
  2001. function isTypeAnnotation(node, opts) {
  2002. if (!node) return false;
  2003. var nodeType = node.type;
  2004. if (nodeType === "TypeAnnotation") {
  2005. if (typeof opts === "undefined") {
  2006. return true;
  2007. } else {
  2008. return (0, _shallowEqual.default)(node, opts);
  2009. }
  2010. }
  2011. return false;
  2012. }
  2013. function isTypeCastExpression(node, opts) {
  2014. if (!node) return false;
  2015. var nodeType = node.type;
  2016. if (nodeType === "TypeCastExpression") {
  2017. if (typeof opts === "undefined") {
  2018. return true;
  2019. } else {
  2020. return (0, _shallowEqual.default)(node, opts);
  2021. }
  2022. }
  2023. return false;
  2024. }
  2025. function isTypeParameter(node, opts) {
  2026. if (!node) return false;
  2027. var nodeType = node.type;
  2028. if (nodeType === "TypeParameter") {
  2029. if (typeof opts === "undefined") {
  2030. return true;
  2031. } else {
  2032. return (0, _shallowEqual.default)(node, opts);
  2033. }
  2034. }
  2035. return false;
  2036. }
  2037. function isTypeParameterDeclaration(node, opts) {
  2038. if (!node) return false;
  2039. var nodeType = node.type;
  2040. if (nodeType === "TypeParameterDeclaration") {
  2041. if (typeof opts === "undefined") {
  2042. return true;
  2043. } else {
  2044. return (0, _shallowEqual.default)(node, opts);
  2045. }
  2046. }
  2047. return false;
  2048. }
  2049. function isTypeParameterInstantiation(node, opts) {
  2050. if (!node) return false;
  2051. var nodeType = node.type;
  2052. if (nodeType === "TypeParameterInstantiation") {
  2053. if (typeof opts === "undefined") {
  2054. return true;
  2055. } else {
  2056. return (0, _shallowEqual.default)(node, opts);
  2057. }
  2058. }
  2059. return false;
  2060. }
  2061. function isUnionTypeAnnotation(node, opts) {
  2062. if (!node) return false;
  2063. var nodeType = node.type;
  2064. if (nodeType === "UnionTypeAnnotation") {
  2065. if (typeof opts === "undefined") {
  2066. return true;
  2067. } else {
  2068. return (0, _shallowEqual.default)(node, opts);
  2069. }
  2070. }
  2071. return false;
  2072. }
  2073. function isVariance(node, opts) {
  2074. if (!node) return false;
  2075. var nodeType = node.type;
  2076. if (nodeType === "Variance") {
  2077. if (typeof opts === "undefined") {
  2078. return true;
  2079. } else {
  2080. return (0, _shallowEqual.default)(node, opts);
  2081. }
  2082. }
  2083. return false;
  2084. }
  2085. function isVoidTypeAnnotation(node, opts) {
  2086. if (!node) return false;
  2087. var nodeType = node.type;
  2088. if (nodeType === "VoidTypeAnnotation") {
  2089. if (typeof opts === "undefined") {
  2090. return true;
  2091. } else {
  2092. return (0, _shallowEqual.default)(node, opts);
  2093. }
  2094. }
  2095. return false;
  2096. }
  2097. function isEnumDeclaration(node, opts) {
  2098. if (!node) return false;
  2099. var nodeType = node.type;
  2100. if (nodeType === "EnumDeclaration") {
  2101. if (typeof opts === "undefined") {
  2102. return true;
  2103. } else {
  2104. return (0, _shallowEqual.default)(node, opts);
  2105. }
  2106. }
  2107. return false;
  2108. }
  2109. function isEnumBooleanBody(node, opts) {
  2110. if (!node) return false;
  2111. var nodeType = node.type;
  2112. if (nodeType === "EnumBooleanBody") {
  2113. if (typeof opts === "undefined") {
  2114. return true;
  2115. } else {
  2116. return (0, _shallowEqual.default)(node, opts);
  2117. }
  2118. }
  2119. return false;
  2120. }
  2121. function isEnumNumberBody(node, opts) {
  2122. if (!node) return false;
  2123. var nodeType = node.type;
  2124. if (nodeType === "EnumNumberBody") {
  2125. if (typeof opts === "undefined") {
  2126. return true;
  2127. } else {
  2128. return (0, _shallowEqual.default)(node, opts);
  2129. }
  2130. }
  2131. return false;
  2132. }
  2133. function isEnumStringBody(node, opts) {
  2134. if (!node) return false;
  2135. var nodeType = node.type;
  2136. if (nodeType === "EnumStringBody") {
  2137. if (typeof opts === "undefined") {
  2138. return true;
  2139. } else {
  2140. return (0, _shallowEqual.default)(node, opts);
  2141. }
  2142. }
  2143. return false;
  2144. }
  2145. function isEnumSymbolBody(node, opts) {
  2146. if (!node) return false;
  2147. var nodeType = node.type;
  2148. if (nodeType === "EnumSymbolBody") {
  2149. if (typeof opts === "undefined") {
  2150. return true;
  2151. } else {
  2152. return (0, _shallowEqual.default)(node, opts);
  2153. }
  2154. }
  2155. return false;
  2156. }
  2157. function isEnumBooleanMember(node, opts) {
  2158. if (!node) return false;
  2159. var nodeType = node.type;
  2160. if (nodeType === "EnumBooleanMember") {
  2161. if (typeof opts === "undefined") {
  2162. return true;
  2163. } else {
  2164. return (0, _shallowEqual.default)(node, opts);
  2165. }
  2166. }
  2167. return false;
  2168. }
  2169. function isEnumNumberMember(node, opts) {
  2170. if (!node) return false;
  2171. var nodeType = node.type;
  2172. if (nodeType === "EnumNumberMember") {
  2173. if (typeof opts === "undefined") {
  2174. return true;
  2175. } else {
  2176. return (0, _shallowEqual.default)(node, opts);
  2177. }
  2178. }
  2179. return false;
  2180. }
  2181. function isEnumStringMember(node, opts) {
  2182. if (!node) return false;
  2183. var nodeType = node.type;
  2184. if (nodeType === "EnumStringMember") {
  2185. if (typeof opts === "undefined") {
  2186. return true;
  2187. } else {
  2188. return (0, _shallowEqual.default)(node, opts);
  2189. }
  2190. }
  2191. return false;
  2192. }
  2193. function isEnumDefaultedMember(node, opts) {
  2194. if (!node) return false;
  2195. var nodeType = node.type;
  2196. if (nodeType === "EnumDefaultedMember") {
  2197. if (typeof opts === "undefined") {
  2198. return true;
  2199. } else {
  2200. return (0, _shallowEqual.default)(node, opts);
  2201. }
  2202. }
  2203. return false;
  2204. }
  2205. function isIndexedAccessType(node, opts) {
  2206. if (!node) return false;
  2207. var nodeType = node.type;
  2208. if (nodeType === "IndexedAccessType") {
  2209. if (typeof opts === "undefined") {
  2210. return true;
  2211. } else {
  2212. return (0, _shallowEqual.default)(node, opts);
  2213. }
  2214. }
  2215. return false;
  2216. }
  2217. function isOptionalIndexedAccessType(node, opts) {
  2218. if (!node) return false;
  2219. var nodeType = node.type;
  2220. if (nodeType === "OptionalIndexedAccessType") {
  2221. if (typeof opts === "undefined") {
  2222. return true;
  2223. } else {
  2224. return (0, _shallowEqual.default)(node, opts);
  2225. }
  2226. }
  2227. return false;
  2228. }
  2229. function isJSXAttribute(node, opts) {
  2230. if (!node) return false;
  2231. var nodeType = node.type;
  2232. if (nodeType === "JSXAttribute") {
  2233. if (typeof opts === "undefined") {
  2234. return true;
  2235. } else {
  2236. return (0, _shallowEqual.default)(node, opts);
  2237. }
  2238. }
  2239. return false;
  2240. }
  2241. function isJSXClosingElement(node, opts) {
  2242. if (!node) return false;
  2243. var nodeType = node.type;
  2244. if (nodeType === "JSXClosingElement") {
  2245. if (typeof opts === "undefined") {
  2246. return true;
  2247. } else {
  2248. return (0, _shallowEqual.default)(node, opts);
  2249. }
  2250. }
  2251. return false;
  2252. }
  2253. function isJSXElement(node, opts) {
  2254. if (!node) return false;
  2255. var nodeType = node.type;
  2256. if (nodeType === "JSXElement") {
  2257. if (typeof opts === "undefined") {
  2258. return true;
  2259. } else {
  2260. return (0, _shallowEqual.default)(node, opts);
  2261. }
  2262. }
  2263. return false;
  2264. }
  2265. function isJSXEmptyExpression(node, opts) {
  2266. if (!node) return false;
  2267. var nodeType = node.type;
  2268. if (nodeType === "JSXEmptyExpression") {
  2269. if (typeof opts === "undefined") {
  2270. return true;
  2271. } else {
  2272. return (0, _shallowEqual.default)(node, opts);
  2273. }
  2274. }
  2275. return false;
  2276. }
  2277. function isJSXExpressionContainer(node, opts) {
  2278. if (!node) return false;
  2279. var nodeType = node.type;
  2280. if (nodeType === "JSXExpressionContainer") {
  2281. if (typeof opts === "undefined") {
  2282. return true;
  2283. } else {
  2284. return (0, _shallowEqual.default)(node, opts);
  2285. }
  2286. }
  2287. return false;
  2288. }
  2289. function isJSXSpreadChild(node, opts) {
  2290. if (!node) return false;
  2291. var nodeType = node.type;
  2292. if (nodeType === "JSXSpreadChild") {
  2293. if (typeof opts === "undefined") {
  2294. return true;
  2295. } else {
  2296. return (0, _shallowEqual.default)(node, opts);
  2297. }
  2298. }
  2299. return false;
  2300. }
  2301. function isJSXIdentifier(node, opts) {
  2302. if (!node) return false;
  2303. var nodeType = node.type;
  2304. if (nodeType === "JSXIdentifier") {
  2305. if (typeof opts === "undefined") {
  2306. return true;
  2307. } else {
  2308. return (0, _shallowEqual.default)(node, opts);
  2309. }
  2310. }
  2311. return false;
  2312. }
  2313. function isJSXMemberExpression(node, opts) {
  2314. if (!node) return false;
  2315. var nodeType = node.type;
  2316. if (nodeType === "JSXMemberExpression") {
  2317. if (typeof opts === "undefined") {
  2318. return true;
  2319. } else {
  2320. return (0, _shallowEqual.default)(node, opts);
  2321. }
  2322. }
  2323. return false;
  2324. }
  2325. function isJSXNamespacedName(node, opts) {
  2326. if (!node) return false;
  2327. var nodeType = node.type;
  2328. if (nodeType === "JSXNamespacedName") {
  2329. if (typeof opts === "undefined") {
  2330. return true;
  2331. } else {
  2332. return (0, _shallowEqual.default)(node, opts);
  2333. }
  2334. }
  2335. return false;
  2336. }
  2337. function isJSXOpeningElement(node, opts) {
  2338. if (!node) return false;
  2339. var nodeType = node.type;
  2340. if (nodeType === "JSXOpeningElement") {
  2341. if (typeof opts === "undefined") {
  2342. return true;
  2343. } else {
  2344. return (0, _shallowEqual.default)(node, opts);
  2345. }
  2346. }
  2347. return false;
  2348. }
  2349. function isJSXSpreadAttribute(node, opts) {
  2350. if (!node) return false;
  2351. var nodeType = node.type;
  2352. if (nodeType === "JSXSpreadAttribute") {
  2353. if (typeof opts === "undefined") {
  2354. return true;
  2355. } else {
  2356. return (0, _shallowEqual.default)(node, opts);
  2357. }
  2358. }
  2359. return false;
  2360. }
  2361. function isJSXText(node, opts) {
  2362. if (!node) return false;
  2363. var nodeType = node.type;
  2364. if (nodeType === "JSXText") {
  2365. if (typeof opts === "undefined") {
  2366. return true;
  2367. } else {
  2368. return (0, _shallowEqual.default)(node, opts);
  2369. }
  2370. }
  2371. return false;
  2372. }
  2373. function isJSXFragment(node, opts) {
  2374. if (!node) return false;
  2375. var nodeType = node.type;
  2376. if (nodeType === "JSXFragment") {
  2377. if (typeof opts === "undefined") {
  2378. return true;
  2379. } else {
  2380. return (0, _shallowEqual.default)(node, opts);
  2381. }
  2382. }
  2383. return false;
  2384. }
  2385. function isJSXOpeningFragment(node, opts) {
  2386. if (!node) return false;
  2387. var nodeType = node.type;
  2388. if (nodeType === "JSXOpeningFragment") {
  2389. if (typeof opts === "undefined") {
  2390. return true;
  2391. } else {
  2392. return (0, _shallowEqual.default)(node, opts);
  2393. }
  2394. }
  2395. return false;
  2396. }
  2397. function isJSXClosingFragment(node, opts) {
  2398. if (!node) return false;
  2399. var nodeType = node.type;
  2400. if (nodeType === "JSXClosingFragment") {
  2401. if (typeof opts === "undefined") {
  2402. return true;
  2403. } else {
  2404. return (0, _shallowEqual.default)(node, opts);
  2405. }
  2406. }
  2407. return false;
  2408. }
  2409. function isNoop(node, opts) {
  2410. if (!node) return false;
  2411. var nodeType = node.type;
  2412. if (nodeType === "Noop") {
  2413. if (typeof opts === "undefined") {
  2414. return true;
  2415. } else {
  2416. return (0, _shallowEqual.default)(node, opts);
  2417. }
  2418. }
  2419. return false;
  2420. }
  2421. function isPlaceholder(node, opts) {
  2422. if (!node) return false;
  2423. var nodeType = node.type;
  2424. if (nodeType === "Placeholder") {
  2425. if (typeof opts === "undefined") {
  2426. return true;
  2427. } else {
  2428. return (0, _shallowEqual.default)(node, opts);
  2429. }
  2430. }
  2431. return false;
  2432. }
  2433. function isV8IntrinsicIdentifier(node, opts) {
  2434. if (!node) return false;
  2435. var nodeType = node.type;
  2436. if (nodeType === "V8IntrinsicIdentifier") {
  2437. if (typeof opts === "undefined") {
  2438. return true;
  2439. } else {
  2440. return (0, _shallowEqual.default)(node, opts);
  2441. }
  2442. }
  2443. return false;
  2444. }
  2445. function isArgumentPlaceholder(node, opts) {
  2446. if (!node) return false;
  2447. var nodeType = node.type;
  2448. if (nodeType === "ArgumentPlaceholder") {
  2449. if (typeof opts === "undefined") {
  2450. return true;
  2451. } else {
  2452. return (0, _shallowEqual.default)(node, opts);
  2453. }
  2454. }
  2455. return false;
  2456. }
  2457. function isBindExpression(node, opts) {
  2458. if (!node) return false;
  2459. var nodeType = node.type;
  2460. if (nodeType === "BindExpression") {
  2461. if (typeof opts === "undefined") {
  2462. return true;
  2463. } else {
  2464. return (0, _shallowEqual.default)(node, opts);
  2465. }
  2466. }
  2467. return false;
  2468. }
  2469. function isImportAttribute(node, opts) {
  2470. if (!node) return false;
  2471. var nodeType = node.type;
  2472. if (nodeType === "ImportAttribute") {
  2473. if (typeof opts === "undefined") {
  2474. return true;
  2475. } else {
  2476. return (0, _shallowEqual.default)(node, opts);
  2477. }
  2478. }
  2479. return false;
  2480. }
  2481. function isDecorator(node, opts) {
  2482. if (!node) return false;
  2483. var nodeType = node.type;
  2484. if (nodeType === "Decorator") {
  2485. if (typeof opts === "undefined") {
  2486. return true;
  2487. } else {
  2488. return (0, _shallowEqual.default)(node, opts);
  2489. }
  2490. }
  2491. return false;
  2492. }
  2493. function isDoExpression(node, opts) {
  2494. if (!node) return false;
  2495. var nodeType = node.type;
  2496. if (nodeType === "DoExpression") {
  2497. if (typeof opts === "undefined") {
  2498. return true;
  2499. } else {
  2500. return (0, _shallowEqual.default)(node, opts);
  2501. }
  2502. }
  2503. return false;
  2504. }
  2505. function isExportDefaultSpecifier(node, opts) {
  2506. if (!node) return false;
  2507. var nodeType = node.type;
  2508. if (nodeType === "ExportDefaultSpecifier") {
  2509. if (typeof opts === "undefined") {
  2510. return true;
  2511. } else {
  2512. return (0, _shallowEqual.default)(node, opts);
  2513. }
  2514. }
  2515. return false;
  2516. }
  2517. function isRecordExpression(node, opts) {
  2518. if (!node) return false;
  2519. var nodeType = node.type;
  2520. if (nodeType === "RecordExpression") {
  2521. if (typeof opts === "undefined") {
  2522. return true;
  2523. } else {
  2524. return (0, _shallowEqual.default)(node, opts);
  2525. }
  2526. }
  2527. return false;
  2528. }
  2529. function isTupleExpression(node, opts) {
  2530. if (!node) return false;
  2531. var nodeType = node.type;
  2532. if (nodeType === "TupleExpression") {
  2533. if (typeof opts === "undefined") {
  2534. return true;
  2535. } else {
  2536. return (0, _shallowEqual.default)(node, opts);
  2537. }
  2538. }
  2539. return false;
  2540. }
  2541. function isDecimalLiteral(node, opts) {
  2542. if (!node) return false;
  2543. var nodeType = node.type;
  2544. if (nodeType === "DecimalLiteral") {
  2545. if (typeof opts === "undefined") {
  2546. return true;
  2547. } else {
  2548. return (0, _shallowEqual.default)(node, opts);
  2549. }
  2550. }
  2551. return false;
  2552. }
  2553. function isStaticBlock(node, opts) {
  2554. if (!node) return false;
  2555. var nodeType = node.type;
  2556. if (nodeType === "StaticBlock") {
  2557. if (typeof opts === "undefined") {
  2558. return true;
  2559. } else {
  2560. return (0, _shallowEqual.default)(node, opts);
  2561. }
  2562. }
  2563. return false;
  2564. }
  2565. function isModuleExpression(node, opts) {
  2566. if (!node) return false;
  2567. var nodeType = node.type;
  2568. if (nodeType === "ModuleExpression") {
  2569. if (typeof opts === "undefined") {
  2570. return true;
  2571. } else {
  2572. return (0, _shallowEqual.default)(node, opts);
  2573. }
  2574. }
  2575. return false;
  2576. }
  2577. function isTopicReference(node, opts) {
  2578. if (!node) return false;
  2579. var nodeType = node.type;
  2580. if (nodeType === "TopicReference") {
  2581. if (typeof opts === "undefined") {
  2582. return true;
  2583. } else {
  2584. return (0, _shallowEqual.default)(node, opts);
  2585. }
  2586. }
  2587. return false;
  2588. }
  2589. function isPipelineTopicExpression(node, opts) {
  2590. if (!node) return false;
  2591. var nodeType = node.type;
  2592. if (nodeType === "PipelineTopicExpression") {
  2593. if (typeof opts === "undefined") {
  2594. return true;
  2595. } else {
  2596. return (0, _shallowEqual.default)(node, opts);
  2597. }
  2598. }
  2599. return false;
  2600. }
  2601. function isPipelineBareFunction(node, opts) {
  2602. if (!node) return false;
  2603. var nodeType = node.type;
  2604. if (nodeType === "PipelineBareFunction") {
  2605. if (typeof opts === "undefined") {
  2606. return true;
  2607. } else {
  2608. return (0, _shallowEqual.default)(node, opts);
  2609. }
  2610. }
  2611. return false;
  2612. }
  2613. function isPipelinePrimaryTopicReference(node, opts) {
  2614. if (!node) return false;
  2615. var nodeType = node.type;
  2616. if (nodeType === "PipelinePrimaryTopicReference") {
  2617. if (typeof opts === "undefined") {
  2618. return true;
  2619. } else {
  2620. return (0, _shallowEqual.default)(node, opts);
  2621. }
  2622. }
  2623. return false;
  2624. }
  2625. function isTSParameterProperty(node, opts) {
  2626. if (!node) return false;
  2627. var nodeType = node.type;
  2628. if (nodeType === "TSParameterProperty") {
  2629. if (typeof opts === "undefined") {
  2630. return true;
  2631. } else {
  2632. return (0, _shallowEqual.default)(node, opts);
  2633. }
  2634. }
  2635. return false;
  2636. }
  2637. function isTSDeclareFunction(node, opts) {
  2638. if (!node) return false;
  2639. var nodeType = node.type;
  2640. if (nodeType === "TSDeclareFunction") {
  2641. if (typeof opts === "undefined") {
  2642. return true;
  2643. } else {
  2644. return (0, _shallowEqual.default)(node, opts);
  2645. }
  2646. }
  2647. return false;
  2648. }
  2649. function isTSDeclareMethod(node, opts) {
  2650. if (!node) return false;
  2651. var nodeType = node.type;
  2652. if (nodeType === "TSDeclareMethod") {
  2653. if (typeof opts === "undefined") {
  2654. return true;
  2655. } else {
  2656. return (0, _shallowEqual.default)(node, opts);
  2657. }
  2658. }
  2659. return false;
  2660. }
  2661. function isTSQualifiedName(node, opts) {
  2662. if (!node) return false;
  2663. var nodeType = node.type;
  2664. if (nodeType === "TSQualifiedName") {
  2665. if (typeof opts === "undefined") {
  2666. return true;
  2667. } else {
  2668. return (0, _shallowEqual.default)(node, opts);
  2669. }
  2670. }
  2671. return false;
  2672. }
  2673. function isTSCallSignatureDeclaration(node, opts) {
  2674. if (!node) return false;
  2675. var nodeType = node.type;
  2676. if (nodeType === "TSCallSignatureDeclaration") {
  2677. if (typeof opts === "undefined") {
  2678. return true;
  2679. } else {
  2680. return (0, _shallowEqual.default)(node, opts);
  2681. }
  2682. }
  2683. return false;
  2684. }
  2685. function isTSConstructSignatureDeclaration(node, opts) {
  2686. if (!node) return false;
  2687. var nodeType = node.type;
  2688. if (nodeType === "TSConstructSignatureDeclaration") {
  2689. if (typeof opts === "undefined") {
  2690. return true;
  2691. } else {
  2692. return (0, _shallowEqual.default)(node, opts);
  2693. }
  2694. }
  2695. return false;
  2696. }
  2697. function isTSPropertySignature(node, opts) {
  2698. if (!node) return false;
  2699. var nodeType = node.type;
  2700. if (nodeType === "TSPropertySignature") {
  2701. if (typeof opts === "undefined") {
  2702. return true;
  2703. } else {
  2704. return (0, _shallowEqual.default)(node, opts);
  2705. }
  2706. }
  2707. return false;
  2708. }
  2709. function isTSMethodSignature(node, opts) {
  2710. if (!node) return false;
  2711. var nodeType = node.type;
  2712. if (nodeType === "TSMethodSignature") {
  2713. if (typeof opts === "undefined") {
  2714. return true;
  2715. } else {
  2716. return (0, _shallowEqual.default)(node, opts);
  2717. }
  2718. }
  2719. return false;
  2720. }
  2721. function isTSIndexSignature(node, opts) {
  2722. if (!node) return false;
  2723. var nodeType = node.type;
  2724. if (nodeType === "TSIndexSignature") {
  2725. if (typeof opts === "undefined") {
  2726. return true;
  2727. } else {
  2728. return (0, _shallowEqual.default)(node, opts);
  2729. }
  2730. }
  2731. return false;
  2732. }
  2733. function isTSAnyKeyword(node, opts) {
  2734. if (!node) return false;
  2735. var nodeType = node.type;
  2736. if (nodeType === "TSAnyKeyword") {
  2737. if (typeof opts === "undefined") {
  2738. return true;
  2739. } else {
  2740. return (0, _shallowEqual.default)(node, opts);
  2741. }
  2742. }
  2743. return false;
  2744. }
  2745. function isTSBooleanKeyword(node, opts) {
  2746. if (!node) return false;
  2747. var nodeType = node.type;
  2748. if (nodeType === "TSBooleanKeyword") {
  2749. if (typeof opts === "undefined") {
  2750. return true;
  2751. } else {
  2752. return (0, _shallowEqual.default)(node, opts);
  2753. }
  2754. }
  2755. return false;
  2756. }
  2757. function isTSBigIntKeyword(node, opts) {
  2758. if (!node) return false;
  2759. var nodeType = node.type;
  2760. if (nodeType === "TSBigIntKeyword") {
  2761. if (typeof opts === "undefined") {
  2762. return true;
  2763. } else {
  2764. return (0, _shallowEqual.default)(node, opts);
  2765. }
  2766. }
  2767. return false;
  2768. }
  2769. function isTSIntrinsicKeyword(node, opts) {
  2770. if (!node) return false;
  2771. var nodeType = node.type;
  2772. if (nodeType === "TSIntrinsicKeyword") {
  2773. if (typeof opts === "undefined") {
  2774. return true;
  2775. } else {
  2776. return (0, _shallowEqual.default)(node, opts);
  2777. }
  2778. }
  2779. return false;
  2780. }
  2781. function isTSNeverKeyword(node, opts) {
  2782. if (!node) return false;
  2783. var nodeType = node.type;
  2784. if (nodeType === "TSNeverKeyword") {
  2785. if (typeof opts === "undefined") {
  2786. return true;
  2787. } else {
  2788. return (0, _shallowEqual.default)(node, opts);
  2789. }
  2790. }
  2791. return false;
  2792. }
  2793. function isTSNullKeyword(node, opts) {
  2794. if (!node) return false;
  2795. var nodeType = node.type;
  2796. if (nodeType === "TSNullKeyword") {
  2797. if (typeof opts === "undefined") {
  2798. return true;
  2799. } else {
  2800. return (0, _shallowEqual.default)(node, opts);
  2801. }
  2802. }
  2803. return false;
  2804. }
  2805. function isTSNumberKeyword(node, opts) {
  2806. if (!node) return false;
  2807. var nodeType = node.type;
  2808. if (nodeType === "TSNumberKeyword") {
  2809. if (typeof opts === "undefined") {
  2810. return true;
  2811. } else {
  2812. return (0, _shallowEqual.default)(node, opts);
  2813. }
  2814. }
  2815. return false;
  2816. }
  2817. function isTSObjectKeyword(node, opts) {
  2818. if (!node) return false;
  2819. var nodeType = node.type;
  2820. if (nodeType === "TSObjectKeyword") {
  2821. if (typeof opts === "undefined") {
  2822. return true;
  2823. } else {
  2824. return (0, _shallowEqual.default)(node, opts);
  2825. }
  2826. }
  2827. return false;
  2828. }
  2829. function isTSStringKeyword(node, opts) {
  2830. if (!node) return false;
  2831. var nodeType = node.type;
  2832. if (nodeType === "TSStringKeyword") {
  2833. if (typeof opts === "undefined") {
  2834. return true;
  2835. } else {
  2836. return (0, _shallowEqual.default)(node, opts);
  2837. }
  2838. }
  2839. return false;
  2840. }
  2841. function isTSSymbolKeyword(node, opts) {
  2842. if (!node) return false;
  2843. var nodeType = node.type;
  2844. if (nodeType === "TSSymbolKeyword") {
  2845. if (typeof opts === "undefined") {
  2846. return true;
  2847. } else {
  2848. return (0, _shallowEqual.default)(node, opts);
  2849. }
  2850. }
  2851. return false;
  2852. }
  2853. function isTSUndefinedKeyword(node, opts) {
  2854. if (!node) return false;
  2855. var nodeType = node.type;
  2856. if (nodeType === "TSUndefinedKeyword") {
  2857. if (typeof opts === "undefined") {
  2858. return true;
  2859. } else {
  2860. return (0, _shallowEqual.default)(node, opts);
  2861. }
  2862. }
  2863. return false;
  2864. }
  2865. function isTSUnknownKeyword(node, opts) {
  2866. if (!node) return false;
  2867. var nodeType = node.type;
  2868. if (nodeType === "TSUnknownKeyword") {
  2869. if (typeof opts === "undefined") {
  2870. return true;
  2871. } else {
  2872. return (0, _shallowEqual.default)(node, opts);
  2873. }
  2874. }
  2875. return false;
  2876. }
  2877. function isTSVoidKeyword(node, opts) {
  2878. if (!node) return false;
  2879. var nodeType = node.type;
  2880. if (nodeType === "TSVoidKeyword") {
  2881. if (typeof opts === "undefined") {
  2882. return true;
  2883. } else {
  2884. return (0, _shallowEqual.default)(node, opts);
  2885. }
  2886. }
  2887. return false;
  2888. }
  2889. function isTSThisType(node, opts) {
  2890. if (!node) return false;
  2891. var nodeType = node.type;
  2892. if (nodeType === "TSThisType") {
  2893. if (typeof opts === "undefined") {
  2894. return true;
  2895. } else {
  2896. return (0, _shallowEqual.default)(node, opts);
  2897. }
  2898. }
  2899. return false;
  2900. }
  2901. function isTSFunctionType(node, opts) {
  2902. if (!node) return false;
  2903. var nodeType = node.type;
  2904. if (nodeType === "TSFunctionType") {
  2905. if (typeof opts === "undefined") {
  2906. return true;
  2907. } else {
  2908. return (0, _shallowEqual.default)(node, opts);
  2909. }
  2910. }
  2911. return false;
  2912. }
  2913. function isTSConstructorType(node, opts) {
  2914. if (!node) return false;
  2915. var nodeType = node.type;
  2916. if (nodeType === "TSConstructorType") {
  2917. if (typeof opts === "undefined") {
  2918. return true;
  2919. } else {
  2920. return (0, _shallowEqual.default)(node, opts);
  2921. }
  2922. }
  2923. return false;
  2924. }
  2925. function isTSTypeReference(node, opts) {
  2926. if (!node) return false;
  2927. var nodeType = node.type;
  2928. if (nodeType === "TSTypeReference") {
  2929. if (typeof opts === "undefined") {
  2930. return true;
  2931. } else {
  2932. return (0, _shallowEqual.default)(node, opts);
  2933. }
  2934. }
  2935. return false;
  2936. }
  2937. function isTSTypePredicate(node, opts) {
  2938. if (!node) return false;
  2939. var nodeType = node.type;
  2940. if (nodeType === "TSTypePredicate") {
  2941. if (typeof opts === "undefined") {
  2942. return true;
  2943. } else {
  2944. return (0, _shallowEqual.default)(node, opts);
  2945. }
  2946. }
  2947. return false;
  2948. }
  2949. function isTSTypeQuery(node, opts) {
  2950. if (!node) return false;
  2951. var nodeType = node.type;
  2952. if (nodeType === "TSTypeQuery") {
  2953. if (typeof opts === "undefined") {
  2954. return true;
  2955. } else {
  2956. return (0, _shallowEqual.default)(node, opts);
  2957. }
  2958. }
  2959. return false;
  2960. }
  2961. function isTSTypeLiteral(node, opts) {
  2962. if (!node) return false;
  2963. var nodeType = node.type;
  2964. if (nodeType === "TSTypeLiteral") {
  2965. if (typeof opts === "undefined") {
  2966. return true;
  2967. } else {
  2968. return (0, _shallowEqual.default)(node, opts);
  2969. }
  2970. }
  2971. return false;
  2972. }
  2973. function isTSArrayType(node, opts) {
  2974. if (!node) return false;
  2975. var nodeType = node.type;
  2976. if (nodeType === "TSArrayType") {
  2977. if (typeof opts === "undefined") {
  2978. return true;
  2979. } else {
  2980. return (0, _shallowEqual.default)(node, opts);
  2981. }
  2982. }
  2983. return false;
  2984. }
  2985. function isTSTupleType(node, opts) {
  2986. if (!node) return false;
  2987. var nodeType = node.type;
  2988. if (nodeType === "TSTupleType") {
  2989. if (typeof opts === "undefined") {
  2990. return true;
  2991. } else {
  2992. return (0, _shallowEqual.default)(node, opts);
  2993. }
  2994. }
  2995. return false;
  2996. }
  2997. function isTSOptionalType(node, opts) {
  2998. if (!node) return false;
  2999. var nodeType = node.type;
  3000. if (nodeType === "TSOptionalType") {
  3001. if (typeof opts === "undefined") {
  3002. return true;
  3003. } else {
  3004. return (0, _shallowEqual.default)(node, opts);
  3005. }
  3006. }
  3007. return false;
  3008. }
  3009. function isTSRestType(node, opts) {
  3010. if (!node) return false;
  3011. var nodeType = node.type;
  3012. if (nodeType === "TSRestType") {
  3013. if (typeof opts === "undefined") {
  3014. return true;
  3015. } else {
  3016. return (0, _shallowEqual.default)(node, opts);
  3017. }
  3018. }
  3019. return false;
  3020. }
  3021. function isTSNamedTupleMember(node, opts) {
  3022. if (!node) return false;
  3023. var nodeType = node.type;
  3024. if (nodeType === "TSNamedTupleMember") {
  3025. if (typeof opts === "undefined") {
  3026. return true;
  3027. } else {
  3028. return (0, _shallowEqual.default)(node, opts);
  3029. }
  3030. }
  3031. return false;
  3032. }
  3033. function isTSUnionType(node, opts) {
  3034. if (!node) return false;
  3035. var nodeType = node.type;
  3036. if (nodeType === "TSUnionType") {
  3037. if (typeof opts === "undefined") {
  3038. return true;
  3039. } else {
  3040. return (0, _shallowEqual.default)(node, opts);
  3041. }
  3042. }
  3043. return false;
  3044. }
  3045. function isTSIntersectionType(node, opts) {
  3046. if (!node) return false;
  3047. var nodeType = node.type;
  3048. if (nodeType === "TSIntersectionType") {
  3049. if (typeof opts === "undefined") {
  3050. return true;
  3051. } else {
  3052. return (0, _shallowEqual.default)(node, opts);
  3053. }
  3054. }
  3055. return false;
  3056. }
  3057. function isTSConditionalType(node, opts) {
  3058. if (!node) return false;
  3059. var nodeType = node.type;
  3060. if (nodeType === "TSConditionalType") {
  3061. if (typeof opts === "undefined") {
  3062. return true;
  3063. } else {
  3064. return (0, _shallowEqual.default)(node, opts);
  3065. }
  3066. }
  3067. return false;
  3068. }
  3069. function isTSInferType(node, opts) {
  3070. if (!node) return false;
  3071. var nodeType = node.type;
  3072. if (nodeType === "TSInferType") {
  3073. if (typeof opts === "undefined") {
  3074. return true;
  3075. } else {
  3076. return (0, _shallowEqual.default)(node, opts);
  3077. }
  3078. }
  3079. return false;
  3080. }
  3081. function isTSParenthesizedType(node, opts) {
  3082. if (!node) return false;
  3083. var nodeType = node.type;
  3084. if (nodeType === "TSParenthesizedType") {
  3085. if (typeof opts === "undefined") {
  3086. return true;
  3087. } else {
  3088. return (0, _shallowEqual.default)(node, opts);
  3089. }
  3090. }
  3091. return false;
  3092. }
  3093. function isTSTypeOperator(node, opts) {
  3094. if (!node) return false;
  3095. var nodeType = node.type;
  3096. if (nodeType === "TSTypeOperator") {
  3097. if (typeof opts === "undefined") {
  3098. return true;
  3099. } else {
  3100. return (0, _shallowEqual.default)(node, opts);
  3101. }
  3102. }
  3103. return false;
  3104. }
  3105. function isTSIndexedAccessType(node, opts) {
  3106. if (!node) return false;
  3107. var nodeType = node.type;
  3108. if (nodeType === "TSIndexedAccessType") {
  3109. if (typeof opts === "undefined") {
  3110. return true;
  3111. } else {
  3112. return (0, _shallowEqual.default)(node, opts);
  3113. }
  3114. }
  3115. return false;
  3116. }
  3117. function isTSMappedType(node, opts) {
  3118. if (!node) return false;
  3119. var nodeType = node.type;
  3120. if (nodeType === "TSMappedType") {
  3121. if (typeof opts === "undefined") {
  3122. return true;
  3123. } else {
  3124. return (0, _shallowEqual.default)(node, opts);
  3125. }
  3126. }
  3127. return false;
  3128. }
  3129. function isTSLiteralType(node, opts) {
  3130. if (!node) return false;
  3131. var nodeType = node.type;
  3132. if (nodeType === "TSLiteralType") {
  3133. if (typeof opts === "undefined") {
  3134. return true;
  3135. } else {
  3136. return (0, _shallowEqual.default)(node, opts);
  3137. }
  3138. }
  3139. return false;
  3140. }
  3141. function isTSExpressionWithTypeArguments(node, opts) {
  3142. if (!node) return false;
  3143. var nodeType = node.type;
  3144. if (nodeType === "TSExpressionWithTypeArguments") {
  3145. if (typeof opts === "undefined") {
  3146. return true;
  3147. } else {
  3148. return (0, _shallowEqual.default)(node, opts);
  3149. }
  3150. }
  3151. return false;
  3152. }
  3153. function isTSInterfaceDeclaration(node, opts) {
  3154. if (!node) return false;
  3155. var nodeType = node.type;
  3156. if (nodeType === "TSInterfaceDeclaration") {
  3157. if (typeof opts === "undefined") {
  3158. return true;
  3159. } else {
  3160. return (0, _shallowEqual.default)(node, opts);
  3161. }
  3162. }
  3163. return false;
  3164. }
  3165. function isTSInterfaceBody(node, opts) {
  3166. if (!node) return false;
  3167. var nodeType = node.type;
  3168. if (nodeType === "TSInterfaceBody") {
  3169. if (typeof opts === "undefined") {
  3170. return true;
  3171. } else {
  3172. return (0, _shallowEqual.default)(node, opts);
  3173. }
  3174. }
  3175. return false;
  3176. }
  3177. function isTSTypeAliasDeclaration(node, opts) {
  3178. if (!node) return false;
  3179. var nodeType = node.type;
  3180. if (nodeType === "TSTypeAliasDeclaration") {
  3181. if (typeof opts === "undefined") {
  3182. return true;
  3183. } else {
  3184. return (0, _shallowEqual.default)(node, opts);
  3185. }
  3186. }
  3187. return false;
  3188. }
  3189. function isTSAsExpression(node, opts) {
  3190. if (!node) return false;
  3191. var nodeType = node.type;
  3192. if (nodeType === "TSAsExpression") {
  3193. if (typeof opts === "undefined") {
  3194. return true;
  3195. } else {
  3196. return (0, _shallowEqual.default)(node, opts);
  3197. }
  3198. }
  3199. return false;
  3200. }
  3201. function isTSTypeAssertion(node, opts) {
  3202. if (!node) return false;
  3203. var nodeType = node.type;
  3204. if (nodeType === "TSTypeAssertion") {
  3205. if (typeof opts === "undefined") {
  3206. return true;
  3207. } else {
  3208. return (0, _shallowEqual.default)(node, opts);
  3209. }
  3210. }
  3211. return false;
  3212. }
  3213. function isTSEnumDeclaration(node, opts) {
  3214. if (!node) return false;
  3215. var nodeType = node.type;
  3216. if (nodeType === "TSEnumDeclaration") {
  3217. if (typeof opts === "undefined") {
  3218. return true;
  3219. } else {
  3220. return (0, _shallowEqual.default)(node, opts);
  3221. }
  3222. }
  3223. return false;
  3224. }
  3225. function isTSEnumMember(node, opts) {
  3226. if (!node) return false;
  3227. var nodeType = node.type;
  3228. if (nodeType === "TSEnumMember") {
  3229. if (typeof opts === "undefined") {
  3230. return true;
  3231. } else {
  3232. return (0, _shallowEqual.default)(node, opts);
  3233. }
  3234. }
  3235. return false;
  3236. }
  3237. function isTSModuleDeclaration(node, opts) {
  3238. if (!node) return false;
  3239. var nodeType = node.type;
  3240. if (nodeType === "TSModuleDeclaration") {
  3241. if (typeof opts === "undefined") {
  3242. return true;
  3243. } else {
  3244. return (0, _shallowEqual.default)(node, opts);
  3245. }
  3246. }
  3247. return false;
  3248. }
  3249. function isTSModuleBlock(node, opts) {
  3250. if (!node) return false;
  3251. var nodeType = node.type;
  3252. if (nodeType === "TSModuleBlock") {
  3253. if (typeof opts === "undefined") {
  3254. return true;
  3255. } else {
  3256. return (0, _shallowEqual.default)(node, opts);
  3257. }
  3258. }
  3259. return false;
  3260. }
  3261. function isTSImportType(node, opts) {
  3262. if (!node) return false;
  3263. var nodeType = node.type;
  3264. if (nodeType === "TSImportType") {
  3265. if (typeof opts === "undefined") {
  3266. return true;
  3267. } else {
  3268. return (0, _shallowEqual.default)(node, opts);
  3269. }
  3270. }
  3271. return false;
  3272. }
  3273. function isTSImportEqualsDeclaration(node, opts) {
  3274. if (!node) return false;
  3275. var nodeType = node.type;
  3276. if (nodeType === "TSImportEqualsDeclaration") {
  3277. if (typeof opts === "undefined") {
  3278. return true;
  3279. } else {
  3280. return (0, _shallowEqual.default)(node, opts);
  3281. }
  3282. }
  3283. return false;
  3284. }
  3285. function isTSExternalModuleReference(node, opts) {
  3286. if (!node) return false;
  3287. var nodeType = node.type;
  3288. if (nodeType === "TSExternalModuleReference") {
  3289. if (typeof opts === "undefined") {
  3290. return true;
  3291. } else {
  3292. return (0, _shallowEqual.default)(node, opts);
  3293. }
  3294. }
  3295. return false;
  3296. }
  3297. function isTSNonNullExpression(node, opts) {
  3298. if (!node) return false;
  3299. var nodeType = node.type;
  3300. if (nodeType === "TSNonNullExpression") {
  3301. if (typeof opts === "undefined") {
  3302. return true;
  3303. } else {
  3304. return (0, _shallowEqual.default)(node, opts);
  3305. }
  3306. }
  3307. return false;
  3308. }
  3309. function isTSExportAssignment(node, opts) {
  3310. if (!node) return false;
  3311. var nodeType = node.type;
  3312. if (nodeType === "TSExportAssignment") {
  3313. if (typeof opts === "undefined") {
  3314. return true;
  3315. } else {
  3316. return (0, _shallowEqual.default)(node, opts);
  3317. }
  3318. }
  3319. return false;
  3320. }
  3321. function isTSNamespaceExportDeclaration(node, opts) {
  3322. if (!node) return false;
  3323. var nodeType = node.type;
  3324. if (nodeType === "TSNamespaceExportDeclaration") {
  3325. if (typeof opts === "undefined") {
  3326. return true;
  3327. } else {
  3328. return (0, _shallowEqual.default)(node, opts);
  3329. }
  3330. }
  3331. return false;
  3332. }
  3333. function isTSTypeAnnotation(node, opts) {
  3334. if (!node) return false;
  3335. var nodeType = node.type;
  3336. if (nodeType === "TSTypeAnnotation") {
  3337. if (typeof opts === "undefined") {
  3338. return true;
  3339. } else {
  3340. return (0, _shallowEqual.default)(node, opts);
  3341. }
  3342. }
  3343. return false;
  3344. }
  3345. function isTSTypeParameterInstantiation(node, opts) {
  3346. if (!node) return false;
  3347. var nodeType = node.type;
  3348. if (nodeType === "TSTypeParameterInstantiation") {
  3349. if (typeof opts === "undefined") {
  3350. return true;
  3351. } else {
  3352. return (0, _shallowEqual.default)(node, opts);
  3353. }
  3354. }
  3355. return false;
  3356. }
  3357. function isTSTypeParameterDeclaration(node, opts) {
  3358. if (!node) return false;
  3359. var nodeType = node.type;
  3360. if (nodeType === "TSTypeParameterDeclaration") {
  3361. if (typeof opts === "undefined") {
  3362. return true;
  3363. } else {
  3364. return (0, _shallowEqual.default)(node, opts);
  3365. }
  3366. }
  3367. return false;
  3368. }
  3369. function isTSTypeParameter(node, opts) {
  3370. if (!node) return false;
  3371. var nodeType = node.type;
  3372. if (nodeType === "TSTypeParameter") {
  3373. if (typeof opts === "undefined") {
  3374. return true;
  3375. } else {
  3376. return (0, _shallowEqual.default)(node, opts);
  3377. }
  3378. }
  3379. return false;
  3380. }
  3381. function isExpression(node, opts) {
  3382. if (!node) return false;
  3383. var nodeType = node.type;
  3384. if ("ArrayExpression" === nodeType || "AssignmentExpression" === nodeType || "BinaryExpression" === nodeType || "CallExpression" === nodeType || "ConditionalExpression" === nodeType || "FunctionExpression" === nodeType || "Identifier" === nodeType || "StringLiteral" === nodeType || "NumericLiteral" === nodeType || "NullLiteral" === nodeType || "BooleanLiteral" === nodeType || "RegExpLiteral" === nodeType || "LogicalExpression" === nodeType || "MemberExpression" === nodeType || "NewExpression" === nodeType || "ObjectExpression" === nodeType || "SequenceExpression" === nodeType || "ParenthesizedExpression" === nodeType || "ThisExpression" === nodeType || "UnaryExpression" === nodeType || "UpdateExpression" === nodeType || "ArrowFunctionExpression" === nodeType || "ClassExpression" === nodeType || "MetaProperty" === nodeType || "Super" === nodeType || "TaggedTemplateExpression" === nodeType || "TemplateLiteral" === nodeType || "YieldExpression" === nodeType || "AwaitExpression" === nodeType || "Import" === nodeType || "BigIntLiteral" === nodeType || "OptionalMemberExpression" === nodeType || "OptionalCallExpression" === nodeType || "TypeCastExpression" === nodeType || "JSXElement" === nodeType || "JSXFragment" === nodeType || "BindExpression" === nodeType || "DoExpression" === nodeType || "RecordExpression" === nodeType || "TupleExpression" === nodeType || "DecimalLiteral" === nodeType || "ModuleExpression" === nodeType || "TopicReference" === nodeType || "PipelineTopicExpression" === nodeType || "PipelineBareFunction" === nodeType || "PipelinePrimaryTopicReference" === nodeType || "TSAsExpression" === nodeType || "TSTypeAssertion" === nodeType || "TSNonNullExpression" === nodeType || nodeType === "Placeholder" && ("Expression" === node.expectedNode || "Identifier" === node.expectedNode || "StringLiteral" === node.expectedNode)) {
  3385. if (typeof opts === "undefined") {
  3386. return true;
  3387. } else {
  3388. return (0, _shallowEqual.default)(node, opts);
  3389. }
  3390. }
  3391. return false;
  3392. }
  3393. function isBinary(node, opts) {
  3394. if (!node) return false;
  3395. var nodeType = node.type;
  3396. if ("BinaryExpression" === nodeType || "LogicalExpression" === nodeType) {
  3397. if (typeof opts === "undefined") {
  3398. return true;
  3399. } else {
  3400. return (0, _shallowEqual.default)(node, opts);
  3401. }
  3402. }
  3403. return false;
  3404. }
  3405. function isScopable(node, opts) {
  3406. if (!node) return false;
  3407. var nodeType = node.type;
  3408. if ("BlockStatement" === nodeType || "CatchClause" === nodeType || "DoWhileStatement" === nodeType || "ForInStatement" === nodeType || "ForStatement" === nodeType || "FunctionDeclaration" === nodeType || "FunctionExpression" === nodeType || "Program" === nodeType || "ObjectMethod" === nodeType || "SwitchStatement" === nodeType || "WhileStatement" === nodeType || "ArrowFunctionExpression" === nodeType || "ClassExpression" === nodeType || "ClassDeclaration" === nodeType || "ForOfStatement" === nodeType || "ClassMethod" === nodeType || "ClassPrivateMethod" === nodeType || "StaticBlock" === nodeType || "TSModuleBlock" === nodeType || nodeType === "Placeholder" && "BlockStatement" === node.expectedNode) {
  3409. if (typeof opts === "undefined") {
  3410. return true;
  3411. } else {
  3412. return (0, _shallowEqual.default)(node, opts);
  3413. }
  3414. }
  3415. return false;
  3416. }
  3417. function isBlockParent(node, opts) {
  3418. if (!node) return false;
  3419. var nodeType = node.type;
  3420. if ("BlockStatement" === nodeType || "CatchClause" === nodeType || "DoWhileStatement" === nodeType || "ForInStatement" === nodeType || "ForStatement" === nodeType || "FunctionDeclaration" === nodeType || "FunctionExpression" === nodeType || "Program" === nodeType || "ObjectMethod" === nodeType || "SwitchStatement" === nodeType || "WhileStatement" === nodeType || "ArrowFunctionExpression" === nodeType || "ForOfStatement" === nodeType || "ClassMethod" === nodeType || "ClassPrivateMethod" === nodeType || "StaticBlock" === nodeType || "TSModuleBlock" === nodeType || nodeType === "Placeholder" && "BlockStatement" === node.expectedNode) {
  3421. if (typeof opts === "undefined") {
  3422. return true;
  3423. } else {
  3424. return (0, _shallowEqual.default)(node, opts);
  3425. }
  3426. }
  3427. return false;
  3428. }
  3429. function isBlock(node, opts) {
  3430. if (!node) return false;
  3431. var nodeType = node.type;
  3432. if ("BlockStatement" === nodeType || "Program" === nodeType || "TSModuleBlock" === nodeType || nodeType === "Placeholder" && "BlockStatement" === node.expectedNode) {
  3433. if (typeof opts === "undefined") {
  3434. return true;
  3435. } else {
  3436. return (0, _shallowEqual.default)(node, opts);
  3437. }
  3438. }
  3439. return false;
  3440. }
  3441. function isStatement(node, opts) {
  3442. if (!node) return false;
  3443. var nodeType = node.type;
  3444. if ("BlockStatement" === nodeType || "BreakStatement" === nodeType || "ContinueStatement" === nodeType || "DebuggerStatement" === nodeType || "DoWhileStatement" === nodeType || "EmptyStatement" === nodeType || "ExpressionStatement" === nodeType || "ForInStatement" === nodeType || "ForStatement" === nodeType || "FunctionDeclaration" === nodeType || "IfStatement" === nodeType || "LabeledStatement" === nodeType || "ReturnStatement" === nodeType || "SwitchStatement" === nodeType || "ThrowStatement" === nodeType || "TryStatement" === nodeType || "VariableDeclaration" === nodeType || "WhileStatement" === nodeType || "WithStatement" === nodeType || "ClassDeclaration" === nodeType || "ExportAllDeclaration" === nodeType || "ExportDefaultDeclaration" === nodeType || "ExportNamedDeclaration" === nodeType || "ForOfStatement" === nodeType || "ImportDeclaration" === nodeType || "DeclareClass" === nodeType || "DeclareFunction" === nodeType || "DeclareInterface" === nodeType || "DeclareModule" === nodeType || "DeclareModuleExports" === nodeType || "DeclareTypeAlias" === nodeType || "DeclareOpaqueType" === nodeType || "DeclareVariable" === nodeType || "DeclareExportDeclaration" === nodeType || "DeclareExportAllDeclaration" === nodeType || "InterfaceDeclaration" === nodeType || "OpaqueType" === nodeType || "TypeAlias" === nodeType || "EnumDeclaration" === nodeType || "TSDeclareFunction" === nodeType || "TSInterfaceDeclaration" === nodeType || "TSTypeAliasDeclaration" === nodeType || "TSEnumDeclaration" === nodeType || "TSModuleDeclaration" === nodeType || "TSImportEqualsDeclaration" === nodeType || "TSExportAssignment" === nodeType || "TSNamespaceExportDeclaration" === nodeType || nodeType === "Placeholder" && ("Statement" === node.expectedNode || "Declaration" === node.expectedNode || "BlockStatement" === node.expectedNode)) {
  3445. if (typeof opts === "undefined") {
  3446. return true;
  3447. } else {
  3448. return (0, _shallowEqual.default)(node, opts);
  3449. }
  3450. }
  3451. return false;
  3452. }
  3453. function isTerminatorless(node, opts) {
  3454. if (!node) return false;
  3455. var nodeType = node.type;
  3456. if ("BreakStatement" === nodeType || "ContinueStatement" === nodeType || "ReturnStatement" === nodeType || "ThrowStatement" === nodeType || "YieldExpression" === nodeType || "AwaitExpression" === nodeType) {
  3457. if (typeof opts === "undefined") {
  3458. return true;
  3459. } else {
  3460. return (0, _shallowEqual.default)(node, opts);
  3461. }
  3462. }
  3463. return false;
  3464. }
  3465. function isCompletionStatement(node, opts) {
  3466. if (!node) return false;
  3467. var nodeType = node.type;
  3468. if ("BreakStatement" === nodeType || "ContinueStatement" === nodeType || "ReturnStatement" === nodeType || "ThrowStatement" === nodeType) {
  3469. if (typeof opts === "undefined") {
  3470. return true;
  3471. } else {
  3472. return (0, _shallowEqual.default)(node, opts);
  3473. }
  3474. }
  3475. return false;
  3476. }
  3477. function isConditional(node, opts) {
  3478. if (!node) return false;
  3479. var nodeType = node.type;
  3480. if ("ConditionalExpression" === nodeType || "IfStatement" === nodeType) {
  3481. if (typeof opts === "undefined") {
  3482. return true;
  3483. } else {
  3484. return (0, _shallowEqual.default)(node, opts);
  3485. }
  3486. }
  3487. return false;
  3488. }
  3489. function isLoop(node, opts) {
  3490. if (!node) return false;
  3491. var nodeType = node.type;
  3492. if ("DoWhileStatement" === nodeType || "ForInStatement" === nodeType || "ForStatement" === nodeType || "WhileStatement" === nodeType || "ForOfStatement" === nodeType) {
  3493. if (typeof opts === "undefined") {
  3494. return true;
  3495. } else {
  3496. return (0, _shallowEqual.default)(node, opts);
  3497. }
  3498. }
  3499. return false;
  3500. }
  3501. function isWhile(node, opts) {
  3502. if (!node) return false;
  3503. var nodeType = node.type;
  3504. if ("DoWhileStatement" === nodeType || "WhileStatement" === nodeType) {
  3505. if (typeof opts === "undefined") {
  3506. return true;
  3507. } else {
  3508. return (0, _shallowEqual.default)(node, opts);
  3509. }
  3510. }
  3511. return false;
  3512. }
  3513. function isExpressionWrapper(node, opts) {
  3514. if (!node) return false;
  3515. var nodeType = node.type;
  3516. if ("ExpressionStatement" === nodeType || "ParenthesizedExpression" === nodeType || "TypeCastExpression" === nodeType) {
  3517. if (typeof opts === "undefined") {
  3518. return true;
  3519. } else {
  3520. return (0, _shallowEqual.default)(node, opts);
  3521. }
  3522. }
  3523. return false;
  3524. }
  3525. function isFor(node, opts) {
  3526. if (!node) return false;
  3527. var nodeType = node.type;
  3528. if ("ForInStatement" === nodeType || "ForStatement" === nodeType || "ForOfStatement" === nodeType) {
  3529. if (typeof opts === "undefined") {
  3530. return true;
  3531. } else {
  3532. return (0, _shallowEqual.default)(node, opts);
  3533. }
  3534. }
  3535. return false;
  3536. }
  3537. function isForXStatement(node, opts) {
  3538. if (!node) return false;
  3539. var nodeType = node.type;
  3540. if ("ForInStatement" === nodeType || "ForOfStatement" === nodeType) {
  3541. if (typeof opts === "undefined") {
  3542. return true;
  3543. } else {
  3544. return (0, _shallowEqual.default)(node, opts);
  3545. }
  3546. }
  3547. return false;
  3548. }
  3549. function isFunction(node, opts) {
  3550. if (!node) return false;
  3551. var nodeType = node.type;
  3552. if ("FunctionDeclaration" === nodeType || "FunctionExpression" === nodeType || "ObjectMethod" === nodeType || "ArrowFunctionExpression" === nodeType || "ClassMethod" === nodeType || "ClassPrivateMethod" === nodeType) {
  3553. if (typeof opts === "undefined") {
  3554. return true;
  3555. } else {
  3556. return (0, _shallowEqual.default)(node, opts);
  3557. }
  3558. }
  3559. return false;
  3560. }
  3561. function isFunctionParent(node, opts) {
  3562. if (!node) return false;
  3563. var nodeType = node.type;
  3564. if ("FunctionDeclaration" === nodeType || "FunctionExpression" === nodeType || "ObjectMethod" === nodeType || "ArrowFunctionExpression" === nodeType || "ClassMethod" === nodeType || "ClassPrivateMethod" === nodeType) {
  3565. if (typeof opts === "undefined") {
  3566. return true;
  3567. } else {
  3568. return (0, _shallowEqual.default)(node, opts);
  3569. }
  3570. }
  3571. return false;
  3572. }
  3573. function isPureish(node, opts) {
  3574. if (!node) return false;
  3575. var nodeType = node.type;
  3576. if ("FunctionDeclaration" === nodeType || "FunctionExpression" === nodeType || "StringLiteral" === nodeType || "NumericLiteral" === nodeType || "NullLiteral" === nodeType || "BooleanLiteral" === nodeType || "RegExpLiteral" === nodeType || "ArrowFunctionExpression" === nodeType || "BigIntLiteral" === nodeType || "DecimalLiteral" === nodeType || nodeType === "Placeholder" && "StringLiteral" === node.expectedNode) {
  3577. if (typeof opts === "undefined") {
  3578. return true;
  3579. } else {
  3580. return (0, _shallowEqual.default)(node, opts);
  3581. }
  3582. }
  3583. return false;
  3584. }
  3585. function isDeclaration(node, opts) {
  3586. if (!node) return false;
  3587. var nodeType = node.type;
  3588. if ("FunctionDeclaration" === nodeType || "VariableDeclaration" === nodeType || "ClassDeclaration" === nodeType || "ExportAllDeclaration" === nodeType || "ExportDefaultDeclaration" === nodeType || "ExportNamedDeclaration" === nodeType || "ImportDeclaration" === nodeType || "DeclareClass" === nodeType || "DeclareFunction" === nodeType || "DeclareInterface" === nodeType || "DeclareModule" === nodeType || "DeclareModuleExports" === nodeType || "DeclareTypeAlias" === nodeType || "DeclareOpaqueType" === nodeType || "DeclareVariable" === nodeType || "DeclareExportDeclaration" === nodeType || "DeclareExportAllDeclaration" === nodeType || "InterfaceDeclaration" === nodeType || "OpaqueType" === nodeType || "TypeAlias" === nodeType || "EnumDeclaration" === nodeType || "TSDeclareFunction" === nodeType || "TSInterfaceDeclaration" === nodeType || "TSTypeAliasDeclaration" === nodeType || "TSEnumDeclaration" === nodeType || "TSModuleDeclaration" === nodeType || nodeType === "Placeholder" && "Declaration" === node.expectedNode) {
  3589. if (typeof opts === "undefined") {
  3590. return true;
  3591. } else {
  3592. return (0, _shallowEqual.default)(node, opts);
  3593. }
  3594. }
  3595. return false;
  3596. }
  3597. function isPatternLike(node, opts) {
  3598. if (!node) return false;
  3599. var nodeType = node.type;
  3600. if ("Identifier" === nodeType || "RestElement" === nodeType || "AssignmentPattern" === nodeType || "ArrayPattern" === nodeType || "ObjectPattern" === nodeType || nodeType === "Placeholder" && ("Pattern" === node.expectedNode || "Identifier" === node.expectedNode)) {
  3601. if (typeof opts === "undefined") {
  3602. return true;
  3603. } else {
  3604. return (0, _shallowEqual.default)(node, opts);
  3605. }
  3606. }
  3607. return false;
  3608. }
  3609. function isLVal(node, opts) {
  3610. if (!node) return false;
  3611. var nodeType = node.type;
  3612. if ("Identifier" === nodeType || "MemberExpression" === nodeType || "RestElement" === nodeType || "AssignmentPattern" === nodeType || "ArrayPattern" === nodeType || "ObjectPattern" === nodeType || "TSParameterProperty" === nodeType || nodeType === "Placeholder" && ("Pattern" === node.expectedNode || "Identifier" === node.expectedNode)) {
  3613. if (typeof opts === "undefined") {
  3614. return true;
  3615. } else {
  3616. return (0, _shallowEqual.default)(node, opts);
  3617. }
  3618. }
  3619. return false;
  3620. }
  3621. function isTSEntityName(node, opts) {
  3622. if (!node) return false;
  3623. var nodeType = node.type;
  3624. if ("Identifier" === nodeType || "TSQualifiedName" === nodeType || nodeType === "Placeholder" && "Identifier" === node.expectedNode) {
  3625. if (typeof opts === "undefined") {
  3626. return true;
  3627. } else {
  3628. return (0, _shallowEqual.default)(node, opts);
  3629. }
  3630. }
  3631. return false;
  3632. }
  3633. function isLiteral(node, opts) {
  3634. if (!node) return false;
  3635. var nodeType = node.type;
  3636. if ("StringLiteral" === nodeType || "NumericLiteral" === nodeType || "NullLiteral" === nodeType || "BooleanLiteral" === nodeType || "RegExpLiteral" === nodeType || "TemplateLiteral" === nodeType || "BigIntLiteral" === nodeType || "DecimalLiteral" === nodeType || nodeType === "Placeholder" && "StringLiteral" === node.expectedNode) {
  3637. if (typeof opts === "undefined") {
  3638. return true;
  3639. } else {
  3640. return (0, _shallowEqual.default)(node, opts);
  3641. }
  3642. }
  3643. return false;
  3644. }
  3645. function isImmutable$2(node, opts) {
  3646. if (!node) return false;
  3647. var nodeType = node.type;
  3648. if ("StringLiteral" === nodeType || "NumericLiteral" === nodeType || "NullLiteral" === nodeType || "BooleanLiteral" === nodeType || "BigIntLiteral" === nodeType || "JSXAttribute" === nodeType || "JSXClosingElement" === nodeType || "JSXElement" === nodeType || "JSXExpressionContainer" === nodeType || "JSXSpreadChild" === nodeType || "JSXOpeningElement" === nodeType || "JSXText" === nodeType || "JSXFragment" === nodeType || "JSXOpeningFragment" === nodeType || "JSXClosingFragment" === nodeType || "DecimalLiteral" === nodeType || nodeType === "Placeholder" && "StringLiteral" === node.expectedNode) {
  3649. if (typeof opts === "undefined") {
  3650. return true;
  3651. } else {
  3652. return (0, _shallowEqual.default)(node, opts);
  3653. }
  3654. }
  3655. return false;
  3656. }
  3657. function isUserWhitespacable(node, opts) {
  3658. if (!node) return false;
  3659. var nodeType = node.type;
  3660. if ("ObjectMethod" === nodeType || "ObjectProperty" === nodeType || "ObjectTypeInternalSlot" === nodeType || "ObjectTypeCallProperty" === nodeType || "ObjectTypeIndexer" === nodeType || "ObjectTypeProperty" === nodeType || "ObjectTypeSpreadProperty" === nodeType) {
  3661. if (typeof opts === "undefined") {
  3662. return true;
  3663. } else {
  3664. return (0, _shallowEqual.default)(node, opts);
  3665. }
  3666. }
  3667. return false;
  3668. }
  3669. function isMethod(node, opts) {
  3670. if (!node) return false;
  3671. var nodeType = node.type;
  3672. if ("ObjectMethod" === nodeType || "ClassMethod" === nodeType || "ClassPrivateMethod" === nodeType) {
  3673. if (typeof opts === "undefined") {
  3674. return true;
  3675. } else {
  3676. return (0, _shallowEqual.default)(node, opts);
  3677. }
  3678. }
  3679. return false;
  3680. }
  3681. function isObjectMember(node, opts) {
  3682. if (!node) return false;
  3683. var nodeType = node.type;
  3684. if ("ObjectMethod" === nodeType || "ObjectProperty" === nodeType) {
  3685. if (typeof opts === "undefined") {
  3686. return true;
  3687. } else {
  3688. return (0, _shallowEqual.default)(node, opts);
  3689. }
  3690. }
  3691. return false;
  3692. }
  3693. function isProperty(node, opts) {
  3694. if (!node) return false;
  3695. var nodeType = node.type;
  3696. if ("ObjectProperty" === nodeType || "ClassProperty" === nodeType || "ClassPrivateProperty" === nodeType) {
  3697. if (typeof opts === "undefined") {
  3698. return true;
  3699. } else {
  3700. return (0, _shallowEqual.default)(node, opts);
  3701. }
  3702. }
  3703. return false;
  3704. }
  3705. function isUnaryLike(node, opts) {
  3706. if (!node) return false;
  3707. var nodeType = node.type;
  3708. if ("UnaryExpression" === nodeType || "SpreadElement" === nodeType) {
  3709. if (typeof opts === "undefined") {
  3710. return true;
  3711. } else {
  3712. return (0, _shallowEqual.default)(node, opts);
  3713. }
  3714. }
  3715. return false;
  3716. }
  3717. function isPattern(node, opts) {
  3718. if (!node) return false;
  3719. var nodeType = node.type;
  3720. if ("AssignmentPattern" === nodeType || "ArrayPattern" === nodeType || "ObjectPattern" === nodeType || nodeType === "Placeholder" && "Pattern" === node.expectedNode) {
  3721. if (typeof opts === "undefined") {
  3722. return true;
  3723. } else {
  3724. return (0, _shallowEqual.default)(node, opts);
  3725. }
  3726. }
  3727. return false;
  3728. }
  3729. function isClass(node, opts) {
  3730. if (!node) return false;
  3731. var nodeType = node.type;
  3732. if ("ClassExpression" === nodeType || "ClassDeclaration" === nodeType) {
  3733. if (typeof opts === "undefined") {
  3734. return true;
  3735. } else {
  3736. return (0, _shallowEqual.default)(node, opts);
  3737. }
  3738. }
  3739. return false;
  3740. }
  3741. function isModuleDeclaration(node, opts) {
  3742. if (!node) return false;
  3743. var nodeType = node.type;
  3744. if ("ExportAllDeclaration" === nodeType || "ExportDefaultDeclaration" === nodeType || "ExportNamedDeclaration" === nodeType || "ImportDeclaration" === nodeType) {
  3745. if (typeof opts === "undefined") {
  3746. return true;
  3747. } else {
  3748. return (0, _shallowEqual.default)(node, opts);
  3749. }
  3750. }
  3751. return false;
  3752. }
  3753. function isExportDeclaration(node, opts) {
  3754. if (!node) return false;
  3755. var nodeType = node.type;
  3756. if ("ExportAllDeclaration" === nodeType || "ExportDefaultDeclaration" === nodeType || "ExportNamedDeclaration" === nodeType) {
  3757. if (typeof opts === "undefined") {
  3758. return true;
  3759. } else {
  3760. return (0, _shallowEqual.default)(node, opts);
  3761. }
  3762. }
  3763. return false;
  3764. }
  3765. function isModuleSpecifier(node, opts) {
  3766. if (!node) return false;
  3767. var nodeType = node.type;
  3768. if ("ExportSpecifier" === nodeType || "ImportDefaultSpecifier" === nodeType || "ImportNamespaceSpecifier" === nodeType || "ImportSpecifier" === nodeType || "ExportNamespaceSpecifier" === nodeType || "ExportDefaultSpecifier" === nodeType) {
  3769. if (typeof opts === "undefined") {
  3770. return true;
  3771. } else {
  3772. return (0, _shallowEqual.default)(node, opts);
  3773. }
  3774. }
  3775. return false;
  3776. }
  3777. function isPrivate(node, opts) {
  3778. if (!node) return false;
  3779. var nodeType = node.type;
  3780. if ("ClassPrivateProperty" === nodeType || "ClassPrivateMethod" === nodeType || "PrivateName" === nodeType) {
  3781. if (typeof opts === "undefined") {
  3782. return true;
  3783. } else {
  3784. return (0, _shallowEqual.default)(node, opts);
  3785. }
  3786. }
  3787. return false;
  3788. }
  3789. function isFlow(node, opts) {
  3790. if (!node) return false;
  3791. var nodeType = node.type;
  3792. if ("AnyTypeAnnotation" === nodeType || "ArrayTypeAnnotation" === nodeType || "BooleanTypeAnnotation" === nodeType || "BooleanLiteralTypeAnnotation" === nodeType || "NullLiteralTypeAnnotation" === nodeType || "ClassImplements" === nodeType || "DeclareClass" === nodeType || "DeclareFunction" === nodeType || "DeclareInterface" === nodeType || "DeclareModule" === nodeType || "DeclareModuleExports" === nodeType || "DeclareTypeAlias" === nodeType || "DeclareOpaqueType" === nodeType || "DeclareVariable" === nodeType || "DeclareExportDeclaration" === nodeType || "DeclareExportAllDeclaration" === nodeType || "DeclaredPredicate" === nodeType || "ExistsTypeAnnotation" === nodeType || "FunctionTypeAnnotation" === nodeType || "FunctionTypeParam" === nodeType || "GenericTypeAnnotation" === nodeType || "InferredPredicate" === nodeType || "InterfaceExtends" === nodeType || "InterfaceDeclaration" === nodeType || "InterfaceTypeAnnotation" === nodeType || "IntersectionTypeAnnotation" === nodeType || "MixedTypeAnnotation" === nodeType || "EmptyTypeAnnotation" === nodeType || "NullableTypeAnnotation" === nodeType || "NumberLiteralTypeAnnotation" === nodeType || "NumberTypeAnnotation" === nodeType || "ObjectTypeAnnotation" === nodeType || "ObjectTypeInternalSlot" === nodeType || "ObjectTypeCallProperty" === nodeType || "ObjectTypeIndexer" === nodeType || "ObjectTypeProperty" === nodeType || "ObjectTypeSpreadProperty" === nodeType || "OpaqueType" === nodeType || "QualifiedTypeIdentifier" === nodeType || "StringLiteralTypeAnnotation" === nodeType || "StringTypeAnnotation" === nodeType || "SymbolTypeAnnotation" === nodeType || "ThisTypeAnnotation" === nodeType || "TupleTypeAnnotation" === nodeType || "TypeofTypeAnnotation" === nodeType || "TypeAlias" === nodeType || "TypeAnnotation" === nodeType || "TypeCastExpression" === nodeType || "TypeParameter" === nodeType || "TypeParameterDeclaration" === nodeType || "TypeParameterInstantiation" === nodeType || "UnionTypeAnnotation" === nodeType || "Variance" === nodeType || "VoidTypeAnnotation" === nodeType || "IndexedAccessType" === nodeType || "OptionalIndexedAccessType" === nodeType) {
  3793. if (typeof opts === "undefined") {
  3794. return true;
  3795. } else {
  3796. return (0, _shallowEqual.default)(node, opts);
  3797. }
  3798. }
  3799. return false;
  3800. }
  3801. function isFlowType(node, opts) {
  3802. if (!node) return false;
  3803. var nodeType = node.type;
  3804. if ("AnyTypeAnnotation" === nodeType || "ArrayTypeAnnotation" === nodeType || "BooleanTypeAnnotation" === nodeType || "BooleanLiteralTypeAnnotation" === nodeType || "NullLiteralTypeAnnotation" === nodeType || "ExistsTypeAnnotation" === nodeType || "FunctionTypeAnnotation" === nodeType || "GenericTypeAnnotation" === nodeType || "InterfaceTypeAnnotation" === nodeType || "IntersectionTypeAnnotation" === nodeType || "MixedTypeAnnotation" === nodeType || "EmptyTypeAnnotation" === nodeType || "NullableTypeAnnotation" === nodeType || "NumberLiteralTypeAnnotation" === nodeType || "NumberTypeAnnotation" === nodeType || "ObjectTypeAnnotation" === nodeType || "StringLiteralTypeAnnotation" === nodeType || "StringTypeAnnotation" === nodeType || "SymbolTypeAnnotation" === nodeType || "ThisTypeAnnotation" === nodeType || "TupleTypeAnnotation" === nodeType || "TypeofTypeAnnotation" === nodeType || "UnionTypeAnnotation" === nodeType || "VoidTypeAnnotation" === nodeType || "IndexedAccessType" === nodeType || "OptionalIndexedAccessType" === nodeType) {
  3805. if (typeof opts === "undefined") {
  3806. return true;
  3807. } else {
  3808. return (0, _shallowEqual.default)(node, opts);
  3809. }
  3810. }
  3811. return false;
  3812. }
  3813. function isFlowBaseAnnotation(node, opts) {
  3814. if (!node) return false;
  3815. var nodeType = node.type;
  3816. if ("AnyTypeAnnotation" === nodeType || "BooleanTypeAnnotation" === nodeType || "NullLiteralTypeAnnotation" === nodeType || "MixedTypeAnnotation" === nodeType || "EmptyTypeAnnotation" === nodeType || "NumberTypeAnnotation" === nodeType || "StringTypeAnnotation" === nodeType || "SymbolTypeAnnotation" === nodeType || "ThisTypeAnnotation" === nodeType || "VoidTypeAnnotation" === nodeType) {
  3817. if (typeof opts === "undefined") {
  3818. return true;
  3819. } else {
  3820. return (0, _shallowEqual.default)(node, opts);
  3821. }
  3822. }
  3823. return false;
  3824. }
  3825. function isFlowDeclaration(node, opts) {
  3826. if (!node) return false;
  3827. var nodeType = node.type;
  3828. if ("DeclareClass" === nodeType || "DeclareFunction" === nodeType || "DeclareInterface" === nodeType || "DeclareModule" === nodeType || "DeclareModuleExports" === nodeType || "DeclareTypeAlias" === nodeType || "DeclareOpaqueType" === nodeType || "DeclareVariable" === nodeType || "DeclareExportDeclaration" === nodeType || "DeclareExportAllDeclaration" === nodeType || "InterfaceDeclaration" === nodeType || "OpaqueType" === nodeType || "TypeAlias" === nodeType) {
  3829. if (typeof opts === "undefined") {
  3830. return true;
  3831. } else {
  3832. return (0, _shallowEqual.default)(node, opts);
  3833. }
  3834. }
  3835. return false;
  3836. }
  3837. function isFlowPredicate(node, opts) {
  3838. if (!node) return false;
  3839. var nodeType = node.type;
  3840. if ("DeclaredPredicate" === nodeType || "InferredPredicate" === nodeType) {
  3841. if (typeof opts === "undefined") {
  3842. return true;
  3843. } else {
  3844. return (0, _shallowEqual.default)(node, opts);
  3845. }
  3846. }
  3847. return false;
  3848. }
  3849. function isEnumBody(node, opts) {
  3850. if (!node) return false;
  3851. var nodeType = node.type;
  3852. if ("EnumBooleanBody" === nodeType || "EnumNumberBody" === nodeType || "EnumStringBody" === nodeType || "EnumSymbolBody" === nodeType) {
  3853. if (typeof opts === "undefined") {
  3854. return true;
  3855. } else {
  3856. return (0, _shallowEqual.default)(node, opts);
  3857. }
  3858. }
  3859. return false;
  3860. }
  3861. function isEnumMember(node, opts) {
  3862. if (!node) return false;
  3863. var nodeType = node.type;
  3864. if ("EnumBooleanMember" === nodeType || "EnumNumberMember" === nodeType || "EnumStringMember" === nodeType || "EnumDefaultedMember" === nodeType) {
  3865. if (typeof opts === "undefined") {
  3866. return true;
  3867. } else {
  3868. return (0, _shallowEqual.default)(node, opts);
  3869. }
  3870. }
  3871. return false;
  3872. }
  3873. function isJSX(node, opts) {
  3874. if (!node) return false;
  3875. var nodeType = node.type;
  3876. if ("JSXAttribute" === nodeType || "JSXClosingElement" === nodeType || "JSXElement" === nodeType || "JSXEmptyExpression" === nodeType || "JSXExpressionContainer" === nodeType || "JSXSpreadChild" === nodeType || "JSXIdentifier" === nodeType || "JSXMemberExpression" === nodeType || "JSXNamespacedName" === nodeType || "JSXOpeningElement" === nodeType || "JSXSpreadAttribute" === nodeType || "JSXText" === nodeType || "JSXFragment" === nodeType || "JSXOpeningFragment" === nodeType || "JSXClosingFragment" === nodeType) {
  3877. if (typeof opts === "undefined") {
  3878. return true;
  3879. } else {
  3880. return (0, _shallowEqual.default)(node, opts);
  3881. }
  3882. }
  3883. return false;
  3884. }
  3885. function isTSTypeElement(node, opts) {
  3886. if (!node) return false;
  3887. var nodeType = node.type;
  3888. if ("TSCallSignatureDeclaration" === nodeType || "TSConstructSignatureDeclaration" === nodeType || "TSPropertySignature" === nodeType || "TSMethodSignature" === nodeType || "TSIndexSignature" === nodeType) {
  3889. if (typeof opts === "undefined") {
  3890. return true;
  3891. } else {
  3892. return (0, _shallowEqual.default)(node, opts);
  3893. }
  3894. }
  3895. return false;
  3896. }
  3897. function isTSType(node, opts) {
  3898. if (!node) return false;
  3899. var nodeType = node.type;
  3900. if ("TSAnyKeyword" === nodeType || "TSBooleanKeyword" === nodeType || "TSBigIntKeyword" === nodeType || "TSIntrinsicKeyword" === nodeType || "TSNeverKeyword" === nodeType || "TSNullKeyword" === nodeType || "TSNumberKeyword" === nodeType || "TSObjectKeyword" === nodeType || "TSStringKeyword" === nodeType || "TSSymbolKeyword" === nodeType || "TSUndefinedKeyword" === nodeType || "TSUnknownKeyword" === nodeType || "TSVoidKeyword" === nodeType || "TSThisType" === nodeType || "TSFunctionType" === nodeType || "TSConstructorType" === nodeType || "TSTypeReference" === nodeType || "TSTypePredicate" === nodeType || "TSTypeQuery" === nodeType || "TSTypeLiteral" === nodeType || "TSArrayType" === nodeType || "TSTupleType" === nodeType || "TSOptionalType" === nodeType || "TSRestType" === nodeType || "TSUnionType" === nodeType || "TSIntersectionType" === nodeType || "TSConditionalType" === nodeType || "TSInferType" === nodeType || "TSParenthesizedType" === nodeType || "TSTypeOperator" === nodeType || "TSIndexedAccessType" === nodeType || "TSMappedType" === nodeType || "TSLiteralType" === nodeType || "TSExpressionWithTypeArguments" === nodeType || "TSImportType" === nodeType) {
  3901. if (typeof opts === "undefined") {
  3902. return true;
  3903. } else {
  3904. return (0, _shallowEqual.default)(node, opts);
  3905. }
  3906. }
  3907. return false;
  3908. }
  3909. function isTSBaseType(node, opts) {
  3910. if (!node) return false;
  3911. var nodeType = node.type;
  3912. if ("TSAnyKeyword" === nodeType || "TSBooleanKeyword" === nodeType || "TSBigIntKeyword" === nodeType || "TSIntrinsicKeyword" === nodeType || "TSNeverKeyword" === nodeType || "TSNullKeyword" === nodeType || "TSNumberKeyword" === nodeType || "TSObjectKeyword" === nodeType || "TSStringKeyword" === nodeType || "TSSymbolKeyword" === nodeType || "TSUndefinedKeyword" === nodeType || "TSUnknownKeyword" === nodeType || "TSVoidKeyword" === nodeType || "TSThisType" === nodeType || "TSLiteralType" === nodeType) {
  3913. if (typeof opts === "undefined") {
  3914. return true;
  3915. } else {
  3916. return (0, _shallowEqual.default)(node, opts);
  3917. }
  3918. }
  3919. return false;
  3920. }
  3921. function isNumberLiteral(node, opts) {
  3922. console.trace("The node type NumberLiteral has been renamed to NumericLiteral");
  3923. if (!node) return false;
  3924. var nodeType = node.type;
  3925. if (nodeType === "NumberLiteral") {
  3926. if (typeof opts === "undefined") {
  3927. return true;
  3928. } else {
  3929. return (0, _shallowEqual.default)(node, opts);
  3930. }
  3931. }
  3932. return false;
  3933. }
  3934. function isRegexLiteral(node, opts) {
  3935. console.trace("The node type RegexLiteral has been renamed to RegExpLiteral");
  3936. if (!node) return false;
  3937. var nodeType = node.type;
  3938. if (nodeType === "RegexLiteral") {
  3939. if (typeof opts === "undefined") {
  3940. return true;
  3941. } else {
  3942. return (0, _shallowEqual.default)(node, opts);
  3943. }
  3944. }
  3945. return false;
  3946. }
  3947. function isRestProperty(node, opts) {
  3948. console.trace("The node type RestProperty has been renamed to RestElement");
  3949. if (!node) return false;
  3950. var nodeType = node.type;
  3951. if (nodeType === "RestProperty") {
  3952. if (typeof opts === "undefined") {
  3953. return true;
  3954. } else {
  3955. return (0, _shallowEqual.default)(node, opts);
  3956. }
  3957. }
  3958. return false;
  3959. }
  3960. function isSpreadProperty(node, opts) {
  3961. console.trace("The node type SpreadProperty has been renamed to SpreadElement");
  3962. if (!node) return false;
  3963. var nodeType = node.type;
  3964. if (nodeType === "SpreadProperty") {
  3965. if (typeof opts === "undefined") {
  3966. return true;
  3967. } else {
  3968. return (0, _shallowEqual.default)(node, opts);
  3969. }
  3970. }
  3971. return false;
  3972. }
  3973. Object.defineProperty(matchesPattern$1, "__esModule", {
  3974. value: true
  3975. });
  3976. matchesPattern$1.default = matchesPattern;
  3977. var _generated$o = generated$4;
  3978. function matchesPattern(member, match, allowPartial) {
  3979. if (!(0, _generated$o.isMemberExpression)(member)) return false;
  3980. var parts = Array.isArray(match) ? match : match.split(".");
  3981. var nodes = [];
  3982. var node;
  3983. for(node = member; (0, _generated$o.isMemberExpression)(node); node = node.object){
  3984. nodes.push(node.property);
  3985. }
  3986. nodes.push(node);
  3987. if (nodes.length < parts.length) return false;
  3988. if (!allowPartial && nodes.length > parts.length) return false;
  3989. for(var i = 0, j = nodes.length - 1; i < parts.length; i++, j--){
  3990. var node1 = nodes[j];
  3991. var value = void 0;
  3992. if ((0, _generated$o.isIdentifier)(node1)) {
  3993. value = node1.name;
  3994. } else if ((0, _generated$o.isStringLiteral)(node1)) {
  3995. value = node1.value;
  3996. } else if ((0, _generated$o.isThisExpression)(node1)) {
  3997. value = "this";
  3998. } else {
  3999. return false;
  4000. }
  4001. if (parts[i] !== value) return false;
  4002. }
  4003. return true;
  4004. }
  4005. Object.defineProperty(buildMatchMemberExpression$1, "__esModule", {
  4006. value: true
  4007. });
  4008. buildMatchMemberExpression$1.default = buildMatchMemberExpression;
  4009. var _matchesPattern = matchesPattern$1;
  4010. function buildMatchMemberExpression(match, allowPartial) {
  4011. var parts = match.split(".");
  4012. return function(member) {
  4013. return (0, _matchesPattern.default)(member, parts, allowPartial);
  4014. };
  4015. }
  4016. Object.defineProperty(isReactComponent$1, "__esModule", {
  4017. value: true
  4018. });
  4019. isReactComponent$1.default = void 0;
  4020. var _buildMatchMemberExpression = buildMatchMemberExpression$1;
  4021. var isReactComponent = (0, _buildMatchMemberExpression.default)("React.Component");
  4022. var _default$4 = isReactComponent;
  4023. isReactComponent$1.default = _default$4;
  4024. var isCompatTag$1 = {};
  4025. Object.defineProperty(isCompatTag$1, "__esModule", {
  4026. value: true
  4027. });
  4028. isCompatTag$1.default = isCompatTag;
  4029. function isCompatTag(tagName) {
  4030. return !!tagName && /^[a-z]/.test(tagName);
  4031. }
  4032. var buildChildren$1 = {};
  4033. var cleanJSXElementLiteralChild$1 = {};
  4034. var generated$3 = {};
  4035. var builder$1 = {};
  4036. var definitions = {};
  4037. var _typeof$4 = function(obj) {
  4038. "@swc/helpers - typeof";
  4039. return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
  4040. };
  4041. var toFastProperties;
  4042. var hasRequiredToFastProperties;
  4043. function requireToFastProperties() {
  4044. if (hasRequiredToFastProperties) return toFastProperties;
  4045. hasRequiredToFastProperties = 1;
  4046. var fastProto = null;
  4047. // Creates an object with permanently fast properties in V8. See Toon Verwaest's
  4048. // post https://medium.com/@tverwaes/setting-up-prototypes-in-v8-ec9c9491dfe2#5f62
  4049. // for more details. Use %HasFastProperties(object) and the Node.js flag
  4050. // --allow-natives-syntax to check whether an object has fast properties.
  4051. function FastObject(o) {
  4052. // A prototype object will have "fast properties" enabled once it is checked
  4053. // against the inline property cache of a function, e.g. fastProto.property:
  4054. // https://github.com/v8/v8/blob/6.0.122/test/mjsunit/fast-prototype.js#L48-L63
  4055. if (fastProto !== null && _typeof$4(fastProto.property)) {
  4056. var result = fastProto;
  4057. fastProto = FastObject.prototype = null;
  4058. return result;
  4059. }
  4060. fastProto = FastObject.prototype = o == null ? Object.create(null) : o;
  4061. return new FastObject;
  4062. }
  4063. // Initialize the inline property cache of FastObject
  4064. FastObject();
  4065. toFastProperties = function toFastproperties(o) {
  4066. return FastObject(o);
  4067. };
  4068. return toFastProperties;
  4069. }
  4070. var core = {};
  4071. var is = {};
  4072. var isType = {};
  4073. var hasRequiredIsType;
  4074. function requireIsType() {
  4075. var isType$1 = function isType(nodeType, targetType) {
  4076. if (nodeType === targetType) return true;
  4077. if (_definitions.ALIAS_KEYS[targetType]) return false;
  4078. var aliases = _definitions.FLIPPED_ALIAS_KEYS[targetType];
  4079. if (aliases) {
  4080. if (aliases[0] === nodeType) return true;
  4081. for(var _i = 0; _i < aliases.length; _i++){
  4082. var alias = aliases[_i];
  4083. if (nodeType === alias) return true;
  4084. }
  4085. }
  4086. return false;
  4087. };
  4088. if (hasRequiredIsType) return isType;
  4089. hasRequiredIsType = 1;
  4090. Object.defineProperty(isType, "__esModule", {
  4091. value: true
  4092. });
  4093. isType.default = isType$1;
  4094. var _definitions = requireDefinitions();
  4095. return isType;
  4096. }
  4097. var isPlaceholderType = {};
  4098. var hasRequiredIsPlaceholderType;
  4099. function requireIsPlaceholderType() {
  4100. var isPlaceholderType$1 = function isPlaceholderType(placeholderType, targetType) {
  4101. if (placeholderType === targetType) return true;
  4102. var aliases = _definitions.PLACEHOLDERS_ALIAS[placeholderType];
  4103. if (aliases) {
  4104. for(var _i = 0; _i < aliases.length; _i++){
  4105. var alias = aliases[_i];
  4106. if (targetType === alias) return true;
  4107. }
  4108. }
  4109. return false;
  4110. };
  4111. if (hasRequiredIsPlaceholderType) return isPlaceholderType;
  4112. hasRequiredIsPlaceholderType = 1;
  4113. Object.defineProperty(isPlaceholderType, "__esModule", {
  4114. value: true
  4115. });
  4116. isPlaceholderType.default = isPlaceholderType$1;
  4117. var _definitions = requireDefinitions();
  4118. return isPlaceholderType;
  4119. }
  4120. var hasRequiredIs;
  4121. function requireIs() {
  4122. var is$1 = function is(type, node, opts) {
  4123. if (!node) return false;
  4124. var matches = (0, _isType.default)(node.type, type);
  4125. if (!matches) {
  4126. if (!opts && node.type === "Placeholder" && type in _definitions.FLIPPED_ALIAS_KEYS) {
  4127. return (0, _isPlaceholderType.default)(node.expectedNode, type);
  4128. }
  4129. return false;
  4130. }
  4131. if (typeof opts === "undefined") {
  4132. return true;
  4133. } else {
  4134. return (0, _shallowEqual.default)(node, opts);
  4135. }
  4136. };
  4137. if (hasRequiredIs) return is;
  4138. hasRequiredIs = 1;
  4139. Object.defineProperty(is, "__esModule", {
  4140. value: true
  4141. });
  4142. is.default = is$1;
  4143. var _shallowEqual = shallowEqual$1;
  4144. var _isType = requireIsType();
  4145. var _isPlaceholderType = requireIsPlaceholderType();
  4146. var _definitions = requireDefinitions();
  4147. return is;
  4148. }
  4149. var isValidIdentifier$1 = {};
  4150. var lib = {};
  4151. var identifier$1 = {};
  4152. Object.defineProperty(identifier$1, "__esModule", {
  4153. value: true
  4154. });
  4155. identifier$1.isIdentifierStart = isIdentifierStart;
  4156. identifier$1.isIdentifierChar = isIdentifierChar;
  4157. identifier$1.isIdentifierName = isIdentifierName;
  4158. var nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࢠ-ࢴࢶ-ࣇऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-鿼ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞿꟂ-ꟊꟵ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ";
  4159. var nonASCIIidentifierChars = "‌‍\xb7̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࣓-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-ໍ໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠐-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿᫀᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷹᷻-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_";
  4160. var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]");
  4161. var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]");
  4162. nonASCIIidentifierStartChars = nonASCIIidentifierChars = null;
  4163. var astralIdentifierStartCodes = [
  4164. 0,
  4165. 11,
  4166. 2,
  4167. 25,
  4168. 2,
  4169. 18,
  4170. 2,
  4171. 1,
  4172. 2,
  4173. 14,
  4174. 3,
  4175. 13,
  4176. 35,
  4177. 122,
  4178. 70,
  4179. 52,
  4180. 268,
  4181. 28,
  4182. 4,
  4183. 48,
  4184. 48,
  4185. 31,
  4186. 14,
  4187. 29,
  4188. 6,
  4189. 37,
  4190. 11,
  4191. 29,
  4192. 3,
  4193. 35,
  4194. 5,
  4195. 7,
  4196. 2,
  4197. 4,
  4198. 43,
  4199. 157,
  4200. 19,
  4201. 35,
  4202. 5,
  4203. 35,
  4204. 5,
  4205. 39,
  4206. 9,
  4207. 51,
  4208. 157,
  4209. 310,
  4210. 10,
  4211. 21,
  4212. 11,
  4213. 7,
  4214. 153,
  4215. 5,
  4216. 3,
  4217. 0,
  4218. 2,
  4219. 43,
  4220. 2,
  4221. 1,
  4222. 4,
  4223. 0,
  4224. 3,
  4225. 22,
  4226. 11,
  4227. 22,
  4228. 10,
  4229. 30,
  4230. 66,
  4231. 18,
  4232. 2,
  4233. 1,
  4234. 11,
  4235. 21,
  4236. 11,
  4237. 25,
  4238. 71,
  4239. 55,
  4240. 7,
  4241. 1,
  4242. 65,
  4243. 0,
  4244. 16,
  4245. 3,
  4246. 2,
  4247. 2,
  4248. 2,
  4249. 28,
  4250. 43,
  4251. 28,
  4252. 4,
  4253. 28,
  4254. 36,
  4255. 7,
  4256. 2,
  4257. 27,
  4258. 28,
  4259. 53,
  4260. 11,
  4261. 21,
  4262. 11,
  4263. 18,
  4264. 14,
  4265. 17,
  4266. 111,
  4267. 72,
  4268. 56,
  4269. 50,
  4270. 14,
  4271. 50,
  4272. 14,
  4273. 35,
  4274. 349,
  4275. 41,
  4276. 7,
  4277. 1,
  4278. 79,
  4279. 28,
  4280. 11,
  4281. 0,
  4282. 9,
  4283. 21,
  4284. 107,
  4285. 20,
  4286. 28,
  4287. 22,
  4288. 13,
  4289. 52,
  4290. 76,
  4291. 44,
  4292. 33,
  4293. 24,
  4294. 27,
  4295. 35,
  4296. 30,
  4297. 0,
  4298. 3,
  4299. 0,
  4300. 9,
  4301. 34,
  4302. 4,
  4303. 0,
  4304. 13,
  4305. 47,
  4306. 15,
  4307. 3,
  4308. 22,
  4309. 0,
  4310. 2,
  4311. 0,
  4312. 36,
  4313. 17,
  4314. 2,
  4315. 24,
  4316. 85,
  4317. 6,
  4318. 2,
  4319. 0,
  4320. 2,
  4321. 3,
  4322. 2,
  4323. 14,
  4324. 2,
  4325. 9,
  4326. 8,
  4327. 46,
  4328. 39,
  4329. 7,
  4330. 3,
  4331. 1,
  4332. 3,
  4333. 21,
  4334. 2,
  4335. 6,
  4336. 2,
  4337. 1,
  4338. 2,
  4339. 4,
  4340. 4,
  4341. 0,
  4342. 19,
  4343. 0,
  4344. 13,
  4345. 4,
  4346. 159,
  4347. 52,
  4348. 19,
  4349. 3,
  4350. 21,
  4351. 2,
  4352. 31,
  4353. 47,
  4354. 21,
  4355. 1,
  4356. 2,
  4357. 0,
  4358. 185,
  4359. 46,
  4360. 42,
  4361. 3,
  4362. 37,
  4363. 47,
  4364. 21,
  4365. 0,
  4366. 60,
  4367. 42,
  4368. 14,
  4369. 0,
  4370. 72,
  4371. 26,
  4372. 230,
  4373. 43,
  4374. 117,
  4375. 63,
  4376. 32,
  4377. 7,
  4378. 3,
  4379. 0,
  4380. 3,
  4381. 7,
  4382. 2,
  4383. 1,
  4384. 2,
  4385. 23,
  4386. 16,
  4387. 0,
  4388. 2,
  4389. 0,
  4390. 95,
  4391. 7,
  4392. 3,
  4393. 38,
  4394. 17,
  4395. 0,
  4396. 2,
  4397. 0,
  4398. 29,
  4399. 0,
  4400. 11,
  4401. 39,
  4402. 8,
  4403. 0,
  4404. 22,
  4405. 0,
  4406. 12,
  4407. 45,
  4408. 20,
  4409. 0,
  4410. 35,
  4411. 56,
  4412. 264,
  4413. 8,
  4414. 2,
  4415. 36,
  4416. 18,
  4417. 0,
  4418. 50,
  4419. 29,
  4420. 113,
  4421. 6,
  4422. 2,
  4423. 1,
  4424. 2,
  4425. 37,
  4426. 22,
  4427. 0,
  4428. 26,
  4429. 5,
  4430. 2,
  4431. 1,
  4432. 2,
  4433. 31,
  4434. 15,
  4435. 0,
  4436. 328,
  4437. 18,
  4438. 190,
  4439. 0,
  4440. 80,
  4441. 921,
  4442. 103,
  4443. 110,
  4444. 18,
  4445. 195,
  4446. 2749,
  4447. 1070,
  4448. 4050,
  4449. 582,
  4450. 8634,
  4451. 568,
  4452. 8,
  4453. 30,
  4454. 114,
  4455. 29,
  4456. 19,
  4457. 47,
  4458. 17,
  4459. 3,
  4460. 32,
  4461. 20,
  4462. 6,
  4463. 18,
  4464. 689,
  4465. 63,
  4466. 129,
  4467. 74,
  4468. 6,
  4469. 0,
  4470. 67,
  4471. 12,
  4472. 65,
  4473. 1,
  4474. 2,
  4475. 0,
  4476. 29,
  4477. 6135,
  4478. 9,
  4479. 1237,
  4480. 43,
  4481. 8,
  4482. 8952,
  4483. 286,
  4484. 50,
  4485. 2,
  4486. 18,
  4487. 3,
  4488. 9,
  4489. 395,
  4490. 2309,
  4491. 106,
  4492. 6,
  4493. 12,
  4494. 4,
  4495. 8,
  4496. 8,
  4497. 9,
  4498. 5991,
  4499. 84,
  4500. 2,
  4501. 70,
  4502. 2,
  4503. 1,
  4504. 3,
  4505. 0,
  4506. 3,
  4507. 1,
  4508. 3,
  4509. 3,
  4510. 2,
  4511. 11,
  4512. 2,
  4513. 0,
  4514. 2,
  4515. 6,
  4516. 2,
  4517. 64,
  4518. 2,
  4519. 3,
  4520. 3,
  4521. 7,
  4522. 2,
  4523. 6,
  4524. 2,
  4525. 27,
  4526. 2,
  4527. 3,
  4528. 2,
  4529. 4,
  4530. 2,
  4531. 0,
  4532. 4,
  4533. 6,
  4534. 2,
  4535. 339,
  4536. 3,
  4537. 24,
  4538. 2,
  4539. 24,
  4540. 2,
  4541. 30,
  4542. 2,
  4543. 24,
  4544. 2,
  4545. 30,
  4546. 2,
  4547. 24,
  4548. 2,
  4549. 30,
  4550. 2,
  4551. 24,
  4552. 2,
  4553. 30,
  4554. 2,
  4555. 24,
  4556. 2,
  4557. 7,
  4558. 2357,
  4559. 44,
  4560. 11,
  4561. 6,
  4562. 17,
  4563. 0,
  4564. 370,
  4565. 43,
  4566. 1301,
  4567. 196,
  4568. 60,
  4569. 67,
  4570. 8,
  4571. 0,
  4572. 1205,
  4573. 3,
  4574. 2,
  4575. 26,
  4576. 2,
  4577. 1,
  4578. 2,
  4579. 0,
  4580. 3,
  4581. 0,
  4582. 2,
  4583. 9,
  4584. 2,
  4585. 3,
  4586. 2,
  4587. 0,
  4588. 2,
  4589. 0,
  4590. 7,
  4591. 0,
  4592. 5,
  4593. 0,
  4594. 2,
  4595. 0,
  4596. 2,
  4597. 0,
  4598. 2,
  4599. 2,
  4600. 2,
  4601. 1,
  4602. 2,
  4603. 0,
  4604. 3,
  4605. 0,
  4606. 2,
  4607. 0,
  4608. 2,
  4609. 0,
  4610. 2,
  4611. 0,
  4612. 2,
  4613. 0,
  4614. 2,
  4615. 1,
  4616. 2,
  4617. 0,
  4618. 3,
  4619. 3,
  4620. 2,
  4621. 6,
  4622. 2,
  4623. 3,
  4624. 2,
  4625. 3,
  4626. 2,
  4627. 0,
  4628. 2,
  4629. 9,
  4630. 2,
  4631. 16,
  4632. 6,
  4633. 2,
  4634. 2,
  4635. 4,
  4636. 2,
  4637. 16,
  4638. 4421,
  4639. 42717,
  4640. 35,
  4641. 4148,
  4642. 12,
  4643. 221,
  4644. 3,
  4645. 5761,
  4646. 15,
  4647. 7472,
  4648. 3104,
  4649. 541,
  4650. 1507,
  4651. 4938
  4652. ];
  4653. var astralIdentifierCodes = [
  4654. 509,
  4655. 0,
  4656. 227,
  4657. 0,
  4658. 150,
  4659. 4,
  4660. 294,
  4661. 9,
  4662. 1368,
  4663. 2,
  4664. 2,
  4665. 1,
  4666. 6,
  4667. 3,
  4668. 41,
  4669. 2,
  4670. 5,
  4671. 0,
  4672. 166,
  4673. 1,
  4674. 574,
  4675. 3,
  4676. 9,
  4677. 9,
  4678. 370,
  4679. 1,
  4680. 154,
  4681. 10,
  4682. 176,
  4683. 2,
  4684. 54,
  4685. 14,
  4686. 32,
  4687. 9,
  4688. 16,
  4689. 3,
  4690. 46,
  4691. 10,
  4692. 54,
  4693. 9,
  4694. 7,
  4695. 2,
  4696. 37,
  4697. 13,
  4698. 2,
  4699. 9,
  4700. 6,
  4701. 1,
  4702. 45,
  4703. 0,
  4704. 13,
  4705. 2,
  4706. 49,
  4707. 13,
  4708. 9,
  4709. 3,
  4710. 2,
  4711. 11,
  4712. 83,
  4713. 11,
  4714. 7,
  4715. 0,
  4716. 161,
  4717. 11,
  4718. 6,
  4719. 9,
  4720. 7,
  4721. 3,
  4722. 56,
  4723. 1,
  4724. 2,
  4725. 6,
  4726. 3,
  4727. 1,
  4728. 3,
  4729. 2,
  4730. 10,
  4731. 0,
  4732. 11,
  4733. 1,
  4734. 3,
  4735. 6,
  4736. 4,
  4737. 4,
  4738. 193,
  4739. 17,
  4740. 10,
  4741. 9,
  4742. 5,
  4743. 0,
  4744. 82,
  4745. 19,
  4746. 13,
  4747. 9,
  4748. 214,
  4749. 6,
  4750. 3,
  4751. 8,
  4752. 28,
  4753. 1,
  4754. 83,
  4755. 16,
  4756. 16,
  4757. 9,
  4758. 82,
  4759. 12,
  4760. 9,
  4761. 9,
  4762. 84,
  4763. 14,
  4764. 5,
  4765. 9,
  4766. 243,
  4767. 14,
  4768. 166,
  4769. 9,
  4770. 71,
  4771. 5,
  4772. 2,
  4773. 1,
  4774. 3,
  4775. 3,
  4776. 2,
  4777. 0,
  4778. 2,
  4779. 1,
  4780. 13,
  4781. 9,
  4782. 120,
  4783. 6,
  4784. 3,
  4785. 6,
  4786. 4,
  4787. 0,
  4788. 29,
  4789. 9,
  4790. 41,
  4791. 6,
  4792. 2,
  4793. 3,
  4794. 9,
  4795. 0,
  4796. 10,
  4797. 10,
  4798. 47,
  4799. 15,
  4800. 406,
  4801. 7,
  4802. 2,
  4803. 7,
  4804. 17,
  4805. 9,
  4806. 57,
  4807. 21,
  4808. 2,
  4809. 13,
  4810. 123,
  4811. 5,
  4812. 4,
  4813. 0,
  4814. 2,
  4815. 1,
  4816. 2,
  4817. 6,
  4818. 2,
  4819. 0,
  4820. 9,
  4821. 9,
  4822. 49,
  4823. 4,
  4824. 2,
  4825. 1,
  4826. 2,
  4827. 4,
  4828. 9,
  4829. 9,
  4830. 330,
  4831. 3,
  4832. 19306,
  4833. 9,
  4834. 135,
  4835. 4,
  4836. 60,
  4837. 6,
  4838. 26,
  4839. 9,
  4840. 1014,
  4841. 0,
  4842. 2,
  4843. 54,
  4844. 8,
  4845. 3,
  4846. 82,
  4847. 0,
  4848. 12,
  4849. 1,
  4850. 19628,
  4851. 1,
  4852. 5319,
  4853. 4,
  4854. 4,
  4855. 5,
  4856. 9,
  4857. 7,
  4858. 3,
  4859. 6,
  4860. 31,
  4861. 3,
  4862. 149,
  4863. 2,
  4864. 1418,
  4865. 49,
  4866. 513,
  4867. 54,
  4868. 5,
  4869. 49,
  4870. 9,
  4871. 0,
  4872. 15,
  4873. 0,
  4874. 23,
  4875. 4,
  4876. 2,
  4877. 14,
  4878. 1361,
  4879. 6,
  4880. 2,
  4881. 16,
  4882. 3,
  4883. 6,
  4884. 2,
  4885. 1,
  4886. 2,
  4887. 4,
  4888. 262,
  4889. 6,
  4890. 10,
  4891. 9,
  4892. 419,
  4893. 13,
  4894. 1495,
  4895. 6,
  4896. 110,
  4897. 6,
  4898. 6,
  4899. 9,
  4900. 4759,
  4901. 9,
  4902. 787719,
  4903. 239
  4904. ];
  4905. function isInAstralSet(code, set) {
  4906. var pos = 0x10000;
  4907. for(var i = 0, length = set.length; i < length; i += 2){
  4908. pos += set[i];
  4909. if (pos > code) return false;
  4910. pos += set[i + 1];
  4911. if (pos >= code) return true;
  4912. }
  4913. return false;
  4914. }
  4915. function isIdentifierStart(code) {
  4916. if (code < 65) return code === 36;
  4917. if (code <= 90) return true;
  4918. if (code < 97) return code === 95;
  4919. if (code <= 122) return true;
  4920. if (code <= 0xffff) {
  4921. return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code));
  4922. }
  4923. return isInAstralSet(code, astralIdentifierStartCodes);
  4924. }
  4925. function isIdentifierChar(code) {
  4926. if (code < 48) return code === 36;
  4927. if (code < 58) return true;
  4928. if (code < 65) return false;
  4929. if (code <= 90) return true;
  4930. if (code < 97) return code === 95;
  4931. if (code <= 122) return true;
  4932. if (code <= 0xffff) {
  4933. return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code));
  4934. }
  4935. return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes);
  4936. }
  4937. function isIdentifierName(name) {
  4938. var isFirst = true;
  4939. for(var i = 0; i < name.length; i++){
  4940. var cp = name.charCodeAt(i);
  4941. if ((cp & 0xfc00) === 0xd800 && i + 1 < name.length) {
  4942. var trail = name.charCodeAt(++i);
  4943. if ((trail & 0xfc00) === 0xdc00) {
  4944. cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff);
  4945. }
  4946. }
  4947. if (isFirst) {
  4948. isFirst = false;
  4949. if (!isIdentifierStart(cp)) {
  4950. return false;
  4951. }
  4952. } else if (!isIdentifierChar(cp)) {
  4953. return false;
  4954. }
  4955. }
  4956. return !isFirst;
  4957. }
  4958. var keyword = {};
  4959. Object.defineProperty(keyword, "__esModule", {
  4960. value: true
  4961. });
  4962. keyword.isReservedWord = isReservedWord;
  4963. keyword.isStrictReservedWord = isStrictReservedWord;
  4964. keyword.isStrictBindOnlyReservedWord = isStrictBindOnlyReservedWord;
  4965. keyword.isStrictBindReservedWord = isStrictBindReservedWord;
  4966. keyword.isKeyword = isKeyword;
  4967. var reservedWords = {
  4968. keyword: [
  4969. "break",
  4970. "case",
  4971. "catch",
  4972. "continue",
  4973. "debugger",
  4974. "default",
  4975. "do",
  4976. "else",
  4977. "finally",
  4978. "for",
  4979. "function",
  4980. "if",
  4981. "return",
  4982. "switch",
  4983. "throw",
  4984. "try",
  4985. "var",
  4986. "const",
  4987. "while",
  4988. "with",
  4989. "new",
  4990. "this",
  4991. "super",
  4992. "class",
  4993. "extends",
  4994. "export",
  4995. "import",
  4996. "null",
  4997. "true",
  4998. "false",
  4999. "in",
  5000. "instanceof",
  5001. "typeof",
  5002. "void",
  5003. "delete"
  5004. ],
  5005. strict: [
  5006. "implements",
  5007. "interface",
  5008. "let",
  5009. "package",
  5010. "private",
  5011. "protected",
  5012. "public",
  5013. "static",
  5014. "yield"
  5015. ],
  5016. strictBind: [
  5017. "eval",
  5018. "arguments"
  5019. ]
  5020. };
  5021. var keywords = new Set(reservedWords.keyword);
  5022. var reservedWordsStrictSet = new Set(reservedWords.strict);
  5023. var reservedWordsStrictBindSet = new Set(reservedWords.strictBind);
  5024. function isReservedWord(word, inModule) {
  5025. return inModule && word === "await" || word === "enum";
  5026. }
  5027. function isStrictReservedWord(word, inModule) {
  5028. return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word);
  5029. }
  5030. function isStrictBindOnlyReservedWord(word) {
  5031. return reservedWordsStrictBindSet.has(word);
  5032. }
  5033. function isStrictBindReservedWord(word, inModule) {
  5034. return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word);
  5035. }
  5036. function isKeyword(word) {
  5037. return keywords.has(word);
  5038. }
  5039. (function(exports) {
  5040. Object.defineProperty(exports, "__esModule", {
  5041. value: true
  5042. });
  5043. Object.defineProperty(exports, "isIdentifierName", {
  5044. enumerable: true,
  5045. get: function get() {
  5046. return _identifier.isIdentifierName;
  5047. }
  5048. });
  5049. Object.defineProperty(exports, "isIdentifierChar", {
  5050. enumerable: true,
  5051. get: function get() {
  5052. return _identifier.isIdentifierChar;
  5053. }
  5054. });
  5055. Object.defineProperty(exports, "isIdentifierStart", {
  5056. enumerable: true,
  5057. get: function get() {
  5058. return _identifier.isIdentifierStart;
  5059. }
  5060. });
  5061. Object.defineProperty(exports, "isReservedWord", {
  5062. enumerable: true,
  5063. get: function get() {
  5064. return _keyword.isReservedWord;
  5065. }
  5066. });
  5067. Object.defineProperty(exports, "isStrictBindOnlyReservedWord", {
  5068. enumerable: true,
  5069. get: function get() {
  5070. return _keyword.isStrictBindOnlyReservedWord;
  5071. }
  5072. });
  5073. Object.defineProperty(exports, "isStrictBindReservedWord", {
  5074. enumerable: true,
  5075. get: function get() {
  5076. return _keyword.isStrictBindReservedWord;
  5077. }
  5078. });
  5079. Object.defineProperty(exports, "isStrictReservedWord", {
  5080. enumerable: true,
  5081. get: function get() {
  5082. return _keyword.isStrictReservedWord;
  5083. }
  5084. });
  5085. Object.defineProperty(exports, "isKeyword", {
  5086. enumerable: true,
  5087. get: function get() {
  5088. return _keyword.isKeyword;
  5089. }
  5090. });
  5091. var _identifier = identifier$1;
  5092. var _keyword = keyword;
  5093. })(lib);
  5094. Object.defineProperty(isValidIdentifier$1, "__esModule", {
  5095. value: true
  5096. });
  5097. isValidIdentifier$1.default = isValidIdentifier;
  5098. var _helperValidatorIdentifier$1 = lib;
  5099. function isValidIdentifier(name, reserved) {
  5100. if (reserved === void 0) reserved = true;
  5101. if (typeof name !== "string") return false;
  5102. if (reserved) {
  5103. if ((0, _helperValidatorIdentifier$1.isKeyword)(name) || (0, _helperValidatorIdentifier$1.isStrictReservedWord)(name, true)) {
  5104. return false;
  5105. }
  5106. }
  5107. return (0, _helperValidatorIdentifier$1.isIdentifierName)(name);
  5108. }
  5109. var constants = {};
  5110. function _arrayLikeToArray$3(arr, len) {
  5111. if (len == null || len > arr.length) len = arr.length;
  5112. for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
  5113. return arr2;
  5114. }
  5115. function _arrayWithoutHoles$3(arr) {
  5116. if (Array.isArray(arr)) return _arrayLikeToArray$3(arr);
  5117. }
  5118. function _iterableToArray$3(iter) {
  5119. if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
  5120. }
  5121. function _nonIterableSpread$3() {
  5122. throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  5123. }
  5124. function _toConsumableArray$3(arr) {
  5125. return _arrayWithoutHoles$3(arr) || _iterableToArray$3(arr) || _unsupportedIterableToArray$3(arr) || _nonIterableSpread$3();
  5126. }
  5127. function _unsupportedIterableToArray$3(o, minLen) {
  5128. if (!o) return;
  5129. if (typeof o === "string") return _arrayLikeToArray$3(o, minLen);
  5130. var n = Object.prototype.toString.call(o).slice(8, -1);
  5131. if (n === "Object" && o.constructor) n = o.constructor.name;
  5132. if (n === "Map" || n === "Set") return Array.from(n);
  5133. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$3(o, minLen);
  5134. }
  5135. Object.defineProperty(constants, "__esModule", {
  5136. value: true
  5137. });
  5138. constants.NOT_LOCAL_BINDING = constants.BLOCK_SCOPED_SYMBOL = constants.INHERIT_KEYS = constants.UNARY_OPERATORS = constants.STRING_UNARY_OPERATORS = constants.NUMBER_UNARY_OPERATORS = constants.BOOLEAN_UNARY_OPERATORS = constants.ASSIGNMENT_OPERATORS = constants.BINARY_OPERATORS = constants.NUMBER_BINARY_OPERATORS = constants.BOOLEAN_BINARY_OPERATORS = constants.COMPARISON_BINARY_OPERATORS = constants.EQUALITY_BINARY_OPERATORS = constants.BOOLEAN_NUMBER_BINARY_OPERATORS = constants.UPDATE_OPERATORS = constants.LOGICAL_OPERATORS = constants.COMMENT_KEYS = constants.FOR_INIT_KEYS = constants.FLATTENABLE_KEYS = constants.STATEMENT_OR_BLOCK_KEYS = void 0;
  5139. var STATEMENT_OR_BLOCK_KEYS = [
  5140. "consequent",
  5141. "body",
  5142. "alternate"
  5143. ];
  5144. constants.STATEMENT_OR_BLOCK_KEYS = STATEMENT_OR_BLOCK_KEYS;
  5145. var FLATTENABLE_KEYS = [
  5146. "body",
  5147. "expressions"
  5148. ];
  5149. constants.FLATTENABLE_KEYS = FLATTENABLE_KEYS;
  5150. var FOR_INIT_KEYS = [
  5151. "left",
  5152. "init"
  5153. ];
  5154. constants.FOR_INIT_KEYS = FOR_INIT_KEYS;
  5155. var COMMENT_KEYS = [
  5156. "leadingComments",
  5157. "trailingComments",
  5158. "innerComments"
  5159. ];
  5160. constants.COMMENT_KEYS = COMMENT_KEYS;
  5161. var LOGICAL_OPERATORS = [
  5162. "||",
  5163. "&&",
  5164. "??"
  5165. ];
  5166. constants.LOGICAL_OPERATORS = LOGICAL_OPERATORS;
  5167. var UPDATE_OPERATORS = [
  5168. "++",
  5169. "--"
  5170. ];
  5171. constants.UPDATE_OPERATORS = UPDATE_OPERATORS;
  5172. var BOOLEAN_NUMBER_BINARY_OPERATORS = [
  5173. ">",
  5174. "<",
  5175. ">=",
  5176. "<="
  5177. ];
  5178. constants.BOOLEAN_NUMBER_BINARY_OPERATORS = BOOLEAN_NUMBER_BINARY_OPERATORS;
  5179. var EQUALITY_BINARY_OPERATORS = [
  5180. "==",
  5181. "===",
  5182. "!=",
  5183. "!=="
  5184. ];
  5185. constants.EQUALITY_BINARY_OPERATORS = EQUALITY_BINARY_OPERATORS;
  5186. var COMPARISON_BINARY_OPERATORS = _toConsumableArray$3(EQUALITY_BINARY_OPERATORS).concat([
  5187. "in",
  5188. "instanceof"
  5189. ]);
  5190. constants.COMPARISON_BINARY_OPERATORS = COMPARISON_BINARY_OPERATORS;
  5191. var BOOLEAN_BINARY_OPERATORS = _toConsumableArray$3(COMPARISON_BINARY_OPERATORS).concat(_toConsumableArray$3(BOOLEAN_NUMBER_BINARY_OPERATORS));
  5192. constants.BOOLEAN_BINARY_OPERATORS = BOOLEAN_BINARY_OPERATORS;
  5193. var NUMBER_BINARY_OPERATORS = [
  5194. "-",
  5195. "/",
  5196. "%",
  5197. "*",
  5198. "**",
  5199. "&",
  5200. "|",
  5201. ">>",
  5202. ">>>",
  5203. "<<",
  5204. "^"
  5205. ];
  5206. constants.NUMBER_BINARY_OPERATORS = NUMBER_BINARY_OPERATORS;
  5207. var BINARY_OPERATORS = [
  5208. "+"
  5209. ].concat(_toConsumableArray$3(NUMBER_BINARY_OPERATORS), _toConsumableArray$3(BOOLEAN_BINARY_OPERATORS));
  5210. constants.BINARY_OPERATORS = BINARY_OPERATORS;
  5211. var ASSIGNMENT_OPERATORS = [
  5212. "=",
  5213. "+="
  5214. ].concat(_toConsumableArray$3(NUMBER_BINARY_OPERATORS.map(function(op) {
  5215. return op + "=";
  5216. })), _toConsumableArray$3(LOGICAL_OPERATORS.map(function(op) {
  5217. return op + "=";
  5218. })));
  5219. constants.ASSIGNMENT_OPERATORS = ASSIGNMENT_OPERATORS;
  5220. var BOOLEAN_UNARY_OPERATORS = [
  5221. "delete",
  5222. "!"
  5223. ];
  5224. constants.BOOLEAN_UNARY_OPERATORS = BOOLEAN_UNARY_OPERATORS;
  5225. var NUMBER_UNARY_OPERATORS = [
  5226. "+",
  5227. "-",
  5228. "~"
  5229. ];
  5230. constants.NUMBER_UNARY_OPERATORS = NUMBER_UNARY_OPERATORS;
  5231. var STRING_UNARY_OPERATORS = [
  5232. "typeof"
  5233. ];
  5234. constants.STRING_UNARY_OPERATORS = STRING_UNARY_OPERATORS;
  5235. var UNARY_OPERATORS = [
  5236. "void",
  5237. "throw"
  5238. ].concat(_toConsumableArray$3(BOOLEAN_UNARY_OPERATORS), _toConsumableArray$3(NUMBER_UNARY_OPERATORS), _toConsumableArray$3(STRING_UNARY_OPERATORS));
  5239. constants.UNARY_OPERATORS = UNARY_OPERATORS;
  5240. var INHERIT_KEYS = {
  5241. optional: [
  5242. "typeAnnotation",
  5243. "typeParameters",
  5244. "returnType"
  5245. ],
  5246. force: [
  5247. "start",
  5248. "loc",
  5249. "end"
  5250. ]
  5251. };
  5252. constants.INHERIT_KEYS = INHERIT_KEYS;
  5253. var BLOCK_SCOPED_SYMBOL = Symbol.for("var used to be block scoped");
  5254. constants.BLOCK_SCOPED_SYMBOL = BLOCK_SCOPED_SYMBOL;
  5255. var NOT_LOCAL_BINDING = Symbol.for("should not be considered a local binding");
  5256. constants.NOT_LOCAL_BINDING = NOT_LOCAL_BINDING;
  5257. var utils = {};
  5258. var validate = {};
  5259. var hasRequiredValidate;
  5260. function requireValidate() {
  5261. var validate$1 = function validate(node, key, val) {
  5262. if (!node) return;
  5263. var fields = _definitions.NODE_FIELDS[node.type];
  5264. if (!fields) return;
  5265. var field = fields[key];
  5266. validateField(node, key, val, field);
  5267. validateChild(node, key, val);
  5268. };
  5269. var validateField = function validateField(node, key, val, field) {
  5270. if (!(field != null && field.validate)) return;
  5271. if (field.optional && val == null) return;
  5272. field.validate(node, key, val);
  5273. };
  5274. var validateChild = function validateChild(node, key, val) {
  5275. if (val == null) return;
  5276. var validate = _definitions.NODE_PARENT_VALIDATIONS[val.type];
  5277. if (!validate) return;
  5278. validate(node, key, val);
  5279. };
  5280. if (hasRequiredValidate) return validate;
  5281. hasRequiredValidate = 1;
  5282. Object.defineProperty(validate, "__esModule", {
  5283. value: true
  5284. });
  5285. validate.default = validate$1;
  5286. validate.validateField = validateField;
  5287. validate.validateChild = validateChild;
  5288. var _definitions = requireDefinitions();
  5289. return validate;
  5290. }
  5291. function _instanceof(left, right) {
  5292. if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
  5293. return !!right[Symbol.hasInstance](left);
  5294. } else {
  5295. return left instanceof right;
  5296. }
  5297. }
  5298. var _typeof$3 = function(obj) {
  5299. "@swc/helpers - typeof";
  5300. return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
  5301. };
  5302. var hasRequiredUtils;
  5303. function requireUtils() {
  5304. var getType = function getType(val) {
  5305. if (Array.isArray(val)) {
  5306. return "array";
  5307. } else if (val === null) {
  5308. return "null";
  5309. } else {
  5310. return typeof val === "undefined" ? "undefined" : _typeof$3(val);
  5311. }
  5312. };
  5313. var validate = function validate(validate1) {
  5314. return {
  5315. validate: validate1
  5316. };
  5317. };
  5318. var typeIs = function typeIs(typeName) {
  5319. return typeof typeName === "string" ? assertNodeType(typeName) : assertNodeType.apply(void 0, typeName);
  5320. };
  5321. var validateType = function validateType(typeName) {
  5322. return validate(typeIs(typeName));
  5323. };
  5324. var validateOptional = function validateOptional(validate) {
  5325. return {
  5326. validate: validate,
  5327. optional: true
  5328. };
  5329. };
  5330. var validateOptionalType = function validateOptionalType(typeName) {
  5331. return {
  5332. validate: typeIs(typeName),
  5333. optional: true
  5334. };
  5335. };
  5336. var arrayOf = function arrayOf(elementType) {
  5337. return chain(assertValueType("array"), assertEach(elementType));
  5338. };
  5339. var arrayOfType = function arrayOfType(typeName) {
  5340. return arrayOf(typeIs(typeName));
  5341. };
  5342. var validateArrayOfType = function validateArrayOfType(typeName) {
  5343. return validate(arrayOfType(typeName));
  5344. };
  5345. var assertEach = function assertEach(callback) {
  5346. function validator(node, key, val) {
  5347. if (!Array.isArray(val)) return;
  5348. for(var i = 0; i < val.length; i++){
  5349. var subkey = key + "[" + i + "]";
  5350. var v = val[i];
  5351. callback(node, subkey, v);
  5352. if (process.env.BABEL_TYPES_8_BREAKING) (0, _validate.validateChild)(node, subkey, v);
  5353. }
  5354. }
  5355. validator.each = callback;
  5356. return validator;
  5357. };
  5358. var assertOneOf = function assertOneOf() {
  5359. for(var _len = arguments.length, values = new Array(_len), _key = 0; _key < _len; _key++){
  5360. values[_key] = arguments[_key];
  5361. }
  5362. function validate(node, key, val) {
  5363. if (values.indexOf(val) < 0) {
  5364. throw new TypeError("Property " + key + " expected value to be one of " + JSON.stringify(values) + " but got " + JSON.stringify(val));
  5365. }
  5366. }
  5367. validate.oneOf = values;
  5368. return validate;
  5369. };
  5370. var assertNodeType = function assertNodeType() {
  5371. for(var _len = arguments.length, types = new Array(_len), _key = 0; _key < _len; _key++){
  5372. types[_key] = arguments[_key];
  5373. }
  5374. function validate(node, key, val) {
  5375. for(var _i = 0; _i < types.length; _i++){
  5376. var type = types[_i];
  5377. if ((0, _is.default)(type, val)) {
  5378. (0, _validate.validateChild)(node, key, val);
  5379. return;
  5380. }
  5381. }
  5382. throw new TypeError("Property " + key + " of " + node.type + " expected node to be of a type " + JSON.stringify(types) + " but instead got " + JSON.stringify(val == null ? void 0 : val.type));
  5383. }
  5384. validate.oneOfNodeTypes = types;
  5385. return validate;
  5386. };
  5387. var assertNodeOrValueType = function assertNodeOrValueType() {
  5388. for(var _len = arguments.length, types = new Array(_len), _key = 0; _key < _len; _key++){
  5389. types[_key] = arguments[_key];
  5390. }
  5391. function validate(node, key, val) {
  5392. for(var _i = 0; _i < types.length; _i++){
  5393. var type = types[_i];
  5394. if (getType(val) === type || (0, _is.default)(type, val)) {
  5395. (0, _validate.validateChild)(node, key, val);
  5396. return;
  5397. }
  5398. }
  5399. throw new TypeError("Property " + key + " of " + node.type + " expected node to be of a type " + JSON.stringify(types) + " but instead got " + JSON.stringify(val == null ? void 0 : val.type));
  5400. }
  5401. validate.oneOfNodeOrValueTypes = types;
  5402. return validate;
  5403. };
  5404. var assertValueType = function assertValueType(type) {
  5405. function validate(node, key, val) {
  5406. var valid = getType(val) === type;
  5407. if (!valid) {
  5408. throw new TypeError("Property " + key + " expected type of " + type + " but got " + getType(val));
  5409. }
  5410. }
  5411. validate.type = type;
  5412. return validate;
  5413. };
  5414. var assertShape = function assertShape(shape) {
  5415. function validate(node, key, val) {
  5416. var errors = [];
  5417. for(var _i = 0, _iter = Object.keys(shape); _i < _iter.length; _i++){
  5418. var property = _iter[_i];
  5419. try {
  5420. (0, _validate.validateField)(node, property, val[property], shape[property]);
  5421. } catch (error) {
  5422. if (_instanceof(error, TypeError)) {
  5423. errors.push(error.message);
  5424. continue;
  5425. }
  5426. throw error;
  5427. }
  5428. }
  5429. if (errors.length) {
  5430. throw new TypeError("Property " + key + " of " + node.type + " expected to have the following:\n" + errors.join("\n"));
  5431. }
  5432. }
  5433. validate.shapeOf = shape;
  5434. return validate;
  5435. };
  5436. var assertOptionalChainStart = function assertOptionalChainStart() {
  5437. function validate(node) {
  5438. var _current;
  5439. var current = node;
  5440. while(node){
  5441. var type = current.type;
  5442. if (type === "OptionalCallExpression") {
  5443. if (current.optional) return;
  5444. current = current.callee;
  5445. continue;
  5446. }
  5447. if (type === "OptionalMemberExpression") {
  5448. if (current.optional) return;
  5449. current = current.object;
  5450. continue;
  5451. }
  5452. break;
  5453. }
  5454. throw new TypeError("Non-optional " + node.type + " must chain from an optional OptionalMemberExpression or OptionalCallExpression. Found chain from " + ((_current = current) == null ? void 0 : _current.type));
  5455. }
  5456. return validate;
  5457. };
  5458. var chain = function chain() {
  5459. for(var _len = arguments.length, fns = new Array(_len), _key = 0; _key < _len; _key++){
  5460. fns[_key] = arguments[_key];
  5461. }
  5462. function validate() {
  5463. for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
  5464. args[_key] = arguments[_key];
  5465. }
  5466. for(var _i = 0; _i < fns.length; _i++){
  5467. var fn = fns[_i];
  5468. fn.apply(void 0, args);
  5469. }
  5470. }
  5471. validate.chainOf = fns;
  5472. if (fns.length >= 2 && "type" in fns[0] && fns[0].type === "array" && !("each" in fns[1])) {
  5473. throw new Error('An assertValueType("array") validator can only be followed by an assertEach(...) validator.');
  5474. }
  5475. return validate;
  5476. };
  5477. var defineType = function defineType(type, opts) {
  5478. if (opts === void 0) opts = {};
  5479. var inherits = opts.inherits && store[opts.inherits] || {};
  5480. var fields = opts.fields;
  5481. if (!fields) {
  5482. fields = {};
  5483. if (inherits.fields) {
  5484. var keys = Object.getOwnPropertyNames(inherits.fields);
  5485. for(var _i = 0; _i < keys.length; _i++){
  5486. var key = keys[_i];
  5487. var field = inherits.fields[key];
  5488. var def = field.default;
  5489. if (Array.isArray(def) ? def.length > 0 : def && typeof def === "object") {
  5490. throw new Error("field defaults can only be primitives or empty arrays currently");
  5491. }
  5492. fields[key] = {
  5493. default: Array.isArray(def) ? [] : def,
  5494. optional: field.optional,
  5495. validate: field.validate
  5496. };
  5497. }
  5498. }
  5499. }
  5500. var visitor = opts.visitor || inherits.visitor || [];
  5501. var aliases = opts.aliases || inherits.aliases || [];
  5502. var builder = opts.builder || inherits.builder || opts.visitor || [];
  5503. for(var _i1 = 0, _iter = Object.keys(opts); _i1 < _iter.length; _i1++){
  5504. var k = _iter[_i1];
  5505. if (validTypeOpts.indexOf(k) === -1) {
  5506. throw new Error('Unknown type option "' + k + '" on ' + type);
  5507. }
  5508. }
  5509. if (opts.deprecatedAlias) {
  5510. DEPRECATED_KEYS[opts.deprecatedAlias] = type;
  5511. }
  5512. for(var _i2 = 0, _iter1 = visitor.concat(builder); _i2 < _iter1.length; _i2++){
  5513. var key1 = _iter1[_i2];
  5514. fields[key1] = fields[key1] || {};
  5515. }
  5516. for(var _i3 = 0, _iter2 = Object.keys(fields); _i3 < _iter2.length; _i3++){
  5517. var key2 = _iter2[_i3];
  5518. var field1 = fields[key2];
  5519. if (field1.default !== undefined && builder.indexOf(key2) === -1) {
  5520. field1.optional = true;
  5521. }
  5522. if (field1.default === undefined) {
  5523. field1.default = null;
  5524. } else if (!field1.validate && field1.default != null) {
  5525. field1.validate = assertValueType(getType(field1.default));
  5526. }
  5527. for(var _i4 = 0, _iter3 = Object.keys(field1); _i4 < _iter3.length; _i4++){
  5528. var k1 = _iter3[_i4];
  5529. if (validFieldKeys.indexOf(k1) === -1) {
  5530. throw new Error('Unknown field key "' + k1 + '" on ' + type + "." + key2);
  5531. }
  5532. }
  5533. }
  5534. VISITOR_KEYS[type] = opts.visitor = visitor;
  5535. BUILDER_KEYS[type] = opts.builder = builder;
  5536. NODE_FIELDS[type] = opts.fields = fields;
  5537. ALIAS_KEYS[type] = opts.aliases = aliases;
  5538. aliases.forEach(function(alias) {
  5539. FLIPPED_ALIAS_KEYS[alias] = FLIPPED_ALIAS_KEYS[alias] || [];
  5540. FLIPPED_ALIAS_KEYS[alias].push(type);
  5541. });
  5542. if (opts.validate) {
  5543. NODE_PARENT_VALIDATIONS[type] = opts.validate;
  5544. }
  5545. store[type] = opts;
  5546. };
  5547. if (hasRequiredUtils) return utils;
  5548. hasRequiredUtils = 1;
  5549. Object.defineProperty(utils, "__esModule", {
  5550. value: true
  5551. });
  5552. utils.validate = validate;
  5553. utils.typeIs = typeIs;
  5554. utils.validateType = validateType;
  5555. utils.validateOptional = validateOptional;
  5556. utils.validateOptionalType = validateOptionalType;
  5557. utils.arrayOf = arrayOf;
  5558. utils.arrayOfType = arrayOfType;
  5559. utils.validateArrayOfType = validateArrayOfType;
  5560. utils.assertEach = assertEach;
  5561. utils.assertOneOf = assertOneOf;
  5562. utils.assertNodeType = assertNodeType;
  5563. utils.assertNodeOrValueType = assertNodeOrValueType;
  5564. utils.assertValueType = assertValueType;
  5565. utils.assertShape = assertShape;
  5566. utils.assertOptionalChainStart = assertOptionalChainStart;
  5567. utils.chain = chain;
  5568. utils.default = defineType;
  5569. utils.NODE_PARENT_VALIDATIONS = utils.DEPRECATED_KEYS = utils.BUILDER_KEYS = utils.NODE_FIELDS = utils.FLIPPED_ALIAS_KEYS = utils.ALIAS_KEYS = utils.VISITOR_KEYS = void 0;
  5570. var _is = requireIs();
  5571. var _validate = requireValidate();
  5572. var VISITOR_KEYS = {};
  5573. utils.VISITOR_KEYS = VISITOR_KEYS;
  5574. var ALIAS_KEYS = {};
  5575. utils.ALIAS_KEYS = ALIAS_KEYS;
  5576. var FLIPPED_ALIAS_KEYS = {};
  5577. utils.FLIPPED_ALIAS_KEYS = FLIPPED_ALIAS_KEYS;
  5578. var NODE_FIELDS = {};
  5579. utils.NODE_FIELDS = NODE_FIELDS;
  5580. var BUILDER_KEYS = {};
  5581. utils.BUILDER_KEYS = BUILDER_KEYS;
  5582. var DEPRECATED_KEYS = {};
  5583. utils.DEPRECATED_KEYS = DEPRECATED_KEYS;
  5584. var NODE_PARENT_VALIDATIONS = {};
  5585. utils.NODE_PARENT_VALIDATIONS = NODE_PARENT_VALIDATIONS;
  5586. var validTypeOpts = [
  5587. "aliases",
  5588. "builder",
  5589. "deprecatedAlias",
  5590. "fields",
  5591. "inherits",
  5592. "visitor",
  5593. "validate"
  5594. ];
  5595. var validFieldKeys = [
  5596. "default",
  5597. "optional",
  5598. "validate"
  5599. ];
  5600. var store = {};
  5601. return utils;
  5602. }
  5603. function _arrayLikeToArray$2(arr, len) {
  5604. if (len == null || len > arr.length) len = arr.length;
  5605. for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
  5606. return arr2;
  5607. }
  5608. function _arrayWithoutHoles$2(arr) {
  5609. if (Array.isArray(arr)) return _arrayLikeToArray$2(arr);
  5610. }
  5611. function _iterableToArray$2(iter) {
  5612. if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
  5613. }
  5614. function _nonIterableSpread$2() {
  5615. throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  5616. }
  5617. function _toConsumableArray$2(arr) {
  5618. return _arrayWithoutHoles$2(arr) || _iterableToArray$2(arr) || _unsupportedIterableToArray$2(arr) || _nonIterableSpread$2();
  5619. }
  5620. function _unsupportedIterableToArray$2(o, minLen) {
  5621. if (!o) return;
  5622. if (typeof o === "string") return _arrayLikeToArray$2(o, minLen);
  5623. var n = Object.prototype.toString.call(o).slice(8, -1);
  5624. if (n === "Object" && o.constructor) n = o.constructor.name;
  5625. if (n === "Map" || n === "Set") return Array.from(n);
  5626. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$2(o, minLen);
  5627. }
  5628. var hasRequiredCore;
  5629. function requireCore() {
  5630. if (hasRequiredCore) return core;
  5631. hasRequiredCore = 1;
  5632. Object.defineProperty(core, "__esModule", {
  5633. value: true
  5634. });
  5635. core.classMethodOrDeclareMethodCommon = core.classMethodOrPropertyCommon = core.patternLikeCommon = core.functionDeclarationCommon = core.functionTypeAnnotationCommon = core.functionCommon = void 0;
  5636. var _is = requireIs();
  5637. var _isValidIdentifier = isValidIdentifier$1;
  5638. var _helperValidatorIdentifier = lib;
  5639. var _constants = constants;
  5640. var _utils = requireUtils();
  5641. (0, _utils.default)("ArrayExpression", {
  5642. fields: {
  5643. elements: {
  5644. validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeOrValueType)("null", "Expression", "SpreadElement"))),
  5645. default: !process.env.BABEL_TYPES_8_BREAKING ? [] : undefined
  5646. }
  5647. },
  5648. visitor: [
  5649. "elements"
  5650. ],
  5651. aliases: [
  5652. "Expression"
  5653. ]
  5654. });
  5655. (0, _utils.default)("AssignmentExpression", {
  5656. fields: {
  5657. operator: {
  5658. validate: function() {
  5659. if (!process.env.BABEL_TYPES_8_BREAKING) {
  5660. return (0, _utils.assertValueType)("string");
  5661. }
  5662. var identifier = (_utils.assertOneOf).apply(this, _constants.ASSIGNMENT_OPERATORS);
  5663. var pattern = (0, _utils.assertOneOf)("=");
  5664. return function(node, key, val) {
  5665. var validator = (0, _is.default)("Pattern", node.left) ? pattern : identifier;
  5666. validator(node, key, val);
  5667. };
  5668. }()
  5669. },
  5670. left: {
  5671. validate: !process.env.BABEL_TYPES_8_BREAKING ? (0, _utils.assertNodeType)("LVal") : (0, _utils.assertNodeType)("Identifier", "MemberExpression", "ArrayPattern", "ObjectPattern")
  5672. },
  5673. right: {
  5674. validate: (0, _utils.assertNodeType)("Expression")
  5675. }
  5676. },
  5677. builder: [
  5678. "operator",
  5679. "left",
  5680. "right"
  5681. ],
  5682. visitor: [
  5683. "left",
  5684. "right"
  5685. ],
  5686. aliases: [
  5687. "Expression"
  5688. ]
  5689. });
  5690. (0, _utils.default)("BinaryExpression", {
  5691. builder: [
  5692. "operator",
  5693. "left",
  5694. "right"
  5695. ],
  5696. fields: {
  5697. operator: {
  5698. validate: (_utils.assertOneOf).apply(this, _constants.BINARY_OPERATORS)
  5699. },
  5700. left: {
  5701. validate: function() {
  5702. var expression = (0, _utils.assertNodeType)("Expression");
  5703. var inOp = (0, _utils.assertNodeType)("Expression", "PrivateName");
  5704. var validator = function validator(node, key, val) {
  5705. var validator1 = node.operator === "in" ? inOp : expression;
  5706. validator1(node, key, val);
  5707. };
  5708. validator.oneOfNodeTypes = [
  5709. "Expression",
  5710. "PrivateName"
  5711. ];
  5712. return validator;
  5713. }()
  5714. },
  5715. right: {
  5716. validate: (0, _utils.assertNodeType)("Expression")
  5717. }
  5718. },
  5719. visitor: [
  5720. "left",
  5721. "right"
  5722. ],
  5723. aliases: [
  5724. "Binary",
  5725. "Expression"
  5726. ]
  5727. });
  5728. (0, _utils.default)("InterpreterDirective", {
  5729. builder: [
  5730. "value"
  5731. ],
  5732. fields: {
  5733. value: {
  5734. validate: (0, _utils.assertValueType)("string")
  5735. }
  5736. }
  5737. });
  5738. (0, _utils.default)("Directive", {
  5739. visitor: [
  5740. "value"
  5741. ],
  5742. fields: {
  5743. value: {
  5744. validate: (0, _utils.assertNodeType)("DirectiveLiteral")
  5745. }
  5746. }
  5747. });
  5748. (0, _utils.default)("DirectiveLiteral", {
  5749. builder: [
  5750. "value"
  5751. ],
  5752. fields: {
  5753. value: {
  5754. validate: (0, _utils.assertValueType)("string")
  5755. }
  5756. }
  5757. });
  5758. (0, _utils.default)("BlockStatement", {
  5759. builder: [
  5760. "body",
  5761. "directives"
  5762. ],
  5763. visitor: [
  5764. "directives",
  5765. "body"
  5766. ],
  5767. fields: {
  5768. directives: {
  5769. validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Directive"))),
  5770. default: []
  5771. },
  5772. body: {
  5773. validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Statement")))
  5774. }
  5775. },
  5776. aliases: [
  5777. "Scopable",
  5778. "BlockParent",
  5779. "Block",
  5780. "Statement"
  5781. ]
  5782. });
  5783. (0, _utils.default)("BreakStatement", {
  5784. visitor: [
  5785. "label"
  5786. ],
  5787. fields: {
  5788. label: {
  5789. validate: (0, _utils.assertNodeType)("Identifier"),
  5790. optional: true
  5791. }
  5792. },
  5793. aliases: [
  5794. "Statement",
  5795. "Terminatorless",
  5796. "CompletionStatement"
  5797. ]
  5798. });
  5799. (0, _utils.default)("CallExpression", {
  5800. visitor: [
  5801. "callee",
  5802. "arguments",
  5803. "typeParameters",
  5804. "typeArguments"
  5805. ],
  5806. builder: [
  5807. "callee",
  5808. "arguments"
  5809. ],
  5810. aliases: [
  5811. "Expression"
  5812. ],
  5813. fields: Object.assign({
  5814. callee: {
  5815. validate: (0, _utils.assertNodeType)("Expression", "V8IntrinsicIdentifier")
  5816. },
  5817. arguments: {
  5818. validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Expression", "SpreadElement", "JSXNamespacedName", "ArgumentPlaceholder")))
  5819. }
  5820. }, !process.env.BABEL_TYPES_8_BREAKING ? {
  5821. optional: {
  5822. validate: (0, _utils.assertOneOf)(true, false),
  5823. optional: true
  5824. }
  5825. } : {}, {
  5826. typeArguments: {
  5827. validate: (0, _utils.assertNodeType)("TypeParameterInstantiation"),
  5828. optional: true
  5829. },
  5830. typeParameters: {
  5831. validate: (0, _utils.assertNodeType)("TSTypeParameterInstantiation"),
  5832. optional: true
  5833. }
  5834. })
  5835. });
  5836. (0, _utils.default)("CatchClause", {
  5837. visitor: [
  5838. "param",
  5839. "body"
  5840. ],
  5841. fields: {
  5842. param: {
  5843. validate: (0, _utils.assertNodeType)("Identifier", "ArrayPattern", "ObjectPattern"),
  5844. optional: true
  5845. },
  5846. body: {
  5847. validate: (0, _utils.assertNodeType)("BlockStatement")
  5848. }
  5849. },
  5850. aliases: [
  5851. "Scopable",
  5852. "BlockParent"
  5853. ]
  5854. });
  5855. (0, _utils.default)("ConditionalExpression", {
  5856. visitor: [
  5857. "test",
  5858. "consequent",
  5859. "alternate"
  5860. ],
  5861. fields: {
  5862. test: {
  5863. validate: (0, _utils.assertNodeType)("Expression")
  5864. },
  5865. consequent: {
  5866. validate: (0, _utils.assertNodeType)("Expression")
  5867. },
  5868. alternate: {
  5869. validate: (0, _utils.assertNodeType)("Expression")
  5870. }
  5871. },
  5872. aliases: [
  5873. "Expression",
  5874. "Conditional"
  5875. ]
  5876. });
  5877. (0, _utils.default)("ContinueStatement", {
  5878. visitor: [
  5879. "label"
  5880. ],
  5881. fields: {
  5882. label: {
  5883. validate: (0, _utils.assertNodeType)("Identifier"),
  5884. optional: true
  5885. }
  5886. },
  5887. aliases: [
  5888. "Statement",
  5889. "Terminatorless",
  5890. "CompletionStatement"
  5891. ]
  5892. });
  5893. (0, _utils.default)("DebuggerStatement", {
  5894. aliases: [
  5895. "Statement"
  5896. ]
  5897. });
  5898. (0, _utils.default)("DoWhileStatement", {
  5899. visitor: [
  5900. "test",
  5901. "body"
  5902. ],
  5903. fields: {
  5904. test: {
  5905. validate: (0, _utils.assertNodeType)("Expression")
  5906. },
  5907. body: {
  5908. validate: (0, _utils.assertNodeType)("Statement")
  5909. }
  5910. },
  5911. aliases: [
  5912. "Statement",
  5913. "BlockParent",
  5914. "Loop",
  5915. "While",
  5916. "Scopable"
  5917. ]
  5918. });
  5919. (0, _utils.default)("EmptyStatement", {
  5920. aliases: [
  5921. "Statement"
  5922. ]
  5923. });
  5924. (0, _utils.default)("ExpressionStatement", {
  5925. visitor: [
  5926. "expression"
  5927. ],
  5928. fields: {
  5929. expression: {
  5930. validate: (0, _utils.assertNodeType)("Expression")
  5931. }
  5932. },
  5933. aliases: [
  5934. "Statement",
  5935. "ExpressionWrapper"
  5936. ]
  5937. });
  5938. (0, _utils.default)("File", {
  5939. builder: [
  5940. "program",
  5941. "comments",
  5942. "tokens"
  5943. ],
  5944. visitor: [
  5945. "program"
  5946. ],
  5947. fields: {
  5948. program: {
  5949. validate: (0, _utils.assertNodeType)("Program")
  5950. },
  5951. comments: {
  5952. validate: !process.env.BABEL_TYPES_8_BREAKING ? Object.assign(function() {}, {
  5953. each: {
  5954. oneOfNodeTypes: [
  5955. "CommentBlock",
  5956. "CommentLine"
  5957. ]
  5958. }
  5959. }) : (0, _utils.assertEach)((0, _utils.assertNodeType)("CommentBlock", "CommentLine")),
  5960. optional: true
  5961. },
  5962. tokens: {
  5963. validate: (0, _utils.assertEach)(Object.assign(function() {}, {
  5964. type: "any"
  5965. })),
  5966. optional: true
  5967. }
  5968. }
  5969. });
  5970. (0, _utils.default)("ForInStatement", {
  5971. visitor: [
  5972. "left",
  5973. "right",
  5974. "body"
  5975. ],
  5976. aliases: [
  5977. "Scopable",
  5978. "Statement",
  5979. "For",
  5980. "BlockParent",
  5981. "Loop",
  5982. "ForXStatement"
  5983. ],
  5984. fields: {
  5985. left: {
  5986. validate: !process.env.BABEL_TYPES_8_BREAKING ? (0, _utils.assertNodeType)("VariableDeclaration", "LVal") : (0, _utils.assertNodeType)("VariableDeclaration", "Identifier", "MemberExpression", "ArrayPattern", "ObjectPattern")
  5987. },
  5988. right: {
  5989. validate: (0, _utils.assertNodeType)("Expression")
  5990. },
  5991. body: {
  5992. validate: (0, _utils.assertNodeType)("Statement")
  5993. }
  5994. }
  5995. });
  5996. (0, _utils.default)("ForStatement", {
  5997. visitor: [
  5998. "init",
  5999. "test",
  6000. "update",
  6001. "body"
  6002. ],
  6003. aliases: [
  6004. "Scopable",
  6005. "Statement",
  6006. "For",
  6007. "BlockParent",
  6008. "Loop"
  6009. ],
  6010. fields: {
  6011. init: {
  6012. validate: (0, _utils.assertNodeType)("VariableDeclaration", "Expression"),
  6013. optional: true
  6014. },
  6015. test: {
  6016. validate: (0, _utils.assertNodeType)("Expression"),
  6017. optional: true
  6018. },
  6019. update: {
  6020. validate: (0, _utils.assertNodeType)("Expression"),
  6021. optional: true
  6022. },
  6023. body: {
  6024. validate: (0, _utils.assertNodeType)("Statement")
  6025. }
  6026. }
  6027. });
  6028. var functionCommon = {
  6029. params: {
  6030. validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Identifier", "Pattern", "RestElement")))
  6031. },
  6032. generator: {
  6033. default: false
  6034. },
  6035. async: {
  6036. default: false
  6037. }
  6038. };
  6039. core.functionCommon = functionCommon;
  6040. var functionTypeAnnotationCommon = {
  6041. returnType: {
  6042. validate: (0, _utils.assertNodeType)("TypeAnnotation", "TSTypeAnnotation", "Noop"),
  6043. optional: true
  6044. },
  6045. typeParameters: {
  6046. validate: (0, _utils.assertNodeType)("TypeParameterDeclaration", "TSTypeParameterDeclaration", "Noop"),
  6047. optional: true
  6048. }
  6049. };
  6050. core.functionTypeAnnotationCommon = functionTypeAnnotationCommon;
  6051. var functionDeclarationCommon = Object.assign({}, functionCommon, {
  6052. declare: {
  6053. validate: (0, _utils.assertValueType)("boolean"),
  6054. optional: true
  6055. },
  6056. id: {
  6057. validate: (0, _utils.assertNodeType)("Identifier"),
  6058. optional: true
  6059. }
  6060. });
  6061. core.functionDeclarationCommon = functionDeclarationCommon;
  6062. (0, _utils.default)("FunctionDeclaration", {
  6063. builder: [
  6064. "id",
  6065. "params",
  6066. "body",
  6067. "generator",
  6068. "async"
  6069. ],
  6070. visitor: [
  6071. "id",
  6072. "params",
  6073. "body",
  6074. "returnType",
  6075. "typeParameters"
  6076. ],
  6077. fields: Object.assign({}, functionDeclarationCommon, functionTypeAnnotationCommon, {
  6078. body: {
  6079. validate: (0, _utils.assertNodeType)("BlockStatement")
  6080. }
  6081. }),
  6082. aliases: [
  6083. "Scopable",
  6084. "Function",
  6085. "BlockParent",
  6086. "FunctionParent",
  6087. "Statement",
  6088. "Pureish",
  6089. "Declaration"
  6090. ],
  6091. validate: function() {
  6092. if (!process.env.BABEL_TYPES_8_BREAKING) return function() {};
  6093. var identifier = (0, _utils.assertNodeType)("Identifier");
  6094. return function(parent, key, node) {
  6095. if (!(0, _is.default)("ExportDefaultDeclaration", parent)) {
  6096. identifier(node, "id", node.id);
  6097. }
  6098. };
  6099. }()
  6100. });
  6101. (0, _utils.default)("FunctionExpression", {
  6102. inherits: "FunctionDeclaration",
  6103. aliases: [
  6104. "Scopable",
  6105. "Function",
  6106. "BlockParent",
  6107. "FunctionParent",
  6108. "Expression",
  6109. "Pureish"
  6110. ],
  6111. fields: Object.assign({}, functionCommon, functionTypeAnnotationCommon, {
  6112. id: {
  6113. validate: (0, _utils.assertNodeType)("Identifier"),
  6114. optional: true
  6115. },
  6116. body: {
  6117. validate: (0, _utils.assertNodeType)("BlockStatement")
  6118. }
  6119. })
  6120. });
  6121. var patternLikeCommon = {
  6122. typeAnnotation: {
  6123. validate: (0, _utils.assertNodeType)("TypeAnnotation", "TSTypeAnnotation", "Noop"),
  6124. optional: true
  6125. },
  6126. decorators: {
  6127. validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator")))
  6128. }
  6129. };
  6130. core.patternLikeCommon = patternLikeCommon;
  6131. (0, _utils.default)("Identifier", {
  6132. builder: [
  6133. "name"
  6134. ],
  6135. visitor: [
  6136. "typeAnnotation",
  6137. "decorators"
  6138. ],
  6139. aliases: [
  6140. "Expression",
  6141. "PatternLike",
  6142. "LVal",
  6143. "TSEntityName"
  6144. ],
  6145. fields: Object.assign({}, patternLikeCommon, {
  6146. name: {
  6147. validate: (0, _utils.chain)((0, _utils.assertValueType)("string"), Object.assign(function(node, key, val) {
  6148. if (!process.env.BABEL_TYPES_8_BREAKING) return;
  6149. if (!(0, _isValidIdentifier.default)(val, false)) {
  6150. throw new TypeError('"' + val + '" is not a valid identifier name');
  6151. }
  6152. }, {
  6153. type: "string"
  6154. }))
  6155. },
  6156. optional: {
  6157. validate: (0, _utils.assertValueType)("boolean"),
  6158. optional: true
  6159. }
  6160. }),
  6161. validate: function validate(parent, key, node) {
  6162. if (!process.env.BABEL_TYPES_8_BREAKING) return;
  6163. var match = /\.(\w+)$/.exec(key);
  6164. if (!match) return;
  6165. var parentKey = match[1];
  6166. var nonComp = {
  6167. computed: false
  6168. };
  6169. if (parentKey === "property") {
  6170. if ((0, _is.default)("MemberExpression", parent, nonComp)) return;
  6171. if ((0, _is.default)("OptionalMemberExpression", parent, nonComp)) return;
  6172. } else if (parentKey === "key") {
  6173. if ((0, _is.default)("Property", parent, nonComp)) return;
  6174. if ((0, _is.default)("Method", parent, nonComp)) return;
  6175. } else if (parentKey === "exported") {
  6176. if ((0, _is.default)("ExportSpecifier", parent)) return;
  6177. } else if (parentKey === "imported") {
  6178. if ((0, _is.default)("ImportSpecifier", parent, {
  6179. imported: node
  6180. })) return;
  6181. } else if (parentKey === "meta") {
  6182. if ((0, _is.default)("MetaProperty", parent, {
  6183. meta: node
  6184. })) return;
  6185. }
  6186. if (((0, _helperValidatorIdentifier.isKeyword)(node.name) || (0, _helperValidatorIdentifier.isReservedWord)(node.name, false)) && node.name !== "this") {
  6187. throw new TypeError('"' + node.name + '" is not a valid identifier');
  6188. }
  6189. }
  6190. });
  6191. (0, _utils.default)("IfStatement", {
  6192. visitor: [
  6193. "test",
  6194. "consequent",
  6195. "alternate"
  6196. ],
  6197. aliases: [
  6198. "Statement",
  6199. "Conditional"
  6200. ],
  6201. fields: {
  6202. test: {
  6203. validate: (0, _utils.assertNodeType)("Expression")
  6204. },
  6205. consequent: {
  6206. validate: (0, _utils.assertNodeType)("Statement")
  6207. },
  6208. alternate: {
  6209. optional: true,
  6210. validate: (0, _utils.assertNodeType)("Statement")
  6211. }
  6212. }
  6213. });
  6214. (0, _utils.default)("LabeledStatement", {
  6215. visitor: [
  6216. "label",
  6217. "body"
  6218. ],
  6219. aliases: [
  6220. "Statement"
  6221. ],
  6222. fields: {
  6223. label: {
  6224. validate: (0, _utils.assertNodeType)("Identifier")
  6225. },
  6226. body: {
  6227. validate: (0, _utils.assertNodeType)("Statement")
  6228. }
  6229. }
  6230. });
  6231. (0, _utils.default)("StringLiteral", {
  6232. builder: [
  6233. "value"
  6234. ],
  6235. fields: {
  6236. value: {
  6237. validate: (0, _utils.assertValueType)("string")
  6238. }
  6239. },
  6240. aliases: [
  6241. "Expression",
  6242. "Pureish",
  6243. "Literal",
  6244. "Immutable"
  6245. ]
  6246. });
  6247. (0, _utils.default)("NumericLiteral", {
  6248. builder: [
  6249. "value"
  6250. ],
  6251. deprecatedAlias: "NumberLiteral",
  6252. fields: {
  6253. value: {
  6254. validate: (0, _utils.assertValueType)("number")
  6255. }
  6256. },
  6257. aliases: [
  6258. "Expression",
  6259. "Pureish",
  6260. "Literal",
  6261. "Immutable"
  6262. ]
  6263. });
  6264. (0, _utils.default)("NullLiteral", {
  6265. aliases: [
  6266. "Expression",
  6267. "Pureish",
  6268. "Literal",
  6269. "Immutable"
  6270. ]
  6271. });
  6272. (0, _utils.default)("BooleanLiteral", {
  6273. builder: [
  6274. "value"
  6275. ],
  6276. fields: {
  6277. value: {
  6278. validate: (0, _utils.assertValueType)("boolean")
  6279. }
  6280. },
  6281. aliases: [
  6282. "Expression",
  6283. "Pureish",
  6284. "Literal",
  6285. "Immutable"
  6286. ]
  6287. });
  6288. (0, _utils.default)("RegExpLiteral", {
  6289. builder: [
  6290. "pattern",
  6291. "flags"
  6292. ],
  6293. deprecatedAlias: "RegexLiteral",
  6294. aliases: [
  6295. "Expression",
  6296. "Pureish",
  6297. "Literal"
  6298. ],
  6299. fields: {
  6300. pattern: {
  6301. validate: (0, _utils.assertValueType)("string")
  6302. },
  6303. flags: {
  6304. validate: (0, _utils.chain)((0, _utils.assertValueType)("string"), Object.assign(function(node, key, val) {
  6305. if (!process.env.BABEL_TYPES_8_BREAKING) return;
  6306. var invalid = /[^gimsuy]/.exec(val);
  6307. if (invalid) {
  6308. throw new TypeError('"' + invalid[0] + '" is not a valid RegExp flag');
  6309. }
  6310. }, {
  6311. type: "string"
  6312. })),
  6313. default: ""
  6314. }
  6315. }
  6316. });
  6317. (0, _utils.default)("LogicalExpression", {
  6318. builder: [
  6319. "operator",
  6320. "left",
  6321. "right"
  6322. ],
  6323. visitor: [
  6324. "left",
  6325. "right"
  6326. ],
  6327. aliases: [
  6328. "Binary",
  6329. "Expression"
  6330. ],
  6331. fields: {
  6332. operator: {
  6333. validate: (_utils.assertOneOf).apply(this, _constants.LOGICAL_OPERATORS)
  6334. },
  6335. left: {
  6336. validate: (0, _utils.assertNodeType)("Expression")
  6337. },
  6338. right: {
  6339. validate: (0, _utils.assertNodeType)("Expression")
  6340. }
  6341. }
  6342. });
  6343. (0, _utils.default)("MemberExpression", {
  6344. builder: [
  6345. "object",
  6346. "property",
  6347. "computed"
  6348. ].concat(_toConsumableArray$2(!process.env.BABEL_TYPES_8_BREAKING ? [
  6349. "optional"
  6350. ] : [])),
  6351. visitor: [
  6352. "object",
  6353. "property"
  6354. ],
  6355. aliases: [
  6356. "Expression",
  6357. "LVal"
  6358. ],
  6359. fields: Object.assign({
  6360. object: {
  6361. validate: (0, _utils.assertNodeType)("Expression")
  6362. },
  6363. property: {
  6364. validate: function() {
  6365. var normal = (0, _utils.assertNodeType)("Identifier", "PrivateName");
  6366. var computed = (0, _utils.assertNodeType)("Expression");
  6367. var validator = function validator(node, key, val) {
  6368. var validator1 = node.computed ? computed : normal;
  6369. validator1(node, key, val);
  6370. };
  6371. validator.oneOfNodeTypes = [
  6372. "Expression",
  6373. "Identifier",
  6374. "PrivateName"
  6375. ];
  6376. return validator;
  6377. }()
  6378. },
  6379. computed: {
  6380. default: false
  6381. }
  6382. }, !process.env.BABEL_TYPES_8_BREAKING ? {
  6383. optional: {
  6384. validate: (0, _utils.assertOneOf)(true, false),
  6385. optional: true
  6386. }
  6387. } : {})
  6388. });
  6389. (0, _utils.default)("NewExpression", {
  6390. inherits: "CallExpression"
  6391. });
  6392. (0, _utils.default)("Program", {
  6393. visitor: [
  6394. "directives",
  6395. "body"
  6396. ],
  6397. builder: [
  6398. "body",
  6399. "directives",
  6400. "sourceType",
  6401. "interpreter"
  6402. ],
  6403. fields: {
  6404. sourceFile: {
  6405. validate: (0, _utils.assertValueType)("string")
  6406. },
  6407. sourceType: {
  6408. validate: (0, _utils.assertOneOf)("script", "module"),
  6409. default: "script"
  6410. },
  6411. interpreter: {
  6412. validate: (0, _utils.assertNodeType)("InterpreterDirective"),
  6413. default: null,
  6414. optional: true
  6415. },
  6416. directives: {
  6417. validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Directive"))),
  6418. default: []
  6419. },
  6420. body: {
  6421. validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Statement")))
  6422. }
  6423. },
  6424. aliases: [
  6425. "Scopable",
  6426. "BlockParent",
  6427. "Block"
  6428. ]
  6429. });
  6430. (0, _utils.default)("ObjectExpression", {
  6431. visitor: [
  6432. "properties"
  6433. ],
  6434. aliases: [
  6435. "Expression"
  6436. ],
  6437. fields: {
  6438. properties: {
  6439. validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("ObjectMethod", "ObjectProperty", "SpreadElement")))
  6440. }
  6441. }
  6442. });
  6443. (0, _utils.default)("ObjectMethod", {
  6444. builder: [
  6445. "kind",
  6446. "key",
  6447. "params",
  6448. "body",
  6449. "computed",
  6450. "generator",
  6451. "async"
  6452. ],
  6453. fields: Object.assign({}, functionCommon, functionTypeAnnotationCommon, {
  6454. kind: Object.assign({
  6455. validate: (0, _utils.assertOneOf)("method", "get", "set")
  6456. }, !process.env.BABEL_TYPES_8_BREAKING ? {
  6457. default: "method"
  6458. } : {}),
  6459. computed: {
  6460. default: false
  6461. },
  6462. key: {
  6463. validate: function() {
  6464. var normal = (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral");
  6465. var computed = (0, _utils.assertNodeType)("Expression");
  6466. var validator = function validator(node, key, val) {
  6467. var validator1 = node.computed ? computed : normal;
  6468. validator1(node, key, val);
  6469. };
  6470. validator.oneOfNodeTypes = [
  6471. "Expression",
  6472. "Identifier",
  6473. "StringLiteral",
  6474. "NumericLiteral"
  6475. ];
  6476. return validator;
  6477. }()
  6478. },
  6479. decorators: {
  6480. validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))),
  6481. optional: true
  6482. },
  6483. body: {
  6484. validate: (0, _utils.assertNodeType)("BlockStatement")
  6485. }
  6486. }),
  6487. visitor: [
  6488. "key",
  6489. "params",
  6490. "body",
  6491. "decorators",
  6492. "returnType",
  6493. "typeParameters"
  6494. ],
  6495. aliases: [
  6496. "UserWhitespacable",
  6497. "Function",
  6498. "Scopable",
  6499. "BlockParent",
  6500. "FunctionParent",
  6501. "Method",
  6502. "ObjectMember"
  6503. ]
  6504. });
  6505. (0, _utils.default)("ObjectProperty", {
  6506. builder: [
  6507. "key",
  6508. "value",
  6509. "computed",
  6510. "shorthand"
  6511. ].concat(_toConsumableArray$2(!process.env.BABEL_TYPES_8_BREAKING ? [
  6512. "decorators"
  6513. ] : [])),
  6514. fields: {
  6515. computed: {
  6516. default: false
  6517. },
  6518. key: {
  6519. validate: function() {
  6520. var normal = (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral");
  6521. var computed = (0, _utils.assertNodeType)("Expression");
  6522. var validator = function validator(node, key, val) {
  6523. var validator1 = node.computed ? computed : normal;
  6524. validator1(node, key, val);
  6525. };
  6526. validator.oneOfNodeTypes = [
  6527. "Expression",
  6528. "Identifier",
  6529. "StringLiteral",
  6530. "NumericLiteral"
  6531. ];
  6532. return validator;
  6533. }()
  6534. },
  6535. value: {
  6536. validate: (0, _utils.assertNodeType)("Expression", "PatternLike")
  6537. },
  6538. shorthand: {
  6539. validate: (0, _utils.chain)((0, _utils.assertValueType)("boolean"), Object.assign(function(node, key, val) {
  6540. if (!process.env.BABEL_TYPES_8_BREAKING) return;
  6541. if (val && node.computed) {
  6542. throw new TypeError("Property shorthand of ObjectProperty cannot be true if computed is true");
  6543. }
  6544. }, {
  6545. type: "boolean"
  6546. }), function(node, key, val) {
  6547. if (!process.env.BABEL_TYPES_8_BREAKING) return;
  6548. if (val && !(0, _is.default)("Identifier", node.key)) {
  6549. throw new TypeError("Property shorthand of ObjectProperty cannot be true if key is not an Identifier");
  6550. }
  6551. }),
  6552. default: false
  6553. },
  6554. decorators: {
  6555. validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))),
  6556. optional: true
  6557. }
  6558. },
  6559. visitor: [
  6560. "key",
  6561. "value",
  6562. "decorators"
  6563. ],
  6564. aliases: [
  6565. "UserWhitespacable",
  6566. "Property",
  6567. "ObjectMember"
  6568. ],
  6569. validate: function() {
  6570. var pattern = (0, _utils.assertNodeType)("Identifier", "Pattern");
  6571. var expression = (0, _utils.assertNodeType)("Expression");
  6572. return function(parent, key, node) {
  6573. if (!process.env.BABEL_TYPES_8_BREAKING) return;
  6574. var validator = (0, _is.default)("ObjectPattern", parent) ? pattern : expression;
  6575. validator(node, "value", node.value);
  6576. };
  6577. }()
  6578. });
  6579. (0, _utils.default)("RestElement", {
  6580. visitor: [
  6581. "argument",
  6582. "typeAnnotation"
  6583. ],
  6584. builder: [
  6585. "argument"
  6586. ],
  6587. aliases: [
  6588. "LVal",
  6589. "PatternLike"
  6590. ],
  6591. deprecatedAlias: "RestProperty",
  6592. fields: Object.assign({}, patternLikeCommon, {
  6593. argument: {
  6594. validate: !process.env.BABEL_TYPES_8_BREAKING ? (0, _utils.assertNodeType)("LVal") : (0, _utils.assertNodeType)("Identifier", "Pattern", "MemberExpression")
  6595. },
  6596. optional: {
  6597. validate: (0, _utils.assertValueType)("boolean"),
  6598. optional: true
  6599. }
  6600. }),
  6601. validate: function validate(parent, key) {
  6602. if (!process.env.BABEL_TYPES_8_BREAKING) return;
  6603. var match = /(\w+)\[(\d+)\]/.exec(key);
  6604. if (!match) throw new Error("Internal Babel error: malformed key.");
  6605. var listKey = match[1], index = match[2];
  6606. if (parent[listKey].length > index + 1) {
  6607. throw new TypeError("RestElement must be last element of " + listKey);
  6608. }
  6609. }
  6610. });
  6611. (0, _utils.default)("ReturnStatement", {
  6612. visitor: [
  6613. "argument"
  6614. ],
  6615. aliases: [
  6616. "Statement",
  6617. "Terminatorless",
  6618. "CompletionStatement"
  6619. ],
  6620. fields: {
  6621. argument: {
  6622. validate: (0, _utils.assertNodeType)("Expression"),
  6623. optional: true
  6624. }
  6625. }
  6626. });
  6627. (0, _utils.default)("SequenceExpression", {
  6628. visitor: [
  6629. "expressions"
  6630. ],
  6631. fields: {
  6632. expressions: {
  6633. validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Expression")))
  6634. }
  6635. },
  6636. aliases: [
  6637. "Expression"
  6638. ]
  6639. });
  6640. (0, _utils.default)("ParenthesizedExpression", {
  6641. visitor: [
  6642. "expression"
  6643. ],
  6644. aliases: [
  6645. "Expression",
  6646. "ExpressionWrapper"
  6647. ],
  6648. fields: {
  6649. expression: {
  6650. validate: (0, _utils.assertNodeType)("Expression")
  6651. }
  6652. }
  6653. });
  6654. (0, _utils.default)("SwitchCase", {
  6655. visitor: [
  6656. "test",
  6657. "consequent"
  6658. ],
  6659. fields: {
  6660. test: {
  6661. validate: (0, _utils.assertNodeType)("Expression"),
  6662. optional: true
  6663. },
  6664. consequent: {
  6665. validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Statement")))
  6666. }
  6667. }
  6668. });
  6669. (0, _utils.default)("SwitchStatement", {
  6670. visitor: [
  6671. "discriminant",
  6672. "cases"
  6673. ],
  6674. aliases: [
  6675. "Statement",
  6676. "BlockParent",
  6677. "Scopable"
  6678. ],
  6679. fields: {
  6680. discriminant: {
  6681. validate: (0, _utils.assertNodeType)("Expression")
  6682. },
  6683. cases: {
  6684. validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("SwitchCase")))
  6685. }
  6686. }
  6687. });
  6688. (0, _utils.default)("ThisExpression", {
  6689. aliases: [
  6690. "Expression"
  6691. ]
  6692. });
  6693. (0, _utils.default)("ThrowStatement", {
  6694. visitor: [
  6695. "argument"
  6696. ],
  6697. aliases: [
  6698. "Statement",
  6699. "Terminatorless",
  6700. "CompletionStatement"
  6701. ],
  6702. fields: {
  6703. argument: {
  6704. validate: (0, _utils.assertNodeType)("Expression")
  6705. }
  6706. }
  6707. });
  6708. (0, _utils.default)("TryStatement", {
  6709. visitor: [
  6710. "block",
  6711. "handler",
  6712. "finalizer"
  6713. ],
  6714. aliases: [
  6715. "Statement"
  6716. ],
  6717. fields: {
  6718. block: {
  6719. validate: (0, _utils.chain)((0, _utils.assertNodeType)("BlockStatement"), Object.assign(function(node) {
  6720. if (!process.env.BABEL_TYPES_8_BREAKING) return;
  6721. if (!node.handler && !node.finalizer) {
  6722. throw new TypeError("TryStatement expects either a handler or finalizer, or both");
  6723. }
  6724. }, {
  6725. oneOfNodeTypes: [
  6726. "BlockStatement"
  6727. ]
  6728. }))
  6729. },
  6730. handler: {
  6731. optional: true,
  6732. validate: (0, _utils.assertNodeType)("CatchClause")
  6733. },
  6734. finalizer: {
  6735. optional: true,
  6736. validate: (0, _utils.assertNodeType)("BlockStatement")
  6737. }
  6738. }
  6739. });
  6740. (0, _utils.default)("UnaryExpression", {
  6741. builder: [
  6742. "operator",
  6743. "argument",
  6744. "prefix"
  6745. ],
  6746. fields: {
  6747. prefix: {
  6748. default: true
  6749. },
  6750. argument: {
  6751. validate: (0, _utils.assertNodeType)("Expression")
  6752. },
  6753. operator: {
  6754. validate: (_utils.assertOneOf).apply(this, _constants.UNARY_OPERATORS)
  6755. }
  6756. },
  6757. visitor: [
  6758. "argument"
  6759. ],
  6760. aliases: [
  6761. "UnaryLike",
  6762. "Expression"
  6763. ]
  6764. });
  6765. (0, _utils.default)("UpdateExpression", {
  6766. builder: [
  6767. "operator",
  6768. "argument",
  6769. "prefix"
  6770. ],
  6771. fields: {
  6772. prefix: {
  6773. default: false
  6774. },
  6775. argument: {
  6776. validate: !process.env.BABEL_TYPES_8_BREAKING ? (0, _utils.assertNodeType)("Expression") : (0, _utils.assertNodeType)("Identifier", "MemberExpression")
  6777. },
  6778. operator: {
  6779. validate: (_utils.assertOneOf).apply(this, _constants.UPDATE_OPERATORS)
  6780. }
  6781. },
  6782. visitor: [
  6783. "argument"
  6784. ],
  6785. aliases: [
  6786. "Expression"
  6787. ]
  6788. });
  6789. (0, _utils.default)("VariableDeclaration", {
  6790. builder: [
  6791. "kind",
  6792. "declarations"
  6793. ],
  6794. visitor: [
  6795. "declarations"
  6796. ],
  6797. aliases: [
  6798. "Statement",
  6799. "Declaration"
  6800. ],
  6801. fields: {
  6802. declare: {
  6803. validate: (0, _utils.assertValueType)("boolean"),
  6804. optional: true
  6805. },
  6806. kind: {
  6807. validate: (0, _utils.assertOneOf)("var", "let", "const")
  6808. },
  6809. declarations: {
  6810. validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("VariableDeclarator")))
  6811. }
  6812. },
  6813. validate: function validate(parent, key, node) {
  6814. if (!process.env.BABEL_TYPES_8_BREAKING) return;
  6815. if (!(0, _is.default)("ForXStatement", parent, {
  6816. left: node
  6817. })) return;
  6818. if (node.declarations.length !== 1) {
  6819. throw new TypeError("Exactly one VariableDeclarator is required in the VariableDeclaration of a " + parent.type);
  6820. }
  6821. }
  6822. });
  6823. (0, _utils.default)("VariableDeclarator", {
  6824. visitor: [
  6825. "id",
  6826. "init"
  6827. ],
  6828. fields: {
  6829. id: {
  6830. validate: function() {
  6831. if (!process.env.BABEL_TYPES_8_BREAKING) {
  6832. return (0, _utils.assertNodeType)("LVal");
  6833. }
  6834. var normal = (0, _utils.assertNodeType)("Identifier", "ArrayPattern", "ObjectPattern");
  6835. var without = (0, _utils.assertNodeType)("Identifier");
  6836. return function(node, key, val) {
  6837. var validator = node.init ? normal : without;
  6838. validator(node, key, val);
  6839. };
  6840. }()
  6841. },
  6842. definite: {
  6843. optional: true,
  6844. validate: (0, _utils.assertValueType)("boolean")
  6845. },
  6846. init: {
  6847. optional: true,
  6848. validate: (0, _utils.assertNodeType)("Expression")
  6849. }
  6850. }
  6851. });
  6852. (0, _utils.default)("WhileStatement", {
  6853. visitor: [
  6854. "test",
  6855. "body"
  6856. ],
  6857. aliases: [
  6858. "Statement",
  6859. "BlockParent",
  6860. "Loop",
  6861. "While",
  6862. "Scopable"
  6863. ],
  6864. fields: {
  6865. test: {
  6866. validate: (0, _utils.assertNodeType)("Expression")
  6867. },
  6868. body: {
  6869. validate: (0, _utils.assertNodeType)("Statement")
  6870. }
  6871. }
  6872. });
  6873. (0, _utils.default)("WithStatement", {
  6874. visitor: [
  6875. "object",
  6876. "body"
  6877. ],
  6878. aliases: [
  6879. "Statement"
  6880. ],
  6881. fields: {
  6882. object: {
  6883. validate: (0, _utils.assertNodeType)("Expression")
  6884. },
  6885. body: {
  6886. validate: (0, _utils.assertNodeType)("Statement")
  6887. }
  6888. }
  6889. });
  6890. (0, _utils.default)("AssignmentPattern", {
  6891. visitor: [
  6892. "left",
  6893. "right",
  6894. "decorators"
  6895. ],
  6896. builder: [
  6897. "left",
  6898. "right"
  6899. ],
  6900. aliases: [
  6901. "Pattern",
  6902. "PatternLike",
  6903. "LVal"
  6904. ],
  6905. fields: Object.assign({}, patternLikeCommon, {
  6906. left: {
  6907. validate: (0, _utils.assertNodeType)("Identifier", "ObjectPattern", "ArrayPattern", "MemberExpression")
  6908. },
  6909. right: {
  6910. validate: (0, _utils.assertNodeType)("Expression")
  6911. },
  6912. decorators: {
  6913. validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))),
  6914. optional: true
  6915. }
  6916. })
  6917. });
  6918. (0, _utils.default)("ArrayPattern", {
  6919. visitor: [
  6920. "elements",
  6921. "typeAnnotation"
  6922. ],
  6923. builder: [
  6924. "elements"
  6925. ],
  6926. aliases: [
  6927. "Pattern",
  6928. "PatternLike",
  6929. "LVal"
  6930. ],
  6931. fields: Object.assign({}, patternLikeCommon, {
  6932. elements: {
  6933. validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeOrValueType)("null", "PatternLike")))
  6934. },
  6935. decorators: {
  6936. validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))),
  6937. optional: true
  6938. },
  6939. optional: {
  6940. validate: (0, _utils.assertValueType)("boolean"),
  6941. optional: true
  6942. }
  6943. })
  6944. });
  6945. (0, _utils.default)("ArrowFunctionExpression", {
  6946. builder: [
  6947. "params",
  6948. "body",
  6949. "async"
  6950. ],
  6951. visitor: [
  6952. "params",
  6953. "body",
  6954. "returnType",
  6955. "typeParameters"
  6956. ],
  6957. aliases: [
  6958. "Scopable",
  6959. "Function",
  6960. "BlockParent",
  6961. "FunctionParent",
  6962. "Expression",
  6963. "Pureish"
  6964. ],
  6965. fields: Object.assign({}, functionCommon, functionTypeAnnotationCommon, {
  6966. expression: {
  6967. validate: (0, _utils.assertValueType)("boolean")
  6968. },
  6969. body: {
  6970. validate: (0, _utils.assertNodeType)("BlockStatement", "Expression")
  6971. }
  6972. })
  6973. });
  6974. (0, _utils.default)("ClassBody", {
  6975. visitor: [
  6976. "body"
  6977. ],
  6978. fields: {
  6979. body: {
  6980. validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("ClassMethod", "ClassPrivateMethod", "ClassProperty", "ClassPrivateProperty", "TSDeclareMethod", "TSIndexSignature")))
  6981. }
  6982. }
  6983. });
  6984. (0, _utils.default)("ClassExpression", {
  6985. builder: [
  6986. "id",
  6987. "superClass",
  6988. "body",
  6989. "decorators"
  6990. ],
  6991. visitor: [
  6992. "id",
  6993. "body",
  6994. "superClass",
  6995. "mixins",
  6996. "typeParameters",
  6997. "superTypeParameters",
  6998. "implements",
  6999. "decorators"
  7000. ],
  7001. aliases: [
  7002. "Scopable",
  7003. "Class",
  7004. "Expression"
  7005. ],
  7006. fields: {
  7007. id: {
  7008. validate: (0, _utils.assertNodeType)("Identifier"),
  7009. optional: true
  7010. },
  7011. typeParameters: {
  7012. validate: (0, _utils.assertNodeType)("TypeParameterDeclaration", "TSTypeParameterDeclaration", "Noop"),
  7013. optional: true
  7014. },
  7015. body: {
  7016. validate: (0, _utils.assertNodeType)("ClassBody")
  7017. },
  7018. superClass: {
  7019. optional: true,
  7020. validate: (0, _utils.assertNodeType)("Expression")
  7021. },
  7022. superTypeParameters: {
  7023. validate: (0, _utils.assertNodeType)("TypeParameterInstantiation", "TSTypeParameterInstantiation"),
  7024. optional: true
  7025. },
  7026. implements: {
  7027. validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("TSExpressionWithTypeArguments", "ClassImplements"))),
  7028. optional: true
  7029. },
  7030. decorators: {
  7031. validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))),
  7032. optional: true
  7033. },
  7034. mixins: {
  7035. validate: (0, _utils.assertNodeType)("InterfaceExtends"),
  7036. optional: true
  7037. }
  7038. }
  7039. });
  7040. (0, _utils.default)("ClassDeclaration", {
  7041. inherits: "ClassExpression",
  7042. aliases: [
  7043. "Scopable",
  7044. "Class",
  7045. "Statement",
  7046. "Declaration"
  7047. ],
  7048. fields: {
  7049. id: {
  7050. validate: (0, _utils.assertNodeType)("Identifier")
  7051. },
  7052. typeParameters: {
  7053. validate: (0, _utils.assertNodeType)("TypeParameterDeclaration", "TSTypeParameterDeclaration", "Noop"),
  7054. optional: true
  7055. },
  7056. body: {
  7057. validate: (0, _utils.assertNodeType)("ClassBody")
  7058. },
  7059. superClass: {
  7060. optional: true,
  7061. validate: (0, _utils.assertNodeType)("Expression")
  7062. },
  7063. superTypeParameters: {
  7064. validate: (0, _utils.assertNodeType)("TypeParameterInstantiation", "TSTypeParameterInstantiation"),
  7065. optional: true
  7066. },
  7067. implements: {
  7068. validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("TSExpressionWithTypeArguments", "ClassImplements"))),
  7069. optional: true
  7070. },
  7071. decorators: {
  7072. validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))),
  7073. optional: true
  7074. },
  7075. mixins: {
  7076. validate: (0, _utils.assertNodeType)("InterfaceExtends"),
  7077. optional: true
  7078. },
  7079. declare: {
  7080. validate: (0, _utils.assertValueType)("boolean"),
  7081. optional: true
  7082. },
  7083. abstract: {
  7084. validate: (0, _utils.assertValueType)("boolean"),
  7085. optional: true
  7086. }
  7087. },
  7088. validate: function() {
  7089. var identifier = (0, _utils.assertNodeType)("Identifier");
  7090. return function(parent, key, node) {
  7091. if (!process.env.BABEL_TYPES_8_BREAKING) return;
  7092. if (!(0, _is.default)("ExportDefaultDeclaration", parent)) {
  7093. identifier(node, "id", node.id);
  7094. }
  7095. };
  7096. }()
  7097. });
  7098. (0, _utils.default)("ExportAllDeclaration", {
  7099. visitor: [
  7100. "source"
  7101. ],
  7102. aliases: [
  7103. "Statement",
  7104. "Declaration",
  7105. "ModuleDeclaration",
  7106. "ExportDeclaration"
  7107. ],
  7108. fields: {
  7109. source: {
  7110. validate: (0, _utils.assertNodeType)("StringLiteral")
  7111. },
  7112. exportKind: (0, _utils.validateOptional)((0, _utils.assertOneOf)("type", "value")),
  7113. assertions: {
  7114. optional: true,
  7115. validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("ImportAttribute")))
  7116. }
  7117. }
  7118. });
  7119. (0, _utils.default)("ExportDefaultDeclaration", {
  7120. visitor: [
  7121. "declaration"
  7122. ],
  7123. aliases: [
  7124. "Statement",
  7125. "Declaration",
  7126. "ModuleDeclaration",
  7127. "ExportDeclaration"
  7128. ],
  7129. fields: {
  7130. declaration: {
  7131. validate: (0, _utils.assertNodeType)("FunctionDeclaration", "TSDeclareFunction", "ClassDeclaration", "Expression")
  7132. },
  7133. exportKind: (0, _utils.validateOptional)((0, _utils.assertOneOf)("value"))
  7134. }
  7135. });
  7136. (0, _utils.default)("ExportNamedDeclaration", {
  7137. visitor: [
  7138. "declaration",
  7139. "specifiers",
  7140. "source"
  7141. ],
  7142. aliases: [
  7143. "Statement",
  7144. "Declaration",
  7145. "ModuleDeclaration",
  7146. "ExportDeclaration"
  7147. ],
  7148. fields: {
  7149. declaration: {
  7150. optional: true,
  7151. validate: (0, _utils.chain)((0, _utils.assertNodeType)("Declaration"), Object.assign(function(node, key, val) {
  7152. if (!process.env.BABEL_TYPES_8_BREAKING) return;
  7153. if (val && node.specifiers.length) {
  7154. throw new TypeError("Only declaration or specifiers is allowed on ExportNamedDeclaration");
  7155. }
  7156. }, {
  7157. oneOfNodeTypes: [
  7158. "Declaration"
  7159. ]
  7160. }), function(node, key, val) {
  7161. if (!process.env.BABEL_TYPES_8_BREAKING) return;
  7162. if (val && node.source) {
  7163. throw new TypeError("Cannot export a declaration from a source");
  7164. }
  7165. })
  7166. },
  7167. assertions: {
  7168. optional: true,
  7169. validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("ImportAttribute")))
  7170. },
  7171. specifiers: {
  7172. default: [],
  7173. validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)(function() {
  7174. var sourced = (0, _utils.assertNodeType)("ExportSpecifier", "ExportDefaultSpecifier", "ExportNamespaceSpecifier");
  7175. var sourceless = (0, _utils.assertNodeType)("ExportSpecifier");
  7176. if (!process.env.BABEL_TYPES_8_BREAKING) return sourced;
  7177. return function(node, key, val) {
  7178. var validator = node.source ? sourced : sourceless;
  7179. validator(node, key, val);
  7180. };
  7181. }()))
  7182. },
  7183. source: {
  7184. validate: (0, _utils.assertNodeType)("StringLiteral"),
  7185. optional: true
  7186. },
  7187. exportKind: (0, _utils.validateOptional)((0, _utils.assertOneOf)("type", "value"))
  7188. }
  7189. });
  7190. (0, _utils.default)("ExportSpecifier", {
  7191. visitor: [
  7192. "local",
  7193. "exported"
  7194. ],
  7195. aliases: [
  7196. "ModuleSpecifier"
  7197. ],
  7198. fields: {
  7199. local: {
  7200. validate: (0, _utils.assertNodeType)("Identifier")
  7201. },
  7202. exported: {
  7203. validate: (0, _utils.assertNodeType)("Identifier", "StringLiteral")
  7204. }
  7205. }
  7206. });
  7207. (0, _utils.default)("ForOfStatement", {
  7208. visitor: [
  7209. "left",
  7210. "right",
  7211. "body"
  7212. ],
  7213. builder: [
  7214. "left",
  7215. "right",
  7216. "body",
  7217. "await"
  7218. ],
  7219. aliases: [
  7220. "Scopable",
  7221. "Statement",
  7222. "For",
  7223. "BlockParent",
  7224. "Loop",
  7225. "ForXStatement"
  7226. ],
  7227. fields: {
  7228. left: {
  7229. validate: function() {
  7230. if (!process.env.BABEL_TYPES_8_BREAKING) {
  7231. return (0, _utils.assertNodeType)("VariableDeclaration", "LVal");
  7232. }
  7233. var declaration = (0, _utils.assertNodeType)("VariableDeclaration");
  7234. var lval = (0, _utils.assertNodeType)("Identifier", "MemberExpression", "ArrayPattern", "ObjectPattern");
  7235. return function(node, key, val) {
  7236. if ((0, _is.default)("VariableDeclaration", val)) {
  7237. declaration(node, key, val);
  7238. } else {
  7239. lval(node, key, val);
  7240. }
  7241. };
  7242. }()
  7243. },
  7244. right: {
  7245. validate: (0, _utils.assertNodeType)("Expression")
  7246. },
  7247. body: {
  7248. validate: (0, _utils.assertNodeType)("Statement")
  7249. },
  7250. await: {
  7251. default: false
  7252. }
  7253. }
  7254. });
  7255. (0, _utils.default)("ImportDeclaration", {
  7256. visitor: [
  7257. "specifiers",
  7258. "source"
  7259. ],
  7260. aliases: [
  7261. "Statement",
  7262. "Declaration",
  7263. "ModuleDeclaration"
  7264. ],
  7265. fields: {
  7266. assertions: {
  7267. optional: true,
  7268. validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("ImportAttribute")))
  7269. },
  7270. specifiers: {
  7271. validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("ImportSpecifier", "ImportDefaultSpecifier", "ImportNamespaceSpecifier")))
  7272. },
  7273. source: {
  7274. validate: (0, _utils.assertNodeType)("StringLiteral")
  7275. },
  7276. importKind: {
  7277. validate: (0, _utils.assertOneOf)("type", "typeof", "value"),
  7278. optional: true
  7279. }
  7280. }
  7281. });
  7282. (0, _utils.default)("ImportDefaultSpecifier", {
  7283. visitor: [
  7284. "local"
  7285. ],
  7286. aliases: [
  7287. "ModuleSpecifier"
  7288. ],
  7289. fields: {
  7290. local: {
  7291. validate: (0, _utils.assertNodeType)("Identifier")
  7292. }
  7293. }
  7294. });
  7295. (0, _utils.default)("ImportNamespaceSpecifier", {
  7296. visitor: [
  7297. "local"
  7298. ],
  7299. aliases: [
  7300. "ModuleSpecifier"
  7301. ],
  7302. fields: {
  7303. local: {
  7304. validate: (0, _utils.assertNodeType)("Identifier")
  7305. }
  7306. }
  7307. });
  7308. (0, _utils.default)("ImportSpecifier", {
  7309. visitor: [
  7310. "local",
  7311. "imported"
  7312. ],
  7313. aliases: [
  7314. "ModuleSpecifier"
  7315. ],
  7316. fields: {
  7317. local: {
  7318. validate: (0, _utils.assertNodeType)("Identifier")
  7319. },
  7320. imported: {
  7321. validate: (0, _utils.assertNodeType)("Identifier", "StringLiteral")
  7322. },
  7323. importKind: {
  7324. validate: (0, _utils.assertOneOf)("type", "typeof"),
  7325. optional: true
  7326. }
  7327. }
  7328. });
  7329. (0, _utils.default)("MetaProperty", {
  7330. visitor: [
  7331. "meta",
  7332. "property"
  7333. ],
  7334. aliases: [
  7335. "Expression"
  7336. ],
  7337. fields: {
  7338. meta: {
  7339. validate: (0, _utils.chain)((0, _utils.assertNodeType)("Identifier"), Object.assign(function(node, key, val) {
  7340. if (!process.env.BABEL_TYPES_8_BREAKING) return;
  7341. var property;
  7342. switch(val.name){
  7343. case "function":
  7344. property = "sent";
  7345. break;
  7346. case "new":
  7347. property = "target";
  7348. break;
  7349. case "import":
  7350. property = "meta";
  7351. break;
  7352. }
  7353. if (!(0, _is.default)("Identifier", node.property, {
  7354. name: property
  7355. })) {
  7356. throw new TypeError("Unrecognised MetaProperty");
  7357. }
  7358. }, {
  7359. oneOfNodeTypes: [
  7360. "Identifier"
  7361. ]
  7362. }))
  7363. },
  7364. property: {
  7365. validate: (0, _utils.assertNodeType)("Identifier")
  7366. }
  7367. }
  7368. });
  7369. var classMethodOrPropertyCommon = {
  7370. abstract: {
  7371. validate: (0, _utils.assertValueType)("boolean"),
  7372. optional: true
  7373. },
  7374. accessibility: {
  7375. validate: (0, _utils.assertOneOf)("public", "private", "protected"),
  7376. optional: true
  7377. },
  7378. static: {
  7379. default: false
  7380. },
  7381. override: {
  7382. default: false
  7383. },
  7384. computed: {
  7385. default: false
  7386. },
  7387. optional: {
  7388. validate: (0, _utils.assertValueType)("boolean"),
  7389. optional: true
  7390. },
  7391. key: {
  7392. validate: (0, _utils.chain)(function() {
  7393. var normal = (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral");
  7394. var computed = (0, _utils.assertNodeType)("Expression");
  7395. return function(node, key, val) {
  7396. var validator = node.computed ? computed : normal;
  7397. validator(node, key, val);
  7398. };
  7399. }(), (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral", "Expression"))
  7400. }
  7401. };
  7402. core.classMethodOrPropertyCommon = classMethodOrPropertyCommon;
  7403. var classMethodOrDeclareMethodCommon = Object.assign({}, functionCommon, classMethodOrPropertyCommon, {
  7404. params: {
  7405. validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Identifier", "Pattern", "RestElement", "TSParameterProperty")))
  7406. },
  7407. kind: {
  7408. validate: (0, _utils.assertOneOf)("get", "set", "method", "constructor"),
  7409. default: "method"
  7410. },
  7411. access: {
  7412. validate: (0, _utils.chain)((0, _utils.assertValueType)("string"), (0, _utils.assertOneOf)("public", "private", "protected")),
  7413. optional: true
  7414. },
  7415. decorators: {
  7416. validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))),
  7417. optional: true
  7418. }
  7419. });
  7420. core.classMethodOrDeclareMethodCommon = classMethodOrDeclareMethodCommon;
  7421. (0, _utils.default)("ClassMethod", {
  7422. aliases: [
  7423. "Function",
  7424. "Scopable",
  7425. "BlockParent",
  7426. "FunctionParent",
  7427. "Method"
  7428. ],
  7429. builder: [
  7430. "kind",
  7431. "key",
  7432. "params",
  7433. "body",
  7434. "computed",
  7435. "static",
  7436. "generator",
  7437. "async"
  7438. ],
  7439. visitor: [
  7440. "key",
  7441. "params",
  7442. "body",
  7443. "decorators",
  7444. "returnType",
  7445. "typeParameters"
  7446. ],
  7447. fields: Object.assign({}, classMethodOrDeclareMethodCommon, functionTypeAnnotationCommon, {
  7448. body: {
  7449. validate: (0, _utils.assertNodeType)("BlockStatement")
  7450. }
  7451. })
  7452. });
  7453. (0, _utils.default)("ObjectPattern", {
  7454. visitor: [
  7455. "properties",
  7456. "typeAnnotation",
  7457. "decorators"
  7458. ],
  7459. builder: [
  7460. "properties"
  7461. ],
  7462. aliases: [
  7463. "Pattern",
  7464. "PatternLike",
  7465. "LVal"
  7466. ],
  7467. fields: Object.assign({}, patternLikeCommon, {
  7468. properties: {
  7469. validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("RestElement", "ObjectProperty")))
  7470. }
  7471. })
  7472. });
  7473. (0, _utils.default)("SpreadElement", {
  7474. visitor: [
  7475. "argument"
  7476. ],
  7477. aliases: [
  7478. "UnaryLike"
  7479. ],
  7480. deprecatedAlias: "SpreadProperty",
  7481. fields: {
  7482. argument: {
  7483. validate: (0, _utils.assertNodeType)("Expression")
  7484. }
  7485. }
  7486. });
  7487. (0, _utils.default)("Super", {
  7488. aliases: [
  7489. "Expression"
  7490. ]
  7491. });
  7492. (0, _utils.default)("TaggedTemplateExpression", {
  7493. visitor: [
  7494. "tag",
  7495. "quasi",
  7496. "typeParameters"
  7497. ],
  7498. builder: [
  7499. "tag",
  7500. "quasi"
  7501. ],
  7502. aliases: [
  7503. "Expression"
  7504. ],
  7505. fields: {
  7506. tag: {
  7507. validate: (0, _utils.assertNodeType)("Expression")
  7508. },
  7509. quasi: {
  7510. validate: (0, _utils.assertNodeType)("TemplateLiteral")
  7511. },
  7512. typeParameters: {
  7513. validate: (0, _utils.assertNodeType)("TypeParameterInstantiation", "TSTypeParameterInstantiation"),
  7514. optional: true
  7515. }
  7516. }
  7517. });
  7518. (0, _utils.default)("TemplateElement", {
  7519. builder: [
  7520. "value",
  7521. "tail"
  7522. ],
  7523. fields: {
  7524. value: {
  7525. validate: (0, _utils.assertShape)({
  7526. raw: {
  7527. validate: (0, _utils.assertValueType)("string")
  7528. },
  7529. cooked: {
  7530. validate: (0, _utils.assertValueType)("string"),
  7531. optional: true
  7532. }
  7533. })
  7534. },
  7535. tail: {
  7536. default: false
  7537. }
  7538. }
  7539. });
  7540. (0, _utils.default)("TemplateLiteral", {
  7541. visitor: [
  7542. "quasis",
  7543. "expressions"
  7544. ],
  7545. aliases: [
  7546. "Expression",
  7547. "Literal"
  7548. ],
  7549. fields: {
  7550. quasis: {
  7551. validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("TemplateElement")))
  7552. },
  7553. expressions: {
  7554. validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Expression", "TSType")), function(node, key, val) {
  7555. if (node.quasis.length !== val.length + 1) {
  7556. throw new TypeError("Number of " + node.type + " quasis should be exactly one more than the number of expressions.\nExpected " + (val.length + 1) + " quasis but got " + node.quasis.length);
  7557. }
  7558. })
  7559. }
  7560. }
  7561. });
  7562. (0, _utils.default)("YieldExpression", {
  7563. builder: [
  7564. "argument",
  7565. "delegate"
  7566. ],
  7567. visitor: [
  7568. "argument"
  7569. ],
  7570. aliases: [
  7571. "Expression",
  7572. "Terminatorless"
  7573. ],
  7574. fields: {
  7575. delegate: {
  7576. validate: (0, _utils.chain)((0, _utils.assertValueType)("boolean"), Object.assign(function(node, key, val) {
  7577. if (!process.env.BABEL_TYPES_8_BREAKING) return;
  7578. if (val && !node.argument) {
  7579. throw new TypeError("Property delegate of YieldExpression cannot be true if there is no argument");
  7580. }
  7581. }, {
  7582. type: "boolean"
  7583. })),
  7584. default: false
  7585. },
  7586. argument: {
  7587. optional: true,
  7588. validate: (0, _utils.assertNodeType)("Expression")
  7589. }
  7590. }
  7591. });
  7592. (0, _utils.default)("AwaitExpression", {
  7593. builder: [
  7594. "argument"
  7595. ],
  7596. visitor: [
  7597. "argument"
  7598. ],
  7599. aliases: [
  7600. "Expression",
  7601. "Terminatorless"
  7602. ],
  7603. fields: {
  7604. argument: {
  7605. validate: (0, _utils.assertNodeType)("Expression")
  7606. }
  7607. }
  7608. });
  7609. (0, _utils.default)("Import", {
  7610. aliases: [
  7611. "Expression"
  7612. ]
  7613. });
  7614. (0, _utils.default)("BigIntLiteral", {
  7615. builder: [
  7616. "value"
  7617. ],
  7618. fields: {
  7619. value: {
  7620. validate: (0, _utils.assertValueType)("string")
  7621. }
  7622. },
  7623. aliases: [
  7624. "Expression",
  7625. "Pureish",
  7626. "Literal",
  7627. "Immutable"
  7628. ]
  7629. });
  7630. (0, _utils.default)("ExportNamespaceSpecifier", {
  7631. visitor: [
  7632. "exported"
  7633. ],
  7634. aliases: [
  7635. "ModuleSpecifier"
  7636. ],
  7637. fields: {
  7638. exported: {
  7639. validate: (0, _utils.assertNodeType)("Identifier")
  7640. }
  7641. }
  7642. });
  7643. (0, _utils.default)("OptionalMemberExpression", {
  7644. builder: [
  7645. "object",
  7646. "property",
  7647. "computed",
  7648. "optional"
  7649. ],
  7650. visitor: [
  7651. "object",
  7652. "property"
  7653. ],
  7654. aliases: [
  7655. "Expression"
  7656. ],
  7657. fields: {
  7658. object: {
  7659. validate: (0, _utils.assertNodeType)("Expression")
  7660. },
  7661. property: {
  7662. validate: function() {
  7663. var normal = (0, _utils.assertNodeType)("Identifier");
  7664. var computed = (0, _utils.assertNodeType)("Expression");
  7665. var validator = function validator(node, key, val) {
  7666. var validator1 = node.computed ? computed : normal;
  7667. validator1(node, key, val);
  7668. };
  7669. validator.oneOfNodeTypes = [
  7670. "Expression",
  7671. "Identifier"
  7672. ];
  7673. return validator;
  7674. }()
  7675. },
  7676. computed: {
  7677. default: false
  7678. },
  7679. optional: {
  7680. validate: !process.env.BABEL_TYPES_8_BREAKING ? (0, _utils.assertValueType)("boolean") : (0, _utils.chain)((0, _utils.assertValueType)("boolean"), (0, _utils.assertOptionalChainStart)())
  7681. }
  7682. }
  7683. });
  7684. (0, _utils.default)("OptionalCallExpression", {
  7685. visitor: [
  7686. "callee",
  7687. "arguments",
  7688. "typeParameters",
  7689. "typeArguments"
  7690. ],
  7691. builder: [
  7692. "callee",
  7693. "arguments",
  7694. "optional"
  7695. ],
  7696. aliases: [
  7697. "Expression"
  7698. ],
  7699. fields: {
  7700. callee: {
  7701. validate: (0, _utils.assertNodeType)("Expression")
  7702. },
  7703. arguments: {
  7704. validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Expression", "SpreadElement", "JSXNamespacedName", "ArgumentPlaceholder")))
  7705. },
  7706. optional: {
  7707. validate: !process.env.BABEL_TYPES_8_BREAKING ? (0, _utils.assertValueType)("boolean") : (0, _utils.chain)((0, _utils.assertValueType)("boolean"), (0, _utils.assertOptionalChainStart)())
  7708. },
  7709. typeArguments: {
  7710. validate: (0, _utils.assertNodeType)("TypeParameterInstantiation"),
  7711. optional: true
  7712. },
  7713. typeParameters: {
  7714. validate: (0, _utils.assertNodeType)("TSTypeParameterInstantiation"),
  7715. optional: true
  7716. }
  7717. }
  7718. });
  7719. (0, _utils.default)("ClassProperty", {
  7720. visitor: [
  7721. "key",
  7722. "value",
  7723. "typeAnnotation",
  7724. "decorators"
  7725. ],
  7726. builder: [
  7727. "key",
  7728. "value",
  7729. "typeAnnotation",
  7730. "decorators",
  7731. "computed",
  7732. "static"
  7733. ],
  7734. aliases: [
  7735. "Property"
  7736. ],
  7737. fields: Object.assign({}, classMethodOrPropertyCommon, {
  7738. value: {
  7739. validate: (0, _utils.assertNodeType)("Expression"),
  7740. optional: true
  7741. },
  7742. definite: {
  7743. validate: (0, _utils.assertValueType)("boolean"),
  7744. optional: true
  7745. },
  7746. typeAnnotation: {
  7747. validate: (0, _utils.assertNodeType)("TypeAnnotation", "TSTypeAnnotation", "Noop"),
  7748. optional: true
  7749. },
  7750. decorators: {
  7751. validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))),
  7752. optional: true
  7753. },
  7754. readonly: {
  7755. validate: (0, _utils.assertValueType)("boolean"),
  7756. optional: true
  7757. },
  7758. declare: {
  7759. validate: (0, _utils.assertValueType)("boolean"),
  7760. optional: true
  7761. },
  7762. variance: {
  7763. validate: (0, _utils.assertNodeType)("Variance"),
  7764. optional: true
  7765. }
  7766. })
  7767. });
  7768. (0, _utils.default)("ClassPrivateProperty", {
  7769. visitor: [
  7770. "key",
  7771. "value",
  7772. "decorators",
  7773. "typeAnnotation"
  7774. ],
  7775. builder: [
  7776. "key",
  7777. "value",
  7778. "decorators",
  7779. "static"
  7780. ],
  7781. aliases: [
  7782. "Property",
  7783. "Private"
  7784. ],
  7785. fields: {
  7786. key: {
  7787. validate: (0, _utils.assertNodeType)("PrivateName")
  7788. },
  7789. value: {
  7790. validate: (0, _utils.assertNodeType)("Expression"),
  7791. optional: true
  7792. },
  7793. typeAnnotation: {
  7794. validate: (0, _utils.assertNodeType)("TypeAnnotation", "TSTypeAnnotation", "Noop"),
  7795. optional: true
  7796. },
  7797. decorators: {
  7798. validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))),
  7799. optional: true
  7800. },
  7801. readonly: {
  7802. validate: (0, _utils.assertValueType)("boolean"),
  7803. optional: true
  7804. },
  7805. definite: {
  7806. validate: (0, _utils.assertValueType)("boolean"),
  7807. optional: true
  7808. },
  7809. variance: {
  7810. validate: (0, _utils.assertNodeType)("Variance"),
  7811. optional: true
  7812. }
  7813. }
  7814. });
  7815. (0, _utils.default)("ClassPrivateMethod", {
  7816. builder: [
  7817. "kind",
  7818. "key",
  7819. "params",
  7820. "body",
  7821. "static"
  7822. ],
  7823. visitor: [
  7824. "key",
  7825. "params",
  7826. "body",
  7827. "decorators",
  7828. "returnType",
  7829. "typeParameters"
  7830. ],
  7831. aliases: [
  7832. "Function",
  7833. "Scopable",
  7834. "BlockParent",
  7835. "FunctionParent",
  7836. "Method",
  7837. "Private"
  7838. ],
  7839. fields: Object.assign({}, classMethodOrDeclareMethodCommon, functionTypeAnnotationCommon, {
  7840. key: {
  7841. validate: (0, _utils.assertNodeType)("PrivateName")
  7842. },
  7843. body: {
  7844. validate: (0, _utils.assertNodeType)("BlockStatement")
  7845. }
  7846. })
  7847. });
  7848. (0, _utils.default)("PrivateName", {
  7849. visitor: [
  7850. "id"
  7851. ],
  7852. aliases: [
  7853. "Private"
  7854. ],
  7855. fields: {
  7856. id: {
  7857. validate: (0, _utils.assertNodeType)("Identifier")
  7858. }
  7859. }
  7860. });
  7861. return core;
  7862. }
  7863. var flow = {};
  7864. var hasRequiredFlow;
  7865. function requireFlow() {
  7866. if (hasRequiredFlow) return flow;
  7867. hasRequiredFlow = 1;
  7868. var _utils = requireUtils();
  7869. var defineInterfaceishType = function(name, typeParameterType) {
  7870. if (typeParameterType === void 0) typeParameterType = "TypeParameterDeclaration";
  7871. (0, _utils.default)(name, {
  7872. builder: [
  7873. "id",
  7874. "typeParameters",
  7875. "extends",
  7876. "body"
  7877. ],
  7878. visitor: [
  7879. "id",
  7880. "typeParameters",
  7881. "extends",
  7882. "mixins",
  7883. "implements",
  7884. "body"
  7885. ],
  7886. aliases: [
  7887. "Flow",
  7888. "FlowDeclaration",
  7889. "Statement",
  7890. "Declaration"
  7891. ],
  7892. fields: {
  7893. id: (0, _utils.validateType)("Identifier"),
  7894. typeParameters: (0, _utils.validateOptionalType)(typeParameterType),
  7895. extends: (0, _utils.validateOptional)((0, _utils.arrayOfType)("InterfaceExtends")),
  7896. mixins: (0, _utils.validateOptional)((0, _utils.arrayOfType)("InterfaceExtends")),
  7897. implements: (0, _utils.validateOptional)((0, _utils.arrayOfType)("ClassImplements")),
  7898. body: (0, _utils.validateType)("ObjectTypeAnnotation")
  7899. }
  7900. });
  7901. };
  7902. (0, _utils.default)("AnyTypeAnnotation", {
  7903. aliases: [
  7904. "Flow",
  7905. "FlowType",
  7906. "FlowBaseAnnotation"
  7907. ]
  7908. });
  7909. (0, _utils.default)("ArrayTypeAnnotation", {
  7910. visitor: [
  7911. "elementType"
  7912. ],
  7913. aliases: [
  7914. "Flow",
  7915. "FlowType"
  7916. ],
  7917. fields: {
  7918. elementType: (0, _utils.validateType)("FlowType")
  7919. }
  7920. });
  7921. (0, _utils.default)("BooleanTypeAnnotation", {
  7922. aliases: [
  7923. "Flow",
  7924. "FlowType",
  7925. "FlowBaseAnnotation"
  7926. ]
  7927. });
  7928. (0, _utils.default)("BooleanLiteralTypeAnnotation", {
  7929. builder: [
  7930. "value"
  7931. ],
  7932. aliases: [
  7933. "Flow",
  7934. "FlowType"
  7935. ],
  7936. fields: {
  7937. value: (0, _utils.validate)((0, _utils.assertValueType)("boolean"))
  7938. }
  7939. });
  7940. (0, _utils.default)("NullLiteralTypeAnnotation", {
  7941. aliases: [
  7942. "Flow",
  7943. "FlowType",
  7944. "FlowBaseAnnotation"
  7945. ]
  7946. });
  7947. (0, _utils.default)("ClassImplements", {
  7948. visitor: [
  7949. "id",
  7950. "typeParameters"
  7951. ],
  7952. aliases: [
  7953. "Flow"
  7954. ],
  7955. fields: {
  7956. id: (0, _utils.validateType)("Identifier"),
  7957. typeParameters: (0, _utils.validateOptionalType)("TypeParameterInstantiation")
  7958. }
  7959. });
  7960. defineInterfaceishType("DeclareClass");
  7961. (0, _utils.default)("DeclareFunction", {
  7962. visitor: [
  7963. "id"
  7964. ],
  7965. aliases: [
  7966. "Flow",
  7967. "FlowDeclaration",
  7968. "Statement",
  7969. "Declaration"
  7970. ],
  7971. fields: {
  7972. id: (0, _utils.validateType)("Identifier"),
  7973. predicate: (0, _utils.validateOptionalType)("DeclaredPredicate")
  7974. }
  7975. });
  7976. defineInterfaceishType("DeclareInterface");
  7977. (0, _utils.default)("DeclareModule", {
  7978. builder: [
  7979. "id",
  7980. "body",
  7981. "kind"
  7982. ],
  7983. visitor: [
  7984. "id",
  7985. "body"
  7986. ],
  7987. aliases: [
  7988. "Flow",
  7989. "FlowDeclaration",
  7990. "Statement",
  7991. "Declaration"
  7992. ],
  7993. fields: {
  7994. id: (0, _utils.validateType)([
  7995. "Identifier",
  7996. "StringLiteral"
  7997. ]),
  7998. body: (0, _utils.validateType)("BlockStatement"),
  7999. kind: (0, _utils.validateOptional)((0, _utils.assertOneOf)("CommonJS", "ES"))
  8000. }
  8001. });
  8002. (0, _utils.default)("DeclareModuleExports", {
  8003. visitor: [
  8004. "typeAnnotation"
  8005. ],
  8006. aliases: [
  8007. "Flow",
  8008. "FlowDeclaration",
  8009. "Statement",
  8010. "Declaration"
  8011. ],
  8012. fields: {
  8013. typeAnnotation: (0, _utils.validateType)("TypeAnnotation")
  8014. }
  8015. });
  8016. (0, _utils.default)("DeclareTypeAlias", {
  8017. visitor: [
  8018. "id",
  8019. "typeParameters",
  8020. "right"
  8021. ],
  8022. aliases: [
  8023. "Flow",
  8024. "FlowDeclaration",
  8025. "Statement",
  8026. "Declaration"
  8027. ],
  8028. fields: {
  8029. id: (0, _utils.validateType)("Identifier"),
  8030. typeParameters: (0, _utils.validateOptionalType)("TypeParameterDeclaration"),
  8031. right: (0, _utils.validateType)("FlowType")
  8032. }
  8033. });
  8034. (0, _utils.default)("DeclareOpaqueType", {
  8035. visitor: [
  8036. "id",
  8037. "typeParameters",
  8038. "supertype"
  8039. ],
  8040. aliases: [
  8041. "Flow",
  8042. "FlowDeclaration",
  8043. "Statement",
  8044. "Declaration"
  8045. ],
  8046. fields: {
  8047. id: (0, _utils.validateType)("Identifier"),
  8048. typeParameters: (0, _utils.validateOptionalType)("TypeParameterDeclaration"),
  8049. supertype: (0, _utils.validateOptionalType)("FlowType"),
  8050. impltype: (0, _utils.validateOptionalType)("FlowType")
  8051. }
  8052. });
  8053. (0, _utils.default)("DeclareVariable", {
  8054. visitor: [
  8055. "id"
  8056. ],
  8057. aliases: [
  8058. "Flow",
  8059. "FlowDeclaration",
  8060. "Statement",
  8061. "Declaration"
  8062. ],
  8063. fields: {
  8064. id: (0, _utils.validateType)("Identifier")
  8065. }
  8066. });
  8067. (0, _utils.default)("DeclareExportDeclaration", {
  8068. visitor: [
  8069. "declaration",
  8070. "specifiers",
  8071. "source"
  8072. ],
  8073. aliases: [
  8074. "Flow",
  8075. "FlowDeclaration",
  8076. "Statement",
  8077. "Declaration"
  8078. ],
  8079. fields: {
  8080. declaration: (0, _utils.validateOptionalType)("Flow"),
  8081. specifiers: (0, _utils.validateOptional)((0, _utils.arrayOfType)([
  8082. "ExportSpecifier",
  8083. "ExportNamespaceSpecifier"
  8084. ])),
  8085. source: (0, _utils.validateOptionalType)("StringLiteral"),
  8086. default: (0, _utils.validateOptional)((0, _utils.assertValueType)("boolean"))
  8087. }
  8088. });
  8089. (0, _utils.default)("DeclareExportAllDeclaration", {
  8090. visitor: [
  8091. "source"
  8092. ],
  8093. aliases: [
  8094. "Flow",
  8095. "FlowDeclaration",
  8096. "Statement",
  8097. "Declaration"
  8098. ],
  8099. fields: {
  8100. source: (0, _utils.validateType)("StringLiteral"),
  8101. exportKind: (0, _utils.validateOptional)((0, _utils.assertOneOf)("type", "value"))
  8102. }
  8103. });
  8104. (0, _utils.default)("DeclaredPredicate", {
  8105. visitor: [
  8106. "value"
  8107. ],
  8108. aliases: [
  8109. "Flow",
  8110. "FlowPredicate"
  8111. ],
  8112. fields: {
  8113. value: (0, _utils.validateType)("Flow")
  8114. }
  8115. });
  8116. (0, _utils.default)("ExistsTypeAnnotation", {
  8117. aliases: [
  8118. "Flow",
  8119. "FlowType"
  8120. ]
  8121. });
  8122. (0, _utils.default)("FunctionTypeAnnotation", {
  8123. visitor: [
  8124. "typeParameters",
  8125. "params",
  8126. "rest",
  8127. "returnType"
  8128. ],
  8129. aliases: [
  8130. "Flow",
  8131. "FlowType"
  8132. ],
  8133. fields: {
  8134. typeParameters: (0, _utils.validateOptionalType)("TypeParameterDeclaration"),
  8135. params: (0, _utils.validate)((0, _utils.arrayOfType)("FunctionTypeParam")),
  8136. rest: (0, _utils.validateOptionalType)("FunctionTypeParam"),
  8137. this: (0, _utils.validateOptionalType)("FunctionTypeParam"),
  8138. returnType: (0, _utils.validateType)("FlowType")
  8139. }
  8140. });
  8141. (0, _utils.default)("FunctionTypeParam", {
  8142. visitor: [
  8143. "name",
  8144. "typeAnnotation"
  8145. ],
  8146. aliases: [
  8147. "Flow"
  8148. ],
  8149. fields: {
  8150. name: (0, _utils.validateOptionalType)("Identifier"),
  8151. typeAnnotation: (0, _utils.validateType)("FlowType"),
  8152. optional: (0, _utils.validateOptional)((0, _utils.assertValueType)("boolean"))
  8153. }
  8154. });
  8155. (0, _utils.default)("GenericTypeAnnotation", {
  8156. visitor: [
  8157. "id",
  8158. "typeParameters"
  8159. ],
  8160. aliases: [
  8161. "Flow",
  8162. "FlowType"
  8163. ],
  8164. fields: {
  8165. id: (0, _utils.validateType)([
  8166. "Identifier",
  8167. "QualifiedTypeIdentifier"
  8168. ]),
  8169. typeParameters: (0, _utils.validateOptionalType)("TypeParameterInstantiation")
  8170. }
  8171. });
  8172. (0, _utils.default)("InferredPredicate", {
  8173. aliases: [
  8174. "Flow",
  8175. "FlowPredicate"
  8176. ]
  8177. });
  8178. (0, _utils.default)("InterfaceExtends", {
  8179. visitor: [
  8180. "id",
  8181. "typeParameters"
  8182. ],
  8183. aliases: [
  8184. "Flow"
  8185. ],
  8186. fields: {
  8187. id: (0, _utils.validateType)([
  8188. "Identifier",
  8189. "QualifiedTypeIdentifier"
  8190. ]),
  8191. typeParameters: (0, _utils.validateOptionalType)("TypeParameterInstantiation")
  8192. }
  8193. });
  8194. defineInterfaceishType("InterfaceDeclaration");
  8195. (0, _utils.default)("InterfaceTypeAnnotation", {
  8196. visitor: [
  8197. "extends",
  8198. "body"
  8199. ],
  8200. aliases: [
  8201. "Flow",
  8202. "FlowType"
  8203. ],
  8204. fields: {
  8205. extends: (0, _utils.validateOptional)((0, _utils.arrayOfType)("InterfaceExtends")),
  8206. body: (0, _utils.validateType)("ObjectTypeAnnotation")
  8207. }
  8208. });
  8209. (0, _utils.default)("IntersectionTypeAnnotation", {
  8210. visitor: [
  8211. "types"
  8212. ],
  8213. aliases: [
  8214. "Flow",
  8215. "FlowType"
  8216. ],
  8217. fields: {
  8218. types: (0, _utils.validate)((0, _utils.arrayOfType)("FlowType"))
  8219. }
  8220. });
  8221. (0, _utils.default)("MixedTypeAnnotation", {
  8222. aliases: [
  8223. "Flow",
  8224. "FlowType",
  8225. "FlowBaseAnnotation"
  8226. ]
  8227. });
  8228. (0, _utils.default)("EmptyTypeAnnotation", {
  8229. aliases: [
  8230. "Flow",
  8231. "FlowType",
  8232. "FlowBaseAnnotation"
  8233. ]
  8234. });
  8235. (0, _utils.default)("NullableTypeAnnotation", {
  8236. visitor: [
  8237. "typeAnnotation"
  8238. ],
  8239. aliases: [
  8240. "Flow",
  8241. "FlowType"
  8242. ],
  8243. fields: {
  8244. typeAnnotation: (0, _utils.validateType)("FlowType")
  8245. }
  8246. });
  8247. (0, _utils.default)("NumberLiteralTypeAnnotation", {
  8248. builder: [
  8249. "value"
  8250. ],
  8251. aliases: [
  8252. "Flow",
  8253. "FlowType"
  8254. ],
  8255. fields: {
  8256. value: (0, _utils.validate)((0, _utils.assertValueType)("number"))
  8257. }
  8258. });
  8259. (0, _utils.default)("NumberTypeAnnotation", {
  8260. aliases: [
  8261. "Flow",
  8262. "FlowType",
  8263. "FlowBaseAnnotation"
  8264. ]
  8265. });
  8266. (0, _utils.default)("ObjectTypeAnnotation", {
  8267. visitor: [
  8268. "properties",
  8269. "indexers",
  8270. "callProperties",
  8271. "internalSlots"
  8272. ],
  8273. aliases: [
  8274. "Flow",
  8275. "FlowType"
  8276. ],
  8277. builder: [
  8278. "properties",
  8279. "indexers",
  8280. "callProperties",
  8281. "internalSlots",
  8282. "exact"
  8283. ],
  8284. fields: {
  8285. properties: (0, _utils.validate)((0, _utils.arrayOfType)([
  8286. "ObjectTypeProperty",
  8287. "ObjectTypeSpreadProperty"
  8288. ])),
  8289. indexers: (0, _utils.validateOptional)((0, _utils.arrayOfType)("ObjectTypeIndexer")),
  8290. callProperties: (0, _utils.validateOptional)((0, _utils.arrayOfType)("ObjectTypeCallProperty")),
  8291. internalSlots: (0, _utils.validateOptional)((0, _utils.arrayOfType)("ObjectTypeInternalSlot")),
  8292. exact: {
  8293. validate: (0, _utils.assertValueType)("boolean"),
  8294. default: false
  8295. },
  8296. inexact: (0, _utils.validateOptional)((0, _utils.assertValueType)("boolean"))
  8297. }
  8298. });
  8299. (0, _utils.default)("ObjectTypeInternalSlot", {
  8300. visitor: [
  8301. "id",
  8302. "value",
  8303. "optional",
  8304. "static",
  8305. "method"
  8306. ],
  8307. aliases: [
  8308. "Flow",
  8309. "UserWhitespacable"
  8310. ],
  8311. fields: {
  8312. id: (0, _utils.validateType)("Identifier"),
  8313. value: (0, _utils.validateType)("FlowType"),
  8314. optional: (0, _utils.validate)((0, _utils.assertValueType)("boolean")),
  8315. static: (0, _utils.validate)((0, _utils.assertValueType)("boolean")),
  8316. method: (0, _utils.validate)((0, _utils.assertValueType)("boolean"))
  8317. }
  8318. });
  8319. (0, _utils.default)("ObjectTypeCallProperty", {
  8320. visitor: [
  8321. "value"
  8322. ],
  8323. aliases: [
  8324. "Flow",
  8325. "UserWhitespacable"
  8326. ],
  8327. fields: {
  8328. value: (0, _utils.validateType)("FlowType"),
  8329. static: (0, _utils.validate)((0, _utils.assertValueType)("boolean"))
  8330. }
  8331. });
  8332. (0, _utils.default)("ObjectTypeIndexer", {
  8333. visitor: [
  8334. "id",
  8335. "key",
  8336. "value",
  8337. "variance"
  8338. ],
  8339. aliases: [
  8340. "Flow",
  8341. "UserWhitespacable"
  8342. ],
  8343. fields: {
  8344. id: (0, _utils.validateOptionalType)("Identifier"),
  8345. key: (0, _utils.validateType)("FlowType"),
  8346. value: (0, _utils.validateType)("FlowType"),
  8347. static: (0, _utils.validate)((0, _utils.assertValueType)("boolean")),
  8348. variance: (0, _utils.validateOptionalType)("Variance")
  8349. }
  8350. });
  8351. (0, _utils.default)("ObjectTypeProperty", {
  8352. visitor: [
  8353. "key",
  8354. "value",
  8355. "variance"
  8356. ],
  8357. aliases: [
  8358. "Flow",
  8359. "UserWhitespacable"
  8360. ],
  8361. fields: {
  8362. key: (0, _utils.validateType)([
  8363. "Identifier",
  8364. "StringLiteral"
  8365. ]),
  8366. value: (0, _utils.validateType)("FlowType"),
  8367. kind: (0, _utils.validate)((0, _utils.assertOneOf)("init", "get", "set")),
  8368. static: (0, _utils.validate)((0, _utils.assertValueType)("boolean")),
  8369. proto: (0, _utils.validate)((0, _utils.assertValueType)("boolean")),
  8370. optional: (0, _utils.validate)((0, _utils.assertValueType)("boolean")),
  8371. variance: (0, _utils.validateOptionalType)("Variance"),
  8372. method: (0, _utils.validate)((0, _utils.assertValueType)("boolean"))
  8373. }
  8374. });
  8375. (0, _utils.default)("ObjectTypeSpreadProperty", {
  8376. visitor: [
  8377. "argument"
  8378. ],
  8379. aliases: [
  8380. "Flow",
  8381. "UserWhitespacable"
  8382. ],
  8383. fields: {
  8384. argument: (0, _utils.validateType)("FlowType")
  8385. }
  8386. });
  8387. (0, _utils.default)("OpaqueType", {
  8388. visitor: [
  8389. "id",
  8390. "typeParameters",
  8391. "supertype",
  8392. "impltype"
  8393. ],
  8394. aliases: [
  8395. "Flow",
  8396. "FlowDeclaration",
  8397. "Statement",
  8398. "Declaration"
  8399. ],
  8400. fields: {
  8401. id: (0, _utils.validateType)("Identifier"),
  8402. typeParameters: (0, _utils.validateOptionalType)("TypeParameterDeclaration"),
  8403. supertype: (0, _utils.validateOptionalType)("FlowType"),
  8404. impltype: (0, _utils.validateType)("FlowType")
  8405. }
  8406. });
  8407. (0, _utils.default)("QualifiedTypeIdentifier", {
  8408. visitor: [
  8409. "id",
  8410. "qualification"
  8411. ],
  8412. aliases: [
  8413. "Flow"
  8414. ],
  8415. fields: {
  8416. id: (0, _utils.validateType)("Identifier"),
  8417. qualification: (0, _utils.validateType)([
  8418. "Identifier",
  8419. "QualifiedTypeIdentifier"
  8420. ])
  8421. }
  8422. });
  8423. (0, _utils.default)("StringLiteralTypeAnnotation", {
  8424. builder: [
  8425. "value"
  8426. ],
  8427. aliases: [
  8428. "Flow",
  8429. "FlowType"
  8430. ],
  8431. fields: {
  8432. value: (0, _utils.validate)((0, _utils.assertValueType)("string"))
  8433. }
  8434. });
  8435. (0, _utils.default)("StringTypeAnnotation", {
  8436. aliases: [
  8437. "Flow",
  8438. "FlowType",
  8439. "FlowBaseAnnotation"
  8440. ]
  8441. });
  8442. (0, _utils.default)("SymbolTypeAnnotation", {
  8443. aliases: [
  8444. "Flow",
  8445. "FlowType",
  8446. "FlowBaseAnnotation"
  8447. ]
  8448. });
  8449. (0, _utils.default)("ThisTypeAnnotation", {
  8450. aliases: [
  8451. "Flow",
  8452. "FlowType",
  8453. "FlowBaseAnnotation"
  8454. ]
  8455. });
  8456. (0, _utils.default)("TupleTypeAnnotation", {
  8457. visitor: [
  8458. "types"
  8459. ],
  8460. aliases: [
  8461. "Flow",
  8462. "FlowType"
  8463. ],
  8464. fields: {
  8465. types: (0, _utils.validate)((0, _utils.arrayOfType)("FlowType"))
  8466. }
  8467. });
  8468. (0, _utils.default)("TypeofTypeAnnotation", {
  8469. visitor: [
  8470. "argument"
  8471. ],
  8472. aliases: [
  8473. "Flow",
  8474. "FlowType"
  8475. ],
  8476. fields: {
  8477. argument: (0, _utils.validateType)("FlowType")
  8478. }
  8479. });
  8480. (0, _utils.default)("TypeAlias", {
  8481. visitor: [
  8482. "id",
  8483. "typeParameters",
  8484. "right"
  8485. ],
  8486. aliases: [
  8487. "Flow",
  8488. "FlowDeclaration",
  8489. "Statement",
  8490. "Declaration"
  8491. ],
  8492. fields: {
  8493. id: (0, _utils.validateType)("Identifier"),
  8494. typeParameters: (0, _utils.validateOptionalType)("TypeParameterDeclaration"),
  8495. right: (0, _utils.validateType)("FlowType")
  8496. }
  8497. });
  8498. (0, _utils.default)("TypeAnnotation", {
  8499. aliases: [
  8500. "Flow"
  8501. ],
  8502. visitor: [
  8503. "typeAnnotation"
  8504. ],
  8505. fields: {
  8506. typeAnnotation: (0, _utils.validateType)("FlowType")
  8507. }
  8508. });
  8509. (0, _utils.default)("TypeCastExpression", {
  8510. visitor: [
  8511. "expression",
  8512. "typeAnnotation"
  8513. ],
  8514. aliases: [
  8515. "Flow",
  8516. "ExpressionWrapper",
  8517. "Expression"
  8518. ],
  8519. fields: {
  8520. expression: (0, _utils.validateType)("Expression"),
  8521. typeAnnotation: (0, _utils.validateType)("TypeAnnotation")
  8522. }
  8523. });
  8524. (0, _utils.default)("TypeParameter", {
  8525. aliases: [
  8526. "Flow"
  8527. ],
  8528. visitor: [
  8529. "bound",
  8530. "default",
  8531. "variance"
  8532. ],
  8533. fields: {
  8534. name: (0, _utils.validate)((0, _utils.assertValueType)("string")),
  8535. bound: (0, _utils.validateOptionalType)("TypeAnnotation"),
  8536. default: (0, _utils.validateOptionalType)("FlowType"),
  8537. variance: (0, _utils.validateOptionalType)("Variance")
  8538. }
  8539. });
  8540. (0, _utils.default)("TypeParameterDeclaration", {
  8541. aliases: [
  8542. "Flow"
  8543. ],
  8544. visitor: [
  8545. "params"
  8546. ],
  8547. fields: {
  8548. params: (0, _utils.validate)((0, _utils.arrayOfType)("TypeParameter"))
  8549. }
  8550. });
  8551. (0, _utils.default)("TypeParameterInstantiation", {
  8552. aliases: [
  8553. "Flow"
  8554. ],
  8555. visitor: [
  8556. "params"
  8557. ],
  8558. fields: {
  8559. params: (0, _utils.validate)((0, _utils.arrayOfType)("FlowType"))
  8560. }
  8561. });
  8562. (0, _utils.default)("UnionTypeAnnotation", {
  8563. visitor: [
  8564. "types"
  8565. ],
  8566. aliases: [
  8567. "Flow",
  8568. "FlowType"
  8569. ],
  8570. fields: {
  8571. types: (0, _utils.validate)((0, _utils.arrayOfType)("FlowType"))
  8572. }
  8573. });
  8574. (0, _utils.default)("Variance", {
  8575. aliases: [
  8576. "Flow"
  8577. ],
  8578. builder: [
  8579. "kind"
  8580. ],
  8581. fields: {
  8582. kind: (0, _utils.validate)((0, _utils.assertOneOf)("minus", "plus"))
  8583. }
  8584. });
  8585. (0, _utils.default)("VoidTypeAnnotation", {
  8586. aliases: [
  8587. "Flow",
  8588. "FlowType",
  8589. "FlowBaseAnnotation"
  8590. ]
  8591. });
  8592. (0, _utils.default)("EnumDeclaration", {
  8593. aliases: [
  8594. "Statement",
  8595. "Declaration"
  8596. ],
  8597. visitor: [
  8598. "id",
  8599. "body"
  8600. ],
  8601. fields: {
  8602. id: (0, _utils.validateType)("Identifier"),
  8603. body: (0, _utils.validateType)([
  8604. "EnumBooleanBody",
  8605. "EnumNumberBody",
  8606. "EnumStringBody",
  8607. "EnumSymbolBody"
  8608. ])
  8609. }
  8610. });
  8611. (0, _utils.default)("EnumBooleanBody", {
  8612. aliases: [
  8613. "EnumBody"
  8614. ],
  8615. visitor: [
  8616. "members"
  8617. ],
  8618. fields: {
  8619. explicitType: (0, _utils.validate)((0, _utils.assertValueType)("boolean")),
  8620. members: (0, _utils.validateArrayOfType)("EnumBooleanMember"),
  8621. hasUnknownMembers: (0, _utils.validate)((0, _utils.assertValueType)("boolean"))
  8622. }
  8623. });
  8624. (0, _utils.default)("EnumNumberBody", {
  8625. aliases: [
  8626. "EnumBody"
  8627. ],
  8628. visitor: [
  8629. "members"
  8630. ],
  8631. fields: {
  8632. explicitType: (0, _utils.validate)((0, _utils.assertValueType)("boolean")),
  8633. members: (0, _utils.validateArrayOfType)("EnumNumberMember"),
  8634. hasUnknownMembers: (0, _utils.validate)((0, _utils.assertValueType)("boolean"))
  8635. }
  8636. });
  8637. (0, _utils.default)("EnumStringBody", {
  8638. aliases: [
  8639. "EnumBody"
  8640. ],
  8641. visitor: [
  8642. "members"
  8643. ],
  8644. fields: {
  8645. explicitType: (0, _utils.validate)((0, _utils.assertValueType)("boolean")),
  8646. members: (0, _utils.validateArrayOfType)([
  8647. "EnumStringMember",
  8648. "EnumDefaultedMember"
  8649. ]),
  8650. hasUnknownMembers: (0, _utils.validate)((0, _utils.assertValueType)("boolean"))
  8651. }
  8652. });
  8653. (0, _utils.default)("EnumSymbolBody", {
  8654. aliases: [
  8655. "EnumBody"
  8656. ],
  8657. visitor: [
  8658. "members"
  8659. ],
  8660. fields: {
  8661. members: (0, _utils.validateArrayOfType)("EnumDefaultedMember"),
  8662. hasUnknownMembers: (0, _utils.validate)((0, _utils.assertValueType)("boolean"))
  8663. }
  8664. });
  8665. (0, _utils.default)("EnumBooleanMember", {
  8666. aliases: [
  8667. "EnumMember"
  8668. ],
  8669. visitor: [
  8670. "id"
  8671. ],
  8672. fields: {
  8673. id: (0, _utils.validateType)("Identifier"),
  8674. init: (0, _utils.validateType)("BooleanLiteral")
  8675. }
  8676. });
  8677. (0, _utils.default)("EnumNumberMember", {
  8678. aliases: [
  8679. "EnumMember"
  8680. ],
  8681. visitor: [
  8682. "id",
  8683. "init"
  8684. ],
  8685. fields: {
  8686. id: (0, _utils.validateType)("Identifier"),
  8687. init: (0, _utils.validateType)("NumericLiteral")
  8688. }
  8689. });
  8690. (0, _utils.default)("EnumStringMember", {
  8691. aliases: [
  8692. "EnumMember"
  8693. ],
  8694. visitor: [
  8695. "id",
  8696. "init"
  8697. ],
  8698. fields: {
  8699. id: (0, _utils.validateType)("Identifier"),
  8700. init: (0, _utils.validateType)("StringLiteral")
  8701. }
  8702. });
  8703. (0, _utils.default)("EnumDefaultedMember", {
  8704. aliases: [
  8705. "EnumMember"
  8706. ],
  8707. visitor: [
  8708. "id"
  8709. ],
  8710. fields: {
  8711. id: (0, _utils.validateType)("Identifier")
  8712. }
  8713. });
  8714. (0, _utils.default)("IndexedAccessType", {
  8715. visitor: [
  8716. "objectType",
  8717. "indexType"
  8718. ],
  8719. aliases: [
  8720. "Flow",
  8721. "FlowType"
  8722. ],
  8723. fields: {
  8724. objectType: (0, _utils.validateType)("FlowType"),
  8725. indexType: (0, _utils.validateType)("FlowType")
  8726. }
  8727. });
  8728. (0, _utils.default)("OptionalIndexedAccessType", {
  8729. visitor: [
  8730. "objectType",
  8731. "indexType"
  8732. ],
  8733. aliases: [
  8734. "Flow",
  8735. "FlowType"
  8736. ],
  8737. fields: {
  8738. objectType: (0, _utils.validateType)("FlowType"),
  8739. indexType: (0, _utils.validateType)("FlowType"),
  8740. optional: (0, _utils.validate)((0, _utils.assertValueType)("boolean"))
  8741. }
  8742. });
  8743. return flow;
  8744. }
  8745. var jsx = {};
  8746. var hasRequiredJsx;
  8747. function requireJsx() {
  8748. if (hasRequiredJsx) return jsx;
  8749. hasRequiredJsx = 1;
  8750. var _utils = requireUtils();
  8751. (0, _utils.default)("JSXAttribute", {
  8752. visitor: [
  8753. "name",
  8754. "value"
  8755. ],
  8756. aliases: [
  8757. "JSX",
  8758. "Immutable"
  8759. ],
  8760. fields: {
  8761. name: {
  8762. validate: (0, _utils.assertNodeType)("JSXIdentifier", "JSXNamespacedName")
  8763. },
  8764. value: {
  8765. optional: true,
  8766. validate: (0, _utils.assertNodeType)("JSXElement", "JSXFragment", "StringLiteral", "JSXExpressionContainer")
  8767. }
  8768. }
  8769. });
  8770. (0, _utils.default)("JSXClosingElement", {
  8771. visitor: [
  8772. "name"
  8773. ],
  8774. aliases: [
  8775. "JSX",
  8776. "Immutable"
  8777. ],
  8778. fields: {
  8779. name: {
  8780. validate: (0, _utils.assertNodeType)("JSXIdentifier", "JSXMemberExpression", "JSXNamespacedName")
  8781. }
  8782. }
  8783. });
  8784. (0, _utils.default)("JSXElement", {
  8785. builder: [
  8786. "openingElement",
  8787. "closingElement",
  8788. "children",
  8789. "selfClosing"
  8790. ],
  8791. visitor: [
  8792. "openingElement",
  8793. "children",
  8794. "closingElement"
  8795. ],
  8796. aliases: [
  8797. "JSX",
  8798. "Immutable",
  8799. "Expression"
  8800. ],
  8801. fields: {
  8802. openingElement: {
  8803. validate: (0, _utils.assertNodeType)("JSXOpeningElement")
  8804. },
  8805. closingElement: {
  8806. optional: true,
  8807. validate: (0, _utils.assertNodeType)("JSXClosingElement")
  8808. },
  8809. children: {
  8810. validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("JSXText", "JSXExpressionContainer", "JSXSpreadChild", "JSXElement", "JSXFragment")))
  8811. },
  8812. selfClosing: {
  8813. validate: (0, _utils.assertValueType)("boolean"),
  8814. optional: true
  8815. }
  8816. }
  8817. });
  8818. (0, _utils.default)("JSXEmptyExpression", {
  8819. aliases: [
  8820. "JSX"
  8821. ]
  8822. });
  8823. (0, _utils.default)("JSXExpressionContainer", {
  8824. visitor: [
  8825. "expression"
  8826. ],
  8827. aliases: [
  8828. "JSX",
  8829. "Immutable"
  8830. ],
  8831. fields: {
  8832. expression: {
  8833. validate: (0, _utils.assertNodeType)("Expression", "JSXEmptyExpression")
  8834. }
  8835. }
  8836. });
  8837. (0, _utils.default)("JSXSpreadChild", {
  8838. visitor: [
  8839. "expression"
  8840. ],
  8841. aliases: [
  8842. "JSX",
  8843. "Immutable"
  8844. ],
  8845. fields: {
  8846. expression: {
  8847. validate: (0, _utils.assertNodeType)("Expression")
  8848. }
  8849. }
  8850. });
  8851. (0, _utils.default)("JSXIdentifier", {
  8852. builder: [
  8853. "name"
  8854. ],
  8855. aliases: [
  8856. "JSX"
  8857. ],
  8858. fields: {
  8859. name: {
  8860. validate: (0, _utils.assertValueType)("string")
  8861. }
  8862. }
  8863. });
  8864. (0, _utils.default)("JSXMemberExpression", {
  8865. visitor: [
  8866. "object",
  8867. "property"
  8868. ],
  8869. aliases: [
  8870. "JSX"
  8871. ],
  8872. fields: {
  8873. object: {
  8874. validate: (0, _utils.assertNodeType)("JSXMemberExpression", "JSXIdentifier")
  8875. },
  8876. property: {
  8877. validate: (0, _utils.assertNodeType)("JSXIdentifier")
  8878. }
  8879. }
  8880. });
  8881. (0, _utils.default)("JSXNamespacedName", {
  8882. visitor: [
  8883. "namespace",
  8884. "name"
  8885. ],
  8886. aliases: [
  8887. "JSX"
  8888. ],
  8889. fields: {
  8890. namespace: {
  8891. validate: (0, _utils.assertNodeType)("JSXIdentifier")
  8892. },
  8893. name: {
  8894. validate: (0, _utils.assertNodeType)("JSXIdentifier")
  8895. }
  8896. }
  8897. });
  8898. (0, _utils.default)("JSXOpeningElement", {
  8899. builder: [
  8900. "name",
  8901. "attributes",
  8902. "selfClosing"
  8903. ],
  8904. visitor: [
  8905. "name",
  8906. "attributes"
  8907. ],
  8908. aliases: [
  8909. "JSX",
  8910. "Immutable"
  8911. ],
  8912. fields: {
  8913. name: {
  8914. validate: (0, _utils.assertNodeType)("JSXIdentifier", "JSXMemberExpression", "JSXNamespacedName")
  8915. },
  8916. selfClosing: {
  8917. default: false
  8918. },
  8919. attributes: {
  8920. validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("JSXAttribute", "JSXSpreadAttribute")))
  8921. },
  8922. typeParameters: {
  8923. validate: (0, _utils.assertNodeType)("TypeParameterInstantiation", "TSTypeParameterInstantiation"),
  8924. optional: true
  8925. }
  8926. }
  8927. });
  8928. (0, _utils.default)("JSXSpreadAttribute", {
  8929. visitor: [
  8930. "argument"
  8931. ],
  8932. aliases: [
  8933. "JSX"
  8934. ],
  8935. fields: {
  8936. argument: {
  8937. validate: (0, _utils.assertNodeType)("Expression")
  8938. }
  8939. }
  8940. });
  8941. (0, _utils.default)("JSXText", {
  8942. aliases: [
  8943. "JSX",
  8944. "Immutable"
  8945. ],
  8946. builder: [
  8947. "value"
  8948. ],
  8949. fields: {
  8950. value: {
  8951. validate: (0, _utils.assertValueType)("string")
  8952. }
  8953. }
  8954. });
  8955. (0, _utils.default)("JSXFragment", {
  8956. builder: [
  8957. "openingFragment",
  8958. "closingFragment",
  8959. "children"
  8960. ],
  8961. visitor: [
  8962. "openingFragment",
  8963. "children",
  8964. "closingFragment"
  8965. ],
  8966. aliases: [
  8967. "JSX",
  8968. "Immutable",
  8969. "Expression"
  8970. ],
  8971. fields: {
  8972. openingFragment: {
  8973. validate: (0, _utils.assertNodeType)("JSXOpeningFragment")
  8974. },
  8975. closingFragment: {
  8976. validate: (0, _utils.assertNodeType)("JSXClosingFragment")
  8977. },
  8978. children: {
  8979. validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("JSXText", "JSXExpressionContainer", "JSXSpreadChild", "JSXElement", "JSXFragment")))
  8980. }
  8981. }
  8982. });
  8983. (0, _utils.default)("JSXOpeningFragment", {
  8984. aliases: [
  8985. "JSX",
  8986. "Immutable"
  8987. ]
  8988. });
  8989. (0, _utils.default)("JSXClosingFragment", {
  8990. aliases: [
  8991. "JSX",
  8992. "Immutable"
  8993. ]
  8994. });
  8995. return jsx;
  8996. }
  8997. var misc = {};
  8998. var placeholders = {};
  8999. var hasRequiredPlaceholders;
  9000. function requirePlaceholders() {
  9001. if (hasRequiredPlaceholders) return placeholders;
  9002. hasRequiredPlaceholders = 1;
  9003. Object.defineProperty(placeholders, "__esModule", {
  9004. value: true
  9005. });
  9006. placeholders.PLACEHOLDERS_FLIPPED_ALIAS = placeholders.PLACEHOLDERS_ALIAS = placeholders.PLACEHOLDERS = void 0;
  9007. var _utils = requireUtils();
  9008. var PLACEHOLDERS = [
  9009. "Identifier",
  9010. "StringLiteral",
  9011. "Expression",
  9012. "Statement",
  9013. "Declaration",
  9014. "BlockStatement",
  9015. "ClassBody",
  9016. "Pattern"
  9017. ];
  9018. placeholders.PLACEHOLDERS = PLACEHOLDERS;
  9019. var PLACEHOLDERS_ALIAS = {
  9020. Declaration: [
  9021. "Statement"
  9022. ],
  9023. Pattern: [
  9024. "PatternLike",
  9025. "LVal"
  9026. ]
  9027. };
  9028. placeholders.PLACEHOLDERS_ALIAS = PLACEHOLDERS_ALIAS;
  9029. for(var _i = 0; _i < PLACEHOLDERS.length; _i++){
  9030. var type = PLACEHOLDERS[_i];
  9031. var alias = _utils.ALIAS_KEYS[type];
  9032. if (alias != null && alias.length) PLACEHOLDERS_ALIAS[type] = alias;
  9033. }
  9034. var PLACEHOLDERS_FLIPPED_ALIAS = {};
  9035. placeholders.PLACEHOLDERS_FLIPPED_ALIAS = PLACEHOLDERS_FLIPPED_ALIAS;
  9036. Object.keys(PLACEHOLDERS_ALIAS).forEach(function(type) {
  9037. PLACEHOLDERS_ALIAS[type].forEach(function(alias) {
  9038. if (!Object.hasOwnProperty.call(PLACEHOLDERS_FLIPPED_ALIAS, alias)) {
  9039. PLACEHOLDERS_FLIPPED_ALIAS[alias] = [];
  9040. }
  9041. PLACEHOLDERS_FLIPPED_ALIAS[alias].push(type);
  9042. });
  9043. });
  9044. return placeholders;
  9045. }
  9046. var hasRequiredMisc;
  9047. function requireMisc() {
  9048. if (hasRequiredMisc) return misc;
  9049. hasRequiredMisc = 1;
  9050. var _utils = requireUtils();
  9051. var _placeholders = requirePlaceholders();
  9052. {
  9053. (0, _utils.default)("Noop", {
  9054. visitor: []
  9055. });
  9056. }
  9057. (0, _utils.default)("Placeholder", {
  9058. visitor: [],
  9059. builder: [
  9060. "expectedNode",
  9061. "name"
  9062. ],
  9063. fields: {
  9064. name: {
  9065. validate: (0, _utils.assertNodeType)("Identifier")
  9066. },
  9067. expectedNode: {
  9068. validate: (_utils.assertOneOf).apply(this, _placeholders.PLACEHOLDERS)
  9069. }
  9070. }
  9071. });
  9072. (0, _utils.default)("V8IntrinsicIdentifier", {
  9073. builder: [
  9074. "name"
  9075. ],
  9076. fields: {
  9077. name: {
  9078. validate: (0, _utils.assertValueType)("string")
  9079. }
  9080. }
  9081. });
  9082. return misc;
  9083. }
  9084. var experimental = {};
  9085. var hasRequiredExperimental;
  9086. function requireExperimental() {
  9087. if (hasRequiredExperimental) return experimental;
  9088. hasRequiredExperimental = 1;
  9089. var _utils = requireUtils();
  9090. (0, _utils.default)("ArgumentPlaceholder", {});
  9091. (0, _utils.default)("BindExpression", {
  9092. visitor: [
  9093. "object",
  9094. "callee"
  9095. ],
  9096. aliases: [
  9097. "Expression"
  9098. ],
  9099. fields: !process.env.BABEL_TYPES_8_BREAKING ? {
  9100. object: {
  9101. validate: Object.assign(function() {}, {
  9102. oneOfNodeTypes: [
  9103. "Expression"
  9104. ]
  9105. })
  9106. },
  9107. callee: {
  9108. validate: Object.assign(function() {}, {
  9109. oneOfNodeTypes: [
  9110. "Expression"
  9111. ]
  9112. })
  9113. }
  9114. } : {
  9115. object: {
  9116. validate: (0, _utils.assertNodeType)("Expression")
  9117. },
  9118. callee: {
  9119. validate: (0, _utils.assertNodeType)("Expression")
  9120. }
  9121. }
  9122. });
  9123. (0, _utils.default)("ImportAttribute", {
  9124. visitor: [
  9125. "key",
  9126. "value"
  9127. ],
  9128. fields: {
  9129. key: {
  9130. validate: (0, _utils.assertNodeType)("Identifier", "StringLiteral")
  9131. },
  9132. value: {
  9133. validate: (0, _utils.assertNodeType)("StringLiteral")
  9134. }
  9135. }
  9136. });
  9137. (0, _utils.default)("Decorator", {
  9138. visitor: [
  9139. "expression"
  9140. ],
  9141. fields: {
  9142. expression: {
  9143. validate: (0, _utils.assertNodeType)("Expression")
  9144. }
  9145. }
  9146. });
  9147. (0, _utils.default)("DoExpression", {
  9148. visitor: [
  9149. "body"
  9150. ],
  9151. builder: [
  9152. "body",
  9153. "async"
  9154. ],
  9155. aliases: [
  9156. "Expression"
  9157. ],
  9158. fields: {
  9159. body: {
  9160. validate: (0, _utils.assertNodeType)("BlockStatement")
  9161. },
  9162. async: {
  9163. validate: (0, _utils.assertValueType)("boolean"),
  9164. default: false
  9165. }
  9166. }
  9167. });
  9168. (0, _utils.default)("ExportDefaultSpecifier", {
  9169. visitor: [
  9170. "exported"
  9171. ],
  9172. aliases: [
  9173. "ModuleSpecifier"
  9174. ],
  9175. fields: {
  9176. exported: {
  9177. validate: (0, _utils.assertNodeType)("Identifier")
  9178. }
  9179. }
  9180. });
  9181. (0, _utils.default)("RecordExpression", {
  9182. visitor: [
  9183. "properties"
  9184. ],
  9185. aliases: [
  9186. "Expression"
  9187. ],
  9188. fields: {
  9189. properties: {
  9190. validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("ObjectProperty", "SpreadElement")))
  9191. }
  9192. }
  9193. });
  9194. (0, _utils.default)("TupleExpression", {
  9195. fields: {
  9196. elements: {
  9197. validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Expression", "SpreadElement"))),
  9198. default: []
  9199. }
  9200. },
  9201. visitor: [
  9202. "elements"
  9203. ],
  9204. aliases: [
  9205. "Expression"
  9206. ]
  9207. });
  9208. (0, _utils.default)("DecimalLiteral", {
  9209. builder: [
  9210. "value"
  9211. ],
  9212. fields: {
  9213. value: {
  9214. validate: (0, _utils.assertValueType)("string")
  9215. }
  9216. },
  9217. aliases: [
  9218. "Expression",
  9219. "Pureish",
  9220. "Literal",
  9221. "Immutable"
  9222. ]
  9223. });
  9224. (0, _utils.default)("StaticBlock", {
  9225. visitor: [
  9226. "body"
  9227. ],
  9228. fields: {
  9229. body: {
  9230. validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Statement")))
  9231. }
  9232. },
  9233. aliases: [
  9234. "Scopable",
  9235. "BlockParent"
  9236. ]
  9237. });
  9238. (0, _utils.default)("ModuleExpression", {
  9239. visitor: [
  9240. "body"
  9241. ],
  9242. fields: {
  9243. body: {
  9244. validate: (0, _utils.assertNodeType)("Program")
  9245. }
  9246. },
  9247. aliases: [
  9248. "Expression"
  9249. ]
  9250. });
  9251. (0, _utils.default)("TopicReference", {
  9252. aliases: [
  9253. "Expression"
  9254. ]
  9255. });
  9256. (0, _utils.default)("PipelineTopicExpression", {
  9257. builder: [
  9258. "expression"
  9259. ],
  9260. visitor: [
  9261. "expression"
  9262. ],
  9263. fields: {
  9264. expression: {
  9265. validate: (0, _utils.assertNodeType)("Expression")
  9266. }
  9267. },
  9268. aliases: [
  9269. "Expression"
  9270. ]
  9271. });
  9272. (0, _utils.default)("PipelineBareFunction", {
  9273. builder: [
  9274. "callee"
  9275. ],
  9276. visitor: [
  9277. "callee"
  9278. ],
  9279. fields: {
  9280. callee: {
  9281. validate: (0, _utils.assertNodeType)("Expression")
  9282. }
  9283. },
  9284. aliases: [
  9285. "Expression"
  9286. ]
  9287. });
  9288. (0, _utils.default)("PipelinePrimaryTopicReference", {
  9289. aliases: [
  9290. "Expression"
  9291. ]
  9292. });
  9293. return experimental;
  9294. }
  9295. var typescript = {};
  9296. var hasRequiredTypescript;
  9297. function requireTypescript() {
  9298. if (hasRequiredTypescript) return typescript;
  9299. hasRequiredTypescript = 1;
  9300. var _utils = requireUtils();
  9301. var _core = requireCore();
  9302. var _is = requireIs();
  9303. var bool = (0, _utils.assertValueType)("boolean");
  9304. var tSFunctionTypeAnnotationCommon = {
  9305. returnType: {
  9306. validate: (0, _utils.assertNodeType)("TSTypeAnnotation", "Noop"),
  9307. optional: true
  9308. },
  9309. typeParameters: {
  9310. validate: (0, _utils.assertNodeType)("TSTypeParameterDeclaration", "Noop"),
  9311. optional: true
  9312. }
  9313. };
  9314. (0, _utils.default)("TSParameterProperty", {
  9315. aliases: [
  9316. "LVal"
  9317. ],
  9318. visitor: [
  9319. "parameter"
  9320. ],
  9321. fields: {
  9322. accessibility: {
  9323. validate: (0, _utils.assertOneOf)("public", "private", "protected"),
  9324. optional: true
  9325. },
  9326. readonly: {
  9327. validate: (0, _utils.assertValueType)("boolean"),
  9328. optional: true
  9329. },
  9330. parameter: {
  9331. validate: (0, _utils.assertNodeType)("Identifier", "AssignmentPattern")
  9332. },
  9333. override: {
  9334. validate: (0, _utils.assertValueType)("boolean"),
  9335. optional: true
  9336. },
  9337. decorators: {
  9338. validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))),
  9339. optional: true
  9340. }
  9341. }
  9342. });
  9343. (0, _utils.default)("TSDeclareFunction", {
  9344. aliases: [
  9345. "Statement",
  9346. "Declaration"
  9347. ],
  9348. visitor: [
  9349. "id",
  9350. "typeParameters",
  9351. "params",
  9352. "returnType"
  9353. ],
  9354. fields: Object.assign({}, _core.functionDeclarationCommon, tSFunctionTypeAnnotationCommon)
  9355. });
  9356. (0, _utils.default)("TSDeclareMethod", {
  9357. visitor: [
  9358. "decorators",
  9359. "key",
  9360. "typeParameters",
  9361. "params",
  9362. "returnType"
  9363. ],
  9364. fields: Object.assign({}, _core.classMethodOrDeclareMethodCommon, tSFunctionTypeAnnotationCommon)
  9365. });
  9366. (0, _utils.default)("TSQualifiedName", {
  9367. aliases: [
  9368. "TSEntityName"
  9369. ],
  9370. visitor: [
  9371. "left",
  9372. "right"
  9373. ],
  9374. fields: {
  9375. left: (0, _utils.validateType)("TSEntityName"),
  9376. right: (0, _utils.validateType)("Identifier")
  9377. }
  9378. });
  9379. var signatureDeclarationCommon = {
  9380. typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterDeclaration"),
  9381. parameters: (0, _utils.validateArrayOfType)([
  9382. "Identifier",
  9383. "RestElement"
  9384. ]),
  9385. typeAnnotation: (0, _utils.validateOptionalType)("TSTypeAnnotation")
  9386. };
  9387. var callConstructSignatureDeclaration = {
  9388. aliases: [
  9389. "TSTypeElement"
  9390. ],
  9391. visitor: [
  9392. "typeParameters",
  9393. "parameters",
  9394. "typeAnnotation"
  9395. ],
  9396. fields: signatureDeclarationCommon
  9397. };
  9398. (0, _utils.default)("TSCallSignatureDeclaration", callConstructSignatureDeclaration);
  9399. (0, _utils.default)("TSConstructSignatureDeclaration", callConstructSignatureDeclaration);
  9400. var namedTypeElementCommon = {
  9401. key: (0, _utils.validateType)("Expression"),
  9402. computed: (0, _utils.validate)(bool),
  9403. optional: (0, _utils.validateOptional)(bool)
  9404. };
  9405. (0, _utils.default)("TSPropertySignature", {
  9406. aliases: [
  9407. "TSTypeElement"
  9408. ],
  9409. visitor: [
  9410. "key",
  9411. "typeAnnotation",
  9412. "initializer"
  9413. ],
  9414. fields: Object.assign({}, namedTypeElementCommon, {
  9415. readonly: (0, _utils.validateOptional)(bool),
  9416. typeAnnotation: (0, _utils.validateOptionalType)("TSTypeAnnotation"),
  9417. initializer: (0, _utils.validateOptionalType)("Expression"),
  9418. kind: {
  9419. validate: (0, _utils.assertOneOf)("get", "set")
  9420. }
  9421. })
  9422. });
  9423. (0, _utils.default)("TSMethodSignature", {
  9424. aliases: [
  9425. "TSTypeElement"
  9426. ],
  9427. visitor: [
  9428. "key",
  9429. "typeParameters",
  9430. "parameters",
  9431. "typeAnnotation"
  9432. ],
  9433. fields: Object.assign({}, signatureDeclarationCommon, namedTypeElementCommon, {
  9434. kind: {
  9435. validate: (0, _utils.assertOneOf)("method", "get", "set")
  9436. }
  9437. })
  9438. });
  9439. (0, _utils.default)("TSIndexSignature", {
  9440. aliases: [
  9441. "TSTypeElement"
  9442. ],
  9443. visitor: [
  9444. "parameters",
  9445. "typeAnnotation"
  9446. ],
  9447. fields: {
  9448. readonly: (0, _utils.validateOptional)(bool),
  9449. static: (0, _utils.validateOptional)(bool),
  9450. parameters: (0, _utils.validateArrayOfType)("Identifier"),
  9451. typeAnnotation: (0, _utils.validateOptionalType)("TSTypeAnnotation")
  9452. }
  9453. });
  9454. var tsKeywordTypes = [
  9455. "TSAnyKeyword",
  9456. "TSBooleanKeyword",
  9457. "TSBigIntKeyword",
  9458. "TSIntrinsicKeyword",
  9459. "TSNeverKeyword",
  9460. "TSNullKeyword",
  9461. "TSNumberKeyword",
  9462. "TSObjectKeyword",
  9463. "TSStringKeyword",
  9464. "TSSymbolKeyword",
  9465. "TSUndefinedKeyword",
  9466. "TSUnknownKeyword",
  9467. "TSVoidKeyword"
  9468. ];
  9469. for(var _i = 0; _i < tsKeywordTypes.length; _i++){
  9470. var type = tsKeywordTypes[_i];
  9471. (0, _utils.default)(type, {
  9472. aliases: [
  9473. "TSType",
  9474. "TSBaseType"
  9475. ],
  9476. visitor: [],
  9477. fields: {}
  9478. });
  9479. }
  9480. (0, _utils.default)("TSThisType", {
  9481. aliases: [
  9482. "TSType",
  9483. "TSBaseType"
  9484. ],
  9485. visitor: [],
  9486. fields: {}
  9487. });
  9488. var fnOrCtrBase = {
  9489. aliases: [
  9490. "TSType"
  9491. ],
  9492. visitor: [
  9493. "typeParameters",
  9494. "parameters",
  9495. "typeAnnotation"
  9496. ]
  9497. };
  9498. (0, _utils.default)("TSFunctionType", Object.assign({}, fnOrCtrBase, {
  9499. fields: signatureDeclarationCommon
  9500. }));
  9501. (0, _utils.default)("TSConstructorType", Object.assign({}, fnOrCtrBase, {
  9502. fields: Object.assign({}, signatureDeclarationCommon, {
  9503. abstract: (0, _utils.validateOptional)(bool)
  9504. })
  9505. }));
  9506. (0, _utils.default)("TSTypeReference", {
  9507. aliases: [
  9508. "TSType"
  9509. ],
  9510. visitor: [
  9511. "typeName",
  9512. "typeParameters"
  9513. ],
  9514. fields: {
  9515. typeName: (0, _utils.validateType)("TSEntityName"),
  9516. typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterInstantiation")
  9517. }
  9518. });
  9519. (0, _utils.default)("TSTypePredicate", {
  9520. aliases: [
  9521. "TSType"
  9522. ],
  9523. visitor: [
  9524. "parameterName",
  9525. "typeAnnotation"
  9526. ],
  9527. builder: [
  9528. "parameterName",
  9529. "typeAnnotation",
  9530. "asserts"
  9531. ],
  9532. fields: {
  9533. parameterName: (0, _utils.validateType)([
  9534. "Identifier",
  9535. "TSThisType"
  9536. ]),
  9537. typeAnnotation: (0, _utils.validateOptionalType)("TSTypeAnnotation"),
  9538. asserts: (0, _utils.validateOptional)(bool)
  9539. }
  9540. });
  9541. (0, _utils.default)("TSTypeQuery", {
  9542. aliases: [
  9543. "TSType"
  9544. ],
  9545. visitor: [
  9546. "exprName"
  9547. ],
  9548. fields: {
  9549. exprName: (0, _utils.validateType)([
  9550. "TSEntityName",
  9551. "TSImportType"
  9552. ])
  9553. }
  9554. });
  9555. (0, _utils.default)("TSTypeLiteral", {
  9556. aliases: [
  9557. "TSType"
  9558. ],
  9559. visitor: [
  9560. "members"
  9561. ],
  9562. fields: {
  9563. members: (0, _utils.validateArrayOfType)("TSTypeElement")
  9564. }
  9565. });
  9566. (0, _utils.default)("TSArrayType", {
  9567. aliases: [
  9568. "TSType"
  9569. ],
  9570. visitor: [
  9571. "elementType"
  9572. ],
  9573. fields: {
  9574. elementType: (0, _utils.validateType)("TSType")
  9575. }
  9576. });
  9577. (0, _utils.default)("TSTupleType", {
  9578. aliases: [
  9579. "TSType"
  9580. ],
  9581. visitor: [
  9582. "elementTypes"
  9583. ],
  9584. fields: {
  9585. elementTypes: (0, _utils.validateArrayOfType)([
  9586. "TSType",
  9587. "TSNamedTupleMember"
  9588. ])
  9589. }
  9590. });
  9591. (0, _utils.default)("TSOptionalType", {
  9592. aliases: [
  9593. "TSType"
  9594. ],
  9595. visitor: [
  9596. "typeAnnotation"
  9597. ],
  9598. fields: {
  9599. typeAnnotation: (0, _utils.validateType)("TSType")
  9600. }
  9601. });
  9602. (0, _utils.default)("TSRestType", {
  9603. aliases: [
  9604. "TSType"
  9605. ],
  9606. visitor: [
  9607. "typeAnnotation"
  9608. ],
  9609. fields: {
  9610. typeAnnotation: (0, _utils.validateType)("TSType")
  9611. }
  9612. });
  9613. (0, _utils.default)("TSNamedTupleMember", {
  9614. visitor: [
  9615. "label",
  9616. "elementType"
  9617. ],
  9618. builder: [
  9619. "label",
  9620. "elementType",
  9621. "optional"
  9622. ],
  9623. fields: {
  9624. label: (0, _utils.validateType)("Identifier"),
  9625. optional: {
  9626. validate: bool,
  9627. default: false
  9628. },
  9629. elementType: (0, _utils.validateType)("TSType")
  9630. }
  9631. });
  9632. var unionOrIntersection = {
  9633. aliases: [
  9634. "TSType"
  9635. ],
  9636. visitor: [
  9637. "types"
  9638. ],
  9639. fields: {
  9640. types: (0, _utils.validateArrayOfType)("TSType")
  9641. }
  9642. };
  9643. (0, _utils.default)("TSUnionType", unionOrIntersection);
  9644. (0, _utils.default)("TSIntersectionType", unionOrIntersection);
  9645. (0, _utils.default)("TSConditionalType", {
  9646. aliases: [
  9647. "TSType"
  9648. ],
  9649. visitor: [
  9650. "checkType",
  9651. "extendsType",
  9652. "trueType",
  9653. "falseType"
  9654. ],
  9655. fields: {
  9656. checkType: (0, _utils.validateType)("TSType"),
  9657. extendsType: (0, _utils.validateType)("TSType"),
  9658. trueType: (0, _utils.validateType)("TSType"),
  9659. falseType: (0, _utils.validateType)("TSType")
  9660. }
  9661. });
  9662. (0, _utils.default)("TSInferType", {
  9663. aliases: [
  9664. "TSType"
  9665. ],
  9666. visitor: [
  9667. "typeParameter"
  9668. ],
  9669. fields: {
  9670. typeParameter: (0, _utils.validateType)("TSTypeParameter")
  9671. }
  9672. });
  9673. (0, _utils.default)("TSParenthesizedType", {
  9674. aliases: [
  9675. "TSType"
  9676. ],
  9677. visitor: [
  9678. "typeAnnotation"
  9679. ],
  9680. fields: {
  9681. typeAnnotation: (0, _utils.validateType)("TSType")
  9682. }
  9683. });
  9684. (0, _utils.default)("TSTypeOperator", {
  9685. aliases: [
  9686. "TSType"
  9687. ],
  9688. visitor: [
  9689. "typeAnnotation"
  9690. ],
  9691. fields: {
  9692. operator: (0, _utils.validate)((0, _utils.assertValueType)("string")),
  9693. typeAnnotation: (0, _utils.validateType)("TSType")
  9694. }
  9695. });
  9696. (0, _utils.default)("TSIndexedAccessType", {
  9697. aliases: [
  9698. "TSType"
  9699. ],
  9700. visitor: [
  9701. "objectType",
  9702. "indexType"
  9703. ],
  9704. fields: {
  9705. objectType: (0, _utils.validateType)("TSType"),
  9706. indexType: (0, _utils.validateType)("TSType")
  9707. }
  9708. });
  9709. (0, _utils.default)("TSMappedType", {
  9710. aliases: [
  9711. "TSType"
  9712. ],
  9713. visitor: [
  9714. "typeParameter",
  9715. "typeAnnotation",
  9716. "nameType"
  9717. ],
  9718. fields: {
  9719. readonly: (0, _utils.validateOptional)(bool),
  9720. typeParameter: (0, _utils.validateType)("TSTypeParameter"),
  9721. optional: (0, _utils.validateOptional)(bool),
  9722. typeAnnotation: (0, _utils.validateOptionalType)("TSType"),
  9723. nameType: (0, _utils.validateOptionalType)("TSType")
  9724. }
  9725. });
  9726. (0, _utils.default)("TSLiteralType", {
  9727. aliases: [
  9728. "TSType",
  9729. "TSBaseType"
  9730. ],
  9731. visitor: [
  9732. "literal"
  9733. ],
  9734. fields: {
  9735. literal: {
  9736. validate: function() {
  9737. var validator = function validator(parent, key, node) {
  9738. if ((0, _is.default)("UnaryExpression", node)) {
  9739. unaryOperator(node, "operator", node.operator);
  9740. unaryExpression(node, "argument", node.argument);
  9741. } else {
  9742. literal(parent, key, node);
  9743. }
  9744. };
  9745. var unaryExpression = (0, _utils.assertNodeType)("NumericLiteral", "BigIntLiteral");
  9746. var unaryOperator = (0, _utils.assertOneOf)("-");
  9747. var literal = (0, _utils.assertNodeType)("NumericLiteral", "StringLiteral", "BooleanLiteral", "BigIntLiteral");
  9748. validator.oneOfNodeTypes = [
  9749. "NumericLiteral",
  9750. "StringLiteral",
  9751. "BooleanLiteral",
  9752. "BigIntLiteral",
  9753. "UnaryExpression"
  9754. ];
  9755. return validator;
  9756. }()
  9757. }
  9758. }
  9759. });
  9760. (0, _utils.default)("TSExpressionWithTypeArguments", {
  9761. aliases: [
  9762. "TSType"
  9763. ],
  9764. visitor: [
  9765. "expression",
  9766. "typeParameters"
  9767. ],
  9768. fields: {
  9769. expression: (0, _utils.validateType)("TSEntityName"),
  9770. typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterInstantiation")
  9771. }
  9772. });
  9773. (0, _utils.default)("TSInterfaceDeclaration", {
  9774. aliases: [
  9775. "Statement",
  9776. "Declaration"
  9777. ],
  9778. visitor: [
  9779. "id",
  9780. "typeParameters",
  9781. "extends",
  9782. "body"
  9783. ],
  9784. fields: {
  9785. declare: (0, _utils.validateOptional)(bool),
  9786. id: (0, _utils.validateType)("Identifier"),
  9787. typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterDeclaration"),
  9788. extends: (0, _utils.validateOptional)((0, _utils.arrayOfType)("TSExpressionWithTypeArguments")),
  9789. body: (0, _utils.validateType)("TSInterfaceBody")
  9790. }
  9791. });
  9792. (0, _utils.default)("TSInterfaceBody", {
  9793. visitor: [
  9794. "body"
  9795. ],
  9796. fields: {
  9797. body: (0, _utils.validateArrayOfType)("TSTypeElement")
  9798. }
  9799. });
  9800. (0, _utils.default)("TSTypeAliasDeclaration", {
  9801. aliases: [
  9802. "Statement",
  9803. "Declaration"
  9804. ],
  9805. visitor: [
  9806. "id",
  9807. "typeParameters",
  9808. "typeAnnotation"
  9809. ],
  9810. fields: {
  9811. declare: (0, _utils.validateOptional)(bool),
  9812. id: (0, _utils.validateType)("Identifier"),
  9813. typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterDeclaration"),
  9814. typeAnnotation: (0, _utils.validateType)("TSType")
  9815. }
  9816. });
  9817. (0, _utils.default)("TSAsExpression", {
  9818. aliases: [
  9819. "Expression"
  9820. ],
  9821. visitor: [
  9822. "expression",
  9823. "typeAnnotation"
  9824. ],
  9825. fields: {
  9826. expression: (0, _utils.validateType)("Expression"),
  9827. typeAnnotation: (0, _utils.validateType)("TSType")
  9828. }
  9829. });
  9830. (0, _utils.default)("TSTypeAssertion", {
  9831. aliases: [
  9832. "Expression"
  9833. ],
  9834. visitor: [
  9835. "typeAnnotation",
  9836. "expression"
  9837. ],
  9838. fields: {
  9839. typeAnnotation: (0, _utils.validateType)("TSType"),
  9840. expression: (0, _utils.validateType)("Expression")
  9841. }
  9842. });
  9843. (0, _utils.default)("TSEnumDeclaration", {
  9844. aliases: [
  9845. "Statement",
  9846. "Declaration"
  9847. ],
  9848. visitor: [
  9849. "id",
  9850. "members"
  9851. ],
  9852. fields: {
  9853. declare: (0, _utils.validateOptional)(bool),
  9854. const: (0, _utils.validateOptional)(bool),
  9855. id: (0, _utils.validateType)("Identifier"),
  9856. members: (0, _utils.validateArrayOfType)("TSEnumMember"),
  9857. initializer: (0, _utils.validateOptionalType)("Expression")
  9858. }
  9859. });
  9860. (0, _utils.default)("TSEnumMember", {
  9861. visitor: [
  9862. "id",
  9863. "initializer"
  9864. ],
  9865. fields: {
  9866. id: (0, _utils.validateType)([
  9867. "Identifier",
  9868. "StringLiteral"
  9869. ]),
  9870. initializer: (0, _utils.validateOptionalType)("Expression")
  9871. }
  9872. });
  9873. (0, _utils.default)("TSModuleDeclaration", {
  9874. aliases: [
  9875. "Statement",
  9876. "Declaration"
  9877. ],
  9878. visitor: [
  9879. "id",
  9880. "body"
  9881. ],
  9882. fields: {
  9883. declare: (0, _utils.validateOptional)(bool),
  9884. global: (0, _utils.validateOptional)(bool),
  9885. id: (0, _utils.validateType)([
  9886. "Identifier",
  9887. "StringLiteral"
  9888. ]),
  9889. body: (0, _utils.validateType)([
  9890. "TSModuleBlock",
  9891. "TSModuleDeclaration"
  9892. ])
  9893. }
  9894. });
  9895. (0, _utils.default)("TSModuleBlock", {
  9896. aliases: [
  9897. "Scopable",
  9898. "Block",
  9899. "BlockParent"
  9900. ],
  9901. visitor: [
  9902. "body"
  9903. ],
  9904. fields: {
  9905. body: (0, _utils.validateArrayOfType)("Statement")
  9906. }
  9907. });
  9908. (0, _utils.default)("TSImportType", {
  9909. aliases: [
  9910. "TSType"
  9911. ],
  9912. visitor: [
  9913. "argument",
  9914. "qualifier",
  9915. "typeParameters"
  9916. ],
  9917. fields: {
  9918. argument: (0, _utils.validateType)("StringLiteral"),
  9919. qualifier: (0, _utils.validateOptionalType)("TSEntityName"),
  9920. typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterInstantiation")
  9921. }
  9922. });
  9923. (0, _utils.default)("TSImportEqualsDeclaration", {
  9924. aliases: [
  9925. "Statement"
  9926. ],
  9927. visitor: [
  9928. "id",
  9929. "moduleReference"
  9930. ],
  9931. fields: {
  9932. isExport: (0, _utils.validate)(bool),
  9933. id: (0, _utils.validateType)("Identifier"),
  9934. moduleReference: (0, _utils.validateType)([
  9935. "TSEntityName",
  9936. "TSExternalModuleReference"
  9937. ]),
  9938. importKind: {
  9939. validate: (0, _utils.assertOneOf)("type", "value"),
  9940. optional: true
  9941. }
  9942. }
  9943. });
  9944. (0, _utils.default)("TSExternalModuleReference", {
  9945. visitor: [
  9946. "expression"
  9947. ],
  9948. fields: {
  9949. expression: (0, _utils.validateType)("StringLiteral")
  9950. }
  9951. });
  9952. (0, _utils.default)("TSNonNullExpression", {
  9953. aliases: [
  9954. "Expression"
  9955. ],
  9956. visitor: [
  9957. "expression"
  9958. ],
  9959. fields: {
  9960. expression: (0, _utils.validateType)("Expression")
  9961. }
  9962. });
  9963. (0, _utils.default)("TSExportAssignment", {
  9964. aliases: [
  9965. "Statement"
  9966. ],
  9967. visitor: [
  9968. "expression"
  9969. ],
  9970. fields: {
  9971. expression: (0, _utils.validateType)("Expression")
  9972. }
  9973. });
  9974. (0, _utils.default)("TSNamespaceExportDeclaration", {
  9975. aliases: [
  9976. "Statement"
  9977. ],
  9978. visitor: [
  9979. "id"
  9980. ],
  9981. fields: {
  9982. id: (0, _utils.validateType)("Identifier")
  9983. }
  9984. });
  9985. (0, _utils.default)("TSTypeAnnotation", {
  9986. visitor: [
  9987. "typeAnnotation"
  9988. ],
  9989. fields: {
  9990. typeAnnotation: {
  9991. validate: (0, _utils.assertNodeType)("TSType")
  9992. }
  9993. }
  9994. });
  9995. (0, _utils.default)("TSTypeParameterInstantiation", {
  9996. visitor: [
  9997. "params"
  9998. ],
  9999. fields: {
  10000. params: {
  10001. validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("TSType")))
  10002. }
  10003. }
  10004. });
  10005. (0, _utils.default)("TSTypeParameterDeclaration", {
  10006. visitor: [
  10007. "params"
  10008. ],
  10009. fields: {
  10010. params: {
  10011. validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("TSTypeParameter")))
  10012. }
  10013. }
  10014. });
  10015. (0, _utils.default)("TSTypeParameter", {
  10016. builder: [
  10017. "constraint",
  10018. "default",
  10019. "name"
  10020. ],
  10021. visitor: [
  10022. "constraint",
  10023. "default"
  10024. ],
  10025. fields: {
  10026. name: {
  10027. validate: (0, _utils.assertValueType)("string")
  10028. },
  10029. constraint: {
  10030. validate: (0, _utils.assertNodeType)("TSType"),
  10031. optional: true
  10032. },
  10033. default: {
  10034. validate: (0, _utils.assertNodeType)("TSType"),
  10035. optional: true
  10036. }
  10037. }
  10038. });
  10039. return typescript;
  10040. }
  10041. var hasRequiredDefinitions;
  10042. function requireDefinitions() {
  10043. if (hasRequiredDefinitions) return definitions;
  10044. hasRequiredDefinitions = 1;
  10045. (function(exports) {
  10046. Object.defineProperty(exports, "__esModule", {
  10047. value: true
  10048. });
  10049. Object.defineProperty(exports, "VISITOR_KEYS", {
  10050. enumerable: true,
  10051. get: function get() {
  10052. return _utils.VISITOR_KEYS;
  10053. }
  10054. });
  10055. Object.defineProperty(exports, "ALIAS_KEYS", {
  10056. enumerable: true,
  10057. get: function get() {
  10058. return _utils.ALIAS_KEYS;
  10059. }
  10060. });
  10061. Object.defineProperty(exports, "FLIPPED_ALIAS_KEYS", {
  10062. enumerable: true,
  10063. get: function get() {
  10064. return _utils.FLIPPED_ALIAS_KEYS;
  10065. }
  10066. });
  10067. Object.defineProperty(exports, "NODE_FIELDS", {
  10068. enumerable: true,
  10069. get: function get() {
  10070. return _utils.NODE_FIELDS;
  10071. }
  10072. });
  10073. Object.defineProperty(exports, "BUILDER_KEYS", {
  10074. enumerable: true,
  10075. get: function get() {
  10076. return _utils.BUILDER_KEYS;
  10077. }
  10078. });
  10079. Object.defineProperty(exports, "DEPRECATED_KEYS", {
  10080. enumerable: true,
  10081. get: function get() {
  10082. return _utils.DEPRECATED_KEYS;
  10083. }
  10084. });
  10085. Object.defineProperty(exports, "NODE_PARENT_VALIDATIONS", {
  10086. enumerable: true,
  10087. get: function get() {
  10088. return _utils.NODE_PARENT_VALIDATIONS;
  10089. }
  10090. });
  10091. Object.defineProperty(exports, "PLACEHOLDERS", {
  10092. enumerable: true,
  10093. get: function get() {
  10094. return _placeholders.PLACEHOLDERS;
  10095. }
  10096. });
  10097. Object.defineProperty(exports, "PLACEHOLDERS_ALIAS", {
  10098. enumerable: true,
  10099. get: function get() {
  10100. return _placeholders.PLACEHOLDERS_ALIAS;
  10101. }
  10102. });
  10103. Object.defineProperty(exports, "PLACEHOLDERS_FLIPPED_ALIAS", {
  10104. enumerable: true,
  10105. get: function get() {
  10106. return _placeholders.PLACEHOLDERS_FLIPPED_ALIAS;
  10107. }
  10108. });
  10109. exports.TYPES = void 0;
  10110. var _toFastProperties = requireToFastProperties();
  10111. requireCore();
  10112. requireFlow();
  10113. requireJsx();
  10114. requireMisc();
  10115. requireExperimental();
  10116. requireTypescript();
  10117. var _utils = requireUtils();
  10118. var _placeholders = requirePlaceholders();
  10119. _toFastProperties(_utils.VISITOR_KEYS);
  10120. _toFastProperties(_utils.ALIAS_KEYS);
  10121. _toFastProperties(_utils.FLIPPED_ALIAS_KEYS);
  10122. _toFastProperties(_utils.NODE_FIELDS);
  10123. _toFastProperties(_utils.BUILDER_KEYS);
  10124. _toFastProperties(_utils.DEPRECATED_KEYS);
  10125. _toFastProperties(_placeholders.PLACEHOLDERS_ALIAS);
  10126. _toFastProperties(_placeholders.PLACEHOLDERS_FLIPPED_ALIAS);
  10127. var TYPES = Object.keys(_utils.VISITOR_KEYS).concat(Object.keys(_utils.FLIPPED_ALIAS_KEYS)).concat(Object.keys(_utils.DEPRECATED_KEYS));
  10128. exports.TYPES = TYPES;
  10129. })(definitions);
  10130. return definitions;
  10131. }
  10132. Object.defineProperty(builder$1, "__esModule", {
  10133. value: true
  10134. });
  10135. builder$1.default = builder;
  10136. var _definitions$6 = requireDefinitions();
  10137. var _validate = requireValidate();
  10138. function builder(type) {
  10139. for(var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){
  10140. args[_key - 1] = arguments[_key];
  10141. }
  10142. var keys = _definitions$6.BUILDER_KEYS[type];
  10143. var countArgs = args.length;
  10144. if (countArgs > keys.length) {
  10145. throw new Error(type + ": Too many arguments passed. Received " + countArgs + " but can receive no more than " + keys.length);
  10146. }
  10147. var node = {
  10148. type: type
  10149. };
  10150. var i = 0;
  10151. keys.forEach(function(key) {
  10152. var field = _definitions$6.NODE_FIELDS[type][key];
  10153. var arg;
  10154. if (i < countArgs) arg = args[i];
  10155. if (arg === undefined) {
  10156. arg = Array.isArray(field.default) ? [] : field.default;
  10157. }
  10158. node[key] = arg;
  10159. i++;
  10160. });
  10161. for(var _i = 0, _iter = Object.keys(node); _i < _iter.length; _i++){
  10162. var key = _iter[_i];
  10163. (0, _validate.default)(node, key, node[key]);
  10164. }
  10165. return node;
  10166. }
  10167. function _arrayLikeToArray$1(arr, len) {
  10168. if (len == null || len > arr.length) len = arr.length;
  10169. for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
  10170. return arr2;
  10171. }
  10172. function _arrayWithoutHoles$1(arr) {
  10173. if (Array.isArray(arr)) return _arrayLikeToArray$1(arr);
  10174. }
  10175. function _iterableToArray$1(iter) {
  10176. if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
  10177. }
  10178. function _nonIterableSpread$1() {
  10179. throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  10180. }
  10181. function _toConsumableArray$1(arr) {
  10182. return _arrayWithoutHoles$1(arr) || _iterableToArray$1(arr) || _unsupportedIterableToArray$1(arr) || _nonIterableSpread$1();
  10183. }
  10184. function _unsupportedIterableToArray$1(o, minLen) {
  10185. if (!o) return;
  10186. if (typeof o === "string") return _arrayLikeToArray$1(o, minLen);
  10187. var n = Object.prototype.toString.call(o).slice(8, -1);
  10188. if (n === "Object" && o.constructor) n = o.constructor.name;
  10189. if (n === "Map" || n === "Set") return Array.from(n);
  10190. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$1(o, minLen);
  10191. }
  10192. Object.defineProperty(generated$3, "__esModule", {
  10193. value: true
  10194. });
  10195. generated$3.arrayExpression = arrayExpression;
  10196. generated$3.assignmentExpression = assignmentExpression;
  10197. generated$3.binaryExpression = binaryExpression;
  10198. generated$3.interpreterDirective = interpreterDirective;
  10199. generated$3.directive = directive;
  10200. generated$3.directiveLiteral = directiveLiteral;
  10201. generated$3.blockStatement = blockStatement;
  10202. generated$3.breakStatement = breakStatement;
  10203. generated$3.callExpression = callExpression;
  10204. generated$3.catchClause = catchClause;
  10205. generated$3.conditionalExpression = conditionalExpression;
  10206. generated$3.continueStatement = continueStatement;
  10207. generated$3.debuggerStatement = debuggerStatement;
  10208. generated$3.doWhileStatement = doWhileStatement;
  10209. generated$3.emptyStatement = emptyStatement;
  10210. generated$3.expressionStatement = expressionStatement;
  10211. generated$3.file = file;
  10212. generated$3.forInStatement = forInStatement;
  10213. generated$3.forStatement = forStatement;
  10214. generated$3.functionDeclaration = functionDeclaration;
  10215. generated$3.functionExpression = functionExpression;
  10216. generated$3.identifier = identifier;
  10217. generated$3.ifStatement = ifStatement;
  10218. generated$3.labeledStatement = labeledStatement;
  10219. generated$3.stringLiteral = stringLiteral;
  10220. generated$3.numericLiteral = numericLiteral;
  10221. generated$3.nullLiteral = nullLiteral;
  10222. generated$3.booleanLiteral = booleanLiteral;
  10223. generated$3.regExpLiteral = regExpLiteral;
  10224. generated$3.logicalExpression = logicalExpression;
  10225. generated$3.memberExpression = memberExpression;
  10226. generated$3.newExpression = newExpression;
  10227. generated$3.program = program;
  10228. generated$3.objectExpression = objectExpression;
  10229. generated$3.objectMethod = objectMethod;
  10230. generated$3.objectProperty = objectProperty;
  10231. generated$3.restElement = restElement;
  10232. generated$3.returnStatement = returnStatement;
  10233. generated$3.sequenceExpression = sequenceExpression;
  10234. generated$3.parenthesizedExpression = parenthesizedExpression;
  10235. generated$3.switchCase = switchCase;
  10236. generated$3.switchStatement = switchStatement;
  10237. generated$3.thisExpression = thisExpression;
  10238. generated$3.throwStatement = throwStatement;
  10239. generated$3.tryStatement = tryStatement;
  10240. generated$3.unaryExpression = unaryExpression;
  10241. generated$3.updateExpression = updateExpression;
  10242. generated$3.variableDeclaration = variableDeclaration;
  10243. generated$3.variableDeclarator = variableDeclarator;
  10244. generated$3.whileStatement = whileStatement;
  10245. generated$3.withStatement = withStatement;
  10246. generated$3.assignmentPattern = assignmentPattern;
  10247. generated$3.arrayPattern = arrayPattern;
  10248. generated$3.arrowFunctionExpression = arrowFunctionExpression;
  10249. generated$3.classBody = classBody;
  10250. generated$3.classExpression = classExpression;
  10251. generated$3.classDeclaration = classDeclaration;
  10252. generated$3.exportAllDeclaration = exportAllDeclaration;
  10253. generated$3.exportDefaultDeclaration = exportDefaultDeclaration;
  10254. generated$3.exportNamedDeclaration = exportNamedDeclaration;
  10255. generated$3.exportSpecifier = exportSpecifier;
  10256. generated$3.forOfStatement = forOfStatement;
  10257. generated$3.importDeclaration = importDeclaration;
  10258. generated$3.importDefaultSpecifier = importDefaultSpecifier;
  10259. generated$3.importNamespaceSpecifier = importNamespaceSpecifier;
  10260. generated$3.importSpecifier = importSpecifier;
  10261. generated$3.metaProperty = metaProperty;
  10262. generated$3.classMethod = classMethod;
  10263. generated$3.objectPattern = objectPattern;
  10264. generated$3.spreadElement = spreadElement;
  10265. generated$3.super = _super;
  10266. generated$3.taggedTemplateExpression = taggedTemplateExpression;
  10267. generated$3.templateElement = templateElement;
  10268. generated$3.templateLiteral = templateLiteral;
  10269. generated$3.yieldExpression = yieldExpression;
  10270. generated$3.awaitExpression = awaitExpression;
  10271. generated$3.import = _import;
  10272. generated$3.bigIntLiteral = bigIntLiteral;
  10273. generated$3.exportNamespaceSpecifier = exportNamespaceSpecifier;
  10274. generated$3.optionalMemberExpression = optionalMemberExpression;
  10275. generated$3.optionalCallExpression = optionalCallExpression;
  10276. generated$3.classProperty = classProperty;
  10277. generated$3.classPrivateProperty = classPrivateProperty;
  10278. generated$3.classPrivateMethod = classPrivateMethod;
  10279. generated$3.privateName = privateName;
  10280. generated$3.anyTypeAnnotation = anyTypeAnnotation;
  10281. generated$3.arrayTypeAnnotation = arrayTypeAnnotation;
  10282. generated$3.booleanTypeAnnotation = booleanTypeAnnotation;
  10283. generated$3.booleanLiteralTypeAnnotation = booleanLiteralTypeAnnotation;
  10284. generated$3.nullLiteralTypeAnnotation = nullLiteralTypeAnnotation;
  10285. generated$3.classImplements = classImplements;
  10286. generated$3.declareClass = declareClass;
  10287. generated$3.declareFunction = declareFunction;
  10288. generated$3.declareInterface = declareInterface;
  10289. generated$3.declareModule = declareModule;
  10290. generated$3.declareModuleExports = declareModuleExports;
  10291. generated$3.declareTypeAlias = declareTypeAlias;
  10292. generated$3.declareOpaqueType = declareOpaqueType;
  10293. generated$3.declareVariable = declareVariable;
  10294. generated$3.declareExportDeclaration = declareExportDeclaration;
  10295. generated$3.declareExportAllDeclaration = declareExportAllDeclaration;
  10296. generated$3.declaredPredicate = declaredPredicate;
  10297. generated$3.existsTypeAnnotation = existsTypeAnnotation;
  10298. generated$3.functionTypeAnnotation = functionTypeAnnotation;
  10299. generated$3.functionTypeParam = functionTypeParam;
  10300. generated$3.genericTypeAnnotation = genericTypeAnnotation;
  10301. generated$3.inferredPredicate = inferredPredicate;
  10302. generated$3.interfaceExtends = interfaceExtends;
  10303. generated$3.interfaceDeclaration = interfaceDeclaration;
  10304. generated$3.interfaceTypeAnnotation = interfaceTypeAnnotation;
  10305. generated$3.intersectionTypeAnnotation = intersectionTypeAnnotation;
  10306. generated$3.mixedTypeAnnotation = mixedTypeAnnotation;
  10307. generated$3.emptyTypeAnnotation = emptyTypeAnnotation;
  10308. generated$3.nullableTypeAnnotation = nullableTypeAnnotation;
  10309. generated$3.numberLiteralTypeAnnotation = numberLiteralTypeAnnotation;
  10310. generated$3.numberTypeAnnotation = numberTypeAnnotation;
  10311. generated$3.objectTypeAnnotation = objectTypeAnnotation;
  10312. generated$3.objectTypeInternalSlot = objectTypeInternalSlot;
  10313. generated$3.objectTypeCallProperty = objectTypeCallProperty;
  10314. generated$3.objectTypeIndexer = objectTypeIndexer;
  10315. generated$3.objectTypeProperty = objectTypeProperty;
  10316. generated$3.objectTypeSpreadProperty = objectTypeSpreadProperty;
  10317. generated$3.opaqueType = opaqueType;
  10318. generated$3.qualifiedTypeIdentifier = qualifiedTypeIdentifier;
  10319. generated$3.stringLiteralTypeAnnotation = stringLiteralTypeAnnotation;
  10320. generated$3.stringTypeAnnotation = stringTypeAnnotation;
  10321. generated$3.symbolTypeAnnotation = symbolTypeAnnotation;
  10322. generated$3.thisTypeAnnotation = thisTypeAnnotation;
  10323. generated$3.tupleTypeAnnotation = tupleTypeAnnotation;
  10324. generated$3.typeofTypeAnnotation = typeofTypeAnnotation;
  10325. generated$3.typeAlias = typeAlias;
  10326. generated$3.typeAnnotation = typeAnnotation;
  10327. generated$3.typeCastExpression = typeCastExpression;
  10328. generated$3.typeParameter = typeParameter;
  10329. generated$3.typeParameterDeclaration = typeParameterDeclaration;
  10330. generated$3.typeParameterInstantiation = typeParameterInstantiation;
  10331. generated$3.unionTypeAnnotation = unionTypeAnnotation;
  10332. generated$3.variance = variance;
  10333. generated$3.voidTypeAnnotation = voidTypeAnnotation;
  10334. generated$3.enumDeclaration = enumDeclaration;
  10335. generated$3.enumBooleanBody = enumBooleanBody;
  10336. generated$3.enumNumberBody = enumNumberBody;
  10337. generated$3.enumStringBody = enumStringBody;
  10338. generated$3.enumSymbolBody = enumSymbolBody;
  10339. generated$3.enumBooleanMember = enumBooleanMember;
  10340. generated$3.enumNumberMember = enumNumberMember;
  10341. generated$3.enumStringMember = enumStringMember;
  10342. generated$3.enumDefaultedMember = enumDefaultedMember;
  10343. generated$3.indexedAccessType = indexedAccessType;
  10344. generated$3.optionalIndexedAccessType = optionalIndexedAccessType;
  10345. generated$3.jSXAttribute = generated$3.jsxAttribute = jsxAttribute;
  10346. generated$3.jSXClosingElement = generated$3.jsxClosingElement = jsxClosingElement;
  10347. generated$3.jSXElement = generated$3.jsxElement = jsxElement;
  10348. generated$3.jSXEmptyExpression = generated$3.jsxEmptyExpression = jsxEmptyExpression;
  10349. generated$3.jSXExpressionContainer = generated$3.jsxExpressionContainer = jsxExpressionContainer;
  10350. generated$3.jSXSpreadChild = generated$3.jsxSpreadChild = jsxSpreadChild;
  10351. generated$3.jSXIdentifier = generated$3.jsxIdentifier = jsxIdentifier;
  10352. generated$3.jSXMemberExpression = generated$3.jsxMemberExpression = jsxMemberExpression;
  10353. generated$3.jSXNamespacedName = generated$3.jsxNamespacedName = jsxNamespacedName;
  10354. generated$3.jSXOpeningElement = generated$3.jsxOpeningElement = jsxOpeningElement;
  10355. generated$3.jSXSpreadAttribute = generated$3.jsxSpreadAttribute = jsxSpreadAttribute;
  10356. generated$3.jSXText = generated$3.jsxText = jsxText;
  10357. generated$3.jSXFragment = generated$3.jsxFragment = jsxFragment;
  10358. generated$3.jSXOpeningFragment = generated$3.jsxOpeningFragment = jsxOpeningFragment;
  10359. generated$3.jSXClosingFragment = generated$3.jsxClosingFragment = jsxClosingFragment;
  10360. generated$3.noop = noop;
  10361. generated$3.placeholder = placeholder;
  10362. generated$3.v8IntrinsicIdentifier = v8IntrinsicIdentifier;
  10363. generated$3.argumentPlaceholder = argumentPlaceholder;
  10364. generated$3.bindExpression = bindExpression;
  10365. generated$3.importAttribute = importAttribute;
  10366. generated$3.decorator = decorator;
  10367. generated$3.doExpression = doExpression;
  10368. generated$3.exportDefaultSpecifier = exportDefaultSpecifier;
  10369. generated$3.recordExpression = recordExpression;
  10370. generated$3.tupleExpression = tupleExpression;
  10371. generated$3.decimalLiteral = decimalLiteral;
  10372. generated$3.staticBlock = staticBlock;
  10373. generated$3.moduleExpression = moduleExpression;
  10374. generated$3.topicReference = topicReference;
  10375. generated$3.pipelineTopicExpression = pipelineTopicExpression;
  10376. generated$3.pipelineBareFunction = pipelineBareFunction;
  10377. generated$3.pipelinePrimaryTopicReference = pipelinePrimaryTopicReference;
  10378. generated$3.tSParameterProperty = generated$3.tsParameterProperty = tsParameterProperty;
  10379. generated$3.tSDeclareFunction = generated$3.tsDeclareFunction = tsDeclareFunction;
  10380. generated$3.tSDeclareMethod = generated$3.tsDeclareMethod = tsDeclareMethod;
  10381. generated$3.tSQualifiedName = generated$3.tsQualifiedName = tsQualifiedName;
  10382. generated$3.tSCallSignatureDeclaration = generated$3.tsCallSignatureDeclaration = tsCallSignatureDeclaration;
  10383. generated$3.tSConstructSignatureDeclaration = generated$3.tsConstructSignatureDeclaration = tsConstructSignatureDeclaration;
  10384. generated$3.tSPropertySignature = generated$3.tsPropertySignature = tsPropertySignature;
  10385. generated$3.tSMethodSignature = generated$3.tsMethodSignature = tsMethodSignature;
  10386. generated$3.tSIndexSignature = generated$3.tsIndexSignature = tsIndexSignature;
  10387. generated$3.tSAnyKeyword = generated$3.tsAnyKeyword = tsAnyKeyword;
  10388. generated$3.tSBooleanKeyword = generated$3.tsBooleanKeyword = tsBooleanKeyword;
  10389. generated$3.tSBigIntKeyword = generated$3.tsBigIntKeyword = tsBigIntKeyword;
  10390. generated$3.tSIntrinsicKeyword = generated$3.tsIntrinsicKeyword = tsIntrinsicKeyword;
  10391. generated$3.tSNeverKeyword = generated$3.tsNeverKeyword = tsNeverKeyword;
  10392. generated$3.tSNullKeyword = generated$3.tsNullKeyword = tsNullKeyword;
  10393. generated$3.tSNumberKeyword = generated$3.tsNumberKeyword = tsNumberKeyword;
  10394. generated$3.tSObjectKeyword = generated$3.tsObjectKeyword = tsObjectKeyword;
  10395. generated$3.tSStringKeyword = generated$3.tsStringKeyword = tsStringKeyword;
  10396. generated$3.tSSymbolKeyword = generated$3.tsSymbolKeyword = tsSymbolKeyword;
  10397. generated$3.tSUndefinedKeyword = generated$3.tsUndefinedKeyword = tsUndefinedKeyword;
  10398. generated$3.tSUnknownKeyword = generated$3.tsUnknownKeyword = tsUnknownKeyword;
  10399. generated$3.tSVoidKeyword = generated$3.tsVoidKeyword = tsVoidKeyword;
  10400. generated$3.tSThisType = generated$3.tsThisType = tsThisType;
  10401. generated$3.tSFunctionType = generated$3.tsFunctionType = tsFunctionType;
  10402. generated$3.tSConstructorType = generated$3.tsConstructorType = tsConstructorType;
  10403. generated$3.tSTypeReference = generated$3.tsTypeReference = tsTypeReference;
  10404. generated$3.tSTypePredicate = generated$3.tsTypePredicate = tsTypePredicate;
  10405. generated$3.tSTypeQuery = generated$3.tsTypeQuery = tsTypeQuery;
  10406. generated$3.tSTypeLiteral = generated$3.tsTypeLiteral = tsTypeLiteral;
  10407. generated$3.tSArrayType = generated$3.tsArrayType = tsArrayType;
  10408. generated$3.tSTupleType = generated$3.tsTupleType = tsTupleType;
  10409. generated$3.tSOptionalType = generated$3.tsOptionalType = tsOptionalType;
  10410. generated$3.tSRestType = generated$3.tsRestType = tsRestType;
  10411. generated$3.tSNamedTupleMember = generated$3.tsNamedTupleMember = tsNamedTupleMember;
  10412. generated$3.tSUnionType = generated$3.tsUnionType = tsUnionType;
  10413. generated$3.tSIntersectionType = generated$3.tsIntersectionType = tsIntersectionType;
  10414. generated$3.tSConditionalType = generated$3.tsConditionalType = tsConditionalType;
  10415. generated$3.tSInferType = generated$3.tsInferType = tsInferType;
  10416. generated$3.tSParenthesizedType = generated$3.tsParenthesizedType = tsParenthesizedType;
  10417. generated$3.tSTypeOperator = generated$3.tsTypeOperator = tsTypeOperator;
  10418. generated$3.tSIndexedAccessType = generated$3.tsIndexedAccessType = tsIndexedAccessType;
  10419. generated$3.tSMappedType = generated$3.tsMappedType = tsMappedType;
  10420. generated$3.tSLiteralType = generated$3.tsLiteralType = tsLiteralType;
  10421. generated$3.tSExpressionWithTypeArguments = generated$3.tsExpressionWithTypeArguments = tsExpressionWithTypeArguments;
  10422. generated$3.tSInterfaceDeclaration = generated$3.tsInterfaceDeclaration = tsInterfaceDeclaration;
  10423. generated$3.tSInterfaceBody = generated$3.tsInterfaceBody = tsInterfaceBody;
  10424. generated$3.tSTypeAliasDeclaration = generated$3.tsTypeAliasDeclaration = tsTypeAliasDeclaration;
  10425. generated$3.tSAsExpression = generated$3.tsAsExpression = tsAsExpression;
  10426. generated$3.tSTypeAssertion = generated$3.tsTypeAssertion = tsTypeAssertion;
  10427. generated$3.tSEnumDeclaration = generated$3.tsEnumDeclaration = tsEnumDeclaration;
  10428. generated$3.tSEnumMember = generated$3.tsEnumMember = tsEnumMember;
  10429. generated$3.tSModuleDeclaration = generated$3.tsModuleDeclaration = tsModuleDeclaration;
  10430. generated$3.tSModuleBlock = generated$3.tsModuleBlock = tsModuleBlock;
  10431. generated$3.tSImportType = generated$3.tsImportType = tsImportType;
  10432. generated$3.tSImportEqualsDeclaration = generated$3.tsImportEqualsDeclaration = tsImportEqualsDeclaration;
  10433. generated$3.tSExternalModuleReference = generated$3.tsExternalModuleReference = tsExternalModuleReference;
  10434. generated$3.tSNonNullExpression = generated$3.tsNonNullExpression = tsNonNullExpression;
  10435. generated$3.tSExportAssignment = generated$3.tsExportAssignment = tsExportAssignment;
  10436. generated$3.tSNamespaceExportDeclaration = generated$3.tsNamespaceExportDeclaration = tsNamespaceExportDeclaration;
  10437. generated$3.tSTypeAnnotation = generated$3.tsTypeAnnotation = tsTypeAnnotation;
  10438. generated$3.tSTypeParameterInstantiation = generated$3.tsTypeParameterInstantiation = tsTypeParameterInstantiation;
  10439. generated$3.tSTypeParameterDeclaration = generated$3.tsTypeParameterDeclaration = tsTypeParameterDeclaration;
  10440. generated$3.tSTypeParameter = generated$3.tsTypeParameter = tsTypeParameter;
  10441. generated$3.numberLiteral = NumberLiteral;
  10442. generated$3.regexLiteral = RegexLiteral;
  10443. generated$3.restProperty = RestProperty;
  10444. generated$3.spreadProperty = SpreadProperty;
  10445. var _builder = builder$1;
  10446. function arrayExpression(elements) {
  10447. return (_builder.default).apply(this, [
  10448. "ArrayExpression"
  10449. ].concat(Array.prototype.slice.call(arguments)));
  10450. }
  10451. function assignmentExpression(operator, left, right) {
  10452. return (_builder.default).apply(this, [
  10453. "AssignmentExpression"
  10454. ].concat(Array.prototype.slice.call(arguments)));
  10455. }
  10456. function binaryExpression(operator, left, right) {
  10457. return (_builder.default).apply(this, [
  10458. "BinaryExpression"
  10459. ].concat(Array.prototype.slice.call(arguments)));
  10460. }
  10461. function interpreterDirective(value) {
  10462. return (_builder.default).apply(this, [
  10463. "InterpreterDirective"
  10464. ].concat(Array.prototype.slice.call(arguments)));
  10465. }
  10466. function directive(value) {
  10467. return (_builder.default).apply(this, [
  10468. "Directive"
  10469. ].concat(Array.prototype.slice.call(arguments)));
  10470. }
  10471. function directiveLiteral(value) {
  10472. return (_builder.default).apply(this, [
  10473. "DirectiveLiteral"
  10474. ].concat(Array.prototype.slice.call(arguments)));
  10475. }
  10476. function blockStatement(body, directives) {
  10477. return (_builder.default).apply(this, [
  10478. "BlockStatement"
  10479. ].concat(Array.prototype.slice.call(arguments)));
  10480. }
  10481. function breakStatement(label) {
  10482. return (_builder.default).apply(this, [
  10483. "BreakStatement"
  10484. ].concat(Array.prototype.slice.call(arguments)));
  10485. }
  10486. function callExpression(callee, _arguments) {
  10487. return (_builder.default).apply(this, [
  10488. "CallExpression"
  10489. ].concat(Array.prototype.slice.call(arguments)));
  10490. }
  10491. function catchClause(param, body) {
  10492. return (_builder.default).apply(this, [
  10493. "CatchClause"
  10494. ].concat(Array.prototype.slice.call(arguments)));
  10495. }
  10496. function conditionalExpression(test, consequent, alternate) {
  10497. return (_builder.default).apply(this, [
  10498. "ConditionalExpression"
  10499. ].concat(Array.prototype.slice.call(arguments)));
  10500. }
  10501. function continueStatement(label) {
  10502. return (_builder.default).apply(this, [
  10503. "ContinueStatement"
  10504. ].concat(Array.prototype.slice.call(arguments)));
  10505. }
  10506. function debuggerStatement() {
  10507. return (_builder.default).apply(this, [
  10508. "DebuggerStatement"
  10509. ].concat(Array.prototype.slice.call(arguments)));
  10510. }
  10511. function doWhileStatement(test, body) {
  10512. return (_builder.default).apply(this, [
  10513. "DoWhileStatement"
  10514. ].concat(Array.prototype.slice.call(arguments)));
  10515. }
  10516. function emptyStatement() {
  10517. return (_builder.default).apply(this, [
  10518. "EmptyStatement"
  10519. ].concat(Array.prototype.slice.call(arguments)));
  10520. }
  10521. function expressionStatement(expression) {
  10522. return (_builder.default).apply(this, [
  10523. "ExpressionStatement"
  10524. ].concat(Array.prototype.slice.call(arguments)));
  10525. }
  10526. function file(program, comments, tokens) {
  10527. return (_builder.default).apply(this, [
  10528. "File"
  10529. ].concat(Array.prototype.slice.call(arguments)));
  10530. }
  10531. function forInStatement(left, right, body) {
  10532. return (_builder.default).apply(this, [
  10533. "ForInStatement"
  10534. ].concat(Array.prototype.slice.call(arguments)));
  10535. }
  10536. function forStatement(init, test, update, body) {
  10537. return (_builder.default).apply(this, [
  10538. "ForStatement"
  10539. ].concat(Array.prototype.slice.call(arguments)));
  10540. }
  10541. function functionDeclaration(id, params, body, generator, async) {
  10542. return (_builder.default).apply(this, [
  10543. "FunctionDeclaration"
  10544. ].concat(Array.prototype.slice.call(arguments)));
  10545. }
  10546. function functionExpression(id, params, body, generator, async) {
  10547. return (_builder.default).apply(this, [
  10548. "FunctionExpression"
  10549. ].concat(Array.prototype.slice.call(arguments)));
  10550. }
  10551. function identifier(name) {
  10552. return (_builder.default).apply(this, [
  10553. "Identifier"
  10554. ].concat(Array.prototype.slice.call(arguments)));
  10555. }
  10556. function ifStatement(test, consequent, alternate) {
  10557. return (_builder.default).apply(this, [
  10558. "IfStatement"
  10559. ].concat(Array.prototype.slice.call(arguments)));
  10560. }
  10561. function labeledStatement(label, body) {
  10562. return (_builder.default).apply(this, [
  10563. "LabeledStatement"
  10564. ].concat(Array.prototype.slice.call(arguments)));
  10565. }
  10566. function stringLiteral(value) {
  10567. return (_builder.default).apply(this, [
  10568. "StringLiteral"
  10569. ].concat(Array.prototype.slice.call(arguments)));
  10570. }
  10571. function numericLiteral(value) {
  10572. return (_builder.default).apply(this, [
  10573. "NumericLiteral"
  10574. ].concat(Array.prototype.slice.call(arguments)));
  10575. }
  10576. function nullLiteral() {
  10577. return (_builder.default).apply(this, [
  10578. "NullLiteral"
  10579. ].concat(Array.prototype.slice.call(arguments)));
  10580. }
  10581. function booleanLiteral(value) {
  10582. return (_builder.default).apply(this, [
  10583. "BooleanLiteral"
  10584. ].concat(Array.prototype.slice.call(arguments)));
  10585. }
  10586. function regExpLiteral(pattern, flags) {
  10587. return (_builder.default).apply(this, [
  10588. "RegExpLiteral"
  10589. ].concat(Array.prototype.slice.call(arguments)));
  10590. }
  10591. function logicalExpression(operator, left, right) {
  10592. return (_builder.default).apply(this, [
  10593. "LogicalExpression"
  10594. ].concat(Array.prototype.slice.call(arguments)));
  10595. }
  10596. function memberExpression(object, property, computed, optional) {
  10597. return (_builder.default).apply(this, [
  10598. "MemberExpression"
  10599. ].concat(Array.prototype.slice.call(arguments)));
  10600. }
  10601. function newExpression(callee, _arguments) {
  10602. return (_builder.default).apply(this, [
  10603. "NewExpression"
  10604. ].concat(Array.prototype.slice.call(arguments)));
  10605. }
  10606. function program(body, directives, sourceType, interpreter) {
  10607. return (_builder.default).apply(this, [
  10608. "Program"
  10609. ].concat(Array.prototype.slice.call(arguments)));
  10610. }
  10611. function objectExpression(properties) {
  10612. return (_builder.default).apply(this, [
  10613. "ObjectExpression"
  10614. ].concat(Array.prototype.slice.call(arguments)));
  10615. }
  10616. function objectMethod(kind, key, params, body, computed, generator, async) {
  10617. return (_builder.default).apply(this, [
  10618. "ObjectMethod"
  10619. ].concat(Array.prototype.slice.call(arguments)));
  10620. }
  10621. function objectProperty(key, value, computed, shorthand, decorators) {
  10622. return (_builder.default).apply(this, [
  10623. "ObjectProperty"
  10624. ].concat(Array.prototype.slice.call(arguments)));
  10625. }
  10626. function restElement(argument) {
  10627. return (_builder.default).apply(this, [
  10628. "RestElement"
  10629. ].concat(Array.prototype.slice.call(arguments)));
  10630. }
  10631. function returnStatement(argument) {
  10632. return (_builder.default).apply(this, [
  10633. "ReturnStatement"
  10634. ].concat(Array.prototype.slice.call(arguments)));
  10635. }
  10636. function sequenceExpression(expressions) {
  10637. return (_builder.default).apply(this, [
  10638. "SequenceExpression"
  10639. ].concat(Array.prototype.slice.call(arguments)));
  10640. }
  10641. function parenthesizedExpression(expression) {
  10642. return (_builder.default).apply(this, [
  10643. "ParenthesizedExpression"
  10644. ].concat(Array.prototype.slice.call(arguments)));
  10645. }
  10646. function switchCase(test, consequent) {
  10647. return (_builder.default).apply(this, [
  10648. "SwitchCase"
  10649. ].concat(Array.prototype.slice.call(arguments)));
  10650. }
  10651. function switchStatement(discriminant, cases) {
  10652. return (_builder.default).apply(this, [
  10653. "SwitchStatement"
  10654. ].concat(Array.prototype.slice.call(arguments)));
  10655. }
  10656. function thisExpression() {
  10657. return (_builder.default).apply(this, [
  10658. "ThisExpression"
  10659. ].concat(Array.prototype.slice.call(arguments)));
  10660. }
  10661. function throwStatement(argument) {
  10662. return (_builder.default).apply(this, [
  10663. "ThrowStatement"
  10664. ].concat(Array.prototype.slice.call(arguments)));
  10665. }
  10666. function tryStatement(block, handler, finalizer) {
  10667. return (_builder.default).apply(this, [
  10668. "TryStatement"
  10669. ].concat(Array.prototype.slice.call(arguments)));
  10670. }
  10671. function unaryExpression(operator, argument, prefix) {
  10672. return (_builder.default).apply(this, [
  10673. "UnaryExpression"
  10674. ].concat(Array.prototype.slice.call(arguments)));
  10675. }
  10676. function updateExpression(operator, argument, prefix) {
  10677. return (_builder.default).apply(this, [
  10678. "UpdateExpression"
  10679. ].concat(Array.prototype.slice.call(arguments)));
  10680. }
  10681. function variableDeclaration(kind, declarations) {
  10682. return (_builder.default).apply(this, [
  10683. "VariableDeclaration"
  10684. ].concat(Array.prototype.slice.call(arguments)));
  10685. }
  10686. function variableDeclarator(id, init) {
  10687. return (_builder.default).apply(this, [
  10688. "VariableDeclarator"
  10689. ].concat(Array.prototype.slice.call(arguments)));
  10690. }
  10691. function whileStatement(test, body) {
  10692. return (_builder.default).apply(this, [
  10693. "WhileStatement"
  10694. ].concat(Array.prototype.slice.call(arguments)));
  10695. }
  10696. function withStatement(object, body) {
  10697. return (_builder.default).apply(this, [
  10698. "WithStatement"
  10699. ].concat(Array.prototype.slice.call(arguments)));
  10700. }
  10701. function assignmentPattern(left, right) {
  10702. return (_builder.default).apply(this, [
  10703. "AssignmentPattern"
  10704. ].concat(Array.prototype.slice.call(arguments)));
  10705. }
  10706. function arrayPattern(elements) {
  10707. return (_builder.default).apply(this, [
  10708. "ArrayPattern"
  10709. ].concat(Array.prototype.slice.call(arguments)));
  10710. }
  10711. function arrowFunctionExpression(params, body, async) {
  10712. return (_builder.default).apply(this, [
  10713. "ArrowFunctionExpression"
  10714. ].concat(Array.prototype.slice.call(arguments)));
  10715. }
  10716. function classBody(body) {
  10717. return (_builder.default).apply(this, [
  10718. "ClassBody"
  10719. ].concat(Array.prototype.slice.call(arguments)));
  10720. }
  10721. function classExpression(id, superClass, body, decorators) {
  10722. return (_builder.default).apply(this, [
  10723. "ClassExpression"
  10724. ].concat(Array.prototype.slice.call(arguments)));
  10725. }
  10726. function classDeclaration(id, superClass, body, decorators) {
  10727. return (_builder.default).apply(this, [
  10728. "ClassDeclaration"
  10729. ].concat(Array.prototype.slice.call(arguments)));
  10730. }
  10731. function exportAllDeclaration(source) {
  10732. return (_builder.default).apply(this, [
  10733. "ExportAllDeclaration"
  10734. ].concat(Array.prototype.slice.call(arguments)));
  10735. }
  10736. function exportDefaultDeclaration(declaration) {
  10737. return (_builder.default).apply(this, [
  10738. "ExportDefaultDeclaration"
  10739. ].concat(Array.prototype.slice.call(arguments)));
  10740. }
  10741. function exportNamedDeclaration(declaration, specifiers, source) {
  10742. return (_builder.default).apply(this, [
  10743. "ExportNamedDeclaration"
  10744. ].concat(Array.prototype.slice.call(arguments)));
  10745. }
  10746. function exportSpecifier(local, exported) {
  10747. return (_builder.default).apply(this, [
  10748. "ExportSpecifier"
  10749. ].concat(Array.prototype.slice.call(arguments)));
  10750. }
  10751. function forOfStatement(left, right, body, _await) {
  10752. return (_builder.default).apply(this, [
  10753. "ForOfStatement"
  10754. ].concat(Array.prototype.slice.call(arguments)));
  10755. }
  10756. function importDeclaration(specifiers, source) {
  10757. return (_builder.default).apply(this, [
  10758. "ImportDeclaration"
  10759. ].concat(Array.prototype.slice.call(arguments)));
  10760. }
  10761. function importDefaultSpecifier(local) {
  10762. return (_builder.default).apply(this, [
  10763. "ImportDefaultSpecifier"
  10764. ].concat(Array.prototype.slice.call(arguments)));
  10765. }
  10766. function importNamespaceSpecifier(local) {
  10767. return (_builder.default).apply(this, [
  10768. "ImportNamespaceSpecifier"
  10769. ].concat(Array.prototype.slice.call(arguments)));
  10770. }
  10771. function importSpecifier(local, imported) {
  10772. return (_builder.default).apply(this, [
  10773. "ImportSpecifier"
  10774. ].concat(Array.prototype.slice.call(arguments)));
  10775. }
  10776. function metaProperty(meta, property) {
  10777. return (_builder.default).apply(this, [
  10778. "MetaProperty"
  10779. ].concat(Array.prototype.slice.call(arguments)));
  10780. }
  10781. function classMethod(kind, key, params, body, computed, _static, generator, async) {
  10782. return (_builder.default).apply(this, [
  10783. "ClassMethod"
  10784. ].concat(Array.prototype.slice.call(arguments)));
  10785. }
  10786. function objectPattern(properties) {
  10787. return (_builder.default).apply(this, [
  10788. "ObjectPattern"
  10789. ].concat(Array.prototype.slice.call(arguments)));
  10790. }
  10791. function spreadElement(argument) {
  10792. return (_builder.default).apply(this, [
  10793. "SpreadElement"
  10794. ].concat(Array.prototype.slice.call(arguments)));
  10795. }
  10796. function _super() {
  10797. return (_builder.default).apply(this, [
  10798. "Super"
  10799. ].concat(Array.prototype.slice.call(arguments)));
  10800. }
  10801. function taggedTemplateExpression(tag, quasi) {
  10802. return (_builder.default).apply(this, [
  10803. "TaggedTemplateExpression"
  10804. ].concat(Array.prototype.slice.call(arguments)));
  10805. }
  10806. function templateElement(value, tail) {
  10807. return (_builder.default).apply(this, [
  10808. "TemplateElement"
  10809. ].concat(Array.prototype.slice.call(arguments)));
  10810. }
  10811. function templateLiteral(quasis, expressions) {
  10812. return (_builder.default).apply(this, [
  10813. "TemplateLiteral"
  10814. ].concat(Array.prototype.slice.call(arguments)));
  10815. }
  10816. function yieldExpression(argument, delegate) {
  10817. return (_builder.default).apply(this, [
  10818. "YieldExpression"
  10819. ].concat(Array.prototype.slice.call(arguments)));
  10820. }
  10821. function awaitExpression(argument) {
  10822. return (_builder.default).apply(this, [
  10823. "AwaitExpression"
  10824. ].concat(Array.prototype.slice.call(arguments)));
  10825. }
  10826. function _import() {
  10827. return (_builder.default).apply(this, [
  10828. "Import"
  10829. ].concat(Array.prototype.slice.call(arguments)));
  10830. }
  10831. function bigIntLiteral(value) {
  10832. return (_builder.default).apply(this, [
  10833. "BigIntLiteral"
  10834. ].concat(Array.prototype.slice.call(arguments)));
  10835. }
  10836. function exportNamespaceSpecifier(exported) {
  10837. return (_builder.default).apply(this, [
  10838. "ExportNamespaceSpecifier"
  10839. ].concat(Array.prototype.slice.call(arguments)));
  10840. }
  10841. function optionalMemberExpression(object, property, computed, optional) {
  10842. return (_builder.default).apply(this, [
  10843. "OptionalMemberExpression"
  10844. ].concat(Array.prototype.slice.call(arguments)));
  10845. }
  10846. function optionalCallExpression(callee, _arguments, optional) {
  10847. return (_builder.default).apply(this, [
  10848. "OptionalCallExpression"
  10849. ].concat(Array.prototype.slice.call(arguments)));
  10850. }
  10851. function classProperty(key, value, typeAnnotation, decorators, computed, _static) {
  10852. return (_builder.default).apply(this, [
  10853. "ClassProperty"
  10854. ].concat(Array.prototype.slice.call(arguments)));
  10855. }
  10856. function classPrivateProperty(key, value, decorators, _static) {
  10857. return (_builder.default).apply(this, [
  10858. "ClassPrivateProperty"
  10859. ].concat(Array.prototype.slice.call(arguments)));
  10860. }
  10861. function classPrivateMethod(kind, key, params, body, _static) {
  10862. return (_builder.default).apply(this, [
  10863. "ClassPrivateMethod"
  10864. ].concat(Array.prototype.slice.call(arguments)));
  10865. }
  10866. function privateName(id) {
  10867. return (_builder.default).apply(this, [
  10868. "PrivateName"
  10869. ].concat(Array.prototype.slice.call(arguments)));
  10870. }
  10871. function anyTypeAnnotation() {
  10872. return (_builder.default).apply(this, [
  10873. "AnyTypeAnnotation"
  10874. ].concat(Array.prototype.slice.call(arguments)));
  10875. }
  10876. function arrayTypeAnnotation(elementType) {
  10877. return (_builder.default).apply(this, [
  10878. "ArrayTypeAnnotation"
  10879. ].concat(Array.prototype.slice.call(arguments)));
  10880. }
  10881. function booleanTypeAnnotation() {
  10882. return (_builder.default).apply(this, [
  10883. "BooleanTypeAnnotation"
  10884. ].concat(Array.prototype.slice.call(arguments)));
  10885. }
  10886. function booleanLiteralTypeAnnotation(value) {
  10887. return (_builder.default).apply(this, [
  10888. "BooleanLiteralTypeAnnotation"
  10889. ].concat(Array.prototype.slice.call(arguments)));
  10890. }
  10891. function nullLiteralTypeAnnotation() {
  10892. return (_builder.default).apply(this, [
  10893. "NullLiteralTypeAnnotation"
  10894. ].concat(Array.prototype.slice.call(arguments)));
  10895. }
  10896. function classImplements(id, typeParameters) {
  10897. return (_builder.default).apply(this, [
  10898. "ClassImplements"
  10899. ].concat(Array.prototype.slice.call(arguments)));
  10900. }
  10901. function declareClass(id, typeParameters, _extends, body) {
  10902. return (_builder.default).apply(this, [
  10903. "DeclareClass"
  10904. ].concat(Array.prototype.slice.call(arguments)));
  10905. }
  10906. function declareFunction(id) {
  10907. return (_builder.default).apply(this, [
  10908. "DeclareFunction"
  10909. ].concat(Array.prototype.slice.call(arguments)));
  10910. }
  10911. function declareInterface(id, typeParameters, _extends, body) {
  10912. return (_builder.default).apply(this, [
  10913. "DeclareInterface"
  10914. ].concat(Array.prototype.slice.call(arguments)));
  10915. }
  10916. function declareModule(id, body, kind) {
  10917. return (_builder.default).apply(this, [
  10918. "DeclareModule"
  10919. ].concat(Array.prototype.slice.call(arguments)));
  10920. }
  10921. function declareModuleExports(typeAnnotation) {
  10922. return (_builder.default).apply(this, [
  10923. "DeclareModuleExports"
  10924. ].concat(Array.prototype.slice.call(arguments)));
  10925. }
  10926. function declareTypeAlias(id, typeParameters, right) {
  10927. return (_builder.default).apply(this, [
  10928. "DeclareTypeAlias"
  10929. ].concat(Array.prototype.slice.call(arguments)));
  10930. }
  10931. function declareOpaqueType(id, typeParameters, supertype) {
  10932. return (_builder.default).apply(this, [
  10933. "DeclareOpaqueType"
  10934. ].concat(Array.prototype.slice.call(arguments)));
  10935. }
  10936. function declareVariable(id) {
  10937. return (_builder.default).apply(this, [
  10938. "DeclareVariable"
  10939. ].concat(Array.prototype.slice.call(arguments)));
  10940. }
  10941. function declareExportDeclaration(declaration, specifiers, source) {
  10942. return (_builder.default).apply(this, [
  10943. "DeclareExportDeclaration"
  10944. ].concat(Array.prototype.slice.call(arguments)));
  10945. }
  10946. function declareExportAllDeclaration(source) {
  10947. return (_builder.default).apply(this, [
  10948. "DeclareExportAllDeclaration"
  10949. ].concat(Array.prototype.slice.call(arguments)));
  10950. }
  10951. function declaredPredicate(value) {
  10952. return (_builder.default).apply(this, [
  10953. "DeclaredPredicate"
  10954. ].concat(Array.prototype.slice.call(arguments)));
  10955. }
  10956. function existsTypeAnnotation() {
  10957. return (_builder.default).apply(this, [
  10958. "ExistsTypeAnnotation"
  10959. ].concat(Array.prototype.slice.call(arguments)));
  10960. }
  10961. function functionTypeAnnotation(typeParameters, params, rest, returnType) {
  10962. return (_builder.default).apply(this, [
  10963. "FunctionTypeAnnotation"
  10964. ].concat(Array.prototype.slice.call(arguments)));
  10965. }
  10966. function functionTypeParam(name, typeAnnotation) {
  10967. return (_builder.default).apply(this, [
  10968. "FunctionTypeParam"
  10969. ].concat(Array.prototype.slice.call(arguments)));
  10970. }
  10971. function genericTypeAnnotation(id, typeParameters) {
  10972. return (_builder.default).apply(this, [
  10973. "GenericTypeAnnotation"
  10974. ].concat(Array.prototype.slice.call(arguments)));
  10975. }
  10976. function inferredPredicate() {
  10977. return (_builder.default).apply(this, [
  10978. "InferredPredicate"
  10979. ].concat(Array.prototype.slice.call(arguments)));
  10980. }
  10981. function interfaceExtends(id, typeParameters) {
  10982. return (_builder.default).apply(this, [
  10983. "InterfaceExtends"
  10984. ].concat(Array.prototype.slice.call(arguments)));
  10985. }
  10986. function interfaceDeclaration(id, typeParameters, _extends, body) {
  10987. return (_builder.default).apply(this, [
  10988. "InterfaceDeclaration"
  10989. ].concat(Array.prototype.slice.call(arguments)));
  10990. }
  10991. function interfaceTypeAnnotation(_extends, body) {
  10992. return (_builder.default).apply(this, [
  10993. "InterfaceTypeAnnotation"
  10994. ].concat(Array.prototype.slice.call(arguments)));
  10995. }
  10996. function intersectionTypeAnnotation(types) {
  10997. return (_builder.default).apply(this, [
  10998. "IntersectionTypeAnnotation"
  10999. ].concat(Array.prototype.slice.call(arguments)));
  11000. }
  11001. function mixedTypeAnnotation() {
  11002. return (_builder.default).apply(this, [
  11003. "MixedTypeAnnotation"
  11004. ].concat(Array.prototype.slice.call(arguments)));
  11005. }
  11006. function emptyTypeAnnotation() {
  11007. return (_builder.default).apply(this, [
  11008. "EmptyTypeAnnotation"
  11009. ].concat(Array.prototype.slice.call(arguments)));
  11010. }
  11011. function nullableTypeAnnotation(typeAnnotation) {
  11012. return (_builder.default).apply(this, [
  11013. "NullableTypeAnnotation"
  11014. ].concat(Array.prototype.slice.call(arguments)));
  11015. }
  11016. function numberLiteralTypeAnnotation(value) {
  11017. return (_builder.default).apply(this, [
  11018. "NumberLiteralTypeAnnotation"
  11019. ].concat(Array.prototype.slice.call(arguments)));
  11020. }
  11021. function numberTypeAnnotation() {
  11022. return (_builder.default).apply(this, [
  11023. "NumberTypeAnnotation"
  11024. ].concat(Array.prototype.slice.call(arguments)));
  11025. }
  11026. function objectTypeAnnotation(properties, indexers, callProperties, internalSlots, exact) {
  11027. return (_builder.default).apply(this, [
  11028. "ObjectTypeAnnotation"
  11029. ].concat(Array.prototype.slice.call(arguments)));
  11030. }
  11031. function objectTypeInternalSlot(id, value, optional, _static, method) {
  11032. return (_builder.default).apply(this, [
  11033. "ObjectTypeInternalSlot"
  11034. ].concat(Array.prototype.slice.call(arguments)));
  11035. }
  11036. function objectTypeCallProperty(value) {
  11037. return (_builder.default).apply(this, [
  11038. "ObjectTypeCallProperty"
  11039. ].concat(Array.prototype.slice.call(arguments)));
  11040. }
  11041. function objectTypeIndexer(id, key, value, variance) {
  11042. return (_builder.default).apply(this, [
  11043. "ObjectTypeIndexer"
  11044. ].concat(Array.prototype.slice.call(arguments)));
  11045. }
  11046. function objectTypeProperty(key, value, variance) {
  11047. return (_builder.default).apply(this, [
  11048. "ObjectTypeProperty"
  11049. ].concat(Array.prototype.slice.call(arguments)));
  11050. }
  11051. function objectTypeSpreadProperty(argument) {
  11052. return (_builder.default).apply(this, [
  11053. "ObjectTypeSpreadProperty"
  11054. ].concat(Array.prototype.slice.call(arguments)));
  11055. }
  11056. function opaqueType(id, typeParameters, supertype, impltype) {
  11057. return (_builder.default).apply(this, [
  11058. "OpaqueType"
  11059. ].concat(Array.prototype.slice.call(arguments)));
  11060. }
  11061. function qualifiedTypeIdentifier(id, qualification) {
  11062. return (_builder.default).apply(this, [
  11063. "QualifiedTypeIdentifier"
  11064. ].concat(Array.prototype.slice.call(arguments)));
  11065. }
  11066. function stringLiteralTypeAnnotation(value) {
  11067. return (_builder.default).apply(this, [
  11068. "StringLiteralTypeAnnotation"
  11069. ].concat(Array.prototype.slice.call(arguments)));
  11070. }
  11071. function stringTypeAnnotation() {
  11072. return (_builder.default).apply(this, [
  11073. "StringTypeAnnotation"
  11074. ].concat(Array.prototype.slice.call(arguments)));
  11075. }
  11076. function symbolTypeAnnotation() {
  11077. return (_builder.default).apply(this, [
  11078. "SymbolTypeAnnotation"
  11079. ].concat(Array.prototype.slice.call(arguments)));
  11080. }
  11081. function thisTypeAnnotation() {
  11082. return (_builder.default).apply(this, [
  11083. "ThisTypeAnnotation"
  11084. ].concat(Array.prototype.slice.call(arguments)));
  11085. }
  11086. function tupleTypeAnnotation(types) {
  11087. return (_builder.default).apply(this, [
  11088. "TupleTypeAnnotation"
  11089. ].concat(Array.prototype.slice.call(arguments)));
  11090. }
  11091. function typeofTypeAnnotation(argument) {
  11092. return (_builder.default).apply(this, [
  11093. "TypeofTypeAnnotation"
  11094. ].concat(Array.prototype.slice.call(arguments)));
  11095. }
  11096. function typeAlias(id, typeParameters, right) {
  11097. return (_builder.default).apply(this, [
  11098. "TypeAlias"
  11099. ].concat(Array.prototype.slice.call(arguments)));
  11100. }
  11101. function typeAnnotation(typeAnnotation) {
  11102. return (_builder.default).apply(this, [
  11103. "TypeAnnotation"
  11104. ].concat(Array.prototype.slice.call(arguments)));
  11105. }
  11106. function typeCastExpression(expression, typeAnnotation) {
  11107. return (_builder.default).apply(this, [
  11108. "TypeCastExpression"
  11109. ].concat(Array.prototype.slice.call(arguments)));
  11110. }
  11111. function typeParameter(bound, _default, variance) {
  11112. return (_builder.default).apply(this, [
  11113. "TypeParameter"
  11114. ].concat(Array.prototype.slice.call(arguments)));
  11115. }
  11116. function typeParameterDeclaration(params) {
  11117. return (_builder.default).apply(this, [
  11118. "TypeParameterDeclaration"
  11119. ].concat(Array.prototype.slice.call(arguments)));
  11120. }
  11121. function typeParameterInstantiation(params) {
  11122. return (_builder.default).apply(this, [
  11123. "TypeParameterInstantiation"
  11124. ].concat(Array.prototype.slice.call(arguments)));
  11125. }
  11126. function unionTypeAnnotation(types) {
  11127. return (_builder.default).apply(this, [
  11128. "UnionTypeAnnotation"
  11129. ].concat(Array.prototype.slice.call(arguments)));
  11130. }
  11131. function variance(kind) {
  11132. return (_builder.default).apply(this, [
  11133. "Variance"
  11134. ].concat(Array.prototype.slice.call(arguments)));
  11135. }
  11136. function voidTypeAnnotation() {
  11137. return (_builder.default).apply(this, [
  11138. "VoidTypeAnnotation"
  11139. ].concat(Array.prototype.slice.call(arguments)));
  11140. }
  11141. function enumDeclaration(id, body) {
  11142. return (_builder.default).apply(this, [
  11143. "EnumDeclaration"
  11144. ].concat(Array.prototype.slice.call(arguments)));
  11145. }
  11146. function enumBooleanBody(members) {
  11147. return (_builder.default).apply(this, [
  11148. "EnumBooleanBody"
  11149. ].concat(Array.prototype.slice.call(arguments)));
  11150. }
  11151. function enumNumberBody(members) {
  11152. return (_builder.default).apply(this, [
  11153. "EnumNumberBody"
  11154. ].concat(Array.prototype.slice.call(arguments)));
  11155. }
  11156. function enumStringBody(members) {
  11157. return (_builder.default).apply(this, [
  11158. "EnumStringBody"
  11159. ].concat(Array.prototype.slice.call(arguments)));
  11160. }
  11161. function enumSymbolBody(members) {
  11162. return (_builder.default).apply(this, [
  11163. "EnumSymbolBody"
  11164. ].concat(Array.prototype.slice.call(arguments)));
  11165. }
  11166. function enumBooleanMember(id) {
  11167. return (_builder.default).apply(this, [
  11168. "EnumBooleanMember"
  11169. ].concat(Array.prototype.slice.call(arguments)));
  11170. }
  11171. function enumNumberMember(id, init) {
  11172. return (_builder.default).apply(this, [
  11173. "EnumNumberMember"
  11174. ].concat(Array.prototype.slice.call(arguments)));
  11175. }
  11176. function enumStringMember(id, init) {
  11177. return (_builder.default).apply(this, [
  11178. "EnumStringMember"
  11179. ].concat(Array.prototype.slice.call(arguments)));
  11180. }
  11181. function enumDefaultedMember(id) {
  11182. return (_builder.default).apply(this, [
  11183. "EnumDefaultedMember"
  11184. ].concat(Array.prototype.slice.call(arguments)));
  11185. }
  11186. function indexedAccessType(objectType, indexType) {
  11187. return (_builder.default).apply(this, [
  11188. "IndexedAccessType"
  11189. ].concat(Array.prototype.slice.call(arguments)));
  11190. }
  11191. function optionalIndexedAccessType(objectType, indexType) {
  11192. return (_builder.default).apply(this, [
  11193. "OptionalIndexedAccessType"
  11194. ].concat(Array.prototype.slice.call(arguments)));
  11195. }
  11196. function jsxAttribute(name, value) {
  11197. return (_builder.default).apply(this, [
  11198. "JSXAttribute"
  11199. ].concat(Array.prototype.slice.call(arguments)));
  11200. }
  11201. function jsxClosingElement(name) {
  11202. return (_builder.default).apply(this, [
  11203. "JSXClosingElement"
  11204. ].concat(Array.prototype.slice.call(arguments)));
  11205. }
  11206. function jsxElement(openingElement, closingElement, children, selfClosing) {
  11207. return (_builder.default).apply(this, [
  11208. "JSXElement"
  11209. ].concat(Array.prototype.slice.call(arguments)));
  11210. }
  11211. function jsxEmptyExpression() {
  11212. return (_builder.default).apply(this, [
  11213. "JSXEmptyExpression"
  11214. ].concat(Array.prototype.slice.call(arguments)));
  11215. }
  11216. function jsxExpressionContainer(expression) {
  11217. return (_builder.default).apply(this, [
  11218. "JSXExpressionContainer"
  11219. ].concat(Array.prototype.slice.call(arguments)));
  11220. }
  11221. function jsxSpreadChild(expression) {
  11222. return (_builder.default).apply(this, [
  11223. "JSXSpreadChild"
  11224. ].concat(Array.prototype.slice.call(arguments)));
  11225. }
  11226. function jsxIdentifier(name) {
  11227. return (_builder.default).apply(this, [
  11228. "JSXIdentifier"
  11229. ].concat(Array.prototype.slice.call(arguments)));
  11230. }
  11231. function jsxMemberExpression(object, property) {
  11232. return (_builder.default).apply(this, [
  11233. "JSXMemberExpression"
  11234. ].concat(Array.prototype.slice.call(arguments)));
  11235. }
  11236. function jsxNamespacedName(namespace, name) {
  11237. return (_builder.default).apply(this, [
  11238. "JSXNamespacedName"
  11239. ].concat(Array.prototype.slice.call(arguments)));
  11240. }
  11241. function jsxOpeningElement(name, attributes, selfClosing) {
  11242. return (_builder.default).apply(this, [
  11243. "JSXOpeningElement"
  11244. ].concat(Array.prototype.slice.call(arguments)));
  11245. }
  11246. function jsxSpreadAttribute(argument) {
  11247. return (_builder.default).apply(this, [
  11248. "JSXSpreadAttribute"
  11249. ].concat(Array.prototype.slice.call(arguments)));
  11250. }
  11251. function jsxText(value) {
  11252. return (_builder.default).apply(this, [
  11253. "JSXText"
  11254. ].concat(Array.prototype.slice.call(arguments)));
  11255. }
  11256. function jsxFragment(openingFragment, closingFragment, children) {
  11257. return (_builder.default).apply(this, [
  11258. "JSXFragment"
  11259. ].concat(Array.prototype.slice.call(arguments)));
  11260. }
  11261. function jsxOpeningFragment() {
  11262. return (_builder.default).apply(this, [
  11263. "JSXOpeningFragment"
  11264. ].concat(Array.prototype.slice.call(arguments)));
  11265. }
  11266. function jsxClosingFragment() {
  11267. return (_builder.default).apply(this, [
  11268. "JSXClosingFragment"
  11269. ].concat(Array.prototype.slice.call(arguments)));
  11270. }
  11271. function noop() {
  11272. return (_builder.default).apply(this, [
  11273. "Noop"
  11274. ].concat(Array.prototype.slice.call(arguments)));
  11275. }
  11276. function placeholder(expectedNode, name) {
  11277. return (_builder.default).apply(this, [
  11278. "Placeholder"
  11279. ].concat(Array.prototype.slice.call(arguments)));
  11280. }
  11281. function v8IntrinsicIdentifier(name) {
  11282. return (_builder.default).apply(this, [
  11283. "V8IntrinsicIdentifier"
  11284. ].concat(Array.prototype.slice.call(arguments)));
  11285. }
  11286. function argumentPlaceholder() {
  11287. return (_builder.default).apply(this, [
  11288. "ArgumentPlaceholder"
  11289. ].concat(Array.prototype.slice.call(arguments)));
  11290. }
  11291. function bindExpression(object, callee) {
  11292. return (_builder.default).apply(this, [
  11293. "BindExpression"
  11294. ].concat(Array.prototype.slice.call(arguments)));
  11295. }
  11296. function importAttribute(key, value) {
  11297. return (_builder.default).apply(this, [
  11298. "ImportAttribute"
  11299. ].concat(Array.prototype.slice.call(arguments)));
  11300. }
  11301. function decorator(expression) {
  11302. return (_builder.default).apply(this, [
  11303. "Decorator"
  11304. ].concat(Array.prototype.slice.call(arguments)));
  11305. }
  11306. function doExpression(body, async) {
  11307. return (_builder.default).apply(this, [
  11308. "DoExpression"
  11309. ].concat(Array.prototype.slice.call(arguments)));
  11310. }
  11311. function exportDefaultSpecifier(exported) {
  11312. return (_builder.default).apply(this, [
  11313. "ExportDefaultSpecifier"
  11314. ].concat(Array.prototype.slice.call(arguments)));
  11315. }
  11316. function recordExpression(properties) {
  11317. return (_builder.default).apply(this, [
  11318. "RecordExpression"
  11319. ].concat(Array.prototype.slice.call(arguments)));
  11320. }
  11321. function tupleExpression(elements) {
  11322. return (_builder.default).apply(this, [
  11323. "TupleExpression"
  11324. ].concat(Array.prototype.slice.call(arguments)));
  11325. }
  11326. function decimalLiteral(value) {
  11327. return (_builder.default).apply(this, [
  11328. "DecimalLiteral"
  11329. ].concat(Array.prototype.slice.call(arguments)));
  11330. }
  11331. function staticBlock(body) {
  11332. return (_builder.default).apply(this, [
  11333. "StaticBlock"
  11334. ].concat(Array.prototype.slice.call(arguments)));
  11335. }
  11336. function moduleExpression(body) {
  11337. return (_builder.default).apply(this, [
  11338. "ModuleExpression"
  11339. ].concat(Array.prototype.slice.call(arguments)));
  11340. }
  11341. function topicReference() {
  11342. return (_builder.default).apply(this, [
  11343. "TopicReference"
  11344. ].concat(Array.prototype.slice.call(arguments)));
  11345. }
  11346. function pipelineTopicExpression(expression) {
  11347. return (_builder.default).apply(this, [
  11348. "PipelineTopicExpression"
  11349. ].concat(Array.prototype.slice.call(arguments)));
  11350. }
  11351. function pipelineBareFunction(callee) {
  11352. return (_builder.default).apply(this, [
  11353. "PipelineBareFunction"
  11354. ].concat(Array.prototype.slice.call(arguments)));
  11355. }
  11356. function pipelinePrimaryTopicReference() {
  11357. return (_builder.default).apply(this, [
  11358. "PipelinePrimaryTopicReference"
  11359. ].concat(Array.prototype.slice.call(arguments)));
  11360. }
  11361. function tsParameterProperty(parameter) {
  11362. return (_builder.default).apply(this, [
  11363. "TSParameterProperty"
  11364. ].concat(Array.prototype.slice.call(arguments)));
  11365. }
  11366. function tsDeclareFunction(id, typeParameters, params, returnType) {
  11367. return (_builder.default).apply(this, [
  11368. "TSDeclareFunction"
  11369. ].concat(Array.prototype.slice.call(arguments)));
  11370. }
  11371. function tsDeclareMethod(decorators, key, typeParameters, params, returnType) {
  11372. return (_builder.default).apply(this, [
  11373. "TSDeclareMethod"
  11374. ].concat(Array.prototype.slice.call(arguments)));
  11375. }
  11376. function tsQualifiedName(left, right) {
  11377. return (_builder.default).apply(this, [
  11378. "TSQualifiedName"
  11379. ].concat(Array.prototype.slice.call(arguments)));
  11380. }
  11381. function tsCallSignatureDeclaration(typeParameters, parameters, typeAnnotation) {
  11382. return (_builder.default).apply(this, [
  11383. "TSCallSignatureDeclaration"
  11384. ].concat(Array.prototype.slice.call(arguments)));
  11385. }
  11386. function tsConstructSignatureDeclaration(typeParameters, parameters, typeAnnotation) {
  11387. return (_builder.default).apply(this, [
  11388. "TSConstructSignatureDeclaration"
  11389. ].concat(Array.prototype.slice.call(arguments)));
  11390. }
  11391. function tsPropertySignature(key, typeAnnotation, initializer) {
  11392. return (_builder.default).apply(this, [
  11393. "TSPropertySignature"
  11394. ].concat(Array.prototype.slice.call(arguments)));
  11395. }
  11396. function tsMethodSignature(key, typeParameters, parameters, typeAnnotation) {
  11397. return (_builder.default).apply(this, [
  11398. "TSMethodSignature"
  11399. ].concat(Array.prototype.slice.call(arguments)));
  11400. }
  11401. function tsIndexSignature(parameters, typeAnnotation) {
  11402. return (_builder.default).apply(this, [
  11403. "TSIndexSignature"
  11404. ].concat(Array.prototype.slice.call(arguments)));
  11405. }
  11406. function tsAnyKeyword() {
  11407. return (_builder.default).apply(this, [
  11408. "TSAnyKeyword"
  11409. ].concat(Array.prototype.slice.call(arguments)));
  11410. }
  11411. function tsBooleanKeyword() {
  11412. return (_builder.default).apply(this, [
  11413. "TSBooleanKeyword"
  11414. ].concat(Array.prototype.slice.call(arguments)));
  11415. }
  11416. function tsBigIntKeyword() {
  11417. return (_builder.default).apply(this, [
  11418. "TSBigIntKeyword"
  11419. ].concat(Array.prototype.slice.call(arguments)));
  11420. }
  11421. function tsIntrinsicKeyword() {
  11422. return (_builder.default).apply(this, [
  11423. "TSIntrinsicKeyword"
  11424. ].concat(Array.prototype.slice.call(arguments)));
  11425. }
  11426. function tsNeverKeyword() {
  11427. return (_builder.default).apply(this, [
  11428. "TSNeverKeyword"
  11429. ].concat(Array.prototype.slice.call(arguments)));
  11430. }
  11431. function tsNullKeyword() {
  11432. return (_builder.default).apply(this, [
  11433. "TSNullKeyword"
  11434. ].concat(Array.prototype.slice.call(arguments)));
  11435. }
  11436. function tsNumberKeyword() {
  11437. return (_builder.default).apply(this, [
  11438. "TSNumberKeyword"
  11439. ].concat(Array.prototype.slice.call(arguments)));
  11440. }
  11441. function tsObjectKeyword() {
  11442. return (_builder.default).apply(this, [
  11443. "TSObjectKeyword"
  11444. ].concat(Array.prototype.slice.call(arguments)));
  11445. }
  11446. function tsStringKeyword() {
  11447. return (_builder.default).apply(this, [
  11448. "TSStringKeyword"
  11449. ].concat(Array.prototype.slice.call(arguments)));
  11450. }
  11451. function tsSymbolKeyword() {
  11452. return (_builder.default).apply(this, [
  11453. "TSSymbolKeyword"
  11454. ].concat(Array.prototype.slice.call(arguments)));
  11455. }
  11456. function tsUndefinedKeyword() {
  11457. return (_builder.default).apply(this, [
  11458. "TSUndefinedKeyword"
  11459. ].concat(Array.prototype.slice.call(arguments)));
  11460. }
  11461. function tsUnknownKeyword() {
  11462. return (_builder.default).apply(this, [
  11463. "TSUnknownKeyword"
  11464. ].concat(Array.prototype.slice.call(arguments)));
  11465. }
  11466. function tsVoidKeyword() {
  11467. return (_builder.default).apply(this, [
  11468. "TSVoidKeyword"
  11469. ].concat(Array.prototype.slice.call(arguments)));
  11470. }
  11471. function tsThisType() {
  11472. return (_builder.default).apply(this, [
  11473. "TSThisType"
  11474. ].concat(Array.prototype.slice.call(arguments)));
  11475. }
  11476. function tsFunctionType(typeParameters, parameters, typeAnnotation) {
  11477. return (_builder.default).apply(this, [
  11478. "TSFunctionType"
  11479. ].concat(Array.prototype.slice.call(arguments)));
  11480. }
  11481. function tsConstructorType(typeParameters, parameters, typeAnnotation) {
  11482. return (_builder.default).apply(this, [
  11483. "TSConstructorType"
  11484. ].concat(Array.prototype.slice.call(arguments)));
  11485. }
  11486. function tsTypeReference(typeName, typeParameters) {
  11487. return (_builder.default).apply(this, [
  11488. "TSTypeReference"
  11489. ].concat(Array.prototype.slice.call(arguments)));
  11490. }
  11491. function tsTypePredicate(parameterName, typeAnnotation, asserts) {
  11492. return (_builder.default).apply(this, [
  11493. "TSTypePredicate"
  11494. ].concat(Array.prototype.slice.call(arguments)));
  11495. }
  11496. function tsTypeQuery(exprName) {
  11497. return (_builder.default).apply(this, [
  11498. "TSTypeQuery"
  11499. ].concat(Array.prototype.slice.call(arguments)));
  11500. }
  11501. function tsTypeLiteral(members) {
  11502. return (_builder.default).apply(this, [
  11503. "TSTypeLiteral"
  11504. ].concat(Array.prototype.slice.call(arguments)));
  11505. }
  11506. function tsArrayType(elementType) {
  11507. return (_builder.default).apply(this, [
  11508. "TSArrayType"
  11509. ].concat(Array.prototype.slice.call(arguments)));
  11510. }
  11511. function tsTupleType(elementTypes) {
  11512. return (_builder.default).apply(this, [
  11513. "TSTupleType"
  11514. ].concat(Array.prototype.slice.call(arguments)));
  11515. }
  11516. function tsOptionalType(typeAnnotation) {
  11517. return (_builder.default).apply(this, [
  11518. "TSOptionalType"
  11519. ].concat(Array.prototype.slice.call(arguments)));
  11520. }
  11521. function tsRestType(typeAnnotation) {
  11522. return (_builder.default).apply(this, [
  11523. "TSRestType"
  11524. ].concat(Array.prototype.slice.call(arguments)));
  11525. }
  11526. function tsNamedTupleMember(label, elementType, optional) {
  11527. return (_builder.default).apply(this, [
  11528. "TSNamedTupleMember"
  11529. ].concat(Array.prototype.slice.call(arguments)));
  11530. }
  11531. function tsUnionType(types) {
  11532. return (_builder.default).apply(this, [
  11533. "TSUnionType"
  11534. ].concat(Array.prototype.slice.call(arguments)));
  11535. }
  11536. function tsIntersectionType(types) {
  11537. return (_builder.default).apply(this, [
  11538. "TSIntersectionType"
  11539. ].concat(Array.prototype.slice.call(arguments)));
  11540. }
  11541. function tsConditionalType(checkType, extendsType, trueType, falseType) {
  11542. return (_builder.default).apply(this, [
  11543. "TSConditionalType"
  11544. ].concat(Array.prototype.slice.call(arguments)));
  11545. }
  11546. function tsInferType(typeParameter) {
  11547. return (_builder.default).apply(this, [
  11548. "TSInferType"
  11549. ].concat(Array.prototype.slice.call(arguments)));
  11550. }
  11551. function tsParenthesizedType(typeAnnotation) {
  11552. return (_builder.default).apply(this, [
  11553. "TSParenthesizedType"
  11554. ].concat(Array.prototype.slice.call(arguments)));
  11555. }
  11556. function tsTypeOperator(typeAnnotation) {
  11557. return (_builder.default).apply(this, [
  11558. "TSTypeOperator"
  11559. ].concat(Array.prototype.slice.call(arguments)));
  11560. }
  11561. function tsIndexedAccessType(objectType, indexType) {
  11562. return (_builder.default).apply(this, [
  11563. "TSIndexedAccessType"
  11564. ].concat(Array.prototype.slice.call(arguments)));
  11565. }
  11566. function tsMappedType(typeParameter, typeAnnotation, nameType) {
  11567. return (_builder.default).apply(this, [
  11568. "TSMappedType"
  11569. ].concat(Array.prototype.slice.call(arguments)));
  11570. }
  11571. function tsLiteralType(literal) {
  11572. return (_builder.default).apply(this, [
  11573. "TSLiteralType"
  11574. ].concat(Array.prototype.slice.call(arguments)));
  11575. }
  11576. function tsExpressionWithTypeArguments(expression, typeParameters) {
  11577. return (_builder.default).apply(this, [
  11578. "TSExpressionWithTypeArguments"
  11579. ].concat(Array.prototype.slice.call(arguments)));
  11580. }
  11581. function tsInterfaceDeclaration(id, typeParameters, _extends, body) {
  11582. return (_builder.default).apply(this, [
  11583. "TSInterfaceDeclaration"
  11584. ].concat(Array.prototype.slice.call(arguments)));
  11585. }
  11586. function tsInterfaceBody(body) {
  11587. return (_builder.default).apply(this, [
  11588. "TSInterfaceBody"
  11589. ].concat(Array.prototype.slice.call(arguments)));
  11590. }
  11591. function tsTypeAliasDeclaration(id, typeParameters, typeAnnotation) {
  11592. return (_builder.default).apply(this, [
  11593. "TSTypeAliasDeclaration"
  11594. ].concat(Array.prototype.slice.call(arguments)));
  11595. }
  11596. function tsAsExpression(expression, typeAnnotation) {
  11597. return (_builder.default).apply(this, [
  11598. "TSAsExpression"
  11599. ].concat(Array.prototype.slice.call(arguments)));
  11600. }
  11601. function tsTypeAssertion(typeAnnotation, expression) {
  11602. return (_builder.default).apply(this, [
  11603. "TSTypeAssertion"
  11604. ].concat(Array.prototype.slice.call(arguments)));
  11605. }
  11606. function tsEnumDeclaration(id, members) {
  11607. return (_builder.default).apply(this, [
  11608. "TSEnumDeclaration"
  11609. ].concat(Array.prototype.slice.call(arguments)));
  11610. }
  11611. function tsEnumMember(id, initializer) {
  11612. return (_builder.default).apply(this, [
  11613. "TSEnumMember"
  11614. ].concat(Array.prototype.slice.call(arguments)));
  11615. }
  11616. function tsModuleDeclaration(id, body) {
  11617. return (_builder.default).apply(this, [
  11618. "TSModuleDeclaration"
  11619. ].concat(Array.prototype.slice.call(arguments)));
  11620. }
  11621. function tsModuleBlock(body) {
  11622. return (_builder.default).apply(this, [
  11623. "TSModuleBlock"
  11624. ].concat(Array.prototype.slice.call(arguments)));
  11625. }
  11626. function tsImportType(argument, qualifier, typeParameters) {
  11627. return (_builder.default).apply(this, [
  11628. "TSImportType"
  11629. ].concat(Array.prototype.slice.call(arguments)));
  11630. }
  11631. function tsImportEqualsDeclaration(id, moduleReference) {
  11632. return (_builder.default).apply(this, [
  11633. "TSImportEqualsDeclaration"
  11634. ].concat(Array.prototype.slice.call(arguments)));
  11635. }
  11636. function tsExternalModuleReference(expression) {
  11637. return (_builder.default).apply(this, [
  11638. "TSExternalModuleReference"
  11639. ].concat(Array.prototype.slice.call(arguments)));
  11640. }
  11641. function tsNonNullExpression(expression) {
  11642. return (_builder.default).apply(this, [
  11643. "TSNonNullExpression"
  11644. ].concat(Array.prototype.slice.call(arguments)));
  11645. }
  11646. function tsExportAssignment(expression) {
  11647. return (_builder.default).apply(this, [
  11648. "TSExportAssignment"
  11649. ].concat(Array.prototype.slice.call(arguments)));
  11650. }
  11651. function tsNamespaceExportDeclaration(id) {
  11652. return (_builder.default).apply(this, [
  11653. "TSNamespaceExportDeclaration"
  11654. ].concat(Array.prototype.slice.call(arguments)));
  11655. }
  11656. function tsTypeAnnotation(typeAnnotation) {
  11657. return (_builder.default).apply(this, [
  11658. "TSTypeAnnotation"
  11659. ].concat(Array.prototype.slice.call(arguments)));
  11660. }
  11661. function tsTypeParameterInstantiation(params) {
  11662. return (_builder.default).apply(this, [
  11663. "TSTypeParameterInstantiation"
  11664. ].concat(Array.prototype.slice.call(arguments)));
  11665. }
  11666. function tsTypeParameterDeclaration(params) {
  11667. return (_builder.default).apply(this, [
  11668. "TSTypeParameterDeclaration"
  11669. ].concat(Array.prototype.slice.call(arguments)));
  11670. }
  11671. function tsTypeParameter(constraint, _default, name) {
  11672. return (_builder.default).apply(this, [
  11673. "TSTypeParameter"
  11674. ].concat(Array.prototype.slice.call(arguments)));
  11675. }
  11676. function NumberLiteral() {
  11677. for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
  11678. args[_key] = arguments[_key];
  11679. }
  11680. console.trace("The node type NumberLiteral has been renamed to NumericLiteral");
  11681. return (_builder.default).apply(this, [
  11682. "NumberLiteral"
  11683. ].concat(_toConsumableArray$1(args)));
  11684. }
  11685. function RegexLiteral() {
  11686. for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
  11687. args[_key] = arguments[_key];
  11688. }
  11689. console.trace("The node type RegexLiteral has been renamed to RegExpLiteral");
  11690. return (_builder.default).apply(this, [
  11691. "RegexLiteral"
  11692. ].concat(_toConsumableArray$1(args)));
  11693. }
  11694. function RestProperty() {
  11695. for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
  11696. args[_key] = arguments[_key];
  11697. }
  11698. console.trace("The node type RestProperty has been renamed to RestElement");
  11699. return (_builder.default).apply(this, [
  11700. "RestProperty"
  11701. ].concat(_toConsumableArray$1(args)));
  11702. }
  11703. function SpreadProperty() {
  11704. for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
  11705. args[_key] = arguments[_key];
  11706. }
  11707. console.trace("The node type SpreadProperty has been renamed to SpreadElement");
  11708. return (_builder.default).apply(this, [
  11709. "SpreadProperty"
  11710. ].concat(_toConsumableArray$1(args)));
  11711. }
  11712. Object.defineProperty(cleanJSXElementLiteralChild$1, "__esModule", {
  11713. value: true
  11714. });
  11715. cleanJSXElementLiteralChild$1.default = cleanJSXElementLiteralChild;
  11716. var _generated$n = generated$3;
  11717. function cleanJSXElementLiteralChild(child, args) {
  11718. var lines = child.value.split(/\r\n|\n|\r/);
  11719. var lastNonEmptyLine = 0;
  11720. for(var i = 0; i < lines.length; i++){
  11721. if (lines[i].match(/[^ \t]/)) {
  11722. lastNonEmptyLine = i;
  11723. }
  11724. }
  11725. var str = "";
  11726. for(var i1 = 0; i1 < lines.length; i1++){
  11727. var line = lines[i1];
  11728. var isFirstLine = i1 === 0;
  11729. var isLastLine = i1 === lines.length - 1;
  11730. var isLastNonEmptyLine = i1 === lastNonEmptyLine;
  11731. var trimmedLine = line.replace(/\t/g, " ");
  11732. if (!isFirstLine) {
  11733. trimmedLine = trimmedLine.replace(/^[ ]+/, "");
  11734. }
  11735. if (!isLastLine) {
  11736. trimmedLine = trimmedLine.replace(/[ ]+$/, "");
  11737. }
  11738. if (trimmedLine) {
  11739. if (!isLastNonEmptyLine) {
  11740. trimmedLine += " ";
  11741. }
  11742. str += trimmedLine;
  11743. }
  11744. }
  11745. if (str) args.push((0, _generated$n.stringLiteral)(str));
  11746. }
  11747. Object.defineProperty(buildChildren$1, "__esModule", {
  11748. value: true
  11749. });
  11750. buildChildren$1.default = buildChildren;
  11751. var _generated$m = generated$4;
  11752. var _cleanJSXElementLiteralChild = cleanJSXElementLiteralChild$1;
  11753. function buildChildren(node) {
  11754. var elements = [];
  11755. for(var i = 0; i < node.children.length; i++){
  11756. var child = node.children[i];
  11757. if ((0, _generated$m.isJSXText)(child)) {
  11758. (0, _cleanJSXElementLiteralChild.default)(child, elements);
  11759. continue;
  11760. }
  11761. if ((0, _generated$m.isJSXExpressionContainer)(child)) child = child.expression;
  11762. if ((0, _generated$m.isJSXEmptyExpression)(child)) continue;
  11763. elements.push(child);
  11764. }
  11765. return elements;
  11766. }
  11767. var assertNode$1 = {};
  11768. var isNode$1 = {};
  11769. Object.defineProperty(isNode$1, "__esModule", {
  11770. value: true
  11771. });
  11772. isNode$1.default = isNode;
  11773. var _definitions$5 = requireDefinitions();
  11774. function isNode(node) {
  11775. return !!(node && _definitions$5.VISITOR_KEYS[node.type]);
  11776. }
  11777. Object.defineProperty(assertNode$1, "__esModule", {
  11778. value: true
  11779. });
  11780. assertNode$1.default = assertNode;
  11781. var _isNode = isNode$1;
  11782. function assertNode(node) {
  11783. if (!(0, _isNode.default)(node)) {
  11784. var _node$type;
  11785. var type = (_node$type = node == null ? void 0 : node.type) != null ? _node$type : JSON.stringify(node);
  11786. throw new TypeError('Not a valid node of type "' + type + '"');
  11787. }
  11788. }
  11789. var generated$2 = {};
  11790. Object.defineProperty(generated$2, "__esModule", {
  11791. value: true
  11792. });
  11793. generated$2.assertArrayExpression = assertArrayExpression;
  11794. generated$2.assertAssignmentExpression = assertAssignmentExpression;
  11795. generated$2.assertBinaryExpression = assertBinaryExpression;
  11796. generated$2.assertInterpreterDirective = assertInterpreterDirective;
  11797. generated$2.assertDirective = assertDirective;
  11798. generated$2.assertDirectiveLiteral = assertDirectiveLiteral;
  11799. generated$2.assertBlockStatement = assertBlockStatement;
  11800. generated$2.assertBreakStatement = assertBreakStatement;
  11801. generated$2.assertCallExpression = assertCallExpression;
  11802. generated$2.assertCatchClause = assertCatchClause;
  11803. generated$2.assertConditionalExpression = assertConditionalExpression;
  11804. generated$2.assertContinueStatement = assertContinueStatement;
  11805. generated$2.assertDebuggerStatement = assertDebuggerStatement;
  11806. generated$2.assertDoWhileStatement = assertDoWhileStatement;
  11807. generated$2.assertEmptyStatement = assertEmptyStatement;
  11808. generated$2.assertExpressionStatement = assertExpressionStatement;
  11809. generated$2.assertFile = assertFile;
  11810. generated$2.assertForInStatement = assertForInStatement;
  11811. generated$2.assertForStatement = assertForStatement;
  11812. generated$2.assertFunctionDeclaration = assertFunctionDeclaration;
  11813. generated$2.assertFunctionExpression = assertFunctionExpression;
  11814. generated$2.assertIdentifier = assertIdentifier;
  11815. generated$2.assertIfStatement = assertIfStatement;
  11816. generated$2.assertLabeledStatement = assertLabeledStatement;
  11817. generated$2.assertStringLiteral = assertStringLiteral;
  11818. generated$2.assertNumericLiteral = assertNumericLiteral;
  11819. generated$2.assertNullLiteral = assertNullLiteral;
  11820. generated$2.assertBooleanLiteral = assertBooleanLiteral;
  11821. generated$2.assertRegExpLiteral = assertRegExpLiteral;
  11822. generated$2.assertLogicalExpression = assertLogicalExpression;
  11823. generated$2.assertMemberExpression = assertMemberExpression;
  11824. generated$2.assertNewExpression = assertNewExpression;
  11825. generated$2.assertProgram = assertProgram;
  11826. generated$2.assertObjectExpression = assertObjectExpression;
  11827. generated$2.assertObjectMethod = assertObjectMethod;
  11828. generated$2.assertObjectProperty = assertObjectProperty;
  11829. generated$2.assertRestElement = assertRestElement;
  11830. generated$2.assertReturnStatement = assertReturnStatement;
  11831. generated$2.assertSequenceExpression = assertSequenceExpression;
  11832. generated$2.assertParenthesizedExpression = assertParenthesizedExpression;
  11833. generated$2.assertSwitchCase = assertSwitchCase;
  11834. generated$2.assertSwitchStatement = assertSwitchStatement;
  11835. generated$2.assertThisExpression = assertThisExpression;
  11836. generated$2.assertThrowStatement = assertThrowStatement;
  11837. generated$2.assertTryStatement = assertTryStatement;
  11838. generated$2.assertUnaryExpression = assertUnaryExpression;
  11839. generated$2.assertUpdateExpression = assertUpdateExpression;
  11840. generated$2.assertVariableDeclaration = assertVariableDeclaration;
  11841. generated$2.assertVariableDeclarator = assertVariableDeclarator;
  11842. generated$2.assertWhileStatement = assertWhileStatement;
  11843. generated$2.assertWithStatement = assertWithStatement;
  11844. generated$2.assertAssignmentPattern = assertAssignmentPattern;
  11845. generated$2.assertArrayPattern = assertArrayPattern;
  11846. generated$2.assertArrowFunctionExpression = assertArrowFunctionExpression;
  11847. generated$2.assertClassBody = assertClassBody;
  11848. generated$2.assertClassExpression = assertClassExpression;
  11849. generated$2.assertClassDeclaration = assertClassDeclaration;
  11850. generated$2.assertExportAllDeclaration = assertExportAllDeclaration;
  11851. generated$2.assertExportDefaultDeclaration = assertExportDefaultDeclaration;
  11852. generated$2.assertExportNamedDeclaration = assertExportNamedDeclaration;
  11853. generated$2.assertExportSpecifier = assertExportSpecifier;
  11854. generated$2.assertForOfStatement = assertForOfStatement;
  11855. generated$2.assertImportDeclaration = assertImportDeclaration;
  11856. generated$2.assertImportDefaultSpecifier = assertImportDefaultSpecifier;
  11857. generated$2.assertImportNamespaceSpecifier = assertImportNamespaceSpecifier;
  11858. generated$2.assertImportSpecifier = assertImportSpecifier;
  11859. generated$2.assertMetaProperty = assertMetaProperty;
  11860. generated$2.assertClassMethod = assertClassMethod;
  11861. generated$2.assertObjectPattern = assertObjectPattern;
  11862. generated$2.assertSpreadElement = assertSpreadElement;
  11863. generated$2.assertSuper = assertSuper;
  11864. generated$2.assertTaggedTemplateExpression = assertTaggedTemplateExpression;
  11865. generated$2.assertTemplateElement = assertTemplateElement;
  11866. generated$2.assertTemplateLiteral = assertTemplateLiteral;
  11867. generated$2.assertYieldExpression = assertYieldExpression;
  11868. generated$2.assertAwaitExpression = assertAwaitExpression;
  11869. generated$2.assertImport = assertImport;
  11870. generated$2.assertBigIntLiteral = assertBigIntLiteral;
  11871. generated$2.assertExportNamespaceSpecifier = assertExportNamespaceSpecifier;
  11872. generated$2.assertOptionalMemberExpression = assertOptionalMemberExpression;
  11873. generated$2.assertOptionalCallExpression = assertOptionalCallExpression;
  11874. generated$2.assertClassProperty = assertClassProperty;
  11875. generated$2.assertClassPrivateProperty = assertClassPrivateProperty;
  11876. generated$2.assertClassPrivateMethod = assertClassPrivateMethod;
  11877. generated$2.assertPrivateName = assertPrivateName;
  11878. generated$2.assertAnyTypeAnnotation = assertAnyTypeAnnotation;
  11879. generated$2.assertArrayTypeAnnotation = assertArrayTypeAnnotation;
  11880. generated$2.assertBooleanTypeAnnotation = assertBooleanTypeAnnotation;
  11881. generated$2.assertBooleanLiteralTypeAnnotation = assertBooleanLiteralTypeAnnotation;
  11882. generated$2.assertNullLiteralTypeAnnotation = assertNullLiteralTypeAnnotation;
  11883. generated$2.assertClassImplements = assertClassImplements;
  11884. generated$2.assertDeclareClass = assertDeclareClass;
  11885. generated$2.assertDeclareFunction = assertDeclareFunction;
  11886. generated$2.assertDeclareInterface = assertDeclareInterface;
  11887. generated$2.assertDeclareModule = assertDeclareModule;
  11888. generated$2.assertDeclareModuleExports = assertDeclareModuleExports;
  11889. generated$2.assertDeclareTypeAlias = assertDeclareTypeAlias;
  11890. generated$2.assertDeclareOpaqueType = assertDeclareOpaqueType;
  11891. generated$2.assertDeclareVariable = assertDeclareVariable;
  11892. generated$2.assertDeclareExportDeclaration = assertDeclareExportDeclaration;
  11893. generated$2.assertDeclareExportAllDeclaration = assertDeclareExportAllDeclaration;
  11894. generated$2.assertDeclaredPredicate = assertDeclaredPredicate;
  11895. generated$2.assertExistsTypeAnnotation = assertExistsTypeAnnotation;
  11896. generated$2.assertFunctionTypeAnnotation = assertFunctionTypeAnnotation;
  11897. generated$2.assertFunctionTypeParam = assertFunctionTypeParam;
  11898. generated$2.assertGenericTypeAnnotation = assertGenericTypeAnnotation;
  11899. generated$2.assertInferredPredicate = assertInferredPredicate;
  11900. generated$2.assertInterfaceExtends = assertInterfaceExtends;
  11901. generated$2.assertInterfaceDeclaration = assertInterfaceDeclaration;
  11902. generated$2.assertInterfaceTypeAnnotation = assertInterfaceTypeAnnotation;
  11903. generated$2.assertIntersectionTypeAnnotation = assertIntersectionTypeAnnotation;
  11904. generated$2.assertMixedTypeAnnotation = assertMixedTypeAnnotation;
  11905. generated$2.assertEmptyTypeAnnotation = assertEmptyTypeAnnotation;
  11906. generated$2.assertNullableTypeAnnotation = assertNullableTypeAnnotation;
  11907. generated$2.assertNumberLiteralTypeAnnotation = assertNumberLiteralTypeAnnotation;
  11908. generated$2.assertNumberTypeAnnotation = assertNumberTypeAnnotation;
  11909. generated$2.assertObjectTypeAnnotation = assertObjectTypeAnnotation;
  11910. generated$2.assertObjectTypeInternalSlot = assertObjectTypeInternalSlot;
  11911. generated$2.assertObjectTypeCallProperty = assertObjectTypeCallProperty;
  11912. generated$2.assertObjectTypeIndexer = assertObjectTypeIndexer;
  11913. generated$2.assertObjectTypeProperty = assertObjectTypeProperty;
  11914. generated$2.assertObjectTypeSpreadProperty = assertObjectTypeSpreadProperty;
  11915. generated$2.assertOpaqueType = assertOpaqueType;
  11916. generated$2.assertQualifiedTypeIdentifier = assertQualifiedTypeIdentifier;
  11917. generated$2.assertStringLiteralTypeAnnotation = assertStringLiteralTypeAnnotation;
  11918. generated$2.assertStringTypeAnnotation = assertStringTypeAnnotation;
  11919. generated$2.assertSymbolTypeAnnotation = assertSymbolTypeAnnotation;
  11920. generated$2.assertThisTypeAnnotation = assertThisTypeAnnotation;
  11921. generated$2.assertTupleTypeAnnotation = assertTupleTypeAnnotation;
  11922. generated$2.assertTypeofTypeAnnotation = assertTypeofTypeAnnotation;
  11923. generated$2.assertTypeAlias = assertTypeAlias;
  11924. generated$2.assertTypeAnnotation = assertTypeAnnotation;
  11925. generated$2.assertTypeCastExpression = assertTypeCastExpression;
  11926. generated$2.assertTypeParameter = assertTypeParameter;
  11927. generated$2.assertTypeParameterDeclaration = assertTypeParameterDeclaration;
  11928. generated$2.assertTypeParameterInstantiation = assertTypeParameterInstantiation;
  11929. generated$2.assertUnionTypeAnnotation = assertUnionTypeAnnotation;
  11930. generated$2.assertVariance = assertVariance;
  11931. generated$2.assertVoidTypeAnnotation = assertVoidTypeAnnotation;
  11932. generated$2.assertEnumDeclaration = assertEnumDeclaration;
  11933. generated$2.assertEnumBooleanBody = assertEnumBooleanBody;
  11934. generated$2.assertEnumNumberBody = assertEnumNumberBody;
  11935. generated$2.assertEnumStringBody = assertEnumStringBody;
  11936. generated$2.assertEnumSymbolBody = assertEnumSymbolBody;
  11937. generated$2.assertEnumBooleanMember = assertEnumBooleanMember;
  11938. generated$2.assertEnumNumberMember = assertEnumNumberMember;
  11939. generated$2.assertEnumStringMember = assertEnumStringMember;
  11940. generated$2.assertEnumDefaultedMember = assertEnumDefaultedMember;
  11941. generated$2.assertIndexedAccessType = assertIndexedAccessType;
  11942. generated$2.assertOptionalIndexedAccessType = assertOptionalIndexedAccessType;
  11943. generated$2.assertJSXAttribute = assertJSXAttribute;
  11944. generated$2.assertJSXClosingElement = assertJSXClosingElement;
  11945. generated$2.assertJSXElement = assertJSXElement;
  11946. generated$2.assertJSXEmptyExpression = assertJSXEmptyExpression;
  11947. generated$2.assertJSXExpressionContainer = assertJSXExpressionContainer;
  11948. generated$2.assertJSXSpreadChild = assertJSXSpreadChild;
  11949. generated$2.assertJSXIdentifier = assertJSXIdentifier;
  11950. generated$2.assertJSXMemberExpression = assertJSXMemberExpression;
  11951. generated$2.assertJSXNamespacedName = assertJSXNamespacedName;
  11952. generated$2.assertJSXOpeningElement = assertJSXOpeningElement;
  11953. generated$2.assertJSXSpreadAttribute = assertJSXSpreadAttribute;
  11954. generated$2.assertJSXText = assertJSXText;
  11955. generated$2.assertJSXFragment = assertJSXFragment;
  11956. generated$2.assertJSXOpeningFragment = assertJSXOpeningFragment;
  11957. generated$2.assertJSXClosingFragment = assertJSXClosingFragment;
  11958. generated$2.assertNoop = assertNoop;
  11959. generated$2.assertPlaceholder = assertPlaceholder;
  11960. generated$2.assertV8IntrinsicIdentifier = assertV8IntrinsicIdentifier;
  11961. generated$2.assertArgumentPlaceholder = assertArgumentPlaceholder;
  11962. generated$2.assertBindExpression = assertBindExpression;
  11963. generated$2.assertImportAttribute = assertImportAttribute;
  11964. generated$2.assertDecorator = assertDecorator;
  11965. generated$2.assertDoExpression = assertDoExpression;
  11966. generated$2.assertExportDefaultSpecifier = assertExportDefaultSpecifier;
  11967. generated$2.assertRecordExpression = assertRecordExpression;
  11968. generated$2.assertTupleExpression = assertTupleExpression;
  11969. generated$2.assertDecimalLiteral = assertDecimalLiteral;
  11970. generated$2.assertStaticBlock = assertStaticBlock;
  11971. generated$2.assertModuleExpression = assertModuleExpression;
  11972. generated$2.assertTopicReference = assertTopicReference;
  11973. generated$2.assertPipelineTopicExpression = assertPipelineTopicExpression;
  11974. generated$2.assertPipelineBareFunction = assertPipelineBareFunction;
  11975. generated$2.assertPipelinePrimaryTopicReference = assertPipelinePrimaryTopicReference;
  11976. generated$2.assertTSParameterProperty = assertTSParameterProperty;
  11977. generated$2.assertTSDeclareFunction = assertTSDeclareFunction;
  11978. generated$2.assertTSDeclareMethod = assertTSDeclareMethod;
  11979. generated$2.assertTSQualifiedName = assertTSQualifiedName;
  11980. generated$2.assertTSCallSignatureDeclaration = assertTSCallSignatureDeclaration;
  11981. generated$2.assertTSConstructSignatureDeclaration = assertTSConstructSignatureDeclaration;
  11982. generated$2.assertTSPropertySignature = assertTSPropertySignature;
  11983. generated$2.assertTSMethodSignature = assertTSMethodSignature;
  11984. generated$2.assertTSIndexSignature = assertTSIndexSignature;
  11985. generated$2.assertTSAnyKeyword = assertTSAnyKeyword;
  11986. generated$2.assertTSBooleanKeyword = assertTSBooleanKeyword;
  11987. generated$2.assertTSBigIntKeyword = assertTSBigIntKeyword;
  11988. generated$2.assertTSIntrinsicKeyword = assertTSIntrinsicKeyword;
  11989. generated$2.assertTSNeverKeyword = assertTSNeverKeyword;
  11990. generated$2.assertTSNullKeyword = assertTSNullKeyword;
  11991. generated$2.assertTSNumberKeyword = assertTSNumberKeyword;
  11992. generated$2.assertTSObjectKeyword = assertTSObjectKeyword;
  11993. generated$2.assertTSStringKeyword = assertTSStringKeyword;
  11994. generated$2.assertTSSymbolKeyword = assertTSSymbolKeyword;
  11995. generated$2.assertTSUndefinedKeyword = assertTSUndefinedKeyword;
  11996. generated$2.assertTSUnknownKeyword = assertTSUnknownKeyword;
  11997. generated$2.assertTSVoidKeyword = assertTSVoidKeyword;
  11998. generated$2.assertTSThisType = assertTSThisType;
  11999. generated$2.assertTSFunctionType = assertTSFunctionType;
  12000. generated$2.assertTSConstructorType = assertTSConstructorType;
  12001. generated$2.assertTSTypeReference = assertTSTypeReference;
  12002. generated$2.assertTSTypePredicate = assertTSTypePredicate;
  12003. generated$2.assertTSTypeQuery = assertTSTypeQuery;
  12004. generated$2.assertTSTypeLiteral = assertTSTypeLiteral;
  12005. generated$2.assertTSArrayType = assertTSArrayType;
  12006. generated$2.assertTSTupleType = assertTSTupleType;
  12007. generated$2.assertTSOptionalType = assertTSOptionalType;
  12008. generated$2.assertTSRestType = assertTSRestType;
  12009. generated$2.assertTSNamedTupleMember = assertTSNamedTupleMember;
  12010. generated$2.assertTSUnionType = assertTSUnionType;
  12011. generated$2.assertTSIntersectionType = assertTSIntersectionType;
  12012. generated$2.assertTSConditionalType = assertTSConditionalType;
  12013. generated$2.assertTSInferType = assertTSInferType;
  12014. generated$2.assertTSParenthesizedType = assertTSParenthesizedType;
  12015. generated$2.assertTSTypeOperator = assertTSTypeOperator;
  12016. generated$2.assertTSIndexedAccessType = assertTSIndexedAccessType;
  12017. generated$2.assertTSMappedType = assertTSMappedType;
  12018. generated$2.assertTSLiteralType = assertTSLiteralType;
  12019. generated$2.assertTSExpressionWithTypeArguments = assertTSExpressionWithTypeArguments;
  12020. generated$2.assertTSInterfaceDeclaration = assertTSInterfaceDeclaration;
  12021. generated$2.assertTSInterfaceBody = assertTSInterfaceBody;
  12022. generated$2.assertTSTypeAliasDeclaration = assertTSTypeAliasDeclaration;
  12023. generated$2.assertTSAsExpression = assertTSAsExpression;
  12024. generated$2.assertTSTypeAssertion = assertTSTypeAssertion;
  12025. generated$2.assertTSEnumDeclaration = assertTSEnumDeclaration;
  12026. generated$2.assertTSEnumMember = assertTSEnumMember;
  12027. generated$2.assertTSModuleDeclaration = assertTSModuleDeclaration;
  12028. generated$2.assertTSModuleBlock = assertTSModuleBlock;
  12029. generated$2.assertTSImportType = assertTSImportType;
  12030. generated$2.assertTSImportEqualsDeclaration = assertTSImportEqualsDeclaration;
  12031. generated$2.assertTSExternalModuleReference = assertTSExternalModuleReference;
  12032. generated$2.assertTSNonNullExpression = assertTSNonNullExpression;
  12033. generated$2.assertTSExportAssignment = assertTSExportAssignment;
  12034. generated$2.assertTSNamespaceExportDeclaration = assertTSNamespaceExportDeclaration;
  12035. generated$2.assertTSTypeAnnotation = assertTSTypeAnnotation;
  12036. generated$2.assertTSTypeParameterInstantiation = assertTSTypeParameterInstantiation;
  12037. generated$2.assertTSTypeParameterDeclaration = assertTSTypeParameterDeclaration;
  12038. generated$2.assertTSTypeParameter = assertTSTypeParameter;
  12039. generated$2.assertExpression = assertExpression;
  12040. generated$2.assertBinary = assertBinary;
  12041. generated$2.assertScopable = assertScopable;
  12042. generated$2.assertBlockParent = assertBlockParent;
  12043. generated$2.assertBlock = assertBlock;
  12044. generated$2.assertStatement = assertStatement;
  12045. generated$2.assertTerminatorless = assertTerminatorless;
  12046. generated$2.assertCompletionStatement = assertCompletionStatement;
  12047. generated$2.assertConditional = assertConditional;
  12048. generated$2.assertLoop = assertLoop;
  12049. generated$2.assertWhile = assertWhile;
  12050. generated$2.assertExpressionWrapper = assertExpressionWrapper;
  12051. generated$2.assertFor = assertFor;
  12052. generated$2.assertForXStatement = assertForXStatement;
  12053. generated$2.assertFunction = assertFunction;
  12054. generated$2.assertFunctionParent = assertFunctionParent;
  12055. generated$2.assertPureish = assertPureish;
  12056. generated$2.assertDeclaration = assertDeclaration;
  12057. generated$2.assertPatternLike = assertPatternLike;
  12058. generated$2.assertLVal = assertLVal;
  12059. generated$2.assertTSEntityName = assertTSEntityName;
  12060. generated$2.assertLiteral = assertLiteral;
  12061. generated$2.assertImmutable = assertImmutable;
  12062. generated$2.assertUserWhitespacable = assertUserWhitespacable;
  12063. generated$2.assertMethod = assertMethod;
  12064. generated$2.assertObjectMember = assertObjectMember;
  12065. generated$2.assertProperty = assertProperty;
  12066. generated$2.assertUnaryLike = assertUnaryLike;
  12067. generated$2.assertPattern = assertPattern;
  12068. generated$2.assertClass = assertClass;
  12069. generated$2.assertModuleDeclaration = assertModuleDeclaration;
  12070. generated$2.assertExportDeclaration = assertExportDeclaration;
  12071. generated$2.assertModuleSpecifier = assertModuleSpecifier;
  12072. generated$2.assertPrivate = assertPrivate;
  12073. generated$2.assertFlow = assertFlow;
  12074. generated$2.assertFlowType = assertFlowType;
  12075. generated$2.assertFlowBaseAnnotation = assertFlowBaseAnnotation;
  12076. generated$2.assertFlowDeclaration = assertFlowDeclaration;
  12077. generated$2.assertFlowPredicate = assertFlowPredicate;
  12078. generated$2.assertEnumBody = assertEnumBody;
  12079. generated$2.assertEnumMember = assertEnumMember;
  12080. generated$2.assertJSX = assertJSX;
  12081. generated$2.assertTSTypeElement = assertTSTypeElement;
  12082. generated$2.assertTSType = assertTSType;
  12083. generated$2.assertTSBaseType = assertTSBaseType;
  12084. generated$2.assertNumberLiteral = assertNumberLiteral;
  12085. generated$2.assertRegexLiteral = assertRegexLiteral;
  12086. generated$2.assertRestProperty = assertRestProperty;
  12087. generated$2.assertSpreadProperty = assertSpreadProperty;
  12088. var _is = requireIs();
  12089. function assert(type, node, opts) {
  12090. if (!(0, _is.default)(type, node, opts)) {
  12091. throw new Error('Expected type "'.concat(type, '" with option ').concat(JSON.stringify(opts), ", ") + 'but instead got "'.concat(node.type, '".'));
  12092. }
  12093. }
  12094. function assertArrayExpression(node, opts) {
  12095. assert("ArrayExpression", node, opts);
  12096. }
  12097. function assertAssignmentExpression(node, opts) {
  12098. assert("AssignmentExpression", node, opts);
  12099. }
  12100. function assertBinaryExpression(node, opts) {
  12101. assert("BinaryExpression", node, opts);
  12102. }
  12103. function assertInterpreterDirective(node, opts) {
  12104. assert("InterpreterDirective", node, opts);
  12105. }
  12106. function assertDirective(node, opts) {
  12107. assert("Directive", node, opts);
  12108. }
  12109. function assertDirectiveLiteral(node, opts) {
  12110. assert("DirectiveLiteral", node, opts);
  12111. }
  12112. function assertBlockStatement(node, opts) {
  12113. assert("BlockStatement", node, opts);
  12114. }
  12115. function assertBreakStatement(node, opts) {
  12116. assert("BreakStatement", node, opts);
  12117. }
  12118. function assertCallExpression(node, opts) {
  12119. assert("CallExpression", node, opts);
  12120. }
  12121. function assertCatchClause(node, opts) {
  12122. assert("CatchClause", node, opts);
  12123. }
  12124. function assertConditionalExpression(node, opts) {
  12125. assert("ConditionalExpression", node, opts);
  12126. }
  12127. function assertContinueStatement(node, opts) {
  12128. assert("ContinueStatement", node, opts);
  12129. }
  12130. function assertDebuggerStatement(node, opts) {
  12131. assert("DebuggerStatement", node, opts);
  12132. }
  12133. function assertDoWhileStatement(node, opts) {
  12134. assert("DoWhileStatement", node, opts);
  12135. }
  12136. function assertEmptyStatement(node, opts) {
  12137. assert("EmptyStatement", node, opts);
  12138. }
  12139. function assertExpressionStatement(node, opts) {
  12140. assert("ExpressionStatement", node, opts);
  12141. }
  12142. function assertFile(node, opts) {
  12143. assert("File", node, opts);
  12144. }
  12145. function assertForInStatement(node, opts) {
  12146. assert("ForInStatement", node, opts);
  12147. }
  12148. function assertForStatement(node, opts) {
  12149. assert("ForStatement", node, opts);
  12150. }
  12151. function assertFunctionDeclaration(node, opts) {
  12152. assert("FunctionDeclaration", node, opts);
  12153. }
  12154. function assertFunctionExpression(node, opts) {
  12155. assert("FunctionExpression", node, opts);
  12156. }
  12157. function assertIdentifier(node, opts) {
  12158. assert("Identifier", node, opts);
  12159. }
  12160. function assertIfStatement(node, opts) {
  12161. assert("IfStatement", node, opts);
  12162. }
  12163. function assertLabeledStatement(node, opts) {
  12164. assert("LabeledStatement", node, opts);
  12165. }
  12166. function assertStringLiteral(node, opts) {
  12167. assert("StringLiteral", node, opts);
  12168. }
  12169. function assertNumericLiteral(node, opts) {
  12170. assert("NumericLiteral", node, opts);
  12171. }
  12172. function assertNullLiteral(node, opts) {
  12173. assert("NullLiteral", node, opts);
  12174. }
  12175. function assertBooleanLiteral(node, opts) {
  12176. assert("BooleanLiteral", node, opts);
  12177. }
  12178. function assertRegExpLiteral(node, opts) {
  12179. assert("RegExpLiteral", node, opts);
  12180. }
  12181. function assertLogicalExpression(node, opts) {
  12182. assert("LogicalExpression", node, opts);
  12183. }
  12184. function assertMemberExpression(node, opts) {
  12185. assert("MemberExpression", node, opts);
  12186. }
  12187. function assertNewExpression(node, opts) {
  12188. assert("NewExpression", node, opts);
  12189. }
  12190. function assertProgram(node, opts) {
  12191. assert("Program", node, opts);
  12192. }
  12193. function assertObjectExpression(node, opts) {
  12194. assert("ObjectExpression", node, opts);
  12195. }
  12196. function assertObjectMethod(node, opts) {
  12197. assert("ObjectMethod", node, opts);
  12198. }
  12199. function assertObjectProperty(node, opts) {
  12200. assert("ObjectProperty", node, opts);
  12201. }
  12202. function assertRestElement(node, opts) {
  12203. assert("RestElement", node, opts);
  12204. }
  12205. function assertReturnStatement(node, opts) {
  12206. assert("ReturnStatement", node, opts);
  12207. }
  12208. function assertSequenceExpression(node, opts) {
  12209. assert("SequenceExpression", node, opts);
  12210. }
  12211. function assertParenthesizedExpression(node, opts) {
  12212. assert("ParenthesizedExpression", node, opts);
  12213. }
  12214. function assertSwitchCase(node, opts) {
  12215. assert("SwitchCase", node, opts);
  12216. }
  12217. function assertSwitchStatement(node, opts) {
  12218. assert("SwitchStatement", node, opts);
  12219. }
  12220. function assertThisExpression(node, opts) {
  12221. assert("ThisExpression", node, opts);
  12222. }
  12223. function assertThrowStatement(node, opts) {
  12224. assert("ThrowStatement", node, opts);
  12225. }
  12226. function assertTryStatement(node, opts) {
  12227. assert("TryStatement", node, opts);
  12228. }
  12229. function assertUnaryExpression(node, opts) {
  12230. assert("UnaryExpression", node, opts);
  12231. }
  12232. function assertUpdateExpression(node, opts) {
  12233. assert("UpdateExpression", node, opts);
  12234. }
  12235. function assertVariableDeclaration(node, opts) {
  12236. assert("VariableDeclaration", node, opts);
  12237. }
  12238. function assertVariableDeclarator(node, opts) {
  12239. assert("VariableDeclarator", node, opts);
  12240. }
  12241. function assertWhileStatement(node, opts) {
  12242. assert("WhileStatement", node, opts);
  12243. }
  12244. function assertWithStatement(node, opts) {
  12245. assert("WithStatement", node, opts);
  12246. }
  12247. function assertAssignmentPattern(node, opts) {
  12248. assert("AssignmentPattern", node, opts);
  12249. }
  12250. function assertArrayPattern(node, opts) {
  12251. assert("ArrayPattern", node, opts);
  12252. }
  12253. function assertArrowFunctionExpression(node, opts) {
  12254. assert("ArrowFunctionExpression", node, opts);
  12255. }
  12256. function assertClassBody(node, opts) {
  12257. assert("ClassBody", node, opts);
  12258. }
  12259. function assertClassExpression(node, opts) {
  12260. assert("ClassExpression", node, opts);
  12261. }
  12262. function assertClassDeclaration(node, opts) {
  12263. assert("ClassDeclaration", node, opts);
  12264. }
  12265. function assertExportAllDeclaration(node, opts) {
  12266. assert("ExportAllDeclaration", node, opts);
  12267. }
  12268. function assertExportDefaultDeclaration(node, opts) {
  12269. assert("ExportDefaultDeclaration", node, opts);
  12270. }
  12271. function assertExportNamedDeclaration(node, opts) {
  12272. assert("ExportNamedDeclaration", node, opts);
  12273. }
  12274. function assertExportSpecifier(node, opts) {
  12275. assert("ExportSpecifier", node, opts);
  12276. }
  12277. function assertForOfStatement(node, opts) {
  12278. assert("ForOfStatement", node, opts);
  12279. }
  12280. function assertImportDeclaration(node, opts) {
  12281. assert("ImportDeclaration", node, opts);
  12282. }
  12283. function assertImportDefaultSpecifier(node, opts) {
  12284. assert("ImportDefaultSpecifier", node, opts);
  12285. }
  12286. function assertImportNamespaceSpecifier(node, opts) {
  12287. assert("ImportNamespaceSpecifier", node, opts);
  12288. }
  12289. function assertImportSpecifier(node, opts) {
  12290. assert("ImportSpecifier", node, opts);
  12291. }
  12292. function assertMetaProperty(node, opts) {
  12293. assert("MetaProperty", node, opts);
  12294. }
  12295. function assertClassMethod(node, opts) {
  12296. assert("ClassMethod", node, opts);
  12297. }
  12298. function assertObjectPattern(node, opts) {
  12299. assert("ObjectPattern", node, opts);
  12300. }
  12301. function assertSpreadElement(node, opts) {
  12302. assert("SpreadElement", node, opts);
  12303. }
  12304. function assertSuper(node, opts) {
  12305. assert("Super", node, opts);
  12306. }
  12307. function assertTaggedTemplateExpression(node, opts) {
  12308. assert("TaggedTemplateExpression", node, opts);
  12309. }
  12310. function assertTemplateElement(node, opts) {
  12311. assert("TemplateElement", node, opts);
  12312. }
  12313. function assertTemplateLiteral(node, opts) {
  12314. assert("TemplateLiteral", node, opts);
  12315. }
  12316. function assertYieldExpression(node, opts) {
  12317. assert("YieldExpression", node, opts);
  12318. }
  12319. function assertAwaitExpression(node, opts) {
  12320. assert("AwaitExpression", node, opts);
  12321. }
  12322. function assertImport(node, opts) {
  12323. assert("Import", node, opts);
  12324. }
  12325. function assertBigIntLiteral(node, opts) {
  12326. assert("BigIntLiteral", node, opts);
  12327. }
  12328. function assertExportNamespaceSpecifier(node, opts) {
  12329. assert("ExportNamespaceSpecifier", node, opts);
  12330. }
  12331. function assertOptionalMemberExpression(node, opts) {
  12332. assert("OptionalMemberExpression", node, opts);
  12333. }
  12334. function assertOptionalCallExpression(node, opts) {
  12335. assert("OptionalCallExpression", node, opts);
  12336. }
  12337. function assertClassProperty(node, opts) {
  12338. assert("ClassProperty", node, opts);
  12339. }
  12340. function assertClassPrivateProperty(node, opts) {
  12341. assert("ClassPrivateProperty", node, opts);
  12342. }
  12343. function assertClassPrivateMethod(node, opts) {
  12344. assert("ClassPrivateMethod", node, opts);
  12345. }
  12346. function assertPrivateName(node, opts) {
  12347. assert("PrivateName", node, opts);
  12348. }
  12349. function assertAnyTypeAnnotation(node, opts) {
  12350. assert("AnyTypeAnnotation", node, opts);
  12351. }
  12352. function assertArrayTypeAnnotation(node, opts) {
  12353. assert("ArrayTypeAnnotation", node, opts);
  12354. }
  12355. function assertBooleanTypeAnnotation(node, opts) {
  12356. assert("BooleanTypeAnnotation", node, opts);
  12357. }
  12358. function assertBooleanLiteralTypeAnnotation(node, opts) {
  12359. assert("BooleanLiteralTypeAnnotation", node, opts);
  12360. }
  12361. function assertNullLiteralTypeAnnotation(node, opts) {
  12362. assert("NullLiteralTypeAnnotation", node, opts);
  12363. }
  12364. function assertClassImplements(node, opts) {
  12365. assert("ClassImplements", node, opts);
  12366. }
  12367. function assertDeclareClass(node, opts) {
  12368. assert("DeclareClass", node, opts);
  12369. }
  12370. function assertDeclareFunction(node, opts) {
  12371. assert("DeclareFunction", node, opts);
  12372. }
  12373. function assertDeclareInterface(node, opts) {
  12374. assert("DeclareInterface", node, opts);
  12375. }
  12376. function assertDeclareModule(node, opts) {
  12377. assert("DeclareModule", node, opts);
  12378. }
  12379. function assertDeclareModuleExports(node, opts) {
  12380. assert("DeclareModuleExports", node, opts);
  12381. }
  12382. function assertDeclareTypeAlias(node, opts) {
  12383. assert("DeclareTypeAlias", node, opts);
  12384. }
  12385. function assertDeclareOpaqueType(node, opts) {
  12386. assert("DeclareOpaqueType", node, opts);
  12387. }
  12388. function assertDeclareVariable(node, opts) {
  12389. assert("DeclareVariable", node, opts);
  12390. }
  12391. function assertDeclareExportDeclaration(node, opts) {
  12392. assert("DeclareExportDeclaration", node, opts);
  12393. }
  12394. function assertDeclareExportAllDeclaration(node, opts) {
  12395. assert("DeclareExportAllDeclaration", node, opts);
  12396. }
  12397. function assertDeclaredPredicate(node, opts) {
  12398. assert("DeclaredPredicate", node, opts);
  12399. }
  12400. function assertExistsTypeAnnotation(node, opts) {
  12401. assert("ExistsTypeAnnotation", node, opts);
  12402. }
  12403. function assertFunctionTypeAnnotation(node, opts) {
  12404. assert("FunctionTypeAnnotation", node, opts);
  12405. }
  12406. function assertFunctionTypeParam(node, opts) {
  12407. assert("FunctionTypeParam", node, opts);
  12408. }
  12409. function assertGenericTypeAnnotation(node, opts) {
  12410. assert("GenericTypeAnnotation", node, opts);
  12411. }
  12412. function assertInferredPredicate(node, opts) {
  12413. assert("InferredPredicate", node, opts);
  12414. }
  12415. function assertInterfaceExtends(node, opts) {
  12416. assert("InterfaceExtends", node, opts);
  12417. }
  12418. function assertInterfaceDeclaration(node, opts) {
  12419. assert("InterfaceDeclaration", node, opts);
  12420. }
  12421. function assertInterfaceTypeAnnotation(node, opts) {
  12422. assert("InterfaceTypeAnnotation", node, opts);
  12423. }
  12424. function assertIntersectionTypeAnnotation(node, opts) {
  12425. assert("IntersectionTypeAnnotation", node, opts);
  12426. }
  12427. function assertMixedTypeAnnotation(node, opts) {
  12428. assert("MixedTypeAnnotation", node, opts);
  12429. }
  12430. function assertEmptyTypeAnnotation(node, opts) {
  12431. assert("EmptyTypeAnnotation", node, opts);
  12432. }
  12433. function assertNullableTypeAnnotation(node, opts) {
  12434. assert("NullableTypeAnnotation", node, opts);
  12435. }
  12436. function assertNumberLiteralTypeAnnotation(node, opts) {
  12437. assert("NumberLiteralTypeAnnotation", node, opts);
  12438. }
  12439. function assertNumberTypeAnnotation(node, opts) {
  12440. assert("NumberTypeAnnotation", node, opts);
  12441. }
  12442. function assertObjectTypeAnnotation(node, opts) {
  12443. assert("ObjectTypeAnnotation", node, opts);
  12444. }
  12445. function assertObjectTypeInternalSlot(node, opts) {
  12446. assert("ObjectTypeInternalSlot", node, opts);
  12447. }
  12448. function assertObjectTypeCallProperty(node, opts) {
  12449. assert("ObjectTypeCallProperty", node, opts);
  12450. }
  12451. function assertObjectTypeIndexer(node, opts) {
  12452. assert("ObjectTypeIndexer", node, opts);
  12453. }
  12454. function assertObjectTypeProperty(node, opts) {
  12455. assert("ObjectTypeProperty", node, opts);
  12456. }
  12457. function assertObjectTypeSpreadProperty(node, opts) {
  12458. assert("ObjectTypeSpreadProperty", node, opts);
  12459. }
  12460. function assertOpaqueType(node, opts) {
  12461. assert("OpaqueType", node, opts);
  12462. }
  12463. function assertQualifiedTypeIdentifier(node, opts) {
  12464. assert("QualifiedTypeIdentifier", node, opts);
  12465. }
  12466. function assertStringLiteralTypeAnnotation(node, opts) {
  12467. assert("StringLiteralTypeAnnotation", node, opts);
  12468. }
  12469. function assertStringTypeAnnotation(node, opts) {
  12470. assert("StringTypeAnnotation", node, opts);
  12471. }
  12472. function assertSymbolTypeAnnotation(node, opts) {
  12473. assert("SymbolTypeAnnotation", node, opts);
  12474. }
  12475. function assertThisTypeAnnotation(node, opts) {
  12476. assert("ThisTypeAnnotation", node, opts);
  12477. }
  12478. function assertTupleTypeAnnotation(node, opts) {
  12479. assert("TupleTypeAnnotation", node, opts);
  12480. }
  12481. function assertTypeofTypeAnnotation(node, opts) {
  12482. assert("TypeofTypeAnnotation", node, opts);
  12483. }
  12484. function assertTypeAlias(node, opts) {
  12485. assert("TypeAlias", node, opts);
  12486. }
  12487. function assertTypeAnnotation(node, opts) {
  12488. assert("TypeAnnotation", node, opts);
  12489. }
  12490. function assertTypeCastExpression(node, opts) {
  12491. assert("TypeCastExpression", node, opts);
  12492. }
  12493. function assertTypeParameter(node, opts) {
  12494. assert("TypeParameter", node, opts);
  12495. }
  12496. function assertTypeParameterDeclaration(node, opts) {
  12497. assert("TypeParameterDeclaration", node, opts);
  12498. }
  12499. function assertTypeParameterInstantiation(node, opts) {
  12500. assert("TypeParameterInstantiation", node, opts);
  12501. }
  12502. function assertUnionTypeAnnotation(node, opts) {
  12503. assert("UnionTypeAnnotation", node, opts);
  12504. }
  12505. function assertVariance(node, opts) {
  12506. assert("Variance", node, opts);
  12507. }
  12508. function assertVoidTypeAnnotation(node, opts) {
  12509. assert("VoidTypeAnnotation", node, opts);
  12510. }
  12511. function assertEnumDeclaration(node, opts) {
  12512. assert("EnumDeclaration", node, opts);
  12513. }
  12514. function assertEnumBooleanBody(node, opts) {
  12515. assert("EnumBooleanBody", node, opts);
  12516. }
  12517. function assertEnumNumberBody(node, opts) {
  12518. assert("EnumNumberBody", node, opts);
  12519. }
  12520. function assertEnumStringBody(node, opts) {
  12521. assert("EnumStringBody", node, opts);
  12522. }
  12523. function assertEnumSymbolBody(node, opts) {
  12524. assert("EnumSymbolBody", node, opts);
  12525. }
  12526. function assertEnumBooleanMember(node, opts) {
  12527. assert("EnumBooleanMember", node, opts);
  12528. }
  12529. function assertEnumNumberMember(node, opts) {
  12530. assert("EnumNumberMember", node, opts);
  12531. }
  12532. function assertEnumStringMember(node, opts) {
  12533. assert("EnumStringMember", node, opts);
  12534. }
  12535. function assertEnumDefaultedMember(node, opts) {
  12536. assert("EnumDefaultedMember", node, opts);
  12537. }
  12538. function assertIndexedAccessType(node, opts) {
  12539. assert("IndexedAccessType", node, opts);
  12540. }
  12541. function assertOptionalIndexedAccessType(node, opts) {
  12542. assert("OptionalIndexedAccessType", node, opts);
  12543. }
  12544. function assertJSXAttribute(node, opts) {
  12545. assert("JSXAttribute", node, opts);
  12546. }
  12547. function assertJSXClosingElement(node, opts) {
  12548. assert("JSXClosingElement", node, opts);
  12549. }
  12550. function assertJSXElement(node, opts) {
  12551. assert("JSXElement", node, opts);
  12552. }
  12553. function assertJSXEmptyExpression(node, opts) {
  12554. assert("JSXEmptyExpression", node, opts);
  12555. }
  12556. function assertJSXExpressionContainer(node, opts) {
  12557. assert("JSXExpressionContainer", node, opts);
  12558. }
  12559. function assertJSXSpreadChild(node, opts) {
  12560. assert("JSXSpreadChild", node, opts);
  12561. }
  12562. function assertJSXIdentifier(node, opts) {
  12563. assert("JSXIdentifier", node, opts);
  12564. }
  12565. function assertJSXMemberExpression(node, opts) {
  12566. assert("JSXMemberExpression", node, opts);
  12567. }
  12568. function assertJSXNamespacedName(node, opts) {
  12569. assert("JSXNamespacedName", node, opts);
  12570. }
  12571. function assertJSXOpeningElement(node, opts) {
  12572. assert("JSXOpeningElement", node, opts);
  12573. }
  12574. function assertJSXSpreadAttribute(node, opts) {
  12575. assert("JSXSpreadAttribute", node, opts);
  12576. }
  12577. function assertJSXText(node, opts) {
  12578. assert("JSXText", node, opts);
  12579. }
  12580. function assertJSXFragment(node, opts) {
  12581. assert("JSXFragment", node, opts);
  12582. }
  12583. function assertJSXOpeningFragment(node, opts) {
  12584. assert("JSXOpeningFragment", node, opts);
  12585. }
  12586. function assertJSXClosingFragment(node, opts) {
  12587. assert("JSXClosingFragment", node, opts);
  12588. }
  12589. function assertNoop(node, opts) {
  12590. assert("Noop", node, opts);
  12591. }
  12592. function assertPlaceholder(node, opts) {
  12593. assert("Placeholder", node, opts);
  12594. }
  12595. function assertV8IntrinsicIdentifier(node, opts) {
  12596. assert("V8IntrinsicIdentifier", node, opts);
  12597. }
  12598. function assertArgumentPlaceholder(node, opts) {
  12599. assert("ArgumentPlaceholder", node, opts);
  12600. }
  12601. function assertBindExpression(node, opts) {
  12602. assert("BindExpression", node, opts);
  12603. }
  12604. function assertImportAttribute(node, opts) {
  12605. assert("ImportAttribute", node, opts);
  12606. }
  12607. function assertDecorator(node, opts) {
  12608. assert("Decorator", node, opts);
  12609. }
  12610. function assertDoExpression(node, opts) {
  12611. assert("DoExpression", node, opts);
  12612. }
  12613. function assertExportDefaultSpecifier(node, opts) {
  12614. assert("ExportDefaultSpecifier", node, opts);
  12615. }
  12616. function assertRecordExpression(node, opts) {
  12617. assert("RecordExpression", node, opts);
  12618. }
  12619. function assertTupleExpression(node, opts) {
  12620. assert("TupleExpression", node, opts);
  12621. }
  12622. function assertDecimalLiteral(node, opts) {
  12623. assert("DecimalLiteral", node, opts);
  12624. }
  12625. function assertStaticBlock(node, opts) {
  12626. assert("StaticBlock", node, opts);
  12627. }
  12628. function assertModuleExpression(node, opts) {
  12629. assert("ModuleExpression", node, opts);
  12630. }
  12631. function assertTopicReference(node, opts) {
  12632. assert("TopicReference", node, opts);
  12633. }
  12634. function assertPipelineTopicExpression(node, opts) {
  12635. assert("PipelineTopicExpression", node, opts);
  12636. }
  12637. function assertPipelineBareFunction(node, opts) {
  12638. assert("PipelineBareFunction", node, opts);
  12639. }
  12640. function assertPipelinePrimaryTopicReference(node, opts) {
  12641. assert("PipelinePrimaryTopicReference", node, opts);
  12642. }
  12643. function assertTSParameterProperty(node, opts) {
  12644. assert("TSParameterProperty", node, opts);
  12645. }
  12646. function assertTSDeclareFunction(node, opts) {
  12647. assert("TSDeclareFunction", node, opts);
  12648. }
  12649. function assertTSDeclareMethod(node, opts) {
  12650. assert("TSDeclareMethod", node, opts);
  12651. }
  12652. function assertTSQualifiedName(node, opts) {
  12653. assert("TSQualifiedName", node, opts);
  12654. }
  12655. function assertTSCallSignatureDeclaration(node, opts) {
  12656. assert("TSCallSignatureDeclaration", node, opts);
  12657. }
  12658. function assertTSConstructSignatureDeclaration(node, opts) {
  12659. assert("TSConstructSignatureDeclaration", node, opts);
  12660. }
  12661. function assertTSPropertySignature(node, opts) {
  12662. assert("TSPropertySignature", node, opts);
  12663. }
  12664. function assertTSMethodSignature(node, opts) {
  12665. assert("TSMethodSignature", node, opts);
  12666. }
  12667. function assertTSIndexSignature(node, opts) {
  12668. assert("TSIndexSignature", node, opts);
  12669. }
  12670. function assertTSAnyKeyword(node, opts) {
  12671. assert("TSAnyKeyword", node, opts);
  12672. }
  12673. function assertTSBooleanKeyword(node, opts) {
  12674. assert("TSBooleanKeyword", node, opts);
  12675. }
  12676. function assertTSBigIntKeyword(node, opts) {
  12677. assert("TSBigIntKeyword", node, opts);
  12678. }
  12679. function assertTSIntrinsicKeyword(node, opts) {
  12680. assert("TSIntrinsicKeyword", node, opts);
  12681. }
  12682. function assertTSNeverKeyword(node, opts) {
  12683. assert("TSNeverKeyword", node, opts);
  12684. }
  12685. function assertTSNullKeyword(node, opts) {
  12686. assert("TSNullKeyword", node, opts);
  12687. }
  12688. function assertTSNumberKeyword(node, opts) {
  12689. assert("TSNumberKeyword", node, opts);
  12690. }
  12691. function assertTSObjectKeyword(node, opts) {
  12692. assert("TSObjectKeyword", node, opts);
  12693. }
  12694. function assertTSStringKeyword(node, opts) {
  12695. assert("TSStringKeyword", node, opts);
  12696. }
  12697. function assertTSSymbolKeyword(node, opts) {
  12698. assert("TSSymbolKeyword", node, opts);
  12699. }
  12700. function assertTSUndefinedKeyword(node, opts) {
  12701. assert("TSUndefinedKeyword", node, opts);
  12702. }
  12703. function assertTSUnknownKeyword(node, opts) {
  12704. assert("TSUnknownKeyword", node, opts);
  12705. }
  12706. function assertTSVoidKeyword(node, opts) {
  12707. assert("TSVoidKeyword", node, opts);
  12708. }
  12709. function assertTSThisType(node, opts) {
  12710. assert("TSThisType", node, opts);
  12711. }
  12712. function assertTSFunctionType(node, opts) {
  12713. assert("TSFunctionType", node, opts);
  12714. }
  12715. function assertTSConstructorType(node, opts) {
  12716. assert("TSConstructorType", node, opts);
  12717. }
  12718. function assertTSTypeReference(node, opts) {
  12719. assert("TSTypeReference", node, opts);
  12720. }
  12721. function assertTSTypePredicate(node, opts) {
  12722. assert("TSTypePredicate", node, opts);
  12723. }
  12724. function assertTSTypeQuery(node, opts) {
  12725. assert("TSTypeQuery", node, opts);
  12726. }
  12727. function assertTSTypeLiteral(node, opts) {
  12728. assert("TSTypeLiteral", node, opts);
  12729. }
  12730. function assertTSArrayType(node, opts) {
  12731. assert("TSArrayType", node, opts);
  12732. }
  12733. function assertTSTupleType(node, opts) {
  12734. assert("TSTupleType", node, opts);
  12735. }
  12736. function assertTSOptionalType(node, opts) {
  12737. assert("TSOptionalType", node, opts);
  12738. }
  12739. function assertTSRestType(node, opts) {
  12740. assert("TSRestType", node, opts);
  12741. }
  12742. function assertTSNamedTupleMember(node, opts) {
  12743. assert("TSNamedTupleMember", node, opts);
  12744. }
  12745. function assertTSUnionType(node, opts) {
  12746. assert("TSUnionType", node, opts);
  12747. }
  12748. function assertTSIntersectionType(node, opts) {
  12749. assert("TSIntersectionType", node, opts);
  12750. }
  12751. function assertTSConditionalType(node, opts) {
  12752. assert("TSConditionalType", node, opts);
  12753. }
  12754. function assertTSInferType(node, opts) {
  12755. assert("TSInferType", node, opts);
  12756. }
  12757. function assertTSParenthesizedType(node, opts) {
  12758. assert("TSParenthesizedType", node, opts);
  12759. }
  12760. function assertTSTypeOperator(node, opts) {
  12761. assert("TSTypeOperator", node, opts);
  12762. }
  12763. function assertTSIndexedAccessType(node, opts) {
  12764. assert("TSIndexedAccessType", node, opts);
  12765. }
  12766. function assertTSMappedType(node, opts) {
  12767. assert("TSMappedType", node, opts);
  12768. }
  12769. function assertTSLiteralType(node, opts) {
  12770. assert("TSLiteralType", node, opts);
  12771. }
  12772. function assertTSExpressionWithTypeArguments(node, opts) {
  12773. assert("TSExpressionWithTypeArguments", node, opts);
  12774. }
  12775. function assertTSInterfaceDeclaration(node, opts) {
  12776. assert("TSInterfaceDeclaration", node, opts);
  12777. }
  12778. function assertTSInterfaceBody(node, opts) {
  12779. assert("TSInterfaceBody", node, opts);
  12780. }
  12781. function assertTSTypeAliasDeclaration(node, opts) {
  12782. assert("TSTypeAliasDeclaration", node, opts);
  12783. }
  12784. function assertTSAsExpression(node, opts) {
  12785. assert("TSAsExpression", node, opts);
  12786. }
  12787. function assertTSTypeAssertion(node, opts) {
  12788. assert("TSTypeAssertion", node, opts);
  12789. }
  12790. function assertTSEnumDeclaration(node, opts) {
  12791. assert("TSEnumDeclaration", node, opts);
  12792. }
  12793. function assertTSEnumMember(node, opts) {
  12794. assert("TSEnumMember", node, opts);
  12795. }
  12796. function assertTSModuleDeclaration(node, opts) {
  12797. assert("TSModuleDeclaration", node, opts);
  12798. }
  12799. function assertTSModuleBlock(node, opts) {
  12800. assert("TSModuleBlock", node, opts);
  12801. }
  12802. function assertTSImportType(node, opts) {
  12803. assert("TSImportType", node, opts);
  12804. }
  12805. function assertTSImportEqualsDeclaration(node, opts) {
  12806. assert("TSImportEqualsDeclaration", node, opts);
  12807. }
  12808. function assertTSExternalModuleReference(node, opts) {
  12809. assert("TSExternalModuleReference", node, opts);
  12810. }
  12811. function assertTSNonNullExpression(node, opts) {
  12812. assert("TSNonNullExpression", node, opts);
  12813. }
  12814. function assertTSExportAssignment(node, opts) {
  12815. assert("TSExportAssignment", node, opts);
  12816. }
  12817. function assertTSNamespaceExportDeclaration(node, opts) {
  12818. assert("TSNamespaceExportDeclaration", node, opts);
  12819. }
  12820. function assertTSTypeAnnotation(node, opts) {
  12821. assert("TSTypeAnnotation", node, opts);
  12822. }
  12823. function assertTSTypeParameterInstantiation(node, opts) {
  12824. assert("TSTypeParameterInstantiation", node, opts);
  12825. }
  12826. function assertTSTypeParameterDeclaration(node, opts) {
  12827. assert("TSTypeParameterDeclaration", node, opts);
  12828. }
  12829. function assertTSTypeParameter(node, opts) {
  12830. assert("TSTypeParameter", node, opts);
  12831. }
  12832. function assertExpression(node, opts) {
  12833. assert("Expression", node, opts);
  12834. }
  12835. function assertBinary(node, opts) {
  12836. assert("Binary", node, opts);
  12837. }
  12838. function assertScopable(node, opts) {
  12839. assert("Scopable", node, opts);
  12840. }
  12841. function assertBlockParent(node, opts) {
  12842. assert("BlockParent", node, opts);
  12843. }
  12844. function assertBlock(node, opts) {
  12845. assert("Block", node, opts);
  12846. }
  12847. function assertStatement(node, opts) {
  12848. assert("Statement", node, opts);
  12849. }
  12850. function assertTerminatorless(node, opts) {
  12851. assert("Terminatorless", node, opts);
  12852. }
  12853. function assertCompletionStatement(node, opts) {
  12854. assert("CompletionStatement", node, opts);
  12855. }
  12856. function assertConditional(node, opts) {
  12857. assert("Conditional", node, opts);
  12858. }
  12859. function assertLoop(node, opts) {
  12860. assert("Loop", node, opts);
  12861. }
  12862. function assertWhile(node, opts) {
  12863. assert("While", node, opts);
  12864. }
  12865. function assertExpressionWrapper(node, opts) {
  12866. assert("ExpressionWrapper", node, opts);
  12867. }
  12868. function assertFor(node, opts) {
  12869. assert("For", node, opts);
  12870. }
  12871. function assertForXStatement(node, opts) {
  12872. assert("ForXStatement", node, opts);
  12873. }
  12874. function assertFunction(node, opts) {
  12875. assert("Function", node, opts);
  12876. }
  12877. function assertFunctionParent(node, opts) {
  12878. assert("FunctionParent", node, opts);
  12879. }
  12880. function assertPureish(node, opts) {
  12881. assert("Pureish", node, opts);
  12882. }
  12883. function assertDeclaration(node, opts) {
  12884. assert("Declaration", node, opts);
  12885. }
  12886. function assertPatternLike(node, opts) {
  12887. assert("PatternLike", node, opts);
  12888. }
  12889. function assertLVal(node, opts) {
  12890. assert("LVal", node, opts);
  12891. }
  12892. function assertTSEntityName(node, opts) {
  12893. assert("TSEntityName", node, opts);
  12894. }
  12895. function assertLiteral(node, opts) {
  12896. assert("Literal", node, opts);
  12897. }
  12898. function assertImmutable(node, opts) {
  12899. assert("Immutable", node, opts);
  12900. }
  12901. function assertUserWhitespacable(node, opts) {
  12902. assert("UserWhitespacable", node, opts);
  12903. }
  12904. function assertMethod(node, opts) {
  12905. assert("Method", node, opts);
  12906. }
  12907. function assertObjectMember(node, opts) {
  12908. assert("ObjectMember", node, opts);
  12909. }
  12910. function assertProperty(node, opts) {
  12911. assert("Property", node, opts);
  12912. }
  12913. function assertUnaryLike(node, opts) {
  12914. assert("UnaryLike", node, opts);
  12915. }
  12916. function assertPattern(node, opts) {
  12917. assert("Pattern", node, opts);
  12918. }
  12919. function assertClass(node, opts) {
  12920. assert("Class", node, opts);
  12921. }
  12922. function assertModuleDeclaration(node, opts) {
  12923. assert("ModuleDeclaration", node, opts);
  12924. }
  12925. function assertExportDeclaration(node, opts) {
  12926. assert("ExportDeclaration", node, opts);
  12927. }
  12928. function assertModuleSpecifier(node, opts) {
  12929. assert("ModuleSpecifier", node, opts);
  12930. }
  12931. function assertPrivate(node, opts) {
  12932. assert("Private", node, opts);
  12933. }
  12934. function assertFlow(node, opts) {
  12935. assert("Flow", node, opts);
  12936. }
  12937. function assertFlowType(node, opts) {
  12938. assert("FlowType", node, opts);
  12939. }
  12940. function assertFlowBaseAnnotation(node, opts) {
  12941. assert("FlowBaseAnnotation", node, opts);
  12942. }
  12943. function assertFlowDeclaration(node, opts) {
  12944. assert("FlowDeclaration", node, opts);
  12945. }
  12946. function assertFlowPredicate(node, opts) {
  12947. assert("FlowPredicate", node, opts);
  12948. }
  12949. function assertEnumBody(node, opts) {
  12950. assert("EnumBody", node, opts);
  12951. }
  12952. function assertEnumMember(node, opts) {
  12953. assert("EnumMember", node, opts);
  12954. }
  12955. function assertJSX(node, opts) {
  12956. assert("JSX", node, opts);
  12957. }
  12958. function assertTSTypeElement(node, opts) {
  12959. assert("TSTypeElement", node, opts);
  12960. }
  12961. function assertTSType(node, opts) {
  12962. assert("TSType", node, opts);
  12963. }
  12964. function assertTSBaseType(node, opts) {
  12965. assert("TSBaseType", node, opts);
  12966. }
  12967. function assertNumberLiteral(node, opts) {
  12968. console.trace("The node type NumberLiteral has been renamed to NumericLiteral");
  12969. assert("NumberLiteral", node, opts);
  12970. }
  12971. function assertRegexLiteral(node, opts) {
  12972. console.trace("The node type RegexLiteral has been renamed to RegExpLiteral");
  12973. assert("RegexLiteral", node, opts);
  12974. }
  12975. function assertRestProperty(node, opts) {
  12976. console.trace("The node type RestProperty has been renamed to RestElement");
  12977. assert("RestProperty", node, opts);
  12978. }
  12979. function assertSpreadProperty(node, opts) {
  12980. console.trace("The node type SpreadProperty has been renamed to SpreadElement");
  12981. assert("SpreadProperty", node, opts);
  12982. }
  12983. var createTypeAnnotationBasedOnTypeof$1 = {};
  12984. Object.defineProperty(createTypeAnnotationBasedOnTypeof$1, "__esModule", {
  12985. value: true
  12986. });
  12987. createTypeAnnotationBasedOnTypeof$1.default = createTypeAnnotationBasedOnTypeof;
  12988. var _generated$l = generated$3;
  12989. function createTypeAnnotationBasedOnTypeof(type) {
  12990. if (type === "string") {
  12991. return (0, _generated$l.stringTypeAnnotation)();
  12992. } else if (type === "number") {
  12993. return (0, _generated$l.numberTypeAnnotation)();
  12994. } else if (type === "undefined") {
  12995. return (0, _generated$l.voidTypeAnnotation)();
  12996. } else if (type === "boolean") {
  12997. return (0, _generated$l.booleanTypeAnnotation)();
  12998. } else if (type === "function") {
  12999. return (0, _generated$l.genericTypeAnnotation)((0, _generated$l.identifier)("Function"));
  13000. } else if (type === "object") {
  13001. return (0, _generated$l.genericTypeAnnotation)((0, _generated$l.identifier)("Object"));
  13002. } else if (type === "symbol") {
  13003. return (0, _generated$l.genericTypeAnnotation)((0, _generated$l.identifier)("Symbol"));
  13004. } else if (type === "bigint") {
  13005. return (0, _generated$l.anyTypeAnnotation)();
  13006. } else {
  13007. throw new Error("Invalid typeof value: " + type);
  13008. }
  13009. }
  13010. var createFlowUnionType$1 = {};
  13011. var removeTypeDuplicates$3 = {};
  13012. Object.defineProperty(removeTypeDuplicates$3, "__esModule", {
  13013. value: true
  13014. });
  13015. removeTypeDuplicates$3.default = removeTypeDuplicates$2;
  13016. var _generated$k = generated$4;
  13017. function getQualifiedName(node) {
  13018. return (0, _generated$k.isIdentifier)(node) ? node.name : node.id.name + "." + getQualifiedName(node.qualification);
  13019. }
  13020. function removeTypeDuplicates$2(nodes) {
  13021. var generics = {};
  13022. var bases = {};
  13023. var typeGroups = [];
  13024. var types = [];
  13025. for(var i = 0; i < nodes.length; i++){
  13026. var node = nodes[i];
  13027. if (!node) continue;
  13028. if (types.indexOf(node) >= 0) {
  13029. continue;
  13030. }
  13031. if ((0, _generated$k.isAnyTypeAnnotation)(node)) {
  13032. return [
  13033. node
  13034. ];
  13035. }
  13036. if ((0, _generated$k.isFlowBaseAnnotation)(node)) {
  13037. bases[node.type] = node;
  13038. continue;
  13039. }
  13040. if ((0, _generated$k.isUnionTypeAnnotation)(node)) {
  13041. if (typeGroups.indexOf(node.types) < 0) {
  13042. nodes = nodes.concat(node.types);
  13043. typeGroups.push(node.types);
  13044. }
  13045. continue;
  13046. }
  13047. if ((0, _generated$k.isGenericTypeAnnotation)(node)) {
  13048. var name = getQualifiedName(node.id);
  13049. if (generics[name]) {
  13050. var existing = generics[name];
  13051. if (existing.typeParameters) {
  13052. if (node.typeParameters) {
  13053. existing.typeParameters.params = removeTypeDuplicates$2(existing.typeParameters.params.concat(node.typeParameters.params));
  13054. }
  13055. } else {
  13056. existing = node.typeParameters;
  13057. }
  13058. } else {
  13059. generics[name] = node;
  13060. }
  13061. continue;
  13062. }
  13063. types.push(node);
  13064. }
  13065. for(var _i = 0, _iter = Object.keys(bases); _i < _iter.length; _i++){
  13066. var type = _iter[_i];
  13067. types.push(bases[type]);
  13068. }
  13069. for(var _i1 = 0, _iter1 = Object.keys(generics); _i1 < _iter1.length; _i1++){
  13070. var name1 = _iter1[_i1];
  13071. types.push(generics[name1]);
  13072. }
  13073. return types;
  13074. }
  13075. Object.defineProperty(createFlowUnionType$1, "__esModule", {
  13076. value: true
  13077. });
  13078. createFlowUnionType$1.default = createFlowUnionType;
  13079. var _generated$j = generated$3;
  13080. var _removeTypeDuplicates$1 = removeTypeDuplicates$3;
  13081. function createFlowUnionType(types) {
  13082. var flattened = (0, _removeTypeDuplicates$1.default)(types);
  13083. if (flattened.length === 1) {
  13084. return flattened[0];
  13085. } else {
  13086. return (0, _generated$j.unionTypeAnnotation)(flattened);
  13087. }
  13088. }
  13089. var createTSUnionType$1 = {};
  13090. var removeTypeDuplicates$1 = {};
  13091. Object.defineProperty(removeTypeDuplicates$1, "__esModule", {
  13092. value: true
  13093. });
  13094. removeTypeDuplicates$1.default = removeTypeDuplicates;
  13095. var _generated$i = generated$4;
  13096. function removeTypeDuplicates(nodes) {
  13097. var generics = {};
  13098. var bases = {};
  13099. var typeGroups = [];
  13100. var types = [];
  13101. for(var i = 0; i < nodes.length; i++){
  13102. var node = nodes[i];
  13103. if (!node) continue;
  13104. if (types.indexOf(node) >= 0) {
  13105. continue;
  13106. }
  13107. if ((0, _generated$i.isTSAnyKeyword)(node)) {
  13108. return [
  13109. node
  13110. ];
  13111. }
  13112. if ((0, _generated$i.isTSBaseType)(node)) {
  13113. bases[node.type] = node;
  13114. continue;
  13115. }
  13116. if ((0, _generated$i.isTSUnionType)(node)) {
  13117. if (typeGroups.indexOf(node.types) < 0) {
  13118. nodes = nodes.concat(node.types);
  13119. typeGroups.push(node.types);
  13120. }
  13121. continue;
  13122. }
  13123. types.push(node);
  13124. }
  13125. for(var _i = 0, _iter = Object.keys(bases); _i < _iter.length; _i++){
  13126. var type = _iter[_i];
  13127. types.push(bases[type]);
  13128. }
  13129. for(var _i1 = 0, _iter1 = Object.keys(generics); _i1 < _iter1.length; _i1++){
  13130. var name = _iter1[_i1];
  13131. types.push(generics[name]);
  13132. }
  13133. return types;
  13134. }
  13135. Object.defineProperty(createTSUnionType$1, "__esModule", {
  13136. value: true
  13137. });
  13138. createTSUnionType$1.default = createTSUnionType;
  13139. var _generated$h = generated$3;
  13140. var _removeTypeDuplicates = removeTypeDuplicates$1;
  13141. function createTSUnionType(typeAnnotations) {
  13142. var types = typeAnnotations.map(function(type) {
  13143. return type.typeAnnotation;
  13144. });
  13145. var flattened = (0, _removeTypeDuplicates.default)(types);
  13146. if (flattened.length === 1) {
  13147. return flattened[0];
  13148. } else {
  13149. return (0, _generated$h.tsUnionType)(flattened);
  13150. }
  13151. }
  13152. var uppercase = {};
  13153. (function(exports) {
  13154. Object.defineProperty(exports, "__esModule", {
  13155. value: true
  13156. });
  13157. Object.defineProperty(exports, "ArrayExpression", {
  13158. enumerable: true,
  13159. get: function get() {
  13160. return _index.arrayExpression;
  13161. }
  13162. });
  13163. Object.defineProperty(exports, "AssignmentExpression", {
  13164. enumerable: true,
  13165. get: function get() {
  13166. return _index.assignmentExpression;
  13167. }
  13168. });
  13169. Object.defineProperty(exports, "BinaryExpression", {
  13170. enumerable: true,
  13171. get: function get() {
  13172. return _index.binaryExpression;
  13173. }
  13174. });
  13175. Object.defineProperty(exports, "InterpreterDirective", {
  13176. enumerable: true,
  13177. get: function get() {
  13178. return _index.interpreterDirective;
  13179. }
  13180. });
  13181. Object.defineProperty(exports, "Directive", {
  13182. enumerable: true,
  13183. get: function get() {
  13184. return _index.directive;
  13185. }
  13186. });
  13187. Object.defineProperty(exports, "DirectiveLiteral", {
  13188. enumerable: true,
  13189. get: function get() {
  13190. return _index.directiveLiteral;
  13191. }
  13192. });
  13193. Object.defineProperty(exports, "BlockStatement", {
  13194. enumerable: true,
  13195. get: function get() {
  13196. return _index.blockStatement;
  13197. }
  13198. });
  13199. Object.defineProperty(exports, "BreakStatement", {
  13200. enumerable: true,
  13201. get: function get() {
  13202. return _index.breakStatement;
  13203. }
  13204. });
  13205. Object.defineProperty(exports, "CallExpression", {
  13206. enumerable: true,
  13207. get: function get() {
  13208. return _index.callExpression;
  13209. }
  13210. });
  13211. Object.defineProperty(exports, "CatchClause", {
  13212. enumerable: true,
  13213. get: function get() {
  13214. return _index.catchClause;
  13215. }
  13216. });
  13217. Object.defineProperty(exports, "ConditionalExpression", {
  13218. enumerable: true,
  13219. get: function get() {
  13220. return _index.conditionalExpression;
  13221. }
  13222. });
  13223. Object.defineProperty(exports, "ContinueStatement", {
  13224. enumerable: true,
  13225. get: function get() {
  13226. return _index.continueStatement;
  13227. }
  13228. });
  13229. Object.defineProperty(exports, "DebuggerStatement", {
  13230. enumerable: true,
  13231. get: function get() {
  13232. return _index.debuggerStatement;
  13233. }
  13234. });
  13235. Object.defineProperty(exports, "DoWhileStatement", {
  13236. enumerable: true,
  13237. get: function get() {
  13238. return _index.doWhileStatement;
  13239. }
  13240. });
  13241. Object.defineProperty(exports, "EmptyStatement", {
  13242. enumerable: true,
  13243. get: function get() {
  13244. return _index.emptyStatement;
  13245. }
  13246. });
  13247. Object.defineProperty(exports, "ExpressionStatement", {
  13248. enumerable: true,
  13249. get: function get() {
  13250. return _index.expressionStatement;
  13251. }
  13252. });
  13253. Object.defineProperty(exports, "File", {
  13254. enumerable: true,
  13255. get: function get() {
  13256. return _index.file;
  13257. }
  13258. });
  13259. Object.defineProperty(exports, "ForInStatement", {
  13260. enumerable: true,
  13261. get: function get() {
  13262. return _index.forInStatement;
  13263. }
  13264. });
  13265. Object.defineProperty(exports, "ForStatement", {
  13266. enumerable: true,
  13267. get: function get() {
  13268. return _index.forStatement;
  13269. }
  13270. });
  13271. Object.defineProperty(exports, "FunctionDeclaration", {
  13272. enumerable: true,
  13273. get: function get() {
  13274. return _index.functionDeclaration;
  13275. }
  13276. });
  13277. Object.defineProperty(exports, "FunctionExpression", {
  13278. enumerable: true,
  13279. get: function get() {
  13280. return _index.functionExpression;
  13281. }
  13282. });
  13283. Object.defineProperty(exports, "Identifier", {
  13284. enumerable: true,
  13285. get: function get() {
  13286. return _index.identifier;
  13287. }
  13288. });
  13289. Object.defineProperty(exports, "IfStatement", {
  13290. enumerable: true,
  13291. get: function get() {
  13292. return _index.ifStatement;
  13293. }
  13294. });
  13295. Object.defineProperty(exports, "LabeledStatement", {
  13296. enumerable: true,
  13297. get: function get() {
  13298. return _index.labeledStatement;
  13299. }
  13300. });
  13301. Object.defineProperty(exports, "StringLiteral", {
  13302. enumerable: true,
  13303. get: function get() {
  13304. return _index.stringLiteral;
  13305. }
  13306. });
  13307. Object.defineProperty(exports, "NumericLiteral", {
  13308. enumerable: true,
  13309. get: function get() {
  13310. return _index.numericLiteral;
  13311. }
  13312. });
  13313. Object.defineProperty(exports, "NullLiteral", {
  13314. enumerable: true,
  13315. get: function get() {
  13316. return _index.nullLiteral;
  13317. }
  13318. });
  13319. Object.defineProperty(exports, "BooleanLiteral", {
  13320. enumerable: true,
  13321. get: function get() {
  13322. return _index.booleanLiteral;
  13323. }
  13324. });
  13325. Object.defineProperty(exports, "RegExpLiteral", {
  13326. enumerable: true,
  13327. get: function get() {
  13328. return _index.regExpLiteral;
  13329. }
  13330. });
  13331. Object.defineProperty(exports, "LogicalExpression", {
  13332. enumerable: true,
  13333. get: function get() {
  13334. return _index.logicalExpression;
  13335. }
  13336. });
  13337. Object.defineProperty(exports, "MemberExpression", {
  13338. enumerable: true,
  13339. get: function get() {
  13340. return _index.memberExpression;
  13341. }
  13342. });
  13343. Object.defineProperty(exports, "NewExpression", {
  13344. enumerable: true,
  13345. get: function get() {
  13346. return _index.newExpression;
  13347. }
  13348. });
  13349. Object.defineProperty(exports, "Program", {
  13350. enumerable: true,
  13351. get: function get() {
  13352. return _index.program;
  13353. }
  13354. });
  13355. Object.defineProperty(exports, "ObjectExpression", {
  13356. enumerable: true,
  13357. get: function get() {
  13358. return _index.objectExpression;
  13359. }
  13360. });
  13361. Object.defineProperty(exports, "ObjectMethod", {
  13362. enumerable: true,
  13363. get: function get() {
  13364. return _index.objectMethod;
  13365. }
  13366. });
  13367. Object.defineProperty(exports, "ObjectProperty", {
  13368. enumerable: true,
  13369. get: function get() {
  13370. return _index.objectProperty;
  13371. }
  13372. });
  13373. Object.defineProperty(exports, "RestElement", {
  13374. enumerable: true,
  13375. get: function get() {
  13376. return _index.restElement;
  13377. }
  13378. });
  13379. Object.defineProperty(exports, "ReturnStatement", {
  13380. enumerable: true,
  13381. get: function get() {
  13382. return _index.returnStatement;
  13383. }
  13384. });
  13385. Object.defineProperty(exports, "SequenceExpression", {
  13386. enumerable: true,
  13387. get: function get() {
  13388. return _index.sequenceExpression;
  13389. }
  13390. });
  13391. Object.defineProperty(exports, "ParenthesizedExpression", {
  13392. enumerable: true,
  13393. get: function get() {
  13394. return _index.parenthesizedExpression;
  13395. }
  13396. });
  13397. Object.defineProperty(exports, "SwitchCase", {
  13398. enumerable: true,
  13399. get: function get() {
  13400. return _index.switchCase;
  13401. }
  13402. });
  13403. Object.defineProperty(exports, "SwitchStatement", {
  13404. enumerable: true,
  13405. get: function get() {
  13406. return _index.switchStatement;
  13407. }
  13408. });
  13409. Object.defineProperty(exports, "ThisExpression", {
  13410. enumerable: true,
  13411. get: function get() {
  13412. return _index.thisExpression;
  13413. }
  13414. });
  13415. Object.defineProperty(exports, "ThrowStatement", {
  13416. enumerable: true,
  13417. get: function get() {
  13418. return _index.throwStatement;
  13419. }
  13420. });
  13421. Object.defineProperty(exports, "TryStatement", {
  13422. enumerable: true,
  13423. get: function get() {
  13424. return _index.tryStatement;
  13425. }
  13426. });
  13427. Object.defineProperty(exports, "UnaryExpression", {
  13428. enumerable: true,
  13429. get: function get() {
  13430. return _index.unaryExpression;
  13431. }
  13432. });
  13433. Object.defineProperty(exports, "UpdateExpression", {
  13434. enumerable: true,
  13435. get: function get() {
  13436. return _index.updateExpression;
  13437. }
  13438. });
  13439. Object.defineProperty(exports, "VariableDeclaration", {
  13440. enumerable: true,
  13441. get: function get() {
  13442. return _index.variableDeclaration;
  13443. }
  13444. });
  13445. Object.defineProperty(exports, "VariableDeclarator", {
  13446. enumerable: true,
  13447. get: function get() {
  13448. return _index.variableDeclarator;
  13449. }
  13450. });
  13451. Object.defineProperty(exports, "WhileStatement", {
  13452. enumerable: true,
  13453. get: function get() {
  13454. return _index.whileStatement;
  13455. }
  13456. });
  13457. Object.defineProperty(exports, "WithStatement", {
  13458. enumerable: true,
  13459. get: function get() {
  13460. return _index.withStatement;
  13461. }
  13462. });
  13463. Object.defineProperty(exports, "AssignmentPattern", {
  13464. enumerable: true,
  13465. get: function get() {
  13466. return _index.assignmentPattern;
  13467. }
  13468. });
  13469. Object.defineProperty(exports, "ArrayPattern", {
  13470. enumerable: true,
  13471. get: function get() {
  13472. return _index.arrayPattern;
  13473. }
  13474. });
  13475. Object.defineProperty(exports, "ArrowFunctionExpression", {
  13476. enumerable: true,
  13477. get: function get() {
  13478. return _index.arrowFunctionExpression;
  13479. }
  13480. });
  13481. Object.defineProperty(exports, "ClassBody", {
  13482. enumerable: true,
  13483. get: function get() {
  13484. return _index.classBody;
  13485. }
  13486. });
  13487. Object.defineProperty(exports, "ClassExpression", {
  13488. enumerable: true,
  13489. get: function get() {
  13490. return _index.classExpression;
  13491. }
  13492. });
  13493. Object.defineProperty(exports, "ClassDeclaration", {
  13494. enumerable: true,
  13495. get: function get() {
  13496. return _index.classDeclaration;
  13497. }
  13498. });
  13499. Object.defineProperty(exports, "ExportAllDeclaration", {
  13500. enumerable: true,
  13501. get: function get() {
  13502. return _index.exportAllDeclaration;
  13503. }
  13504. });
  13505. Object.defineProperty(exports, "ExportDefaultDeclaration", {
  13506. enumerable: true,
  13507. get: function get() {
  13508. return _index.exportDefaultDeclaration;
  13509. }
  13510. });
  13511. Object.defineProperty(exports, "ExportNamedDeclaration", {
  13512. enumerable: true,
  13513. get: function get() {
  13514. return _index.exportNamedDeclaration;
  13515. }
  13516. });
  13517. Object.defineProperty(exports, "ExportSpecifier", {
  13518. enumerable: true,
  13519. get: function get() {
  13520. return _index.exportSpecifier;
  13521. }
  13522. });
  13523. Object.defineProperty(exports, "ForOfStatement", {
  13524. enumerable: true,
  13525. get: function get() {
  13526. return _index.forOfStatement;
  13527. }
  13528. });
  13529. Object.defineProperty(exports, "ImportDeclaration", {
  13530. enumerable: true,
  13531. get: function get() {
  13532. return _index.importDeclaration;
  13533. }
  13534. });
  13535. Object.defineProperty(exports, "ImportDefaultSpecifier", {
  13536. enumerable: true,
  13537. get: function get() {
  13538. return _index.importDefaultSpecifier;
  13539. }
  13540. });
  13541. Object.defineProperty(exports, "ImportNamespaceSpecifier", {
  13542. enumerable: true,
  13543. get: function get() {
  13544. return _index.importNamespaceSpecifier;
  13545. }
  13546. });
  13547. Object.defineProperty(exports, "ImportSpecifier", {
  13548. enumerable: true,
  13549. get: function get() {
  13550. return _index.importSpecifier;
  13551. }
  13552. });
  13553. Object.defineProperty(exports, "MetaProperty", {
  13554. enumerable: true,
  13555. get: function get() {
  13556. return _index.metaProperty;
  13557. }
  13558. });
  13559. Object.defineProperty(exports, "ClassMethod", {
  13560. enumerable: true,
  13561. get: function get() {
  13562. return _index.classMethod;
  13563. }
  13564. });
  13565. Object.defineProperty(exports, "ObjectPattern", {
  13566. enumerable: true,
  13567. get: function get() {
  13568. return _index.objectPattern;
  13569. }
  13570. });
  13571. Object.defineProperty(exports, "SpreadElement", {
  13572. enumerable: true,
  13573. get: function get() {
  13574. return _index.spreadElement;
  13575. }
  13576. });
  13577. Object.defineProperty(exports, "Super", {
  13578. enumerable: true,
  13579. get: function get() {
  13580. return _index.super;
  13581. }
  13582. });
  13583. Object.defineProperty(exports, "TaggedTemplateExpression", {
  13584. enumerable: true,
  13585. get: function get() {
  13586. return _index.taggedTemplateExpression;
  13587. }
  13588. });
  13589. Object.defineProperty(exports, "TemplateElement", {
  13590. enumerable: true,
  13591. get: function get() {
  13592. return _index.templateElement;
  13593. }
  13594. });
  13595. Object.defineProperty(exports, "TemplateLiteral", {
  13596. enumerable: true,
  13597. get: function get() {
  13598. return _index.templateLiteral;
  13599. }
  13600. });
  13601. Object.defineProperty(exports, "YieldExpression", {
  13602. enumerable: true,
  13603. get: function get() {
  13604. return _index.yieldExpression;
  13605. }
  13606. });
  13607. Object.defineProperty(exports, "AwaitExpression", {
  13608. enumerable: true,
  13609. get: function get() {
  13610. return _index.awaitExpression;
  13611. }
  13612. });
  13613. Object.defineProperty(exports, "Import", {
  13614. enumerable: true,
  13615. get: function get() {
  13616. return _index.import;
  13617. }
  13618. });
  13619. Object.defineProperty(exports, "BigIntLiteral", {
  13620. enumerable: true,
  13621. get: function get() {
  13622. return _index.bigIntLiteral;
  13623. }
  13624. });
  13625. Object.defineProperty(exports, "ExportNamespaceSpecifier", {
  13626. enumerable: true,
  13627. get: function get() {
  13628. return _index.exportNamespaceSpecifier;
  13629. }
  13630. });
  13631. Object.defineProperty(exports, "OptionalMemberExpression", {
  13632. enumerable: true,
  13633. get: function get() {
  13634. return _index.optionalMemberExpression;
  13635. }
  13636. });
  13637. Object.defineProperty(exports, "OptionalCallExpression", {
  13638. enumerable: true,
  13639. get: function get() {
  13640. return _index.optionalCallExpression;
  13641. }
  13642. });
  13643. Object.defineProperty(exports, "ClassProperty", {
  13644. enumerable: true,
  13645. get: function get() {
  13646. return _index.classProperty;
  13647. }
  13648. });
  13649. Object.defineProperty(exports, "ClassPrivateProperty", {
  13650. enumerable: true,
  13651. get: function get() {
  13652. return _index.classPrivateProperty;
  13653. }
  13654. });
  13655. Object.defineProperty(exports, "ClassPrivateMethod", {
  13656. enumerable: true,
  13657. get: function get() {
  13658. return _index.classPrivateMethod;
  13659. }
  13660. });
  13661. Object.defineProperty(exports, "PrivateName", {
  13662. enumerable: true,
  13663. get: function get() {
  13664. return _index.privateName;
  13665. }
  13666. });
  13667. Object.defineProperty(exports, "AnyTypeAnnotation", {
  13668. enumerable: true,
  13669. get: function get() {
  13670. return _index.anyTypeAnnotation;
  13671. }
  13672. });
  13673. Object.defineProperty(exports, "ArrayTypeAnnotation", {
  13674. enumerable: true,
  13675. get: function get() {
  13676. return _index.arrayTypeAnnotation;
  13677. }
  13678. });
  13679. Object.defineProperty(exports, "BooleanTypeAnnotation", {
  13680. enumerable: true,
  13681. get: function get() {
  13682. return _index.booleanTypeAnnotation;
  13683. }
  13684. });
  13685. Object.defineProperty(exports, "BooleanLiteralTypeAnnotation", {
  13686. enumerable: true,
  13687. get: function get() {
  13688. return _index.booleanLiteralTypeAnnotation;
  13689. }
  13690. });
  13691. Object.defineProperty(exports, "NullLiteralTypeAnnotation", {
  13692. enumerable: true,
  13693. get: function get() {
  13694. return _index.nullLiteralTypeAnnotation;
  13695. }
  13696. });
  13697. Object.defineProperty(exports, "ClassImplements", {
  13698. enumerable: true,
  13699. get: function get() {
  13700. return _index.classImplements;
  13701. }
  13702. });
  13703. Object.defineProperty(exports, "DeclareClass", {
  13704. enumerable: true,
  13705. get: function get() {
  13706. return _index.declareClass;
  13707. }
  13708. });
  13709. Object.defineProperty(exports, "DeclareFunction", {
  13710. enumerable: true,
  13711. get: function get() {
  13712. return _index.declareFunction;
  13713. }
  13714. });
  13715. Object.defineProperty(exports, "DeclareInterface", {
  13716. enumerable: true,
  13717. get: function get() {
  13718. return _index.declareInterface;
  13719. }
  13720. });
  13721. Object.defineProperty(exports, "DeclareModule", {
  13722. enumerable: true,
  13723. get: function get() {
  13724. return _index.declareModule;
  13725. }
  13726. });
  13727. Object.defineProperty(exports, "DeclareModuleExports", {
  13728. enumerable: true,
  13729. get: function get() {
  13730. return _index.declareModuleExports;
  13731. }
  13732. });
  13733. Object.defineProperty(exports, "DeclareTypeAlias", {
  13734. enumerable: true,
  13735. get: function get() {
  13736. return _index.declareTypeAlias;
  13737. }
  13738. });
  13739. Object.defineProperty(exports, "DeclareOpaqueType", {
  13740. enumerable: true,
  13741. get: function get() {
  13742. return _index.declareOpaqueType;
  13743. }
  13744. });
  13745. Object.defineProperty(exports, "DeclareVariable", {
  13746. enumerable: true,
  13747. get: function get() {
  13748. return _index.declareVariable;
  13749. }
  13750. });
  13751. Object.defineProperty(exports, "DeclareExportDeclaration", {
  13752. enumerable: true,
  13753. get: function get() {
  13754. return _index.declareExportDeclaration;
  13755. }
  13756. });
  13757. Object.defineProperty(exports, "DeclareExportAllDeclaration", {
  13758. enumerable: true,
  13759. get: function get() {
  13760. return _index.declareExportAllDeclaration;
  13761. }
  13762. });
  13763. Object.defineProperty(exports, "DeclaredPredicate", {
  13764. enumerable: true,
  13765. get: function get() {
  13766. return _index.declaredPredicate;
  13767. }
  13768. });
  13769. Object.defineProperty(exports, "ExistsTypeAnnotation", {
  13770. enumerable: true,
  13771. get: function get() {
  13772. return _index.existsTypeAnnotation;
  13773. }
  13774. });
  13775. Object.defineProperty(exports, "FunctionTypeAnnotation", {
  13776. enumerable: true,
  13777. get: function get() {
  13778. return _index.functionTypeAnnotation;
  13779. }
  13780. });
  13781. Object.defineProperty(exports, "FunctionTypeParam", {
  13782. enumerable: true,
  13783. get: function get() {
  13784. return _index.functionTypeParam;
  13785. }
  13786. });
  13787. Object.defineProperty(exports, "GenericTypeAnnotation", {
  13788. enumerable: true,
  13789. get: function get() {
  13790. return _index.genericTypeAnnotation;
  13791. }
  13792. });
  13793. Object.defineProperty(exports, "InferredPredicate", {
  13794. enumerable: true,
  13795. get: function get() {
  13796. return _index.inferredPredicate;
  13797. }
  13798. });
  13799. Object.defineProperty(exports, "InterfaceExtends", {
  13800. enumerable: true,
  13801. get: function get() {
  13802. return _index.interfaceExtends;
  13803. }
  13804. });
  13805. Object.defineProperty(exports, "InterfaceDeclaration", {
  13806. enumerable: true,
  13807. get: function get() {
  13808. return _index.interfaceDeclaration;
  13809. }
  13810. });
  13811. Object.defineProperty(exports, "InterfaceTypeAnnotation", {
  13812. enumerable: true,
  13813. get: function get() {
  13814. return _index.interfaceTypeAnnotation;
  13815. }
  13816. });
  13817. Object.defineProperty(exports, "IntersectionTypeAnnotation", {
  13818. enumerable: true,
  13819. get: function get() {
  13820. return _index.intersectionTypeAnnotation;
  13821. }
  13822. });
  13823. Object.defineProperty(exports, "MixedTypeAnnotation", {
  13824. enumerable: true,
  13825. get: function get() {
  13826. return _index.mixedTypeAnnotation;
  13827. }
  13828. });
  13829. Object.defineProperty(exports, "EmptyTypeAnnotation", {
  13830. enumerable: true,
  13831. get: function get() {
  13832. return _index.emptyTypeAnnotation;
  13833. }
  13834. });
  13835. Object.defineProperty(exports, "NullableTypeAnnotation", {
  13836. enumerable: true,
  13837. get: function get() {
  13838. return _index.nullableTypeAnnotation;
  13839. }
  13840. });
  13841. Object.defineProperty(exports, "NumberLiteralTypeAnnotation", {
  13842. enumerable: true,
  13843. get: function get() {
  13844. return _index.numberLiteralTypeAnnotation;
  13845. }
  13846. });
  13847. Object.defineProperty(exports, "NumberTypeAnnotation", {
  13848. enumerable: true,
  13849. get: function get() {
  13850. return _index.numberTypeAnnotation;
  13851. }
  13852. });
  13853. Object.defineProperty(exports, "ObjectTypeAnnotation", {
  13854. enumerable: true,
  13855. get: function get() {
  13856. return _index.objectTypeAnnotation;
  13857. }
  13858. });
  13859. Object.defineProperty(exports, "ObjectTypeInternalSlot", {
  13860. enumerable: true,
  13861. get: function get() {
  13862. return _index.objectTypeInternalSlot;
  13863. }
  13864. });
  13865. Object.defineProperty(exports, "ObjectTypeCallProperty", {
  13866. enumerable: true,
  13867. get: function get() {
  13868. return _index.objectTypeCallProperty;
  13869. }
  13870. });
  13871. Object.defineProperty(exports, "ObjectTypeIndexer", {
  13872. enumerable: true,
  13873. get: function get() {
  13874. return _index.objectTypeIndexer;
  13875. }
  13876. });
  13877. Object.defineProperty(exports, "ObjectTypeProperty", {
  13878. enumerable: true,
  13879. get: function get() {
  13880. return _index.objectTypeProperty;
  13881. }
  13882. });
  13883. Object.defineProperty(exports, "ObjectTypeSpreadProperty", {
  13884. enumerable: true,
  13885. get: function get() {
  13886. return _index.objectTypeSpreadProperty;
  13887. }
  13888. });
  13889. Object.defineProperty(exports, "OpaqueType", {
  13890. enumerable: true,
  13891. get: function get() {
  13892. return _index.opaqueType;
  13893. }
  13894. });
  13895. Object.defineProperty(exports, "QualifiedTypeIdentifier", {
  13896. enumerable: true,
  13897. get: function get() {
  13898. return _index.qualifiedTypeIdentifier;
  13899. }
  13900. });
  13901. Object.defineProperty(exports, "StringLiteralTypeAnnotation", {
  13902. enumerable: true,
  13903. get: function get() {
  13904. return _index.stringLiteralTypeAnnotation;
  13905. }
  13906. });
  13907. Object.defineProperty(exports, "StringTypeAnnotation", {
  13908. enumerable: true,
  13909. get: function get() {
  13910. return _index.stringTypeAnnotation;
  13911. }
  13912. });
  13913. Object.defineProperty(exports, "SymbolTypeAnnotation", {
  13914. enumerable: true,
  13915. get: function get() {
  13916. return _index.symbolTypeAnnotation;
  13917. }
  13918. });
  13919. Object.defineProperty(exports, "ThisTypeAnnotation", {
  13920. enumerable: true,
  13921. get: function get() {
  13922. return _index.thisTypeAnnotation;
  13923. }
  13924. });
  13925. Object.defineProperty(exports, "TupleTypeAnnotation", {
  13926. enumerable: true,
  13927. get: function get() {
  13928. return _index.tupleTypeAnnotation;
  13929. }
  13930. });
  13931. Object.defineProperty(exports, "TypeofTypeAnnotation", {
  13932. enumerable: true,
  13933. get: function get() {
  13934. return _index.typeofTypeAnnotation;
  13935. }
  13936. });
  13937. Object.defineProperty(exports, "TypeAlias", {
  13938. enumerable: true,
  13939. get: function get() {
  13940. return _index.typeAlias;
  13941. }
  13942. });
  13943. Object.defineProperty(exports, "TypeAnnotation", {
  13944. enumerable: true,
  13945. get: function get() {
  13946. return _index.typeAnnotation;
  13947. }
  13948. });
  13949. Object.defineProperty(exports, "TypeCastExpression", {
  13950. enumerable: true,
  13951. get: function get() {
  13952. return _index.typeCastExpression;
  13953. }
  13954. });
  13955. Object.defineProperty(exports, "TypeParameter", {
  13956. enumerable: true,
  13957. get: function get() {
  13958. return _index.typeParameter;
  13959. }
  13960. });
  13961. Object.defineProperty(exports, "TypeParameterDeclaration", {
  13962. enumerable: true,
  13963. get: function get() {
  13964. return _index.typeParameterDeclaration;
  13965. }
  13966. });
  13967. Object.defineProperty(exports, "TypeParameterInstantiation", {
  13968. enumerable: true,
  13969. get: function get() {
  13970. return _index.typeParameterInstantiation;
  13971. }
  13972. });
  13973. Object.defineProperty(exports, "UnionTypeAnnotation", {
  13974. enumerable: true,
  13975. get: function get() {
  13976. return _index.unionTypeAnnotation;
  13977. }
  13978. });
  13979. Object.defineProperty(exports, "Variance", {
  13980. enumerable: true,
  13981. get: function get() {
  13982. return _index.variance;
  13983. }
  13984. });
  13985. Object.defineProperty(exports, "VoidTypeAnnotation", {
  13986. enumerable: true,
  13987. get: function get() {
  13988. return _index.voidTypeAnnotation;
  13989. }
  13990. });
  13991. Object.defineProperty(exports, "EnumDeclaration", {
  13992. enumerable: true,
  13993. get: function get() {
  13994. return _index.enumDeclaration;
  13995. }
  13996. });
  13997. Object.defineProperty(exports, "EnumBooleanBody", {
  13998. enumerable: true,
  13999. get: function get() {
  14000. return _index.enumBooleanBody;
  14001. }
  14002. });
  14003. Object.defineProperty(exports, "EnumNumberBody", {
  14004. enumerable: true,
  14005. get: function get() {
  14006. return _index.enumNumberBody;
  14007. }
  14008. });
  14009. Object.defineProperty(exports, "EnumStringBody", {
  14010. enumerable: true,
  14011. get: function get() {
  14012. return _index.enumStringBody;
  14013. }
  14014. });
  14015. Object.defineProperty(exports, "EnumSymbolBody", {
  14016. enumerable: true,
  14017. get: function get() {
  14018. return _index.enumSymbolBody;
  14019. }
  14020. });
  14021. Object.defineProperty(exports, "EnumBooleanMember", {
  14022. enumerable: true,
  14023. get: function get() {
  14024. return _index.enumBooleanMember;
  14025. }
  14026. });
  14027. Object.defineProperty(exports, "EnumNumberMember", {
  14028. enumerable: true,
  14029. get: function get() {
  14030. return _index.enumNumberMember;
  14031. }
  14032. });
  14033. Object.defineProperty(exports, "EnumStringMember", {
  14034. enumerable: true,
  14035. get: function get() {
  14036. return _index.enumStringMember;
  14037. }
  14038. });
  14039. Object.defineProperty(exports, "EnumDefaultedMember", {
  14040. enumerable: true,
  14041. get: function get() {
  14042. return _index.enumDefaultedMember;
  14043. }
  14044. });
  14045. Object.defineProperty(exports, "IndexedAccessType", {
  14046. enumerable: true,
  14047. get: function get() {
  14048. return _index.indexedAccessType;
  14049. }
  14050. });
  14051. Object.defineProperty(exports, "OptionalIndexedAccessType", {
  14052. enumerable: true,
  14053. get: function get() {
  14054. return _index.optionalIndexedAccessType;
  14055. }
  14056. });
  14057. Object.defineProperty(exports, "JSXAttribute", {
  14058. enumerable: true,
  14059. get: function get() {
  14060. return _index.jsxAttribute;
  14061. }
  14062. });
  14063. Object.defineProperty(exports, "JSXClosingElement", {
  14064. enumerable: true,
  14065. get: function get() {
  14066. return _index.jsxClosingElement;
  14067. }
  14068. });
  14069. Object.defineProperty(exports, "JSXElement", {
  14070. enumerable: true,
  14071. get: function get() {
  14072. return _index.jsxElement;
  14073. }
  14074. });
  14075. Object.defineProperty(exports, "JSXEmptyExpression", {
  14076. enumerable: true,
  14077. get: function get() {
  14078. return _index.jsxEmptyExpression;
  14079. }
  14080. });
  14081. Object.defineProperty(exports, "JSXExpressionContainer", {
  14082. enumerable: true,
  14083. get: function get() {
  14084. return _index.jsxExpressionContainer;
  14085. }
  14086. });
  14087. Object.defineProperty(exports, "JSXSpreadChild", {
  14088. enumerable: true,
  14089. get: function get() {
  14090. return _index.jsxSpreadChild;
  14091. }
  14092. });
  14093. Object.defineProperty(exports, "JSXIdentifier", {
  14094. enumerable: true,
  14095. get: function get() {
  14096. return _index.jsxIdentifier;
  14097. }
  14098. });
  14099. Object.defineProperty(exports, "JSXMemberExpression", {
  14100. enumerable: true,
  14101. get: function get() {
  14102. return _index.jsxMemberExpression;
  14103. }
  14104. });
  14105. Object.defineProperty(exports, "JSXNamespacedName", {
  14106. enumerable: true,
  14107. get: function get() {
  14108. return _index.jsxNamespacedName;
  14109. }
  14110. });
  14111. Object.defineProperty(exports, "JSXOpeningElement", {
  14112. enumerable: true,
  14113. get: function get() {
  14114. return _index.jsxOpeningElement;
  14115. }
  14116. });
  14117. Object.defineProperty(exports, "JSXSpreadAttribute", {
  14118. enumerable: true,
  14119. get: function get() {
  14120. return _index.jsxSpreadAttribute;
  14121. }
  14122. });
  14123. Object.defineProperty(exports, "JSXText", {
  14124. enumerable: true,
  14125. get: function get() {
  14126. return _index.jsxText;
  14127. }
  14128. });
  14129. Object.defineProperty(exports, "JSXFragment", {
  14130. enumerable: true,
  14131. get: function get() {
  14132. return _index.jsxFragment;
  14133. }
  14134. });
  14135. Object.defineProperty(exports, "JSXOpeningFragment", {
  14136. enumerable: true,
  14137. get: function get() {
  14138. return _index.jsxOpeningFragment;
  14139. }
  14140. });
  14141. Object.defineProperty(exports, "JSXClosingFragment", {
  14142. enumerable: true,
  14143. get: function get() {
  14144. return _index.jsxClosingFragment;
  14145. }
  14146. });
  14147. Object.defineProperty(exports, "Noop", {
  14148. enumerable: true,
  14149. get: function get() {
  14150. return _index.noop;
  14151. }
  14152. });
  14153. Object.defineProperty(exports, "Placeholder", {
  14154. enumerable: true,
  14155. get: function get() {
  14156. return _index.placeholder;
  14157. }
  14158. });
  14159. Object.defineProperty(exports, "V8IntrinsicIdentifier", {
  14160. enumerable: true,
  14161. get: function get() {
  14162. return _index.v8IntrinsicIdentifier;
  14163. }
  14164. });
  14165. Object.defineProperty(exports, "ArgumentPlaceholder", {
  14166. enumerable: true,
  14167. get: function get() {
  14168. return _index.argumentPlaceholder;
  14169. }
  14170. });
  14171. Object.defineProperty(exports, "BindExpression", {
  14172. enumerable: true,
  14173. get: function get() {
  14174. return _index.bindExpression;
  14175. }
  14176. });
  14177. Object.defineProperty(exports, "ImportAttribute", {
  14178. enumerable: true,
  14179. get: function get() {
  14180. return _index.importAttribute;
  14181. }
  14182. });
  14183. Object.defineProperty(exports, "Decorator", {
  14184. enumerable: true,
  14185. get: function get() {
  14186. return _index.decorator;
  14187. }
  14188. });
  14189. Object.defineProperty(exports, "DoExpression", {
  14190. enumerable: true,
  14191. get: function get() {
  14192. return _index.doExpression;
  14193. }
  14194. });
  14195. Object.defineProperty(exports, "ExportDefaultSpecifier", {
  14196. enumerable: true,
  14197. get: function get() {
  14198. return _index.exportDefaultSpecifier;
  14199. }
  14200. });
  14201. Object.defineProperty(exports, "RecordExpression", {
  14202. enumerable: true,
  14203. get: function get() {
  14204. return _index.recordExpression;
  14205. }
  14206. });
  14207. Object.defineProperty(exports, "TupleExpression", {
  14208. enumerable: true,
  14209. get: function get() {
  14210. return _index.tupleExpression;
  14211. }
  14212. });
  14213. Object.defineProperty(exports, "DecimalLiteral", {
  14214. enumerable: true,
  14215. get: function get() {
  14216. return _index.decimalLiteral;
  14217. }
  14218. });
  14219. Object.defineProperty(exports, "StaticBlock", {
  14220. enumerable: true,
  14221. get: function get() {
  14222. return _index.staticBlock;
  14223. }
  14224. });
  14225. Object.defineProperty(exports, "ModuleExpression", {
  14226. enumerable: true,
  14227. get: function get() {
  14228. return _index.moduleExpression;
  14229. }
  14230. });
  14231. Object.defineProperty(exports, "TopicReference", {
  14232. enumerable: true,
  14233. get: function get() {
  14234. return _index.topicReference;
  14235. }
  14236. });
  14237. Object.defineProperty(exports, "PipelineTopicExpression", {
  14238. enumerable: true,
  14239. get: function get() {
  14240. return _index.pipelineTopicExpression;
  14241. }
  14242. });
  14243. Object.defineProperty(exports, "PipelineBareFunction", {
  14244. enumerable: true,
  14245. get: function get() {
  14246. return _index.pipelineBareFunction;
  14247. }
  14248. });
  14249. Object.defineProperty(exports, "PipelinePrimaryTopicReference", {
  14250. enumerable: true,
  14251. get: function get() {
  14252. return _index.pipelinePrimaryTopicReference;
  14253. }
  14254. });
  14255. Object.defineProperty(exports, "TSParameterProperty", {
  14256. enumerable: true,
  14257. get: function get() {
  14258. return _index.tsParameterProperty;
  14259. }
  14260. });
  14261. Object.defineProperty(exports, "TSDeclareFunction", {
  14262. enumerable: true,
  14263. get: function get() {
  14264. return _index.tsDeclareFunction;
  14265. }
  14266. });
  14267. Object.defineProperty(exports, "TSDeclareMethod", {
  14268. enumerable: true,
  14269. get: function get() {
  14270. return _index.tsDeclareMethod;
  14271. }
  14272. });
  14273. Object.defineProperty(exports, "TSQualifiedName", {
  14274. enumerable: true,
  14275. get: function get() {
  14276. return _index.tsQualifiedName;
  14277. }
  14278. });
  14279. Object.defineProperty(exports, "TSCallSignatureDeclaration", {
  14280. enumerable: true,
  14281. get: function get() {
  14282. return _index.tsCallSignatureDeclaration;
  14283. }
  14284. });
  14285. Object.defineProperty(exports, "TSConstructSignatureDeclaration", {
  14286. enumerable: true,
  14287. get: function get() {
  14288. return _index.tsConstructSignatureDeclaration;
  14289. }
  14290. });
  14291. Object.defineProperty(exports, "TSPropertySignature", {
  14292. enumerable: true,
  14293. get: function get() {
  14294. return _index.tsPropertySignature;
  14295. }
  14296. });
  14297. Object.defineProperty(exports, "TSMethodSignature", {
  14298. enumerable: true,
  14299. get: function get() {
  14300. return _index.tsMethodSignature;
  14301. }
  14302. });
  14303. Object.defineProperty(exports, "TSIndexSignature", {
  14304. enumerable: true,
  14305. get: function get() {
  14306. return _index.tsIndexSignature;
  14307. }
  14308. });
  14309. Object.defineProperty(exports, "TSAnyKeyword", {
  14310. enumerable: true,
  14311. get: function get() {
  14312. return _index.tsAnyKeyword;
  14313. }
  14314. });
  14315. Object.defineProperty(exports, "TSBooleanKeyword", {
  14316. enumerable: true,
  14317. get: function get() {
  14318. return _index.tsBooleanKeyword;
  14319. }
  14320. });
  14321. Object.defineProperty(exports, "TSBigIntKeyword", {
  14322. enumerable: true,
  14323. get: function get() {
  14324. return _index.tsBigIntKeyword;
  14325. }
  14326. });
  14327. Object.defineProperty(exports, "TSIntrinsicKeyword", {
  14328. enumerable: true,
  14329. get: function get() {
  14330. return _index.tsIntrinsicKeyword;
  14331. }
  14332. });
  14333. Object.defineProperty(exports, "TSNeverKeyword", {
  14334. enumerable: true,
  14335. get: function get() {
  14336. return _index.tsNeverKeyword;
  14337. }
  14338. });
  14339. Object.defineProperty(exports, "TSNullKeyword", {
  14340. enumerable: true,
  14341. get: function get() {
  14342. return _index.tsNullKeyword;
  14343. }
  14344. });
  14345. Object.defineProperty(exports, "TSNumberKeyword", {
  14346. enumerable: true,
  14347. get: function get() {
  14348. return _index.tsNumberKeyword;
  14349. }
  14350. });
  14351. Object.defineProperty(exports, "TSObjectKeyword", {
  14352. enumerable: true,
  14353. get: function get() {
  14354. return _index.tsObjectKeyword;
  14355. }
  14356. });
  14357. Object.defineProperty(exports, "TSStringKeyword", {
  14358. enumerable: true,
  14359. get: function get() {
  14360. return _index.tsStringKeyword;
  14361. }
  14362. });
  14363. Object.defineProperty(exports, "TSSymbolKeyword", {
  14364. enumerable: true,
  14365. get: function get() {
  14366. return _index.tsSymbolKeyword;
  14367. }
  14368. });
  14369. Object.defineProperty(exports, "TSUndefinedKeyword", {
  14370. enumerable: true,
  14371. get: function get() {
  14372. return _index.tsUndefinedKeyword;
  14373. }
  14374. });
  14375. Object.defineProperty(exports, "TSUnknownKeyword", {
  14376. enumerable: true,
  14377. get: function get() {
  14378. return _index.tsUnknownKeyword;
  14379. }
  14380. });
  14381. Object.defineProperty(exports, "TSVoidKeyword", {
  14382. enumerable: true,
  14383. get: function get() {
  14384. return _index.tsVoidKeyword;
  14385. }
  14386. });
  14387. Object.defineProperty(exports, "TSThisType", {
  14388. enumerable: true,
  14389. get: function get() {
  14390. return _index.tsThisType;
  14391. }
  14392. });
  14393. Object.defineProperty(exports, "TSFunctionType", {
  14394. enumerable: true,
  14395. get: function get() {
  14396. return _index.tsFunctionType;
  14397. }
  14398. });
  14399. Object.defineProperty(exports, "TSConstructorType", {
  14400. enumerable: true,
  14401. get: function get() {
  14402. return _index.tsConstructorType;
  14403. }
  14404. });
  14405. Object.defineProperty(exports, "TSTypeReference", {
  14406. enumerable: true,
  14407. get: function get() {
  14408. return _index.tsTypeReference;
  14409. }
  14410. });
  14411. Object.defineProperty(exports, "TSTypePredicate", {
  14412. enumerable: true,
  14413. get: function get() {
  14414. return _index.tsTypePredicate;
  14415. }
  14416. });
  14417. Object.defineProperty(exports, "TSTypeQuery", {
  14418. enumerable: true,
  14419. get: function get() {
  14420. return _index.tsTypeQuery;
  14421. }
  14422. });
  14423. Object.defineProperty(exports, "TSTypeLiteral", {
  14424. enumerable: true,
  14425. get: function get() {
  14426. return _index.tsTypeLiteral;
  14427. }
  14428. });
  14429. Object.defineProperty(exports, "TSArrayType", {
  14430. enumerable: true,
  14431. get: function get() {
  14432. return _index.tsArrayType;
  14433. }
  14434. });
  14435. Object.defineProperty(exports, "TSTupleType", {
  14436. enumerable: true,
  14437. get: function get() {
  14438. return _index.tsTupleType;
  14439. }
  14440. });
  14441. Object.defineProperty(exports, "TSOptionalType", {
  14442. enumerable: true,
  14443. get: function get() {
  14444. return _index.tsOptionalType;
  14445. }
  14446. });
  14447. Object.defineProperty(exports, "TSRestType", {
  14448. enumerable: true,
  14449. get: function get() {
  14450. return _index.tsRestType;
  14451. }
  14452. });
  14453. Object.defineProperty(exports, "TSNamedTupleMember", {
  14454. enumerable: true,
  14455. get: function get() {
  14456. return _index.tsNamedTupleMember;
  14457. }
  14458. });
  14459. Object.defineProperty(exports, "TSUnionType", {
  14460. enumerable: true,
  14461. get: function get() {
  14462. return _index.tsUnionType;
  14463. }
  14464. });
  14465. Object.defineProperty(exports, "TSIntersectionType", {
  14466. enumerable: true,
  14467. get: function get() {
  14468. return _index.tsIntersectionType;
  14469. }
  14470. });
  14471. Object.defineProperty(exports, "TSConditionalType", {
  14472. enumerable: true,
  14473. get: function get() {
  14474. return _index.tsConditionalType;
  14475. }
  14476. });
  14477. Object.defineProperty(exports, "TSInferType", {
  14478. enumerable: true,
  14479. get: function get() {
  14480. return _index.tsInferType;
  14481. }
  14482. });
  14483. Object.defineProperty(exports, "TSParenthesizedType", {
  14484. enumerable: true,
  14485. get: function get() {
  14486. return _index.tsParenthesizedType;
  14487. }
  14488. });
  14489. Object.defineProperty(exports, "TSTypeOperator", {
  14490. enumerable: true,
  14491. get: function get() {
  14492. return _index.tsTypeOperator;
  14493. }
  14494. });
  14495. Object.defineProperty(exports, "TSIndexedAccessType", {
  14496. enumerable: true,
  14497. get: function get() {
  14498. return _index.tsIndexedAccessType;
  14499. }
  14500. });
  14501. Object.defineProperty(exports, "TSMappedType", {
  14502. enumerable: true,
  14503. get: function get() {
  14504. return _index.tsMappedType;
  14505. }
  14506. });
  14507. Object.defineProperty(exports, "TSLiteralType", {
  14508. enumerable: true,
  14509. get: function get() {
  14510. return _index.tsLiteralType;
  14511. }
  14512. });
  14513. Object.defineProperty(exports, "TSExpressionWithTypeArguments", {
  14514. enumerable: true,
  14515. get: function get() {
  14516. return _index.tsExpressionWithTypeArguments;
  14517. }
  14518. });
  14519. Object.defineProperty(exports, "TSInterfaceDeclaration", {
  14520. enumerable: true,
  14521. get: function get() {
  14522. return _index.tsInterfaceDeclaration;
  14523. }
  14524. });
  14525. Object.defineProperty(exports, "TSInterfaceBody", {
  14526. enumerable: true,
  14527. get: function get() {
  14528. return _index.tsInterfaceBody;
  14529. }
  14530. });
  14531. Object.defineProperty(exports, "TSTypeAliasDeclaration", {
  14532. enumerable: true,
  14533. get: function get() {
  14534. return _index.tsTypeAliasDeclaration;
  14535. }
  14536. });
  14537. Object.defineProperty(exports, "TSAsExpression", {
  14538. enumerable: true,
  14539. get: function get() {
  14540. return _index.tsAsExpression;
  14541. }
  14542. });
  14543. Object.defineProperty(exports, "TSTypeAssertion", {
  14544. enumerable: true,
  14545. get: function get() {
  14546. return _index.tsTypeAssertion;
  14547. }
  14548. });
  14549. Object.defineProperty(exports, "TSEnumDeclaration", {
  14550. enumerable: true,
  14551. get: function get() {
  14552. return _index.tsEnumDeclaration;
  14553. }
  14554. });
  14555. Object.defineProperty(exports, "TSEnumMember", {
  14556. enumerable: true,
  14557. get: function get() {
  14558. return _index.tsEnumMember;
  14559. }
  14560. });
  14561. Object.defineProperty(exports, "TSModuleDeclaration", {
  14562. enumerable: true,
  14563. get: function get() {
  14564. return _index.tsModuleDeclaration;
  14565. }
  14566. });
  14567. Object.defineProperty(exports, "TSModuleBlock", {
  14568. enumerable: true,
  14569. get: function get() {
  14570. return _index.tsModuleBlock;
  14571. }
  14572. });
  14573. Object.defineProperty(exports, "TSImportType", {
  14574. enumerable: true,
  14575. get: function get() {
  14576. return _index.tsImportType;
  14577. }
  14578. });
  14579. Object.defineProperty(exports, "TSImportEqualsDeclaration", {
  14580. enumerable: true,
  14581. get: function get() {
  14582. return _index.tsImportEqualsDeclaration;
  14583. }
  14584. });
  14585. Object.defineProperty(exports, "TSExternalModuleReference", {
  14586. enumerable: true,
  14587. get: function get() {
  14588. return _index.tsExternalModuleReference;
  14589. }
  14590. });
  14591. Object.defineProperty(exports, "TSNonNullExpression", {
  14592. enumerable: true,
  14593. get: function get() {
  14594. return _index.tsNonNullExpression;
  14595. }
  14596. });
  14597. Object.defineProperty(exports, "TSExportAssignment", {
  14598. enumerable: true,
  14599. get: function get() {
  14600. return _index.tsExportAssignment;
  14601. }
  14602. });
  14603. Object.defineProperty(exports, "TSNamespaceExportDeclaration", {
  14604. enumerable: true,
  14605. get: function get() {
  14606. return _index.tsNamespaceExportDeclaration;
  14607. }
  14608. });
  14609. Object.defineProperty(exports, "TSTypeAnnotation", {
  14610. enumerable: true,
  14611. get: function get() {
  14612. return _index.tsTypeAnnotation;
  14613. }
  14614. });
  14615. Object.defineProperty(exports, "TSTypeParameterInstantiation", {
  14616. enumerable: true,
  14617. get: function get() {
  14618. return _index.tsTypeParameterInstantiation;
  14619. }
  14620. });
  14621. Object.defineProperty(exports, "TSTypeParameterDeclaration", {
  14622. enumerable: true,
  14623. get: function get() {
  14624. return _index.tsTypeParameterDeclaration;
  14625. }
  14626. });
  14627. Object.defineProperty(exports, "TSTypeParameter", {
  14628. enumerable: true,
  14629. get: function get() {
  14630. return _index.tsTypeParameter;
  14631. }
  14632. });
  14633. Object.defineProperty(exports, "NumberLiteral", {
  14634. enumerable: true,
  14635. get: function get() {
  14636. return _index.numberLiteral;
  14637. }
  14638. });
  14639. Object.defineProperty(exports, "RegexLiteral", {
  14640. enumerable: true,
  14641. get: function get() {
  14642. return _index.regexLiteral;
  14643. }
  14644. });
  14645. Object.defineProperty(exports, "RestProperty", {
  14646. enumerable: true,
  14647. get: function get() {
  14648. return _index.restProperty;
  14649. }
  14650. });
  14651. Object.defineProperty(exports, "SpreadProperty", {
  14652. enumerable: true,
  14653. get: function get() {
  14654. return _index.spreadProperty;
  14655. }
  14656. });
  14657. var _index = generated$3;
  14658. })(uppercase);
  14659. var cloneNode$1 = {};
  14660. Object.defineProperty(cloneNode$1, "__esModule", {
  14661. value: true
  14662. });
  14663. cloneNode$1.default = cloneNode;
  14664. var _definitions$4 = requireDefinitions();
  14665. var _generated$g = generated$4;
  14666. var has = Function.call.bind(Object.prototype.hasOwnProperty);
  14667. function cloneIfNode(obj, deep, withoutLoc) {
  14668. if (obj && typeof obj.type === "string") {
  14669. return cloneNode(obj, deep, withoutLoc);
  14670. }
  14671. return obj;
  14672. }
  14673. function cloneIfNodeOrArray(obj, deep, withoutLoc) {
  14674. if (Array.isArray(obj)) {
  14675. return obj.map(function(node) {
  14676. return cloneIfNode(node, deep, withoutLoc);
  14677. });
  14678. }
  14679. return cloneIfNode(obj, deep, withoutLoc);
  14680. }
  14681. function cloneNode(node, deep, withoutLoc) {
  14682. if (deep === void 0) deep = true;
  14683. if (withoutLoc === void 0) withoutLoc = false;
  14684. if (!node) return node;
  14685. var type = node.type;
  14686. var newNode = {
  14687. type: node.type
  14688. };
  14689. if ((0, _generated$g.isIdentifier)(node)) {
  14690. newNode.name = node.name;
  14691. if (has(node, "optional") && typeof node.optional === "boolean") {
  14692. newNode.optional = node.optional;
  14693. }
  14694. if (has(node, "typeAnnotation")) {
  14695. newNode.typeAnnotation = deep ? cloneIfNodeOrArray(node.typeAnnotation, true, withoutLoc) : node.typeAnnotation;
  14696. }
  14697. } else if (!has(_definitions$4.NODE_FIELDS, type)) {
  14698. throw new Error('Unknown node type: "' + type + '"');
  14699. } else {
  14700. for(var _i = 0, _iter = Object.keys(_definitions$4.NODE_FIELDS[type]); _i < _iter.length; _i++){
  14701. var field = _iter[_i];
  14702. if (has(node, field)) {
  14703. if (deep) {
  14704. newNode[field] = (0, _generated$g.isFile)(node) && field === "comments" ? maybeCloneComments(node.comments, deep, withoutLoc) : cloneIfNodeOrArray(node[field], true, withoutLoc);
  14705. } else {
  14706. newNode[field] = node[field];
  14707. }
  14708. }
  14709. }
  14710. }
  14711. if (has(node, "loc")) {
  14712. if (withoutLoc) {
  14713. newNode.loc = null;
  14714. } else {
  14715. newNode.loc = node.loc;
  14716. }
  14717. }
  14718. if (has(node, "leadingComments")) {
  14719. newNode.leadingComments = maybeCloneComments(node.leadingComments, deep, withoutLoc);
  14720. }
  14721. if (has(node, "innerComments")) {
  14722. newNode.innerComments = maybeCloneComments(node.innerComments, deep, withoutLoc);
  14723. }
  14724. if (has(node, "trailingComments")) {
  14725. newNode.trailingComments = maybeCloneComments(node.trailingComments, deep, withoutLoc);
  14726. }
  14727. if (has(node, "extra")) {
  14728. newNode.extra = Object.assign({}, node.extra);
  14729. }
  14730. return newNode;
  14731. }
  14732. function maybeCloneComments(comments, deep, withoutLoc) {
  14733. if (!comments || !deep) {
  14734. return comments;
  14735. }
  14736. return comments.map(function(param) {
  14737. var type = param.type, value = param.value, loc = param.loc;
  14738. if (withoutLoc) {
  14739. return {
  14740. type: type,
  14741. value: value,
  14742. loc: null
  14743. };
  14744. }
  14745. return {
  14746. type: type,
  14747. value: value,
  14748. loc: loc
  14749. };
  14750. });
  14751. }
  14752. var clone$1 = {};
  14753. Object.defineProperty(clone$1, "__esModule", {
  14754. value: true
  14755. });
  14756. clone$1.default = clone;
  14757. var _cloneNode$5 = cloneNode$1;
  14758. function clone(node) {
  14759. return (0, _cloneNode$5.default)(node, false);
  14760. }
  14761. var cloneDeep$1 = {};
  14762. Object.defineProperty(cloneDeep$1, "__esModule", {
  14763. value: true
  14764. });
  14765. cloneDeep$1.default = cloneDeep;
  14766. var _cloneNode$4 = cloneNode$1;
  14767. function cloneDeep(node) {
  14768. return (0, _cloneNode$4.default)(node);
  14769. }
  14770. var cloneDeepWithoutLoc$1 = {};
  14771. Object.defineProperty(cloneDeepWithoutLoc$1, "__esModule", {
  14772. value: true
  14773. });
  14774. cloneDeepWithoutLoc$1.default = cloneDeepWithoutLoc;
  14775. var _cloneNode$3 = cloneNode$1;
  14776. function cloneDeepWithoutLoc(node) {
  14777. return (0, _cloneNode$3.default)(node, true, true);
  14778. }
  14779. var cloneWithoutLoc$1 = {};
  14780. Object.defineProperty(cloneWithoutLoc$1, "__esModule", {
  14781. value: true
  14782. });
  14783. cloneWithoutLoc$1.default = cloneWithoutLoc;
  14784. var _cloneNode$2 = cloneNode$1;
  14785. function cloneWithoutLoc(node) {
  14786. return (0, _cloneNode$2.default)(node, false, true);
  14787. }
  14788. var addComment$1 = {};
  14789. var addComments$1 = {};
  14790. Object.defineProperty(addComments$1, "__esModule", {
  14791. value: true
  14792. });
  14793. addComments$1.default = addComments;
  14794. function addComments(node, type, comments) {
  14795. if (!comments || !node) return node;
  14796. var key = "" + type + "Comments";
  14797. if (node[key]) {
  14798. if (type === "leading") {
  14799. node[key] = comments.concat(node[key]);
  14800. } else {
  14801. node[key] = node[key].concat(comments);
  14802. }
  14803. } else {
  14804. node[key] = comments;
  14805. }
  14806. return node;
  14807. }
  14808. Object.defineProperty(addComment$1, "__esModule", {
  14809. value: true
  14810. });
  14811. addComment$1.default = addComment;
  14812. var _addComments = addComments$1;
  14813. function addComment(node, type, content, line) {
  14814. return (0, _addComments.default)(node, type, [
  14815. {
  14816. type: line ? "CommentLine" : "CommentBlock",
  14817. value: content
  14818. }
  14819. ]);
  14820. }
  14821. var inheritInnerComments$1 = {};
  14822. var inherit$1 = {};
  14823. Object.defineProperty(inherit$1, "__esModule", {
  14824. value: true
  14825. });
  14826. inherit$1.default = inherit;
  14827. function inherit(key, child, parent) {
  14828. if (child && parent) {
  14829. child[key] = Array.from(new Set([].concat(child[key], parent[key]).filter(Boolean)));
  14830. }
  14831. }
  14832. Object.defineProperty(inheritInnerComments$1, "__esModule", {
  14833. value: true
  14834. });
  14835. inheritInnerComments$1.default = inheritInnerComments;
  14836. var _inherit$2 = inherit$1;
  14837. function inheritInnerComments(child, parent) {
  14838. (0, _inherit$2.default)("innerComments", child, parent);
  14839. }
  14840. var inheritLeadingComments$1 = {};
  14841. Object.defineProperty(inheritLeadingComments$1, "__esModule", {
  14842. value: true
  14843. });
  14844. inheritLeadingComments$1.default = inheritLeadingComments;
  14845. var _inherit$1 = inherit$1;
  14846. function inheritLeadingComments(child, parent) {
  14847. (0, _inherit$1.default)("leadingComments", child, parent);
  14848. }
  14849. var inheritsComments$1 = {};
  14850. var inheritTrailingComments$1 = {};
  14851. Object.defineProperty(inheritTrailingComments$1, "__esModule", {
  14852. value: true
  14853. });
  14854. inheritTrailingComments$1.default = inheritTrailingComments;
  14855. var _inherit = inherit$1;
  14856. function inheritTrailingComments(child, parent) {
  14857. (0, _inherit.default)("trailingComments", child, parent);
  14858. }
  14859. Object.defineProperty(inheritsComments$1, "__esModule", {
  14860. value: true
  14861. });
  14862. inheritsComments$1.default = inheritsComments;
  14863. var _inheritTrailingComments = inheritTrailingComments$1;
  14864. var _inheritLeadingComments = inheritLeadingComments$1;
  14865. var _inheritInnerComments = inheritInnerComments$1;
  14866. function inheritsComments(child, parent) {
  14867. (0, _inheritTrailingComments.default)(child, parent);
  14868. (0, _inheritLeadingComments.default)(child, parent);
  14869. (0, _inheritInnerComments.default)(child, parent);
  14870. return child;
  14871. }
  14872. var removeComments$1 = {};
  14873. Object.defineProperty(removeComments$1, "__esModule", {
  14874. value: true
  14875. });
  14876. removeComments$1.default = removeComments;
  14877. var _constants$4 = constants;
  14878. function removeComments(node) {
  14879. _constants$4.COMMENT_KEYS.forEach(function(key) {
  14880. node[key] = null;
  14881. });
  14882. return node;
  14883. }
  14884. var generated$1 = {};
  14885. Object.defineProperty(generated$1, "__esModule", {
  14886. value: true
  14887. });
  14888. generated$1.TSBASETYPE_TYPES = generated$1.TSTYPE_TYPES = generated$1.TSTYPEELEMENT_TYPES = generated$1.JSX_TYPES = generated$1.ENUMMEMBER_TYPES = generated$1.ENUMBODY_TYPES = generated$1.FLOWPREDICATE_TYPES = generated$1.FLOWDECLARATION_TYPES = generated$1.FLOWBASEANNOTATION_TYPES = generated$1.FLOWTYPE_TYPES = generated$1.FLOW_TYPES = generated$1.PRIVATE_TYPES = generated$1.MODULESPECIFIER_TYPES = generated$1.EXPORTDECLARATION_TYPES = generated$1.MODULEDECLARATION_TYPES = generated$1.CLASS_TYPES = generated$1.PATTERN_TYPES = generated$1.UNARYLIKE_TYPES = generated$1.PROPERTY_TYPES = generated$1.OBJECTMEMBER_TYPES = generated$1.METHOD_TYPES = generated$1.USERWHITESPACABLE_TYPES = generated$1.IMMUTABLE_TYPES = generated$1.LITERAL_TYPES = generated$1.TSENTITYNAME_TYPES = generated$1.LVAL_TYPES = generated$1.PATTERNLIKE_TYPES = generated$1.DECLARATION_TYPES = generated$1.PUREISH_TYPES = generated$1.FUNCTIONPARENT_TYPES = generated$1.FUNCTION_TYPES = generated$1.FORXSTATEMENT_TYPES = generated$1.FOR_TYPES = generated$1.EXPRESSIONWRAPPER_TYPES = generated$1.WHILE_TYPES = generated$1.LOOP_TYPES = generated$1.CONDITIONAL_TYPES = generated$1.COMPLETIONSTATEMENT_TYPES = generated$1.TERMINATORLESS_TYPES = generated$1.STATEMENT_TYPES = generated$1.BLOCK_TYPES = generated$1.BLOCKPARENT_TYPES = generated$1.SCOPABLE_TYPES = generated$1.BINARY_TYPES = generated$1.EXPRESSION_TYPES = void 0;
  14889. var _definitions$3 = requireDefinitions();
  14890. var EXPRESSION_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Expression"];
  14891. generated$1.EXPRESSION_TYPES = EXPRESSION_TYPES;
  14892. var BINARY_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Binary"];
  14893. generated$1.BINARY_TYPES = BINARY_TYPES;
  14894. var SCOPABLE_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Scopable"];
  14895. generated$1.SCOPABLE_TYPES = SCOPABLE_TYPES;
  14896. var BLOCKPARENT_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["BlockParent"];
  14897. generated$1.BLOCKPARENT_TYPES = BLOCKPARENT_TYPES;
  14898. var BLOCK_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Block"];
  14899. generated$1.BLOCK_TYPES = BLOCK_TYPES;
  14900. var STATEMENT_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Statement"];
  14901. generated$1.STATEMENT_TYPES = STATEMENT_TYPES;
  14902. var TERMINATORLESS_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Terminatorless"];
  14903. generated$1.TERMINATORLESS_TYPES = TERMINATORLESS_TYPES;
  14904. var COMPLETIONSTATEMENT_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["CompletionStatement"];
  14905. generated$1.COMPLETIONSTATEMENT_TYPES = COMPLETIONSTATEMENT_TYPES;
  14906. var CONDITIONAL_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Conditional"];
  14907. generated$1.CONDITIONAL_TYPES = CONDITIONAL_TYPES;
  14908. var LOOP_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Loop"];
  14909. generated$1.LOOP_TYPES = LOOP_TYPES;
  14910. var WHILE_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["While"];
  14911. generated$1.WHILE_TYPES = WHILE_TYPES;
  14912. var EXPRESSIONWRAPPER_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["ExpressionWrapper"];
  14913. generated$1.EXPRESSIONWRAPPER_TYPES = EXPRESSIONWRAPPER_TYPES;
  14914. var FOR_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["For"];
  14915. generated$1.FOR_TYPES = FOR_TYPES;
  14916. var FORXSTATEMENT_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["ForXStatement"];
  14917. generated$1.FORXSTATEMENT_TYPES = FORXSTATEMENT_TYPES;
  14918. var FUNCTION_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Function"];
  14919. generated$1.FUNCTION_TYPES = FUNCTION_TYPES;
  14920. var FUNCTIONPARENT_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["FunctionParent"];
  14921. generated$1.FUNCTIONPARENT_TYPES = FUNCTIONPARENT_TYPES;
  14922. var PUREISH_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Pureish"];
  14923. generated$1.PUREISH_TYPES = PUREISH_TYPES;
  14924. var DECLARATION_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Declaration"];
  14925. generated$1.DECLARATION_TYPES = DECLARATION_TYPES;
  14926. var PATTERNLIKE_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["PatternLike"];
  14927. generated$1.PATTERNLIKE_TYPES = PATTERNLIKE_TYPES;
  14928. var LVAL_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["LVal"];
  14929. generated$1.LVAL_TYPES = LVAL_TYPES;
  14930. var TSENTITYNAME_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["TSEntityName"];
  14931. generated$1.TSENTITYNAME_TYPES = TSENTITYNAME_TYPES;
  14932. var LITERAL_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Literal"];
  14933. generated$1.LITERAL_TYPES = LITERAL_TYPES;
  14934. var IMMUTABLE_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Immutable"];
  14935. generated$1.IMMUTABLE_TYPES = IMMUTABLE_TYPES;
  14936. var USERWHITESPACABLE_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["UserWhitespacable"];
  14937. generated$1.USERWHITESPACABLE_TYPES = USERWHITESPACABLE_TYPES;
  14938. var METHOD_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Method"];
  14939. generated$1.METHOD_TYPES = METHOD_TYPES;
  14940. var OBJECTMEMBER_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["ObjectMember"];
  14941. generated$1.OBJECTMEMBER_TYPES = OBJECTMEMBER_TYPES;
  14942. var PROPERTY_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Property"];
  14943. generated$1.PROPERTY_TYPES = PROPERTY_TYPES;
  14944. var UNARYLIKE_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["UnaryLike"];
  14945. generated$1.UNARYLIKE_TYPES = UNARYLIKE_TYPES;
  14946. var PATTERN_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Pattern"];
  14947. generated$1.PATTERN_TYPES = PATTERN_TYPES;
  14948. var CLASS_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Class"];
  14949. generated$1.CLASS_TYPES = CLASS_TYPES;
  14950. var MODULEDECLARATION_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["ModuleDeclaration"];
  14951. generated$1.MODULEDECLARATION_TYPES = MODULEDECLARATION_TYPES;
  14952. var EXPORTDECLARATION_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["ExportDeclaration"];
  14953. generated$1.EXPORTDECLARATION_TYPES = EXPORTDECLARATION_TYPES;
  14954. var MODULESPECIFIER_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["ModuleSpecifier"];
  14955. generated$1.MODULESPECIFIER_TYPES = MODULESPECIFIER_TYPES;
  14956. var PRIVATE_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Private"];
  14957. generated$1.PRIVATE_TYPES = PRIVATE_TYPES;
  14958. var FLOW_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Flow"];
  14959. generated$1.FLOW_TYPES = FLOW_TYPES;
  14960. var FLOWTYPE_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["FlowType"];
  14961. generated$1.FLOWTYPE_TYPES = FLOWTYPE_TYPES;
  14962. var FLOWBASEANNOTATION_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["FlowBaseAnnotation"];
  14963. generated$1.FLOWBASEANNOTATION_TYPES = FLOWBASEANNOTATION_TYPES;
  14964. var FLOWDECLARATION_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["FlowDeclaration"];
  14965. generated$1.FLOWDECLARATION_TYPES = FLOWDECLARATION_TYPES;
  14966. var FLOWPREDICATE_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["FlowPredicate"];
  14967. generated$1.FLOWPREDICATE_TYPES = FLOWPREDICATE_TYPES;
  14968. var ENUMBODY_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["EnumBody"];
  14969. generated$1.ENUMBODY_TYPES = ENUMBODY_TYPES;
  14970. var ENUMMEMBER_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["EnumMember"];
  14971. generated$1.ENUMMEMBER_TYPES = ENUMMEMBER_TYPES;
  14972. var JSX_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["JSX"];
  14973. generated$1.JSX_TYPES = JSX_TYPES;
  14974. var TSTYPEELEMENT_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["TSTypeElement"];
  14975. generated$1.TSTYPEELEMENT_TYPES = TSTYPEELEMENT_TYPES;
  14976. var TSTYPE_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["TSType"];
  14977. generated$1.TSTYPE_TYPES = TSTYPE_TYPES;
  14978. var TSBASETYPE_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["TSBaseType"];
  14979. generated$1.TSBASETYPE_TYPES = TSBASETYPE_TYPES;
  14980. var ensureBlock$1 = {};
  14981. var toBlock$1 = {};
  14982. Object.defineProperty(toBlock$1, "__esModule", {
  14983. value: true
  14984. });
  14985. toBlock$1.default = toBlock;
  14986. var _generated$f = generated$4;
  14987. var _generated2$3 = generated$3;
  14988. function toBlock(node, parent) {
  14989. if ((0, _generated$f.isBlockStatement)(node)) {
  14990. return node;
  14991. }
  14992. var blockNodes = [];
  14993. if ((0, _generated$f.isEmptyStatement)(node)) {
  14994. blockNodes = [];
  14995. } else {
  14996. if (!(0, _generated$f.isStatement)(node)) {
  14997. if ((0, _generated$f.isFunction)(parent)) {
  14998. node = (0, _generated2$3.returnStatement)(node);
  14999. } else {
  15000. node = (0, _generated2$3.expressionStatement)(node);
  15001. }
  15002. }
  15003. blockNodes = [
  15004. node
  15005. ];
  15006. }
  15007. return (0, _generated2$3.blockStatement)(blockNodes);
  15008. }
  15009. Object.defineProperty(ensureBlock$1, "__esModule", {
  15010. value: true
  15011. });
  15012. ensureBlock$1.default = ensureBlock;
  15013. var _toBlock = toBlock$1;
  15014. function ensureBlock(node, key) {
  15015. if (key === void 0) key = "body";
  15016. return node[key] = (0, _toBlock.default)(node[key], node);
  15017. }
  15018. var toBindingIdentifierName$1 = {};
  15019. var toIdentifier$1 = {};
  15020. Object.defineProperty(toIdentifier$1, "__esModule", {
  15021. value: true
  15022. });
  15023. toIdentifier$1.default = toIdentifier;
  15024. var _isValidIdentifier$2 = isValidIdentifier$1;
  15025. var _helperValidatorIdentifier = lib;
  15026. function toIdentifier(input) {
  15027. input = input + "";
  15028. var name = "";
  15029. for(var _i = 0; _i < input.length; _i++){
  15030. var c = input[_i];
  15031. name += (0, _helperValidatorIdentifier.isIdentifierChar)(c.codePointAt(0)) ? c : "-";
  15032. }
  15033. name = name.replace(/^[-0-9]+/, "");
  15034. name = name.replace(/[-\s]+(.)?/g, function(match, c) {
  15035. return c ? c.toUpperCase() : "";
  15036. });
  15037. if (!(0, _isValidIdentifier$2.default)(name)) {
  15038. name = "_" + name;
  15039. }
  15040. return name || "_";
  15041. }
  15042. Object.defineProperty(toBindingIdentifierName$1, "__esModule", {
  15043. value: true
  15044. });
  15045. toBindingIdentifierName$1.default = toBindingIdentifierName;
  15046. var _toIdentifier = toIdentifier$1;
  15047. function toBindingIdentifierName(name) {
  15048. name = (0, _toIdentifier.default)(name);
  15049. if (name === "eval" || name === "arguments") name = "_" + name;
  15050. return name;
  15051. }
  15052. var toComputedKey$1 = {};
  15053. Object.defineProperty(toComputedKey$1, "__esModule", {
  15054. value: true
  15055. });
  15056. toComputedKey$1.default = toComputedKey;
  15057. var _generated$e = generated$4;
  15058. var _generated2$2 = generated$3;
  15059. function toComputedKey(node, key) {
  15060. if (key === void 0) key = node.key || node.property;
  15061. if (!node.computed && (0, _generated$e.isIdentifier)(key)) key = (0, _generated2$2.stringLiteral)(key.name);
  15062. return key;
  15063. }
  15064. var toExpression$1 = {};
  15065. Object.defineProperty(toExpression$1, "__esModule", {
  15066. value: true
  15067. });
  15068. toExpression$1.default = void 0;
  15069. var _generated$d = generated$4;
  15070. var _default$3 = toExpression;
  15071. toExpression$1.default = _default$3;
  15072. function toExpression(node) {
  15073. if ((0, _generated$d.isExpressionStatement)(node)) {
  15074. node = node.expression;
  15075. }
  15076. if ((0, _generated$d.isExpression)(node)) {
  15077. return node;
  15078. }
  15079. if ((0, _generated$d.isClass)(node)) {
  15080. node.type = "ClassExpression";
  15081. } else if ((0, _generated$d.isFunction)(node)) {
  15082. node.type = "FunctionExpression";
  15083. }
  15084. if (!(0, _generated$d.isExpression)(node)) {
  15085. throw new Error("cannot turn " + node.type + " to an expression");
  15086. }
  15087. return node;
  15088. }
  15089. var toKeyAlias$1 = {};
  15090. var removePropertiesDeep$1 = {};
  15091. var traverseFast$1 = {};
  15092. Object.defineProperty(traverseFast$1, "__esModule", {
  15093. value: true
  15094. });
  15095. traverseFast$1.default = traverseFast;
  15096. var _definitions$2 = requireDefinitions();
  15097. function traverseFast(node, enter, opts) {
  15098. if (!node) return;
  15099. var keys = _definitions$2.VISITOR_KEYS[node.type];
  15100. if (!keys) return;
  15101. opts = opts || {};
  15102. enter(node, opts);
  15103. for(var _i = 0; _i < keys.length; _i++){
  15104. var key = keys[_i];
  15105. var subNode = node[key];
  15106. if (Array.isArray(subNode)) {
  15107. for(var _i1 = 0; _i1 < subNode.length; _i1++){
  15108. var _$node = subNode[_i1];
  15109. traverseFast(_$node, enter, opts);
  15110. }
  15111. } else {
  15112. traverseFast(subNode, enter, opts);
  15113. }
  15114. }
  15115. }
  15116. var removeProperties$1 = {};
  15117. Object.defineProperty(removeProperties$1, "__esModule", {
  15118. value: true
  15119. });
  15120. removeProperties$1.default = removeProperties;
  15121. var _constants$3 = constants;
  15122. var CLEAR_KEYS = [
  15123. "tokens",
  15124. "start",
  15125. "end",
  15126. "loc",
  15127. "raw",
  15128. "rawValue"
  15129. ];
  15130. var CLEAR_KEYS_PLUS_COMMENTS = _constants$3.COMMENT_KEYS.concat([
  15131. "comments"
  15132. ]).concat(CLEAR_KEYS);
  15133. function removeProperties(node, opts) {
  15134. if (opts === void 0) opts = {};
  15135. var map = opts.preserveComments ? CLEAR_KEYS : CLEAR_KEYS_PLUS_COMMENTS;
  15136. for(var _i = 0; _i < map.length; _i++){
  15137. var key = map[_i];
  15138. if (node[key] != null) node[key] = undefined;
  15139. }
  15140. for(var _i1 = 0, _iter = Object.keys(node); _i1 < _iter.length; _i1++){
  15141. var key1 = _iter[_i1];
  15142. if (key1[0] === "_" && node[key1] != null) node[key1] = undefined;
  15143. }
  15144. var symbols = Object.getOwnPropertySymbols(node);
  15145. for(var _i2 = 0; _i2 < symbols.length; _i2++){
  15146. var sym = symbols[_i2];
  15147. node[sym] = null;
  15148. }
  15149. }
  15150. Object.defineProperty(removePropertiesDeep$1, "__esModule", {
  15151. value: true
  15152. });
  15153. removePropertiesDeep$1.default = removePropertiesDeep;
  15154. var _traverseFast = traverseFast$1;
  15155. var _removeProperties = removeProperties$1;
  15156. function removePropertiesDeep(tree, opts) {
  15157. (0, _traverseFast.default)(tree, _removeProperties.default, opts);
  15158. return tree;
  15159. }
  15160. Object.defineProperty(toKeyAlias$1, "__esModule", {
  15161. value: true
  15162. });
  15163. toKeyAlias$1.default = toKeyAlias;
  15164. var _generated$c = generated$4;
  15165. var _cloneNode$1 = cloneNode$1;
  15166. var _removePropertiesDeep = removePropertiesDeep$1;
  15167. function toKeyAlias(node, key) {
  15168. if (key === void 0) key = node.key;
  15169. var alias;
  15170. if (node.kind === "method") {
  15171. return toKeyAlias.increment() + "";
  15172. } else if ((0, _generated$c.isIdentifier)(key)) {
  15173. alias = key.name;
  15174. } else if ((0, _generated$c.isStringLiteral)(key)) {
  15175. alias = JSON.stringify(key.value);
  15176. } else {
  15177. alias = JSON.stringify((0, _removePropertiesDeep.default)((0, _cloneNode$1.default)(key)));
  15178. }
  15179. if (node.computed) {
  15180. alias = "[" + alias + "]";
  15181. }
  15182. if (node.static) {
  15183. alias = "static:" + alias;
  15184. }
  15185. return alias;
  15186. }
  15187. toKeyAlias.uid = 0;
  15188. toKeyAlias.increment = function() {
  15189. if (toKeyAlias.uid >= Number.MAX_SAFE_INTEGER) {
  15190. return toKeyAlias.uid = 0;
  15191. } else {
  15192. return toKeyAlias.uid++;
  15193. }
  15194. };
  15195. var toSequenceExpression$1 = {};
  15196. var gatherSequenceExpressions$1 = {};
  15197. var getBindingIdentifiers$1 = {};
  15198. Object.defineProperty(getBindingIdentifiers$1, "__esModule", {
  15199. value: true
  15200. });
  15201. getBindingIdentifiers$1.default = getBindingIdentifiers;
  15202. var _generated$b = generated$4;
  15203. function getBindingIdentifiers(node, duplicates, outerOnly) {
  15204. var search = [].concat(node);
  15205. var ids = Object.create(null);
  15206. while(search.length){
  15207. var id = search.shift();
  15208. if (!id) continue;
  15209. var keys = getBindingIdentifiers.keys[id.type];
  15210. if ((0, _generated$b.isIdentifier)(id)) {
  15211. if (duplicates) {
  15212. var _ids = ids[id.name] = ids[id.name] || [];
  15213. _ids.push(id);
  15214. } else {
  15215. ids[id.name] = id;
  15216. }
  15217. continue;
  15218. }
  15219. if ((0, _generated$b.isExportDeclaration)(id) && !(0, _generated$b.isExportAllDeclaration)(id)) {
  15220. if ((0, _generated$b.isDeclaration)(id.declaration)) {
  15221. search.push(id.declaration);
  15222. }
  15223. continue;
  15224. }
  15225. if (outerOnly) {
  15226. if ((0, _generated$b.isFunctionDeclaration)(id)) {
  15227. search.push(id.id);
  15228. continue;
  15229. }
  15230. if ((0, _generated$b.isFunctionExpression)(id)) {
  15231. continue;
  15232. }
  15233. }
  15234. if (keys) {
  15235. for(var i = 0; i < keys.length; i++){
  15236. var key = keys[i];
  15237. if (id[key]) {
  15238. search = search.concat(id[key]);
  15239. }
  15240. }
  15241. }
  15242. }
  15243. return ids;
  15244. }
  15245. getBindingIdentifiers.keys = {
  15246. DeclareClass: [
  15247. "id"
  15248. ],
  15249. DeclareFunction: [
  15250. "id"
  15251. ],
  15252. DeclareModule: [
  15253. "id"
  15254. ],
  15255. DeclareVariable: [
  15256. "id"
  15257. ],
  15258. DeclareInterface: [
  15259. "id"
  15260. ],
  15261. DeclareTypeAlias: [
  15262. "id"
  15263. ],
  15264. DeclareOpaqueType: [
  15265. "id"
  15266. ],
  15267. InterfaceDeclaration: [
  15268. "id"
  15269. ],
  15270. TypeAlias: [
  15271. "id"
  15272. ],
  15273. OpaqueType: [
  15274. "id"
  15275. ],
  15276. CatchClause: [
  15277. "param"
  15278. ],
  15279. LabeledStatement: [
  15280. "label"
  15281. ],
  15282. UnaryExpression: [
  15283. "argument"
  15284. ],
  15285. AssignmentExpression: [
  15286. "left"
  15287. ],
  15288. ImportSpecifier: [
  15289. "local"
  15290. ],
  15291. ImportNamespaceSpecifier: [
  15292. "local"
  15293. ],
  15294. ImportDefaultSpecifier: [
  15295. "local"
  15296. ],
  15297. ImportDeclaration: [
  15298. "specifiers"
  15299. ],
  15300. ExportSpecifier: [
  15301. "exported"
  15302. ],
  15303. ExportNamespaceSpecifier: [
  15304. "exported"
  15305. ],
  15306. ExportDefaultSpecifier: [
  15307. "exported"
  15308. ],
  15309. FunctionDeclaration: [
  15310. "id",
  15311. "params"
  15312. ],
  15313. FunctionExpression: [
  15314. "id",
  15315. "params"
  15316. ],
  15317. ArrowFunctionExpression: [
  15318. "params"
  15319. ],
  15320. ObjectMethod: [
  15321. "params"
  15322. ],
  15323. ClassMethod: [
  15324. "params"
  15325. ],
  15326. ForInStatement: [
  15327. "left"
  15328. ],
  15329. ForOfStatement: [
  15330. "left"
  15331. ],
  15332. ClassDeclaration: [
  15333. "id"
  15334. ],
  15335. ClassExpression: [
  15336. "id"
  15337. ],
  15338. RestElement: [
  15339. "argument"
  15340. ],
  15341. UpdateExpression: [
  15342. "argument"
  15343. ],
  15344. ObjectProperty: [
  15345. "value"
  15346. ],
  15347. AssignmentPattern: [
  15348. "left"
  15349. ],
  15350. ArrayPattern: [
  15351. "elements"
  15352. ],
  15353. ObjectPattern: [
  15354. "properties"
  15355. ],
  15356. VariableDeclaration: [
  15357. "declarations"
  15358. ],
  15359. VariableDeclarator: [
  15360. "id"
  15361. ]
  15362. };
  15363. Object.defineProperty(gatherSequenceExpressions$1, "__esModule", {
  15364. value: true
  15365. });
  15366. gatherSequenceExpressions$1.default = gatherSequenceExpressions;
  15367. var _getBindingIdentifiers$2 = getBindingIdentifiers$1;
  15368. var _generated$a = generated$4;
  15369. var _generated2$1 = generated$3;
  15370. var _cloneNode = cloneNode$1;
  15371. function gatherSequenceExpressions(nodes, scope, declars) {
  15372. var exprs = [];
  15373. var ensureLastUndefined = true;
  15374. for(var _i = 0; _i < nodes.length; _i++){
  15375. var node = nodes[_i];
  15376. if (!(0, _generated$a.isEmptyStatement)(node)) {
  15377. ensureLastUndefined = false;
  15378. }
  15379. if ((0, _generated$a.isExpression)(node)) {
  15380. exprs.push(node);
  15381. } else if ((0, _generated$a.isExpressionStatement)(node)) {
  15382. exprs.push(node.expression);
  15383. } else if ((0, _generated$a.isVariableDeclaration)(node)) {
  15384. if (node.kind !== "var") return;
  15385. for(var _i1 = 0, _declarations = node.declarations; _i1 < _declarations.length; _i1++){
  15386. var declar = _declarations[_i1];
  15387. var bindings = (0, _getBindingIdentifiers$2.default)(declar);
  15388. for(var _i2 = 0, _iter = Object.keys(bindings); _i2 < _iter.length; _i2++){
  15389. var key = _iter[_i2];
  15390. declars.push({
  15391. kind: node.kind,
  15392. id: (0, _cloneNode.default)(bindings[key])
  15393. });
  15394. }
  15395. if (declar.init) {
  15396. exprs.push((0, _generated2$1.assignmentExpression)("=", declar.id, declar.init));
  15397. }
  15398. }
  15399. ensureLastUndefined = true;
  15400. } else if ((0, _generated$a.isIfStatement)(node)) {
  15401. var consequent = node.consequent ? gatherSequenceExpressions([
  15402. node.consequent
  15403. ], scope, declars) : scope.buildUndefinedNode();
  15404. var alternate = node.alternate ? gatherSequenceExpressions([
  15405. node.alternate
  15406. ], scope, declars) : scope.buildUndefinedNode();
  15407. if (!consequent || !alternate) return;
  15408. exprs.push((0, _generated2$1.conditionalExpression)(node.test, consequent, alternate));
  15409. } else if ((0, _generated$a.isBlockStatement)(node)) {
  15410. var body = gatherSequenceExpressions(node.body, scope, declars);
  15411. if (!body) return;
  15412. exprs.push(body);
  15413. } else if ((0, _generated$a.isEmptyStatement)(node)) {
  15414. if (nodes.indexOf(node) === 0) {
  15415. ensureLastUndefined = true;
  15416. }
  15417. } else {
  15418. return;
  15419. }
  15420. }
  15421. if (ensureLastUndefined) {
  15422. exprs.push(scope.buildUndefinedNode());
  15423. }
  15424. if (exprs.length === 1) {
  15425. return exprs[0];
  15426. } else {
  15427. return (0, _generated2$1.sequenceExpression)(exprs);
  15428. }
  15429. }
  15430. Object.defineProperty(toSequenceExpression$1, "__esModule", {
  15431. value: true
  15432. });
  15433. toSequenceExpression$1.default = toSequenceExpression;
  15434. var _gatherSequenceExpressions = gatherSequenceExpressions$1;
  15435. function toSequenceExpression(nodes, scope) {
  15436. if (!(nodes != null && nodes.length)) return;
  15437. var declars = [];
  15438. var result = (0, _gatherSequenceExpressions.default)(nodes, scope, declars);
  15439. if (!result) return;
  15440. for(var _i = 0; _i < declars.length; _i++){
  15441. var declar = declars[_i];
  15442. scope.push(declar);
  15443. }
  15444. return result;
  15445. }
  15446. var toStatement$1 = {};
  15447. Object.defineProperty(toStatement$1, "__esModule", {
  15448. value: true
  15449. });
  15450. toStatement$1.default = void 0;
  15451. var _generated$9 = generated$4;
  15452. var _generated2 = generated$3;
  15453. var _default$2 = toStatement;
  15454. toStatement$1.default = _default$2;
  15455. function toStatement(node, ignore) {
  15456. if ((0, _generated$9.isStatement)(node)) {
  15457. return node;
  15458. }
  15459. var mustHaveId = false;
  15460. var newType;
  15461. if ((0, _generated$9.isClass)(node)) {
  15462. mustHaveId = true;
  15463. newType = "ClassDeclaration";
  15464. } else if ((0, _generated$9.isFunction)(node)) {
  15465. mustHaveId = true;
  15466. newType = "FunctionDeclaration";
  15467. } else if ((0, _generated$9.isAssignmentExpression)(node)) {
  15468. return (0, _generated2.expressionStatement)(node);
  15469. }
  15470. if (mustHaveId && !node.id) {
  15471. newType = false;
  15472. }
  15473. if (!newType) {
  15474. if (ignore) {
  15475. return false;
  15476. } else {
  15477. throw new Error("cannot turn " + node.type + " to a statement");
  15478. }
  15479. }
  15480. node.type = newType;
  15481. return node;
  15482. }
  15483. var valueToNode$1 = {};
  15484. Object.defineProperty(valueToNode$1, "__esModule", {
  15485. value: true
  15486. });
  15487. valueToNode$1.default = void 0;
  15488. var _isValidIdentifier$1 = isValidIdentifier$1;
  15489. var _generated$8 = generated$3;
  15490. var _default$1 = valueToNode;
  15491. valueToNode$1.default = _default$1;
  15492. var objectToString = Function.call.bind(Object.prototype.toString);
  15493. function isRegExp(value) {
  15494. return objectToString(value) === "[object RegExp]";
  15495. }
  15496. function isPlainObject(value) {
  15497. if (typeof value !== "object" || value === null || Object.prototype.toString.call(value) !== "[object Object]") {
  15498. return false;
  15499. }
  15500. var proto = Object.getPrototypeOf(value);
  15501. return proto === null || Object.getPrototypeOf(proto) === null;
  15502. }
  15503. function valueToNode(value) {
  15504. if (value === undefined) {
  15505. return (0, _generated$8.identifier)("undefined");
  15506. }
  15507. if (value === true || value === false) {
  15508. return (0, _generated$8.booleanLiteral)(value);
  15509. }
  15510. if (value === null) {
  15511. return (0, _generated$8.nullLiteral)();
  15512. }
  15513. if (typeof value === "string") {
  15514. return (0, _generated$8.stringLiteral)(value);
  15515. }
  15516. if (typeof value === "number") {
  15517. var result;
  15518. if (Number.isFinite(value)) {
  15519. result = (0, _generated$8.numericLiteral)(Math.abs(value));
  15520. } else {
  15521. var numerator;
  15522. if (Number.isNaN(value)) {
  15523. numerator = (0, _generated$8.numericLiteral)(0);
  15524. } else {
  15525. numerator = (0, _generated$8.numericLiteral)(1);
  15526. }
  15527. result = (0, _generated$8.binaryExpression)("/", numerator, (0, _generated$8.numericLiteral)(0));
  15528. }
  15529. if (value < 0 || Object.is(value, -0)) {
  15530. result = (0, _generated$8.unaryExpression)("-", result);
  15531. }
  15532. return result;
  15533. }
  15534. if (isRegExp(value)) {
  15535. var pattern = value.source;
  15536. var flags = value.toString().match(/\/([a-z]+|)$/)[1];
  15537. return (0, _generated$8.regExpLiteral)(pattern, flags);
  15538. }
  15539. if (Array.isArray(value)) {
  15540. return (0, _generated$8.arrayExpression)(value.map(valueToNode));
  15541. }
  15542. if (isPlainObject(value)) {
  15543. var props = [];
  15544. for(var _i = 0, _iter = Object.keys(value); _i < _iter.length; _i++){
  15545. var key = _iter[_i];
  15546. var nodeKey = void 0;
  15547. if ((0, _isValidIdentifier$1.default)(key)) {
  15548. nodeKey = (0, _generated$8.identifier)(key);
  15549. } else {
  15550. nodeKey = (0, _generated$8.stringLiteral)(key);
  15551. }
  15552. props.push((0, _generated$8.objectProperty)(nodeKey, valueToNode(value[key])));
  15553. }
  15554. return (0, _generated$8.objectExpression)(props);
  15555. }
  15556. throw new Error("don't know how to turn this value into a node");
  15557. }
  15558. var appendToMemberExpression$1 = {};
  15559. Object.defineProperty(appendToMemberExpression$1, "__esModule", {
  15560. value: true
  15561. });
  15562. appendToMemberExpression$1.default = appendToMemberExpression;
  15563. var _generated$7 = generated$3;
  15564. function appendToMemberExpression(member, append, computed) {
  15565. if (computed === void 0) computed = false;
  15566. member.object = (0, _generated$7.memberExpression)(member.object, member.property, member.computed);
  15567. member.property = append;
  15568. member.computed = !!computed;
  15569. return member;
  15570. }
  15571. var inherits$1 = {};
  15572. Object.defineProperty(inherits$1, "__esModule", {
  15573. value: true
  15574. });
  15575. inherits$1.default = inherits;
  15576. var _constants$2 = constants;
  15577. var _inheritsComments = inheritsComments$1;
  15578. function inherits(child, parent) {
  15579. if (!child || !parent) return child;
  15580. for(var _i = 0, _optional = _constants$2.INHERIT_KEYS.optional; _i < _optional.length; _i++){
  15581. var key = _optional[_i];
  15582. if (child[key] == null) {
  15583. child[key] = parent[key];
  15584. }
  15585. }
  15586. for(var _i1 = 0, _iter = Object.keys(parent); _i1 < _iter.length; _i1++){
  15587. var key1 = _iter[_i1];
  15588. if (key1[0] === "_" && key1 !== "__clone") child[key1] = parent[key1];
  15589. }
  15590. for(var _i2 = 0, _force = _constants$2.INHERIT_KEYS.force; _i2 < _force.length; _i2++){
  15591. var key2 = _force[_i2];
  15592. child[key2] = parent[key2];
  15593. }
  15594. (0, _inheritsComments.default)(child, parent);
  15595. return child;
  15596. }
  15597. var prependToMemberExpression$1 = {};
  15598. Object.defineProperty(prependToMemberExpression$1, "__esModule", {
  15599. value: true
  15600. });
  15601. prependToMemberExpression$1.default = prependToMemberExpression;
  15602. var _generated$6 = generated$3;
  15603. function prependToMemberExpression(member, prepend) {
  15604. member.object = (0, _generated$6.memberExpression)(prepend, member.object);
  15605. return member;
  15606. }
  15607. var getOuterBindingIdentifiers$1 = {};
  15608. Object.defineProperty(getOuterBindingIdentifiers$1, "__esModule", {
  15609. value: true
  15610. });
  15611. getOuterBindingIdentifiers$1.default = void 0;
  15612. var _getBindingIdentifiers$1 = getBindingIdentifiers$1;
  15613. var _default = getOuterBindingIdentifiers;
  15614. getOuterBindingIdentifiers$1.default = _default;
  15615. function getOuterBindingIdentifiers(node, duplicates) {
  15616. return (0, _getBindingIdentifiers$1.default)(node, duplicates, true);
  15617. }
  15618. var traverse$1 = {};
  15619. Object.defineProperty(traverse$1, "__esModule", {
  15620. value: true
  15621. });
  15622. traverse$1.default = traverse;
  15623. var _definitions$1 = requireDefinitions();
  15624. function traverse(node, handlers, state) {
  15625. if (typeof handlers === "function") {
  15626. handlers = {
  15627. enter: handlers
  15628. };
  15629. }
  15630. var enter = handlers.enter, exit = handlers.exit;
  15631. traverseSimpleImpl(node, enter, exit, state, []);
  15632. }
  15633. function traverseSimpleImpl(node, enter, exit, state, ancestors) {
  15634. var keys = _definitions$1.VISITOR_KEYS[node.type];
  15635. if (!keys) return;
  15636. if (enter) enter(node, ancestors, state);
  15637. for(var _i = 0; _i < keys.length; _i++){
  15638. var key = keys[_i];
  15639. var subNode = node[key];
  15640. if (Array.isArray(subNode)) {
  15641. for(var i = 0; i < subNode.length; i++){
  15642. var child = subNode[i];
  15643. if (!child) continue;
  15644. ancestors.push({
  15645. node: node,
  15646. key: key,
  15647. index: i
  15648. });
  15649. traverseSimpleImpl(child, enter, exit, state, ancestors);
  15650. ancestors.pop();
  15651. }
  15652. } else if (subNode) {
  15653. ancestors.push({
  15654. node: node,
  15655. key: key
  15656. });
  15657. traverseSimpleImpl(subNode, enter, exit, state, ancestors);
  15658. ancestors.pop();
  15659. }
  15660. }
  15661. if (exit) exit(node, ancestors, state);
  15662. }
  15663. var isBinding$1 = {};
  15664. Object.defineProperty(isBinding$1, "__esModule", {
  15665. value: true
  15666. });
  15667. isBinding$1.default = isBinding;
  15668. var _getBindingIdentifiers = getBindingIdentifiers$1;
  15669. function isBinding(node, parent, grandparent) {
  15670. if (grandparent && node.type === "Identifier" && parent.type === "ObjectProperty" && grandparent.type === "ObjectExpression") {
  15671. return false;
  15672. }
  15673. var keys = _getBindingIdentifiers.default.keys[parent.type];
  15674. if (keys) {
  15675. for(var i = 0; i < keys.length; i++){
  15676. var key = keys[i];
  15677. var val = parent[key];
  15678. if (Array.isArray(val)) {
  15679. if (val.indexOf(node) >= 0) return true;
  15680. } else {
  15681. if (val === node) return true;
  15682. }
  15683. }
  15684. }
  15685. return false;
  15686. }
  15687. var isBlockScoped$1 = {};
  15688. var isLet$1 = {};
  15689. Object.defineProperty(isLet$1, "__esModule", {
  15690. value: true
  15691. });
  15692. isLet$1.default = isLet;
  15693. var _generated$5 = generated$4;
  15694. var _constants$1 = constants;
  15695. function isLet(node) {
  15696. return (0, _generated$5.isVariableDeclaration)(node) && (node.kind !== "var" || node[_constants$1.BLOCK_SCOPED_SYMBOL]);
  15697. }
  15698. Object.defineProperty(isBlockScoped$1, "__esModule", {
  15699. value: true
  15700. });
  15701. isBlockScoped$1.default = isBlockScoped;
  15702. var _generated$4 = generated$4;
  15703. var _isLet = isLet$1;
  15704. function isBlockScoped(node) {
  15705. return (0, _generated$4.isFunctionDeclaration)(node) || (0, _generated$4.isClassDeclaration)(node) || (0, _isLet.default)(node);
  15706. }
  15707. var isImmutable$1 = {};
  15708. Object.defineProperty(isImmutable$1, "__esModule", {
  15709. value: true
  15710. });
  15711. isImmutable$1.default = isImmutable;
  15712. var _isType = requireIsType();
  15713. var _generated$3 = generated$4;
  15714. function isImmutable(node) {
  15715. if ((0, _isType.default)(node.type, "Immutable")) return true;
  15716. if ((0, _generated$3.isIdentifier)(node)) {
  15717. if (node.name === "undefined") {
  15718. return true;
  15719. } else {
  15720. return false;
  15721. }
  15722. }
  15723. return false;
  15724. }
  15725. var isNodesEquivalent$1 = {};
  15726. var _typeof$2 = function(obj) {
  15727. "@swc/helpers - typeof";
  15728. return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
  15729. };
  15730. Object.defineProperty(isNodesEquivalent$1, "__esModule", {
  15731. value: true
  15732. });
  15733. isNodesEquivalent$1.default = isNodesEquivalent;
  15734. var _definitions = requireDefinitions();
  15735. function isNodesEquivalent(a, b) {
  15736. if (typeof a !== "object" || typeof b !== "object" || a == null || b == null) {
  15737. return a === b;
  15738. }
  15739. if (a.type !== b.type) {
  15740. return false;
  15741. }
  15742. var fields = Object.keys(_definitions.NODE_FIELDS[a.type] || a.type);
  15743. var visitorKeys = _definitions.VISITOR_KEYS[a.type];
  15744. for(var _i = 0; _i < fields.length; _i++){
  15745. var field = fields[_i];
  15746. if (_typeof$2(a[field]) !== _typeof$2(b[field])) {
  15747. return false;
  15748. }
  15749. if (a[field] == null && b[field] == null) {
  15750. continue;
  15751. } else if (a[field] == null || b[field] == null) {
  15752. return false;
  15753. }
  15754. if (Array.isArray(a[field])) {
  15755. if (!Array.isArray(b[field])) {
  15756. return false;
  15757. }
  15758. if (a[field].length !== b[field].length) {
  15759. return false;
  15760. }
  15761. for(var i = 0; i < a[field].length; i++){
  15762. if (!isNodesEquivalent(a[field][i], b[field][i])) {
  15763. return false;
  15764. }
  15765. }
  15766. continue;
  15767. }
  15768. if (typeof a[field] === "object" && !(visitorKeys != null && visitorKeys.includes(field))) {
  15769. for(var _i1 = 0, _iter = Object.keys(a[field]); _i1 < _iter.length; _i1++){
  15770. var key = _iter[_i1];
  15771. if (a[field][key] !== b[field][key]) {
  15772. return false;
  15773. }
  15774. }
  15775. continue;
  15776. }
  15777. if (!isNodesEquivalent(a[field], b[field])) {
  15778. return false;
  15779. }
  15780. }
  15781. return true;
  15782. }
  15783. var isReferenced$1 = {};
  15784. Object.defineProperty(isReferenced$1, "__esModule", {
  15785. value: true
  15786. });
  15787. isReferenced$1.default = isReferenced;
  15788. function isReferenced(node, parent, grandparent) {
  15789. switch(parent.type){
  15790. case "MemberExpression":
  15791. case "JSXMemberExpression":
  15792. case "OptionalMemberExpression":
  15793. if (parent.property === node) {
  15794. return !!parent.computed;
  15795. }
  15796. return parent.object === node;
  15797. case "VariableDeclarator":
  15798. return parent.init === node;
  15799. case "ArrowFunctionExpression":
  15800. return parent.body === node;
  15801. case "PrivateName":
  15802. return false;
  15803. case "ClassMethod":
  15804. case "ClassPrivateMethod":
  15805. case "ObjectMethod":
  15806. if (parent.params.includes(node)) {
  15807. return false;
  15808. }
  15809. case "ObjectProperty":
  15810. case "ClassProperty":
  15811. case "ClassPrivateProperty":
  15812. if (parent.key === node) {
  15813. return !!parent.computed;
  15814. }
  15815. if (parent.value === node) {
  15816. return !grandparent || grandparent.type !== "ObjectPattern";
  15817. }
  15818. return true;
  15819. case "ClassDeclaration":
  15820. case "ClassExpression":
  15821. return parent.superClass === node;
  15822. case "AssignmentExpression":
  15823. return parent.right === node;
  15824. case "AssignmentPattern":
  15825. return parent.right === node;
  15826. case "LabeledStatement":
  15827. return false;
  15828. case "CatchClause":
  15829. return false;
  15830. case "RestElement":
  15831. return false;
  15832. case "BreakStatement":
  15833. case "ContinueStatement":
  15834. return false;
  15835. case "FunctionDeclaration":
  15836. case "FunctionExpression":
  15837. return false;
  15838. case "ExportNamespaceSpecifier":
  15839. case "ExportDefaultSpecifier":
  15840. return false;
  15841. case "ExportSpecifier":
  15842. if (grandparent != null && grandparent.source) {
  15843. return false;
  15844. }
  15845. return parent.local === node;
  15846. case "ImportDefaultSpecifier":
  15847. case "ImportNamespaceSpecifier":
  15848. case "ImportSpecifier":
  15849. return false;
  15850. case "JSXAttribute":
  15851. return false;
  15852. case "ObjectPattern":
  15853. case "ArrayPattern":
  15854. return false;
  15855. case "MetaProperty":
  15856. return false;
  15857. case "ObjectTypeProperty":
  15858. return parent.key !== node;
  15859. case "TSEnumMember":
  15860. return parent.id !== node;
  15861. case "TSPropertySignature":
  15862. if (parent.key === node) {
  15863. return !!parent.computed;
  15864. }
  15865. return true;
  15866. }
  15867. return true;
  15868. }
  15869. var isScope$1 = {};
  15870. Object.defineProperty(isScope$1, "__esModule", {
  15871. value: true
  15872. });
  15873. isScope$1.default = isScope;
  15874. var _generated$2 = generated$4;
  15875. function isScope(node, parent) {
  15876. if ((0, _generated$2.isBlockStatement)(node) && ((0, _generated$2.isFunction)(parent) || (0, _generated$2.isCatchClause)(parent))) {
  15877. return false;
  15878. }
  15879. if ((0, _generated$2.isPattern)(node) && ((0, _generated$2.isFunction)(parent) || (0, _generated$2.isCatchClause)(parent))) {
  15880. return true;
  15881. }
  15882. return (0, _generated$2.isScopable)(node);
  15883. }
  15884. var isSpecifierDefault$1 = {};
  15885. Object.defineProperty(isSpecifierDefault$1, "__esModule", {
  15886. value: true
  15887. });
  15888. isSpecifierDefault$1.default = isSpecifierDefault;
  15889. var _generated$1 = generated$4;
  15890. function isSpecifierDefault(specifier) {
  15891. return (0, _generated$1.isImportDefaultSpecifier)(specifier) || (0, _generated$1.isIdentifier)(specifier.imported || specifier.exported, {
  15892. name: "default"
  15893. });
  15894. }
  15895. var isValidES3Identifier$1 = {};
  15896. Object.defineProperty(isValidES3Identifier$1, "__esModule", {
  15897. value: true
  15898. });
  15899. isValidES3Identifier$1.default = isValidES3Identifier;
  15900. var _isValidIdentifier = isValidIdentifier$1;
  15901. var RESERVED_WORDS_ES3_ONLY = new Set([
  15902. "abstract",
  15903. "boolean",
  15904. "byte",
  15905. "char",
  15906. "double",
  15907. "enum",
  15908. "final",
  15909. "float",
  15910. "goto",
  15911. "implements",
  15912. "int",
  15913. "interface",
  15914. "long",
  15915. "native",
  15916. "package",
  15917. "private",
  15918. "protected",
  15919. "public",
  15920. "short",
  15921. "static",
  15922. "synchronized",
  15923. "throws",
  15924. "transient",
  15925. "volatile"
  15926. ]);
  15927. function isValidES3Identifier(name) {
  15928. return (0, _isValidIdentifier.default)(name) && !RESERVED_WORDS_ES3_ONLY.has(name);
  15929. }
  15930. var isVar$1 = {};
  15931. Object.defineProperty(isVar$1, "__esModule", {
  15932. value: true
  15933. });
  15934. isVar$1.default = isVar;
  15935. var _generated = generated$4;
  15936. var _constants = constants;
  15937. function isVar(node) {
  15938. return (0, _generated.isVariableDeclaration)(node, {
  15939. kind: "var"
  15940. }) && !node[_constants.BLOCK_SCOPED_SYMBOL];
  15941. }
  15942. var generated = {};
  15943. (function(exports) {
  15944. Object.defineProperty(exports, "__esModule", {
  15945. value: true
  15946. });
  15947. var _exportNames = {
  15948. react: true,
  15949. assertNode: true,
  15950. createTypeAnnotationBasedOnTypeof: true,
  15951. createUnionTypeAnnotation: true,
  15952. createFlowUnionType: true,
  15953. createTSUnionType: true,
  15954. cloneNode: true,
  15955. clone: true,
  15956. cloneDeep: true,
  15957. cloneDeepWithoutLoc: true,
  15958. cloneWithoutLoc: true,
  15959. addComment: true,
  15960. addComments: true,
  15961. inheritInnerComments: true,
  15962. inheritLeadingComments: true,
  15963. inheritsComments: true,
  15964. inheritTrailingComments: true,
  15965. removeComments: true,
  15966. ensureBlock: true,
  15967. toBindingIdentifierName: true,
  15968. toBlock: true,
  15969. toComputedKey: true,
  15970. toExpression: true,
  15971. toIdentifier: true,
  15972. toKeyAlias: true,
  15973. toSequenceExpression: true,
  15974. toStatement: true,
  15975. valueToNode: true,
  15976. appendToMemberExpression: true,
  15977. inherits: true,
  15978. prependToMemberExpression: true,
  15979. removeProperties: true,
  15980. removePropertiesDeep: true,
  15981. removeTypeDuplicates: true,
  15982. getBindingIdentifiers: true,
  15983. getOuterBindingIdentifiers: true,
  15984. traverse: true,
  15985. traverseFast: true,
  15986. shallowEqual: true,
  15987. is: true,
  15988. isBinding: true,
  15989. isBlockScoped: true,
  15990. isImmutable: true,
  15991. isLet: true,
  15992. isNode: true,
  15993. isNodesEquivalent: true,
  15994. isPlaceholderType: true,
  15995. isReferenced: true,
  15996. isScope: true,
  15997. isSpecifierDefault: true,
  15998. isType: true,
  15999. isValidES3Identifier: true,
  16000. isValidIdentifier: true,
  16001. isVar: true,
  16002. matchesPattern: true,
  16003. validate: true,
  16004. buildMatchMemberExpression: true
  16005. };
  16006. Object.defineProperty(exports, "assertNode", {
  16007. enumerable: true,
  16008. get: function get() {
  16009. return _assertNode.default;
  16010. }
  16011. });
  16012. Object.defineProperty(exports, "createTypeAnnotationBasedOnTypeof", {
  16013. enumerable: true,
  16014. get: function get() {
  16015. return _createTypeAnnotationBasedOnTypeof.default;
  16016. }
  16017. });
  16018. Object.defineProperty(exports, "createUnionTypeAnnotation", {
  16019. enumerable: true,
  16020. get: function get() {
  16021. return _createFlowUnionType.default;
  16022. }
  16023. });
  16024. Object.defineProperty(exports, "createFlowUnionType", {
  16025. enumerable: true,
  16026. get: function get() {
  16027. return _createFlowUnionType.default;
  16028. }
  16029. });
  16030. Object.defineProperty(exports, "createTSUnionType", {
  16031. enumerable: true,
  16032. get: function get() {
  16033. return _createTSUnionType.default;
  16034. }
  16035. });
  16036. Object.defineProperty(exports, "cloneNode", {
  16037. enumerable: true,
  16038. get: function get() {
  16039. return _cloneNode.default;
  16040. }
  16041. });
  16042. Object.defineProperty(exports, "clone", {
  16043. enumerable: true,
  16044. get: function get() {
  16045. return _clone.default;
  16046. }
  16047. });
  16048. Object.defineProperty(exports, "cloneDeep", {
  16049. enumerable: true,
  16050. get: function get() {
  16051. return _cloneDeep.default;
  16052. }
  16053. });
  16054. Object.defineProperty(exports, "cloneDeepWithoutLoc", {
  16055. enumerable: true,
  16056. get: function get() {
  16057. return _cloneDeepWithoutLoc.default;
  16058. }
  16059. });
  16060. Object.defineProperty(exports, "cloneWithoutLoc", {
  16061. enumerable: true,
  16062. get: function get() {
  16063. return _cloneWithoutLoc.default;
  16064. }
  16065. });
  16066. Object.defineProperty(exports, "addComment", {
  16067. enumerable: true,
  16068. get: function get() {
  16069. return _addComment.default;
  16070. }
  16071. });
  16072. Object.defineProperty(exports, "addComments", {
  16073. enumerable: true,
  16074. get: function get() {
  16075. return _addComments.default;
  16076. }
  16077. });
  16078. Object.defineProperty(exports, "inheritInnerComments", {
  16079. enumerable: true,
  16080. get: function get() {
  16081. return _inheritInnerComments.default;
  16082. }
  16083. });
  16084. Object.defineProperty(exports, "inheritLeadingComments", {
  16085. enumerable: true,
  16086. get: function get() {
  16087. return _inheritLeadingComments.default;
  16088. }
  16089. });
  16090. Object.defineProperty(exports, "inheritsComments", {
  16091. enumerable: true,
  16092. get: function get() {
  16093. return _inheritsComments.default;
  16094. }
  16095. });
  16096. Object.defineProperty(exports, "inheritTrailingComments", {
  16097. enumerable: true,
  16098. get: function get() {
  16099. return _inheritTrailingComments.default;
  16100. }
  16101. });
  16102. Object.defineProperty(exports, "removeComments", {
  16103. enumerable: true,
  16104. get: function get() {
  16105. return _removeComments.default;
  16106. }
  16107. });
  16108. Object.defineProperty(exports, "ensureBlock", {
  16109. enumerable: true,
  16110. get: function get() {
  16111. return _ensureBlock.default;
  16112. }
  16113. });
  16114. Object.defineProperty(exports, "toBindingIdentifierName", {
  16115. enumerable: true,
  16116. get: function get() {
  16117. return _toBindingIdentifierName.default;
  16118. }
  16119. });
  16120. Object.defineProperty(exports, "toBlock", {
  16121. enumerable: true,
  16122. get: function get() {
  16123. return _toBlock.default;
  16124. }
  16125. });
  16126. Object.defineProperty(exports, "toComputedKey", {
  16127. enumerable: true,
  16128. get: function get() {
  16129. return _toComputedKey.default;
  16130. }
  16131. });
  16132. Object.defineProperty(exports, "toExpression", {
  16133. enumerable: true,
  16134. get: function get() {
  16135. return _toExpression.default;
  16136. }
  16137. });
  16138. Object.defineProperty(exports, "toIdentifier", {
  16139. enumerable: true,
  16140. get: function get() {
  16141. return _toIdentifier.default;
  16142. }
  16143. });
  16144. Object.defineProperty(exports, "toKeyAlias", {
  16145. enumerable: true,
  16146. get: function get() {
  16147. return _toKeyAlias.default;
  16148. }
  16149. });
  16150. Object.defineProperty(exports, "toSequenceExpression", {
  16151. enumerable: true,
  16152. get: function get() {
  16153. return _toSequenceExpression.default;
  16154. }
  16155. });
  16156. Object.defineProperty(exports, "toStatement", {
  16157. enumerable: true,
  16158. get: function get() {
  16159. return _toStatement.default;
  16160. }
  16161. });
  16162. Object.defineProperty(exports, "valueToNode", {
  16163. enumerable: true,
  16164. get: function get() {
  16165. return _valueToNode.default;
  16166. }
  16167. });
  16168. Object.defineProperty(exports, "appendToMemberExpression", {
  16169. enumerable: true,
  16170. get: function get() {
  16171. return _appendToMemberExpression.default;
  16172. }
  16173. });
  16174. Object.defineProperty(exports, "inherits", {
  16175. enumerable: true,
  16176. get: function get() {
  16177. return _inherits.default;
  16178. }
  16179. });
  16180. Object.defineProperty(exports, "prependToMemberExpression", {
  16181. enumerable: true,
  16182. get: function get() {
  16183. return _prependToMemberExpression.default;
  16184. }
  16185. });
  16186. Object.defineProperty(exports, "removeProperties", {
  16187. enumerable: true,
  16188. get: function get() {
  16189. return _removeProperties.default;
  16190. }
  16191. });
  16192. Object.defineProperty(exports, "removePropertiesDeep", {
  16193. enumerable: true,
  16194. get: function get() {
  16195. return _removePropertiesDeep.default;
  16196. }
  16197. });
  16198. Object.defineProperty(exports, "removeTypeDuplicates", {
  16199. enumerable: true,
  16200. get: function get() {
  16201. return _removeTypeDuplicates.default;
  16202. }
  16203. });
  16204. Object.defineProperty(exports, "getBindingIdentifiers", {
  16205. enumerable: true,
  16206. get: function get() {
  16207. return _getBindingIdentifiers.default;
  16208. }
  16209. });
  16210. Object.defineProperty(exports, "getOuterBindingIdentifiers", {
  16211. enumerable: true,
  16212. get: function get() {
  16213. return _getOuterBindingIdentifiers.default;
  16214. }
  16215. });
  16216. Object.defineProperty(exports, "traverse", {
  16217. enumerable: true,
  16218. get: function get() {
  16219. return _traverse.default;
  16220. }
  16221. });
  16222. Object.defineProperty(exports, "traverseFast", {
  16223. enumerable: true,
  16224. get: function get() {
  16225. return _traverseFast.default;
  16226. }
  16227. });
  16228. Object.defineProperty(exports, "shallowEqual", {
  16229. enumerable: true,
  16230. get: function get() {
  16231. return _shallowEqual.default;
  16232. }
  16233. });
  16234. Object.defineProperty(exports, "is", {
  16235. enumerable: true,
  16236. get: function get() {
  16237. return _is.default;
  16238. }
  16239. });
  16240. Object.defineProperty(exports, "isBinding", {
  16241. enumerable: true,
  16242. get: function get() {
  16243. return _isBinding.default;
  16244. }
  16245. });
  16246. Object.defineProperty(exports, "isBlockScoped", {
  16247. enumerable: true,
  16248. get: function get() {
  16249. return _isBlockScoped.default;
  16250. }
  16251. });
  16252. Object.defineProperty(exports, "isImmutable", {
  16253. enumerable: true,
  16254. get: function get() {
  16255. return _isImmutable.default;
  16256. }
  16257. });
  16258. Object.defineProperty(exports, "isLet", {
  16259. enumerable: true,
  16260. get: function get() {
  16261. return _isLet.default;
  16262. }
  16263. });
  16264. Object.defineProperty(exports, "isNode", {
  16265. enumerable: true,
  16266. get: function get() {
  16267. return _isNode.default;
  16268. }
  16269. });
  16270. Object.defineProperty(exports, "isNodesEquivalent", {
  16271. enumerable: true,
  16272. get: function get() {
  16273. return _isNodesEquivalent.default;
  16274. }
  16275. });
  16276. Object.defineProperty(exports, "isPlaceholderType", {
  16277. enumerable: true,
  16278. get: function get() {
  16279. return _isPlaceholderType.default;
  16280. }
  16281. });
  16282. Object.defineProperty(exports, "isReferenced", {
  16283. enumerable: true,
  16284. get: function get() {
  16285. return _isReferenced.default;
  16286. }
  16287. });
  16288. Object.defineProperty(exports, "isScope", {
  16289. enumerable: true,
  16290. get: function get() {
  16291. return _isScope.default;
  16292. }
  16293. });
  16294. Object.defineProperty(exports, "isSpecifierDefault", {
  16295. enumerable: true,
  16296. get: function get() {
  16297. return _isSpecifierDefault.default;
  16298. }
  16299. });
  16300. Object.defineProperty(exports, "isType", {
  16301. enumerable: true,
  16302. get: function get() {
  16303. return _isType.default;
  16304. }
  16305. });
  16306. Object.defineProperty(exports, "isValidES3Identifier", {
  16307. enumerable: true,
  16308. get: function get() {
  16309. return _isValidES3Identifier.default;
  16310. }
  16311. });
  16312. Object.defineProperty(exports, "isValidIdentifier", {
  16313. enumerable: true,
  16314. get: function get() {
  16315. return _isValidIdentifier.default;
  16316. }
  16317. });
  16318. Object.defineProperty(exports, "isVar", {
  16319. enumerable: true,
  16320. get: function get() {
  16321. return _isVar.default;
  16322. }
  16323. });
  16324. Object.defineProperty(exports, "matchesPattern", {
  16325. enumerable: true,
  16326. get: function get() {
  16327. return _matchesPattern.default;
  16328. }
  16329. });
  16330. Object.defineProperty(exports, "validate", {
  16331. enumerable: true,
  16332. get: function get() {
  16333. return _validate.default;
  16334. }
  16335. });
  16336. Object.defineProperty(exports, "buildMatchMemberExpression", {
  16337. enumerable: true,
  16338. get: function get() {
  16339. return _buildMatchMemberExpression.default;
  16340. }
  16341. });
  16342. exports.react = void 0;
  16343. var _isReactComponent = isReactComponent$1;
  16344. var _isCompatTag = isCompatTag$1;
  16345. var _buildChildren = buildChildren$1;
  16346. var _assertNode = assertNode$1;
  16347. var _generated = generated$2;
  16348. Object.keys(_generated).forEach(function(key) {
  16349. if (key === "default" || key === "__esModule") return;
  16350. if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
  16351. if (key in exports && exports[key] === _generated[key]) return;
  16352. Object.defineProperty(exports, key, {
  16353. enumerable: true,
  16354. get: function get() {
  16355. return _generated[key];
  16356. }
  16357. });
  16358. });
  16359. var _createTypeAnnotationBasedOnTypeof = createTypeAnnotationBasedOnTypeof$1;
  16360. var _createFlowUnionType = createFlowUnionType$1;
  16361. var _createTSUnionType = createTSUnionType$1;
  16362. var _generated2 = generated$3;
  16363. Object.keys(_generated2).forEach(function(key) {
  16364. if (key === "default" || key === "__esModule") return;
  16365. if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
  16366. if (key in exports && exports[key] === _generated2[key]) return;
  16367. Object.defineProperty(exports, key, {
  16368. enumerable: true,
  16369. get: function get() {
  16370. return _generated2[key];
  16371. }
  16372. });
  16373. });
  16374. var _uppercase = uppercase;
  16375. Object.keys(_uppercase).forEach(function(key) {
  16376. if (key === "default" || key === "__esModule") return;
  16377. if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
  16378. if (key in exports && exports[key] === _uppercase[key]) return;
  16379. Object.defineProperty(exports, key, {
  16380. enumerable: true,
  16381. get: function get() {
  16382. return _uppercase[key];
  16383. }
  16384. });
  16385. });
  16386. var _cloneNode = cloneNode$1;
  16387. var _clone = clone$1;
  16388. var _cloneDeep = cloneDeep$1;
  16389. var _cloneDeepWithoutLoc = cloneDeepWithoutLoc$1;
  16390. var _cloneWithoutLoc = cloneWithoutLoc$1;
  16391. var _addComment = addComment$1;
  16392. var _addComments = addComments$1;
  16393. var _inheritInnerComments = inheritInnerComments$1;
  16394. var _inheritLeadingComments = inheritLeadingComments$1;
  16395. var _inheritsComments = inheritsComments$1;
  16396. var _inheritTrailingComments = inheritTrailingComments$1;
  16397. var _removeComments = removeComments$1;
  16398. var _generated3 = generated$1;
  16399. Object.keys(_generated3).forEach(function(key) {
  16400. if (key === "default" || key === "__esModule") return;
  16401. if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
  16402. if (key in exports && exports[key] === _generated3[key]) return;
  16403. Object.defineProperty(exports, key, {
  16404. enumerable: true,
  16405. get: function get() {
  16406. return _generated3[key];
  16407. }
  16408. });
  16409. });
  16410. var _constants = constants;
  16411. Object.keys(_constants).forEach(function(key) {
  16412. if (key === "default" || key === "__esModule") return;
  16413. if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
  16414. if (key in exports && exports[key] === _constants[key]) return;
  16415. Object.defineProperty(exports, key, {
  16416. enumerable: true,
  16417. get: function get() {
  16418. return _constants[key];
  16419. }
  16420. });
  16421. });
  16422. var _ensureBlock = ensureBlock$1;
  16423. var _toBindingIdentifierName = toBindingIdentifierName$1;
  16424. var _toBlock = toBlock$1;
  16425. var _toComputedKey = toComputedKey$1;
  16426. var _toExpression = toExpression$1;
  16427. var _toIdentifier = toIdentifier$1;
  16428. var _toKeyAlias = toKeyAlias$1;
  16429. var _toSequenceExpression = toSequenceExpression$1;
  16430. var _toStatement = toStatement$1;
  16431. var _valueToNode = valueToNode$1;
  16432. var _definitions = requireDefinitions();
  16433. Object.keys(_definitions).forEach(function(key) {
  16434. if (key === "default" || key === "__esModule") return;
  16435. if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
  16436. if (key in exports && exports[key] === _definitions[key]) return;
  16437. Object.defineProperty(exports, key, {
  16438. enumerable: true,
  16439. get: function get() {
  16440. return _definitions[key];
  16441. }
  16442. });
  16443. });
  16444. var _appendToMemberExpression = appendToMemberExpression$1;
  16445. var _inherits = inherits$1;
  16446. var _prependToMemberExpression = prependToMemberExpression$1;
  16447. var _removeProperties = removeProperties$1;
  16448. var _removePropertiesDeep = removePropertiesDeep$1;
  16449. var _removeTypeDuplicates = removeTypeDuplicates$3;
  16450. var _getBindingIdentifiers = getBindingIdentifiers$1;
  16451. var _getOuterBindingIdentifiers = getOuterBindingIdentifiers$1;
  16452. var _traverse = traverse$1;
  16453. Object.keys(_traverse).forEach(function(key) {
  16454. if (key === "default" || key === "__esModule") return;
  16455. if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
  16456. if (key in exports && exports[key] === _traverse[key]) return;
  16457. Object.defineProperty(exports, key, {
  16458. enumerable: true,
  16459. get: function get() {
  16460. return _traverse[key];
  16461. }
  16462. });
  16463. });
  16464. var _traverseFast = traverseFast$1;
  16465. var _shallowEqual = shallowEqual$1;
  16466. var _is = requireIs();
  16467. var _isBinding = isBinding$1;
  16468. var _isBlockScoped = isBlockScoped$1;
  16469. var _isImmutable = isImmutable$1;
  16470. var _isLet = isLet$1;
  16471. var _isNode = isNode$1;
  16472. var _isNodesEquivalent = isNodesEquivalent$1;
  16473. var _isPlaceholderType = requireIsPlaceholderType();
  16474. var _isReferenced = isReferenced$1;
  16475. var _isScope = isScope$1;
  16476. var _isSpecifierDefault = isSpecifierDefault$1;
  16477. var _isType = requireIsType();
  16478. var _isValidES3Identifier = isValidES3Identifier$1;
  16479. var _isValidIdentifier = isValidIdentifier$1;
  16480. var _isVar = isVar$1;
  16481. var _matchesPattern = matchesPattern$1;
  16482. var _validate = requireValidate();
  16483. var _buildMatchMemberExpression = buildMatchMemberExpression$1;
  16484. var _generated4 = generated$4;
  16485. Object.keys(_generated4).forEach(function(key) {
  16486. if (key === "default" || key === "__esModule") return;
  16487. if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
  16488. if (key in exports && exports[key] === _generated4[key]) return;
  16489. Object.defineProperty(exports, key, {
  16490. enumerable: true,
  16491. get: function get() {
  16492. return _generated4[key];
  16493. }
  16494. });
  16495. });
  16496. var _generated5 = generated;
  16497. Object.keys(_generated5).forEach(function(key) {
  16498. if (key === "default" || key === "__esModule") return;
  16499. if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
  16500. if (key in exports && exports[key] === _generated5[key]) return;
  16501. Object.defineProperty(exports, key, {
  16502. enumerable: true,
  16503. get: function get() {
  16504. return _generated5[key];
  16505. }
  16506. });
  16507. });
  16508. var react = {
  16509. isReactComponent: _isReactComponent.default,
  16510. isCompatTag: _isCompatTag.default,
  16511. buildChildren: _buildChildren.default
  16512. };
  16513. exports.react = react;
  16514. })(lib$1);
  16515. function hash(str) {
  16516. var _$hash = 5381, i = str.length;
  16517. while(i){
  16518. _$hash = _$hash * 33 ^ str.charCodeAt(--i);
  16519. }
  16520. /* JavaScript does bitwise operations (like XOR, above) on 32-bit signed
  16521. * integers. Since we want the results to be always positive, convert the
  16522. * signed int to an unsigned by doing an unsigned bitshift. */ return _$hash >>> 0;
  16523. }
  16524. var stringHash = hash;
  16525. var sourceMapGenerator = {};
  16526. var base64Vlq = {};
  16527. var base64$1 = {};
  16528. /*
  16529. * Copyright 2011 Mozilla Foundation and contributors
  16530. * Licensed under the New BSD license. See LICENSE or:
  16531. * http://opensource.org/licenses/BSD-3-Clause
  16532. */ var intToCharMap = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");
  16533. /**
  16534. * Encode an integer in the range of 0 to 63 to a single base 64 digit.
  16535. */ base64$1.encode = function encode(number) {
  16536. if (0 <= number && number < intToCharMap.length) {
  16537. return intToCharMap[number];
  16538. }
  16539. throw new TypeError("Must be between 0 and 63: " + number);
  16540. };
  16541. /*
  16542. * Copyright 2011 Mozilla Foundation and contributors
  16543. * Licensed under the New BSD license. See LICENSE or:
  16544. * http://opensource.org/licenses/BSD-3-Clause
  16545. *
  16546. * Based on the Base 64 VLQ implementation in Closure Compiler:
  16547. * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java
  16548. *
  16549. * Copyright 2011 The Closure Compiler Authors. All rights reserved.
  16550. * Redistribution and use in source and binary forms, with or without
  16551. * modification, are permitted provided that the following conditions are
  16552. * met:
  16553. *
  16554. * * Redistributions of source code must retain the above copyright
  16555. * notice, this list of conditions and the following disclaimer.
  16556. * * Redistributions in binary form must reproduce the above
  16557. * copyright notice, this list of conditions and the following
  16558. * disclaimer in the documentation and/or other materials provided
  16559. * with the distribution.
  16560. * * Neither the name of Google Inc. nor the names of its
  16561. * contributors may be used to endorse or promote products derived
  16562. * from this software without specific prior written permission.
  16563. *
  16564. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  16565. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  16566. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  16567. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  16568. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  16569. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  16570. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  16571. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  16572. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  16573. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  16574. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  16575. */ var base64 = base64$1;
  16576. // A single base 64 digit can contain 6 bits of data. For the base 64 variable
  16577. // length quantities we use in the source map spec, the first bit is the sign,
  16578. // the next four bits are the actual value, and the 6th bit is the
  16579. // continuation bit. The continuation bit tells us whether there are more
  16580. // digits in this value following this digit.
  16581. //
  16582. // Continuation
  16583. // | Sign
  16584. // | |
  16585. // V V
  16586. // 101011
  16587. var VLQ_BASE_SHIFT = 5;
  16588. // binary: 100000
  16589. var VLQ_BASE = 1 << VLQ_BASE_SHIFT;
  16590. // binary: 011111
  16591. var VLQ_BASE_MASK = VLQ_BASE - 1;
  16592. // binary: 100000
  16593. var VLQ_CONTINUATION_BIT = VLQ_BASE;
  16594. /**
  16595. * Converts from a two-complement value to a value where the sign bit is
  16596. * placed in the least significant bit. For example, as decimals:
  16597. * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary)
  16598. * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)
  16599. */ function toVLQSigned(aValue) {
  16600. return aValue < 0 ? (-aValue << 1) + 1 : (aValue << 1) + 0;
  16601. }
  16602. /**
  16603. * Returns the base 64 VLQ encoded value.
  16604. */ base64Vlq.encode = function base64VLQ_encode(aValue) {
  16605. var encoded = "";
  16606. var digit;
  16607. var vlq = toVLQSigned(aValue);
  16608. do {
  16609. digit = vlq & VLQ_BASE_MASK;
  16610. vlq >>>= VLQ_BASE_SHIFT;
  16611. if (vlq > 0) {
  16612. // There are still more digits in this value, so we must make sure the
  16613. // continuation bit is marked.
  16614. digit |= VLQ_CONTINUATION_BIT;
  16615. }
  16616. encoded += base64.encode(digit);
  16617. }while (vlq > 0);
  16618. return encoded;
  16619. };
  16620. var util$3 = {};
  16621. (function(exports) {
  16622. var getArg = /*
  16623. * Copyright 2011 Mozilla Foundation and contributors
  16624. * Licensed under the New BSD license. See LICENSE or:
  16625. * http://opensource.org/licenses/BSD-3-Clause
  16626. */ /**
  16627. * This is a helper function for getting values from parameter/options
  16628. * objects.
  16629. *
  16630. * @param args The object we are extracting values from
  16631. * @param name The name of the property we are getting.
  16632. * @param defaultValue An optional value to return if the property is missing
  16633. * from the object. If this is not specified and the property is missing, an
  16634. * error will be thrown.
  16635. */ function getArg(aArgs, aName, aDefaultValue) {
  16636. if (aName in aArgs) {
  16637. return aArgs[aName];
  16638. } else if (arguments.length === 3) {
  16639. return aDefaultValue;
  16640. }
  16641. throw new Error('"' + aName + '" is a required argument.');
  16642. };
  16643. var urlParse = function urlParse(aUrl) {
  16644. var match = aUrl.match(urlRegexp);
  16645. if (!match) {
  16646. return null;
  16647. }
  16648. return {
  16649. scheme: match[1],
  16650. auth: match[2],
  16651. host: match[3],
  16652. port: match[4],
  16653. path: match[5]
  16654. };
  16655. };
  16656. var urlGenerate = function urlGenerate(aParsedUrl) {
  16657. var url = "";
  16658. if (aParsedUrl.scheme) {
  16659. url += aParsedUrl.scheme + ":";
  16660. }
  16661. url += "//";
  16662. if (aParsedUrl.auth) {
  16663. url += aParsedUrl.auth + "@";
  16664. }
  16665. if (aParsedUrl.host) {
  16666. url += aParsedUrl.host;
  16667. }
  16668. if (aParsedUrl.port) {
  16669. url += ":" + aParsedUrl.port;
  16670. }
  16671. if (aParsedUrl.path) {
  16672. url += aParsedUrl.path;
  16673. }
  16674. return url;
  16675. };
  16676. var lruMemoize = /**
  16677. * Takes some function `f(input) -> result` and returns a memoized version of
  16678. * `f`.
  16679. *
  16680. * We keep at most `MAX_CACHED_INPUTS` memoized results of `f` alive. The
  16681. * memoization is a dumb-simple, linear least-recently-used cache.
  16682. */ function lruMemoize(f) {
  16683. var cache = [];
  16684. return function(input) {
  16685. for(var i = 0; i < cache.length; i++){
  16686. if (cache[i].input === input) {
  16687. var temp = cache[0];
  16688. cache[0] = cache[i];
  16689. cache[i] = temp;
  16690. return cache[0].result;
  16691. }
  16692. }
  16693. var result = f(input);
  16694. cache.unshift({
  16695. input: input,
  16696. result: result
  16697. });
  16698. if (cache.length > MAX_CACHED_INPUTS) {
  16699. cache.pop();
  16700. }
  16701. return result;
  16702. };
  16703. };
  16704. var join = /**
  16705. * Joins two paths/URLs.
  16706. *
  16707. * @param aRoot The root path or URL.
  16708. * @param aPath The path or URL to be joined with the root.
  16709. *
  16710. * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a
  16711. * scheme-relative URL: Then the scheme of aRoot, if any, is prepended
  16712. * first.
  16713. * - Otherwise aPath is a path. If aRoot is a URL, then its path portion
  16714. * is updated with the result and aRoot is returned. Otherwise the result
  16715. * is returned.
  16716. * - If aPath is absolute, the result is aPath.
  16717. * - Otherwise the two paths are joined with a slash.
  16718. * - Joining for example 'http://' and 'www.example.com' is also supported.
  16719. */ function join(aRoot, aPath) {
  16720. if (aRoot === "") {
  16721. aRoot = ".";
  16722. }
  16723. if (aPath === "") {
  16724. aPath = ".";
  16725. }
  16726. var aPathUrl = urlParse(aPath);
  16727. var aRootUrl = urlParse(aRoot);
  16728. if (aRootUrl) {
  16729. aRoot = aRootUrl.path || "/";
  16730. }
  16731. // `join(foo, '//www.example.org')`
  16732. if (aPathUrl && !aPathUrl.scheme) {
  16733. if (aRootUrl) {
  16734. aPathUrl.scheme = aRootUrl.scheme;
  16735. }
  16736. return urlGenerate(aPathUrl);
  16737. }
  16738. if (aPathUrl || aPath.match(dataUrlRegexp)) {
  16739. return aPath;
  16740. }
  16741. // `join('http://', 'www.example.com')`
  16742. if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {
  16743. aRootUrl.host = aPath;
  16744. return urlGenerate(aRootUrl);
  16745. }
  16746. var joined = aPath.charAt(0) === "/" ? aPath : normalize(aRoot.replace(/\/+$/, "") + "/" + aPath);
  16747. if (aRootUrl) {
  16748. aRootUrl.path = joined;
  16749. return urlGenerate(aRootUrl);
  16750. }
  16751. return joined;
  16752. };
  16753. var relative = /**
  16754. * Make a path relative to a URL or another path.
  16755. *
  16756. * @param aRoot The root path or URL.
  16757. * @param aPath The path or URL to be made relative to aRoot.
  16758. */ function relative(aRoot, aPath) {
  16759. if (aRoot === "") {
  16760. aRoot = ".";
  16761. }
  16762. aRoot = aRoot.replace(/\/$/, "");
  16763. // It is possible for the path to be above the root. In this case, simply
  16764. // checking whether the root is a prefix of the path won't work. Instead, we
  16765. // need to remove components from the root one by one, until either we find
  16766. // a prefix that fits, or we run out of components to remove.
  16767. var level = 0;
  16768. while(aPath.indexOf(aRoot + "/") !== 0){
  16769. var index = aRoot.lastIndexOf("/");
  16770. if (index < 0) {
  16771. return aPath;
  16772. }
  16773. // If the only part of the root that is left is the scheme (i.e. http://,
  16774. // file:///, etc.), one or more slashes (/), or simply nothing at all, we
  16775. // have exhausted all components, so the path is not relative to the root.
  16776. aRoot = aRoot.slice(0, index);
  16777. if (aRoot.match(/^([^\/]+:\/)?\/*$/)) {
  16778. return aPath;
  16779. }
  16780. ++level;
  16781. }
  16782. // Make sure we add a "../" for each component we removed from the root.
  16783. return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1);
  16784. };
  16785. var identity = function identity(s) {
  16786. return s;
  16787. };
  16788. var toSetString = /**
  16789. * Because behavior goes wacky when you set `__proto__` on objects, we
  16790. * have to prefix all the strings in our set with an arbitrary character.
  16791. *
  16792. * See https://github.com/mozilla/source-map/pull/31 and
  16793. * https://github.com/mozilla/source-map/issues/30
  16794. *
  16795. * @param String aStr
  16796. */ function toSetString(aStr) {
  16797. if (isProtoString(aStr)) {
  16798. return "$" + aStr;
  16799. }
  16800. return aStr;
  16801. };
  16802. var fromSetString = function fromSetString(aStr) {
  16803. if (isProtoString(aStr)) {
  16804. return aStr.slice(1);
  16805. }
  16806. return aStr;
  16807. };
  16808. var isProtoString = function isProtoString(s) {
  16809. if (!s) {
  16810. return false;
  16811. }
  16812. var length = s.length;
  16813. if (length < 9 /* "__proto__".length */ ) {
  16814. return false;
  16815. }
  16816. /* eslint-disable no-multi-spaces */ 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 /* '_' */ ) {
  16817. return false;
  16818. }
  16819. /* eslint-enable no-multi-spaces */ for(var i = length - 10; i >= 0; i--){
  16820. if (s.charCodeAt(i) !== 36 /* '$' */ ) {
  16821. return false;
  16822. }
  16823. }
  16824. return true;
  16825. };
  16826. var compareByOriginalPositions = /**
  16827. * Comparator between two mappings where the original positions are compared.
  16828. *
  16829. * Optionally pass in `true` as `onlyCompareGenerated` to consider two
  16830. * mappings with the same original source/line/column, but different generated
  16831. * line and column the same. Useful when searching for a mapping with a
  16832. * stubbed out mapping.
  16833. */ function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {
  16834. var cmp = strcmp(mappingA.source, mappingB.source);
  16835. if (cmp !== 0) {
  16836. return cmp;
  16837. }
  16838. cmp = mappingA.originalLine - mappingB.originalLine;
  16839. if (cmp !== 0) {
  16840. return cmp;
  16841. }
  16842. cmp = mappingA.originalColumn - mappingB.originalColumn;
  16843. if (cmp !== 0 || onlyCompareOriginal) {
  16844. return cmp;
  16845. }
  16846. cmp = mappingA.generatedColumn - mappingB.generatedColumn;
  16847. if (cmp !== 0) {
  16848. return cmp;
  16849. }
  16850. cmp = mappingA.generatedLine - mappingB.generatedLine;
  16851. if (cmp !== 0) {
  16852. return cmp;
  16853. }
  16854. return strcmp(mappingA.name, mappingB.name);
  16855. };
  16856. var compareByGeneratedPositionsDeflated = /**
  16857. * Comparator between two mappings with deflated source and name indices where
  16858. * the generated positions are compared.
  16859. *
  16860. * Optionally pass in `true` as `onlyCompareGenerated` to consider two
  16861. * mappings with the same generated line and column, but different
  16862. * source/name/original line and column the same. Useful when searching for a
  16863. * mapping with a stubbed out mapping.
  16864. */ function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {
  16865. var cmp = mappingA.generatedLine - mappingB.generatedLine;
  16866. if (cmp !== 0) {
  16867. return cmp;
  16868. }
  16869. cmp = mappingA.generatedColumn - mappingB.generatedColumn;
  16870. if (cmp !== 0 || onlyCompareGenerated) {
  16871. return cmp;
  16872. }
  16873. cmp = strcmp(mappingA.source, mappingB.source);
  16874. if (cmp !== 0) {
  16875. return cmp;
  16876. }
  16877. cmp = mappingA.originalLine - mappingB.originalLine;
  16878. if (cmp !== 0) {
  16879. return cmp;
  16880. }
  16881. cmp = mappingA.originalColumn - mappingB.originalColumn;
  16882. if (cmp !== 0) {
  16883. return cmp;
  16884. }
  16885. return strcmp(mappingA.name, mappingB.name);
  16886. };
  16887. var strcmp = function strcmp(aStr1, aStr2) {
  16888. if (aStr1 === aStr2) {
  16889. return 0;
  16890. }
  16891. if (aStr1 === null) {
  16892. return 1; // aStr2 !== null
  16893. }
  16894. if (aStr2 === null) {
  16895. return -1; // aStr1 !== null
  16896. }
  16897. if (aStr1 > aStr2) {
  16898. return 1;
  16899. }
  16900. return -1;
  16901. };
  16902. var compareByGeneratedPositionsInflated = /**
  16903. * Comparator between two mappings with inflated source and name strings where
  16904. * the generated positions are compared.
  16905. */ function compareByGeneratedPositionsInflated(mappingA, mappingB) {
  16906. var cmp = mappingA.generatedLine - mappingB.generatedLine;
  16907. if (cmp !== 0) {
  16908. return cmp;
  16909. }
  16910. cmp = mappingA.generatedColumn - mappingB.generatedColumn;
  16911. if (cmp !== 0) {
  16912. return cmp;
  16913. }
  16914. cmp = strcmp(mappingA.source, mappingB.source);
  16915. if (cmp !== 0) {
  16916. return cmp;
  16917. }
  16918. cmp = mappingA.originalLine - mappingB.originalLine;
  16919. if (cmp !== 0) {
  16920. return cmp;
  16921. }
  16922. cmp = mappingA.originalColumn - mappingB.originalColumn;
  16923. if (cmp !== 0) {
  16924. return cmp;
  16925. }
  16926. return strcmp(mappingA.name, mappingB.name);
  16927. };
  16928. var parseSourceMapInput = /**
  16929. * Strip any JSON XSSI avoidance prefix from the string (as documented
  16930. * in the source maps specification), and then parse the string as
  16931. * JSON.
  16932. */ function parseSourceMapInput(str) {
  16933. return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, ""));
  16934. };
  16935. var computeSourceURL = /**
  16936. * Compute the URL of a source given the the source root, the source's
  16937. * URL, and the source map's URL.
  16938. */ function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) {
  16939. sourceURL = sourceURL || "";
  16940. if (sourceRoot) {
  16941. // This follows what Chrome does.
  16942. if (sourceRoot[sourceRoot.length - 1] !== "/" && sourceURL[0] !== "/") {
  16943. sourceRoot += "/";
  16944. }
  16945. // The spec says:
  16946. // Line 4: An optional source root, useful for relocating source
  16947. // files on a server or removing repeated values in the
  16948. // “sources” entry. This value is prepended to the individual
  16949. // entries in the “source” field.
  16950. sourceURL = sourceRoot + sourceURL;
  16951. }
  16952. // Historically, SourceMapConsumer did not take the sourceMapURL as
  16953. // a parameter. This mode is still somewhat supported, which is why
  16954. // this code block is conditional. However, it's preferable to pass
  16955. // the source map URL to SourceMapConsumer, so that this function
  16956. // can implement the source URL resolution algorithm as outlined in
  16957. // the spec. This block is basically the equivalent of:
  16958. // new URL(sourceURL, sourceMapURL).toString()
  16959. // ... except it avoids using URL, which wasn't available in the
  16960. // older releases of node still supported by this library.
  16961. //
  16962. // The spec says:
  16963. // If the sources are not absolute URLs after prepending of the
  16964. // “sourceRoot”, the sources are resolved relative to the
  16965. // SourceMap (like resolving script src in a html document).
  16966. if (sourceMapURL) {
  16967. var parsed = urlParse(sourceMapURL);
  16968. if (!parsed) {
  16969. throw new Error("sourceMapURL could not be parsed");
  16970. }
  16971. if (parsed.path) {
  16972. // Strip the last path component, but keep the "/".
  16973. var index = parsed.path.lastIndexOf("/");
  16974. if (index >= 0) {
  16975. parsed.path = parsed.path.substring(0, index + 1);
  16976. }
  16977. }
  16978. sourceURL = join(urlGenerate(parsed), sourceURL);
  16979. }
  16980. return normalize(sourceURL);
  16981. };
  16982. exports.getArg = getArg;
  16983. var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/;
  16984. var dataUrlRegexp = /^data:.+\,.+$/;
  16985. exports.urlParse = urlParse;
  16986. exports.urlGenerate = urlGenerate;
  16987. var MAX_CACHED_INPUTS = 32;
  16988. /**
  16989. * Normalizes a path, or the path portion of a URL:
  16990. *
  16991. * - Replaces consecutive slashes with one slash.
  16992. * - Removes unnecessary '.' parts.
  16993. * - Removes unnecessary '<dir>/..' parts.
  16994. *
  16995. * Based on code in the Node.js 'path' core module.
  16996. *
  16997. * @param aPath The path or url to normalize.
  16998. */ var normalize = lruMemoize(function normalize(aPath) {
  16999. var path = aPath;
  17000. var url = urlParse(aPath);
  17001. if (url) {
  17002. if (!url.path) {
  17003. return aPath;
  17004. }
  17005. path = url.path;
  17006. }
  17007. var isAbsolute = exports.isAbsolute(path);
  17008. // Split the path into parts between `/` characters. This is much faster than
  17009. // using `.split(/\/+/g)`.
  17010. var parts = [];
  17011. var start = 0;
  17012. var i = 0;
  17013. while(true){
  17014. start = i;
  17015. i = path.indexOf("/", start);
  17016. if (i === -1) {
  17017. parts.push(path.slice(start));
  17018. break;
  17019. } else {
  17020. parts.push(path.slice(start, i));
  17021. while(i < path.length && path[i] === "/"){
  17022. i++;
  17023. }
  17024. }
  17025. }
  17026. var up = 0;
  17027. for(i = parts.length - 1; i >= 0; i--){
  17028. var part = parts[i];
  17029. if (part === ".") {
  17030. parts.splice(i, 1);
  17031. } else if (part === "..") {
  17032. up++;
  17033. } else if (up > 0) {
  17034. if (part === "") {
  17035. // The first part is blank if the path is absolute. Trying to go
  17036. // above the root is a no-op. Therefore we can remove all '..' parts
  17037. // directly after the root.
  17038. parts.splice(i + 1, up);
  17039. up = 0;
  17040. } else {
  17041. parts.splice(i, 2);
  17042. up--;
  17043. }
  17044. }
  17045. }
  17046. path = parts.join("/");
  17047. if (path === "") {
  17048. path = isAbsolute ? "/" : ".";
  17049. }
  17050. if (url) {
  17051. url.path = path;
  17052. return urlGenerate(url);
  17053. }
  17054. return path;
  17055. });
  17056. exports.normalize = normalize;
  17057. exports.join = join;
  17058. exports.isAbsolute = function(aPath) {
  17059. return aPath.charAt(0) === "/" || urlRegexp.test(aPath);
  17060. };
  17061. exports.relative = relative;
  17062. var supportsNullProto = function() {
  17063. var obj = Object.create(null);
  17064. return !("__proto__" in obj);
  17065. }();
  17066. exports.toSetString = supportsNullProto ? identity : toSetString;
  17067. exports.fromSetString = supportsNullProto ? identity : fromSetString;
  17068. exports.compareByOriginalPositions = compareByOriginalPositions;
  17069. exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;
  17070. exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;
  17071. exports.parseSourceMapInput = parseSourceMapInput;
  17072. exports.computeSourceURL = computeSourceURL;
  17073. })(util$3);
  17074. var arraySet = {};
  17075. /*
  17076. * Copyright 2011 Mozilla Foundation and contributors
  17077. * Licensed under the New BSD license. See LICENSE or:
  17078. * http://opensource.org/licenses/BSD-3-Clause
  17079. */ /**
  17080. * A data structure which is a combination of an array and a set. Adding a new
  17081. * member is O(1), testing for membership is O(1), and finding the index of an
  17082. * element is O(1). Removing elements from the set is not supported. Only
  17083. * strings are supported for membership.
  17084. */ var ArraySet$2 = /*#__PURE__*/ function() {
  17085. function ArraySet() {
  17086. this._array = [];
  17087. this._set = new Map();
  17088. }
  17089. var _proto = ArraySet.prototype;
  17090. /**
  17091. * Return how many unique items are in this ArraySet. If duplicates have been
  17092. * added, than those do not count towards the size.
  17093. *
  17094. * @returns Number
  17095. */ _proto.size = function size() {
  17096. return this._set.size;
  17097. };
  17098. /**
  17099. * Add the given string to this set.
  17100. *
  17101. * @param String aStr
  17102. */ _proto.add = function add(aStr, aAllowDuplicates) {
  17103. var isDuplicate = this.has(aStr);
  17104. var idx = this._array.length;
  17105. if (!isDuplicate || aAllowDuplicates) {
  17106. this._array.push(aStr);
  17107. }
  17108. if (!isDuplicate) {
  17109. this._set.set(aStr, idx);
  17110. }
  17111. };
  17112. /**
  17113. * Is the given string a member of this set?
  17114. *
  17115. * @param String aStr
  17116. */ _proto.has = function has(aStr) {
  17117. return this._set.has(aStr);
  17118. };
  17119. /**
  17120. * What is the index of the given string in the array?
  17121. *
  17122. * @param String aStr
  17123. */ _proto.indexOf = function indexOf(aStr) {
  17124. var idx = this._set.get(aStr);
  17125. if (idx >= 0) {
  17126. return idx;
  17127. }
  17128. throw new Error('"' + aStr + '" is not in the set.');
  17129. };
  17130. /**
  17131. * What is the element at the given index?
  17132. *
  17133. * @param Number aIdx
  17134. */ _proto.at = function at(aIdx) {
  17135. if (aIdx >= 0 && aIdx < this._array.length) {
  17136. return this._array[aIdx];
  17137. }
  17138. throw new Error("No element indexed by " + aIdx);
  17139. };
  17140. /**
  17141. * Returns the array representation of this set (which has the proper indices
  17142. * indicated by indexOf). Note that this is a copy of the internal array used
  17143. * for storing the members so that no one can mess with internal state.
  17144. */ _proto.toArray = function toArray() {
  17145. return this._array.slice();
  17146. };
  17147. /**
  17148. * Static method for creating ArraySet instances from an existing array.
  17149. */ ArraySet.fromArray = function fromArray(aArray, aAllowDuplicates) {
  17150. var set = new ArraySet();
  17151. for(var i = 0, len = aArray.length; i < len; i++){
  17152. set.add(aArray[i], aAllowDuplicates);
  17153. }
  17154. return set;
  17155. };
  17156. return ArraySet;
  17157. }();
  17158. arraySet.ArraySet = ArraySet$2;
  17159. var mappingList = {};
  17160. /*
  17161. * Copyright 2014 Mozilla Foundation and contributors
  17162. * Licensed under the New BSD license. See LICENSE or:
  17163. * http://opensource.org/licenses/BSD-3-Clause
  17164. */ var util$2 = util$3;
  17165. /**
  17166. * Determine whether mappingB is after mappingA with respect to generated
  17167. * position.
  17168. */ function generatedPositionAfter(mappingA, mappingB) {
  17169. // Optimized for most common case
  17170. var lineA = mappingA.generatedLine;
  17171. var lineB = mappingB.generatedLine;
  17172. var columnA = mappingA.generatedColumn;
  17173. var columnB = mappingB.generatedColumn;
  17174. return lineB > lineA || lineB == lineA && columnB >= columnA || util$2.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;
  17175. }
  17176. /**
  17177. * A data structure to provide a sorted view of accumulated mappings in a
  17178. * performance conscious manner. It trades a negligible overhead in general
  17179. * case for a large speedup in case of mappings being added in order.
  17180. */ var MappingList$1 = /*#__PURE__*/ function() {
  17181. function MappingList() {
  17182. this._array = [];
  17183. this._sorted = true;
  17184. // Serves as infimum
  17185. this._last = {
  17186. generatedLine: -1,
  17187. generatedColumn: 0
  17188. };
  17189. }
  17190. var _proto = MappingList.prototype;
  17191. /**
  17192. * Iterate through internal items. This method takes the same arguments that
  17193. * `Array.prototype.forEach` takes.
  17194. *
  17195. * NOTE: The order of the mappings is NOT guaranteed.
  17196. */ _proto.unsortedForEach = function unsortedForEach(aCallback, aThisArg) {
  17197. this._array.forEach(aCallback, aThisArg);
  17198. };
  17199. /**
  17200. * Add the given source mapping.
  17201. *
  17202. * @param Object aMapping
  17203. */ _proto.add = function add(aMapping) {
  17204. if (generatedPositionAfter(this._last, aMapping)) {
  17205. this._last = aMapping;
  17206. this._array.push(aMapping);
  17207. } else {
  17208. this._sorted = false;
  17209. this._array.push(aMapping);
  17210. }
  17211. };
  17212. /**
  17213. * Returns the flat, sorted array of mappings. The mappings are sorted by
  17214. * generated position.
  17215. *
  17216. * WARNING: This method returns internal data without copying, for
  17217. * performance. The return value must NOT be mutated, and should be treated as
  17218. * an immutable borrow. If you want to take ownership, you must make your own
  17219. * copy.
  17220. */ _proto.toArray = function toArray() {
  17221. if (!this._sorted) {
  17222. this._array.sort(util$2.compareByGeneratedPositionsInflated);
  17223. this._sorted = true;
  17224. }
  17225. return this._array;
  17226. };
  17227. return MappingList;
  17228. }();
  17229. mappingList.MappingList = MappingList$1;
  17230. /*
  17231. * Copyright 2011 Mozilla Foundation and contributors
  17232. * Licensed under the New BSD license. See LICENSE or:
  17233. * http://opensource.org/licenses/BSD-3-Clause
  17234. */ var base64VLQ = base64Vlq;
  17235. var util$1 = util$3;
  17236. var ArraySet$1 = arraySet.ArraySet;
  17237. var MappingList = mappingList.MappingList;
  17238. /**
  17239. * An instance of the SourceMapGenerator represents a source map which is
  17240. * being built incrementally. You may pass an object with the following
  17241. * properties:
  17242. *
  17243. * - file: The filename of the generated source.
  17244. * - sourceRoot: A root for all relative URLs in this source map.
  17245. */ var SourceMapGenerator$1 = /*#__PURE__*/ function() {
  17246. function SourceMapGenerator(aArgs) {
  17247. if (!aArgs) {
  17248. aArgs = {};
  17249. }
  17250. this._file = util$1.getArg(aArgs, "file", null);
  17251. this._sourceRoot = util$1.getArg(aArgs, "sourceRoot", null);
  17252. this._skipValidation = util$1.getArg(aArgs, "skipValidation", false);
  17253. this._sources = new ArraySet$1();
  17254. this._names = new ArraySet$1();
  17255. this._mappings = new MappingList();
  17256. this._sourcesContents = null;
  17257. }
  17258. var _proto = SourceMapGenerator.prototype;
  17259. /**
  17260. * Add a single mapping from original source line and column to the generated
  17261. * source's line and column for this source map being created. The mapping
  17262. * object should have the following properties:
  17263. *
  17264. * - generated: An object with the generated line and column positions.
  17265. * - original: An object with the original line and column positions.
  17266. * - source: The original source file (relative to the sourceRoot).
  17267. * - name: An optional original token name for this mapping.
  17268. */ _proto.addMapping = function addMapping(aArgs) {
  17269. var generated = util$1.getArg(aArgs, "generated");
  17270. var original = util$1.getArg(aArgs, "original", null);
  17271. var source = util$1.getArg(aArgs, "source", null);
  17272. var name = util$1.getArg(aArgs, "name", null);
  17273. if (!this._skipValidation) {
  17274. this._validateMapping(generated, original, source, name);
  17275. }
  17276. if (source != null) {
  17277. source = String(source);
  17278. if (!this._sources.has(source)) {
  17279. this._sources.add(source);
  17280. }
  17281. }
  17282. if (name != null) {
  17283. name = String(name);
  17284. if (!this._names.has(name)) {
  17285. this._names.add(name);
  17286. }
  17287. }
  17288. this._mappings.add({
  17289. generatedLine: generated.line,
  17290. generatedColumn: generated.column,
  17291. originalLine: original != null && original.line,
  17292. originalColumn: original != null && original.column,
  17293. source: source,
  17294. name: name
  17295. });
  17296. };
  17297. /**
  17298. * Set the source content for a source file.
  17299. */ _proto.setSourceContent = function setSourceContent(aSourceFile, aSourceContent) {
  17300. var source = aSourceFile;
  17301. if (this._sourceRoot != null) {
  17302. source = util$1.relative(this._sourceRoot, source);
  17303. }
  17304. if (aSourceContent != null) {
  17305. // Add the source content to the _sourcesContents map.
  17306. // Create a new _sourcesContents map if the property is null.
  17307. if (!this._sourcesContents) {
  17308. this._sourcesContents = Object.create(null);
  17309. }
  17310. this._sourcesContents[util$1.toSetString(source)] = aSourceContent;
  17311. } else if (this._sourcesContents) {
  17312. // Remove the source file from the _sourcesContents map.
  17313. // If the _sourcesContents map is empty, set the property to null.
  17314. delete this._sourcesContents[util$1.toSetString(source)];
  17315. if (Object.keys(this._sourcesContents).length === 0) {
  17316. this._sourcesContents = null;
  17317. }
  17318. }
  17319. };
  17320. /**
  17321. * Applies the mappings of a sub-source-map for a specific source file to the
  17322. * source map being generated. Each mapping to the supplied source file is
  17323. * rewritten using the supplied source map. Note: The resolution for the
  17324. * resulting mappings is the minimium of this map and the supplied map.
  17325. *
  17326. * @param aSourceMapConsumer The source map to be applied.
  17327. * @param aSourceFile Optional. The filename of the source file.
  17328. * If omitted, SourceMapConsumer's file property will be used.
  17329. * @param aSourceMapPath Optional. The dirname of the path to the source map
  17330. * to be applied. If relative, it is relative to the SourceMapConsumer.
  17331. * This parameter is needed when the two source maps aren't in the same
  17332. * directory, and the source map to be applied contains relative source
  17333. * paths. If so, those relative source paths need to be rewritten
  17334. * relative to the SourceMapGenerator.
  17335. */ _proto.applySourceMap = function applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {
  17336. var sourceFile = aSourceFile;
  17337. // If aSourceFile is omitted, we will use the file property of the SourceMap
  17338. if (aSourceFile == null) {
  17339. if (aSourceMapConsumer.file == null) {
  17340. throw new Error("SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, " + 'or the source map\'s "file" property. Both were omitted.');
  17341. }
  17342. sourceFile = aSourceMapConsumer.file;
  17343. }
  17344. var sourceRoot = this._sourceRoot;
  17345. // Make "sourceFile" relative if an absolute Url is passed.
  17346. if (sourceRoot != null) {
  17347. sourceFile = util$1.relative(sourceRoot, sourceFile);
  17348. }
  17349. // Applying the SourceMap can add and remove items from the sources and
  17350. // the names array.
  17351. var newSources = this._mappings.toArray().length > 0 ? new ArraySet$1() : this._sources;
  17352. var newNames = new ArraySet$1();
  17353. // Find mappings for the "sourceFile"
  17354. this._mappings.unsortedForEach(function(mapping) {
  17355. if (mapping.source === sourceFile && mapping.originalLine != null) {
  17356. // Check if it can be mapped by the source map, then update the mapping.
  17357. var original = aSourceMapConsumer.originalPositionFor({
  17358. line: mapping.originalLine,
  17359. column: mapping.originalColumn
  17360. });
  17361. if (original.source != null) {
  17362. // Copy mapping
  17363. mapping.source = original.source;
  17364. if (aSourceMapPath != null) {
  17365. mapping.source = util$1.join(aSourceMapPath, mapping.source);
  17366. }
  17367. if (sourceRoot != null) {
  17368. mapping.source = util$1.relative(sourceRoot, mapping.source);
  17369. }
  17370. mapping.originalLine = original.line;
  17371. mapping.originalColumn = original.column;
  17372. if (original.name != null) {
  17373. mapping.name = original.name;
  17374. }
  17375. }
  17376. }
  17377. var source = mapping.source;
  17378. if (source != null && !newSources.has(source)) {
  17379. newSources.add(source);
  17380. }
  17381. var name = mapping.name;
  17382. if (name != null && !newNames.has(name)) {
  17383. newNames.add(name);
  17384. }
  17385. }, this);
  17386. this._sources = newSources;
  17387. this._names = newNames;
  17388. // Copy sourcesContents of applied map.
  17389. aSourceMapConsumer.sources.forEach(function(srcFile) {
  17390. var content = aSourceMapConsumer.sourceContentFor(srcFile);
  17391. if (content != null) {
  17392. if (aSourceMapPath != null) {
  17393. srcFile = util$1.join(aSourceMapPath, srcFile);
  17394. }
  17395. if (sourceRoot != null) {
  17396. srcFile = util$1.relative(sourceRoot, srcFile);
  17397. }
  17398. this.setSourceContent(srcFile, content);
  17399. }
  17400. }, this);
  17401. };
  17402. /**
  17403. * A mapping can have one of the three levels of data:
  17404. *
  17405. * 1. Just the generated position.
  17406. * 2. The Generated position, original position, and original source.
  17407. * 3. Generated and original position, original source, as well as a name
  17408. * token.
  17409. *
  17410. * To maintain consistency, we validate that any new mapping being added falls
  17411. * in to one of these categories.
  17412. */ _proto._validateMapping = function _validateMapping(aGenerated, aOriginal, aSource, aName) {
  17413. // When aOriginal is truthy but has empty values for .line and .column,
  17414. // it is most likely a programmer error. In this case we throw a very
  17415. // specific error message to try to guide them the right way.
  17416. // For example: https://github.com/Polymer/polymer-bundler/pull/519
  17417. if (aOriginal && typeof aOriginal.line !== "number" && typeof aOriginal.column !== "number") {
  17418. throw new Error("original.line and original.column are not numbers -- you probably meant to omit " + "the original mapping entirely and only map the generated position. If so, pass " + "null for the original mapping instead of an object with empty or null values.");
  17419. }
  17420. if (aGenerated && "line" in aGenerated && "column" in aGenerated && aGenerated.line > 0 && aGenerated.column >= 0 && !aOriginal && !aSource && !aName) ; 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) ; else {
  17421. throw new Error("Invalid mapping: " + JSON.stringify({
  17422. generated: aGenerated,
  17423. source: aSource,
  17424. original: aOriginal,
  17425. name: aName
  17426. }));
  17427. }
  17428. };
  17429. /**
  17430. * Serialize the accumulated mappings in to the stream of base 64 VLQs
  17431. * specified by the source map format.
  17432. */ _proto._serializeMappings = function _serializeMappings() {
  17433. var previousGeneratedColumn = 0;
  17434. var previousGeneratedLine = 1;
  17435. var previousOriginalColumn = 0;
  17436. var previousOriginalLine = 0;
  17437. var previousName = 0;
  17438. var previousSource = 0;
  17439. var result = "";
  17440. var next;
  17441. var mapping;
  17442. var nameIdx;
  17443. var sourceIdx;
  17444. var mappings = this._mappings.toArray();
  17445. for(var i = 0, len = mappings.length; i < len; i++){
  17446. mapping = mappings[i];
  17447. next = "";
  17448. if (mapping.generatedLine !== previousGeneratedLine) {
  17449. previousGeneratedColumn = 0;
  17450. while(mapping.generatedLine !== previousGeneratedLine){
  17451. next += ";";
  17452. previousGeneratedLine++;
  17453. }
  17454. } else if (i > 0) {
  17455. if (!util$1.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) {
  17456. continue;
  17457. }
  17458. next += ",";
  17459. }
  17460. next += base64VLQ.encode(mapping.generatedColumn - previousGeneratedColumn);
  17461. previousGeneratedColumn = mapping.generatedColumn;
  17462. if (mapping.source != null) {
  17463. sourceIdx = this._sources.indexOf(mapping.source);
  17464. next += base64VLQ.encode(sourceIdx - previousSource);
  17465. previousSource = sourceIdx;
  17466. // lines are stored 0-based in SourceMap spec version 3
  17467. next += base64VLQ.encode(mapping.originalLine - 1 - previousOriginalLine);
  17468. previousOriginalLine = mapping.originalLine - 1;
  17469. next += base64VLQ.encode(mapping.originalColumn - previousOriginalColumn);
  17470. previousOriginalColumn = mapping.originalColumn;
  17471. if (mapping.name != null) {
  17472. nameIdx = this._names.indexOf(mapping.name);
  17473. next += base64VLQ.encode(nameIdx - previousName);
  17474. previousName = nameIdx;
  17475. }
  17476. }
  17477. result += next;
  17478. }
  17479. return result;
  17480. };
  17481. _proto._generateSourcesContent = function _generateSourcesContent(aSources, aSourceRoot) {
  17482. return aSources.map(function(source) {
  17483. if (!this._sourcesContents) {
  17484. return null;
  17485. }
  17486. if (aSourceRoot != null) {
  17487. source = util$1.relative(aSourceRoot, source);
  17488. }
  17489. var key = util$1.toSetString(source);
  17490. return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) ? this._sourcesContents[key] : null;
  17491. }, this);
  17492. };
  17493. /**
  17494. * Externalize the source map.
  17495. */ _proto.toJSON = function toJSON() {
  17496. var map = {
  17497. version: this._version,
  17498. sources: this._sources.toArray(),
  17499. names: this._names.toArray(),
  17500. mappings: this._serializeMappings()
  17501. };
  17502. if (this._file != null) {
  17503. map.file = this._file;
  17504. }
  17505. if (this._sourceRoot != null) {
  17506. map.sourceRoot = this._sourceRoot;
  17507. }
  17508. if (this._sourcesContents) {
  17509. map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);
  17510. }
  17511. return map;
  17512. };
  17513. /**
  17514. * Render the source map being generated to a string.
  17515. */ _proto.toString = function toString() {
  17516. return JSON.stringify(this.toJSON());
  17517. };
  17518. /**
  17519. * Creates a new SourceMapGenerator based on a SourceMapConsumer
  17520. *
  17521. * @param aSourceMapConsumer The SourceMap.
  17522. */ SourceMapGenerator.fromSourceMap = function fromSourceMap(aSourceMapConsumer) {
  17523. var sourceRoot = aSourceMapConsumer.sourceRoot;
  17524. var generator = new SourceMapGenerator({
  17525. file: aSourceMapConsumer.file,
  17526. sourceRoot: sourceRoot
  17527. });
  17528. aSourceMapConsumer.eachMapping(function(mapping) {
  17529. var newMapping = {
  17530. generated: {
  17531. line: mapping.generatedLine,
  17532. column: mapping.generatedColumn
  17533. }
  17534. };
  17535. if (mapping.source != null) {
  17536. newMapping.source = mapping.source;
  17537. if (sourceRoot != null) {
  17538. newMapping.source = util$1.relative(sourceRoot, newMapping.source);
  17539. }
  17540. newMapping.original = {
  17541. line: mapping.originalLine,
  17542. column: mapping.originalColumn
  17543. };
  17544. if (mapping.name != null) {
  17545. newMapping.name = mapping.name;
  17546. }
  17547. }
  17548. generator.addMapping(newMapping);
  17549. });
  17550. aSourceMapConsumer.sources.forEach(function(sourceFile) {
  17551. var sourceRelative = sourceFile;
  17552. if (sourceRoot !== null) {
  17553. sourceRelative = util$1.relative(sourceRoot, sourceFile);
  17554. }
  17555. if (!generator._sources.has(sourceRelative)) {
  17556. generator._sources.add(sourceRelative);
  17557. }
  17558. var content = aSourceMapConsumer.sourceContentFor(sourceFile);
  17559. if (content != null) {
  17560. generator.setSourceContent(sourceFile, content);
  17561. }
  17562. });
  17563. return generator;
  17564. };
  17565. return SourceMapGenerator;
  17566. }();
  17567. SourceMapGenerator$1.prototype._version = 3;
  17568. sourceMapGenerator.SourceMapGenerator = SourceMapGenerator$1;
  17569. var binarySearch$1 = {};
  17570. (function(exports) {
  17571. /*
  17572. * Copyright 2011 Mozilla Foundation and contributors
  17573. * Licensed under the New BSD license. See LICENSE or:
  17574. * http://opensource.org/licenses/BSD-3-Clause
  17575. */ exports.GREATEST_LOWER_BOUND = 1;
  17576. exports.LEAST_UPPER_BOUND = 2;
  17577. /**
  17578. * Recursive implementation of binary search.
  17579. *
  17580. * @param aLow Indices here and lower do not contain the needle.
  17581. * @param aHigh Indices here and higher do not contain the needle.
  17582. * @param aNeedle The element being searched for.
  17583. * @param aHaystack The non-empty array being searched.
  17584. * @param aCompare Function which takes two elements and returns -1, 0, or 1.
  17585. * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
  17586. * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
  17587. * closest element that is smaller than or greater than the one we are
  17588. * searching for, respectively, if the exact element cannot be found.
  17589. */ function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {
  17590. // This function terminates when one of the following is true:
  17591. //
  17592. // 1. We find the exact element we are looking for.
  17593. //
  17594. // 2. We did not find the exact element, but we can return the index of
  17595. // the next-closest element.
  17596. //
  17597. // 3. We did not find the exact element, and there is no next-closest
  17598. // element than the one we are searching for, so we return -1.
  17599. var mid = Math.floor((aHigh - aLow) / 2) + aLow;
  17600. var cmp = aCompare(aNeedle, aHaystack[mid], true);
  17601. if (cmp === 0) {
  17602. // Found the element we are looking for.
  17603. return mid;
  17604. } else if (cmp > 0) {
  17605. // Our needle is greater than aHaystack[mid].
  17606. if (aHigh - mid > 1) {
  17607. // The element is in the upper half.
  17608. return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);
  17609. }
  17610. // The exact needle element was not found in this haystack. Determine if
  17611. // we are in termination case (3) or (2) and return the appropriate thing.
  17612. if (aBias == exports.LEAST_UPPER_BOUND) {
  17613. return aHigh < aHaystack.length ? aHigh : -1;
  17614. }
  17615. return mid;
  17616. }
  17617. // Our needle is less than aHaystack[mid].
  17618. if (mid - aLow > 1) {
  17619. // The element is in the lower half.
  17620. return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);
  17621. }
  17622. // we are in termination case (3) or (2) and return the appropriate thing.
  17623. if (aBias == exports.LEAST_UPPER_BOUND) {
  17624. return mid;
  17625. }
  17626. return aLow < 0 ? -1 : aLow;
  17627. }
  17628. /**
  17629. * This is an implementation of binary search which will always try and return
  17630. * the index of the closest element if there is no exact hit. This is because
  17631. * mappings between original and generated line/col pairs are single points,
  17632. * and there is an implicit region between each of them, so a miss just means
  17633. * that you aren't on the very start of a region.
  17634. *
  17635. * @param aNeedle The element you are looking for.
  17636. * @param aHaystack The array that is being searched.
  17637. * @param aCompare A function which takes the needle and an element in the
  17638. * array and returns -1, 0, or 1 depending on whether the needle is less
  17639. * than, equal to, or greater than the element, respectively.
  17640. * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
  17641. * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
  17642. * closest element that is smaller than or greater than the one we are
  17643. * searching for, respectively, if the exact element cannot be found.
  17644. * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'.
  17645. */ exports.search = function search(aNeedle, aHaystack, aCompare, aBias) {
  17646. if (aHaystack.length === 0) {
  17647. return -1;
  17648. }
  17649. var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, aCompare, aBias || exports.GREATEST_LOWER_BOUND);
  17650. if (index < 0) {
  17651. return -1;
  17652. }
  17653. // We have found either the exact element, or the next-closest element than
  17654. // the one we are searching for. However, there may be more than one such
  17655. // element. Make sure we always return the smallest of these.
  17656. while(index - 1 >= 0){
  17657. if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {
  17658. break;
  17659. }
  17660. --index;
  17661. }
  17662. return index;
  17663. };
  17664. })(binarySearch$1);
  17665. var readWasm$2 = {exports: {}};
  17666. if (typeof fetch === "function") {
  17667. // Web version of reading a wasm file into an array buffer.
  17668. var mappingsWasmUrl = null;
  17669. readWasm$2.exports = function readWasm() {
  17670. if (typeof mappingsWasmUrl !== "string") {
  17671. throw new Error("You must provide the URL of lib/mappings.wasm by calling " + "SourceMapConsumer.initialize({ 'lib/mappings.wasm': ... }) " + "before using SourceMapConsumer");
  17672. }
  17673. return fetch(mappingsWasmUrl).then(function(response) {
  17674. return response.arrayBuffer();
  17675. });
  17676. };
  17677. readWasm$2.exports.initialize = function(url) {
  17678. return mappingsWasmUrl = url;
  17679. };
  17680. } else {
  17681. // Node version of reading a wasm file into an array buffer.
  17682. var fs = require$$0__default["default"];
  17683. var path = require$$1__default["default"];
  17684. readWasm$2.exports = function readWasm() {
  17685. return new Promise(function(resolve, reject) {
  17686. var wasmPath = path.join(__dirname, "mappings.wasm");
  17687. fs.readFile(wasmPath, null, function(error, data) {
  17688. if (error) {
  17689. reject(error);
  17690. return;
  17691. }
  17692. resolve(data.buffer);
  17693. });
  17694. });
  17695. };
  17696. readWasm$2.exports.initialize = function(_) {
  17697. console.debug("SourceMapConsumer.initialize is a no-op when running in node.js");
  17698. };
  17699. }
  17700. var readWasm$1 = readWasm$2.exports;
  17701. /**
  17702. * Provide the JIT with a nice shape / hidden class.
  17703. */ function Mapping() {
  17704. this.generatedLine = 0;
  17705. this.generatedColumn = 0;
  17706. this.lastGeneratedColumn = null;
  17707. this.source = null;
  17708. this.originalLine = null;
  17709. this.originalColumn = null;
  17710. this.name = null;
  17711. }
  17712. var cachedWasm = null;
  17713. var wasm$1 = function wasm() {
  17714. if (cachedWasm) {
  17715. return cachedWasm;
  17716. }
  17717. var callbackStack = [];
  17718. cachedWasm = readWasm$1().then(function(buffer) {
  17719. return WebAssembly.instantiate(buffer, {
  17720. env: {
  17721. mapping_callback: function mapping_callback(generatedLine, generatedColumn, hasLastGeneratedColumn, lastGeneratedColumn, hasOriginal, source, originalLine, originalColumn, hasName, name) {
  17722. var mapping = new Mapping();
  17723. // JS uses 1-based line numbers, wasm uses 0-based.
  17724. mapping.generatedLine = generatedLine + 1;
  17725. mapping.generatedColumn = generatedColumn;
  17726. if (hasLastGeneratedColumn) {
  17727. // JS uses inclusive last generated column, wasm uses exclusive.
  17728. mapping.lastGeneratedColumn = lastGeneratedColumn - 1;
  17729. }
  17730. if (hasOriginal) {
  17731. mapping.source = source;
  17732. // JS uses 1-based line numbers, wasm uses 0-based.
  17733. mapping.originalLine = originalLine + 1;
  17734. mapping.originalColumn = originalColumn;
  17735. if (hasName) {
  17736. mapping.name = name;
  17737. }
  17738. }
  17739. callbackStack[callbackStack.length - 1](mapping);
  17740. },
  17741. start_all_generated_locations_for: function start_all_generated_locations_for() {
  17742. console.time("all_generated_locations_for");
  17743. },
  17744. end_all_generated_locations_for: function end_all_generated_locations_for() {
  17745. console.timeEnd("all_generated_locations_for");
  17746. },
  17747. start_compute_column_spans: function start_compute_column_spans() {
  17748. console.time("compute_column_spans");
  17749. },
  17750. end_compute_column_spans: function end_compute_column_spans() {
  17751. console.timeEnd("compute_column_spans");
  17752. },
  17753. start_generated_location_for: function start_generated_location_for() {
  17754. console.time("generated_location_for");
  17755. },
  17756. end_generated_location_for: function end_generated_location_for() {
  17757. console.timeEnd("generated_location_for");
  17758. },
  17759. start_original_location_for: function start_original_location_for() {
  17760. console.time("original_location_for");
  17761. },
  17762. end_original_location_for: function end_original_location_for() {
  17763. console.timeEnd("original_location_for");
  17764. },
  17765. start_parse_mappings: function start_parse_mappings() {
  17766. console.time("parse_mappings");
  17767. },
  17768. end_parse_mappings: function end_parse_mappings() {
  17769. console.timeEnd("parse_mappings");
  17770. },
  17771. start_sort_by_generated_location: function start_sort_by_generated_location() {
  17772. console.time("sort_by_generated_location");
  17773. },
  17774. end_sort_by_generated_location: function end_sort_by_generated_location() {
  17775. console.timeEnd("sort_by_generated_location");
  17776. },
  17777. start_sort_by_original_location: function start_sort_by_original_location() {
  17778. console.time("sort_by_original_location");
  17779. },
  17780. end_sort_by_original_location: function end_sort_by_original_location() {
  17781. console.timeEnd("sort_by_original_location");
  17782. }
  17783. }
  17784. });
  17785. }).then(function(Wasm) {
  17786. return {
  17787. exports: Wasm.instance.exports,
  17788. withMappingCallback: function(mappingCallback, f) {
  17789. callbackStack.push(mappingCallback);
  17790. try {
  17791. f();
  17792. } finally{
  17793. callbackStack.pop();
  17794. }
  17795. }
  17796. };
  17797. }).then(null, function(e) {
  17798. cachedWasm = null;
  17799. throw e;
  17800. });
  17801. return cachedWasm;
  17802. };
  17803. /* -*- Mode: js; js-indent-level: 2; -*- */ function _assertThisInitialized(self) {
  17804. if (self === void 0) {
  17805. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  17806. }
  17807. return self;
  17808. }
  17809. function _defineProperties(target, props) {
  17810. for(var i = 0; i < props.length; i++){
  17811. var descriptor = props[i];
  17812. descriptor.enumerable = descriptor.enumerable || false;
  17813. descriptor.configurable = true;
  17814. if ("value" in descriptor) descriptor.writable = true;
  17815. Object.defineProperty(target, descriptor.key, descriptor);
  17816. }
  17817. }
  17818. function _createClass(Constructor, protoProps, staticProps) {
  17819. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  17820. if (staticProps) _defineProperties(Constructor, staticProps);
  17821. return Constructor;
  17822. }
  17823. function _inherits(subClass, superClass) {
  17824. if (typeof superClass !== "function" && superClass !== null) {
  17825. throw new TypeError("Super expression must either be null or a function");
  17826. }
  17827. subClass.prototype = Object.create(superClass && superClass.prototype, {
  17828. constructor: {
  17829. value: subClass,
  17830. writable: true,
  17831. configurable: true
  17832. }
  17833. });
  17834. if (superClass) _setPrototypeOf(subClass, superClass);
  17835. }
  17836. function _possibleConstructorReturn(self, call) {
  17837. if (call && (_typeof$1(call) === "object" || typeof call === "function")) {
  17838. return call;
  17839. }
  17840. return _assertThisInitialized(self);
  17841. }
  17842. function _setPrototypeOf(o, p) {
  17843. _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
  17844. o.__proto__ = p;
  17845. return o;
  17846. };
  17847. return _setPrototypeOf(o, p);
  17848. }
  17849. var _typeof$1 = function(obj) {
  17850. "@swc/helpers - typeof";
  17851. return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
  17852. };
  17853. /*
  17854. * Copyright 2011 Mozilla Foundation and contributors
  17855. * Licensed under the New BSD license. See LICENSE or:
  17856. * http://opensource.org/licenses/BSD-3-Clause
  17857. */ var util = util$3;
  17858. var binarySearch = binarySearch$1;
  17859. var ArraySet = arraySet.ArraySet;
  17860. var readWasm = readWasm$2.exports;
  17861. var wasm = wasm$1;
  17862. var INTERNAL = Symbol("smcInternal");
  17863. var SourceMapConsumer = /*#__PURE__*/ function() {
  17864. function SourceMapConsumer(aSourceMap, aSourceMapURL) {
  17865. // If the constructor was called by super(), just return Promise<this>.
  17866. // Yes, this is a hack to retain the pre-existing API of the base-class
  17867. // constructor also being an async factory function.
  17868. if (aSourceMap == INTERNAL) {
  17869. return Promise.resolve(this);
  17870. }
  17871. return _factory(aSourceMap, aSourceMapURL);
  17872. }
  17873. var _proto = SourceMapConsumer.prototype;
  17874. /**
  17875. * Parse the mappings in a string in to a data structure which we can easily
  17876. * query (the ordered arrays in the `this.__generatedMappings` and
  17877. * `this.__originalMappings` properties).
  17878. */ _proto._parseMappings = function _parseMappings(aStr, aSourceRoot) {
  17879. throw new Error("Subclasses must implement _parseMappings");
  17880. };
  17881. /**
  17882. * Iterate over each mapping between an original source/line/column and a
  17883. * generated line/column in this source map.
  17884. *
  17885. * @param Function aCallback
  17886. * The function that is called with each mapping.
  17887. * @param Object aContext
  17888. * Optional. If specified, this object will be the value of `this` every
  17889. * time that `aCallback` is called.
  17890. * @param aOrder
  17891. * Either `SourceMapConsumer.GENERATED_ORDER` or
  17892. * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to
  17893. * iterate over the mappings sorted by the generated file's line/column
  17894. * order or the original's source/line/column order, respectively. Defaults to
  17895. * `SourceMapConsumer.GENERATED_ORDER`.
  17896. */ _proto.eachMapping = function eachMapping(aCallback, aContext, aOrder) {
  17897. throw new Error("Subclasses must implement eachMapping");
  17898. };
  17899. /**
  17900. * Returns all generated line and column information for the original source,
  17901. * line, and column provided. If no column is provided, returns all mappings
  17902. * corresponding to a either the line we are searching for or the next
  17903. * closest line that has any mappings. Otherwise, returns all mappings
  17904. * corresponding to the given line and either the column we are searching for
  17905. * or the next closest column that has any offsets.
  17906. *
  17907. * The only argument is an object with the following properties:
  17908. *
  17909. * - source: The filename of the original source.
  17910. * - line: The line number in the original source. The line number is 1-based.
  17911. * - column: Optional. the column number in the original source.
  17912. * The column number is 0-based.
  17913. *
  17914. * and an array of objects is returned, each with the following properties:
  17915. *
  17916. * - line: The line number in the generated source, or null. The
  17917. * line number is 1-based.
  17918. * - column: The column number in the generated source, or null.
  17919. * The column number is 0-based.
  17920. */ _proto.allGeneratedPositionsFor = function allGeneratedPositionsFor(aArgs) {
  17921. throw new Error("Subclasses must implement allGeneratedPositionsFor");
  17922. };
  17923. _proto.destroy = function destroy() {
  17924. throw new Error("Subclasses must implement destroy");
  17925. };
  17926. SourceMapConsumer.initialize = function initialize(opts) {
  17927. readWasm.initialize(opts["lib/mappings.wasm"]);
  17928. };
  17929. SourceMapConsumer.fromSourceMap = function fromSourceMap(aSourceMap, aSourceMapURL) {
  17930. return _factoryBSM(aSourceMap, aSourceMapURL);
  17931. };
  17932. /**
  17933. * Construct a new `SourceMapConsumer` from `rawSourceMap` and `sourceMapUrl`
  17934. * (see the `SourceMapConsumer` constructor for details. Then, invoke the `async
  17935. * function f(SourceMapConsumer) -> T` with the newly constructed consumer, wait
  17936. * for `f` to complete, call `destroy` on the consumer, and return `f`'s return
  17937. * value.
  17938. *
  17939. * You must not use the consumer after `f` completes!
  17940. *
  17941. * By using `with`, you do not have to remember to manually call `destroy` on
  17942. * the consumer, since it will be called automatically once `f` completes.
  17943. *
  17944. * ```js
  17945. * const xSquared = await SourceMapConsumer.with(
  17946. * myRawSourceMap,
  17947. * null,
  17948. * async function (consumer) {
  17949. * // Use `consumer` inside here and don't worry about remembering
  17950. * // to call `destroy`.
  17951. *
  17952. * const x = await whatever(consumer);
  17953. * return x * x;
  17954. * }
  17955. * );
  17956. *
  17957. * // You may not use that `consumer` anymore out here; it has
  17958. * // been destroyed. But you can use `xSquared`.
  17959. * console.log(xSquared);
  17960. * ```
  17961. */ SourceMapConsumer.with = function _with(rawSourceMap, sourceMapUrl, f) {
  17962. // Note: The `acorn` version that `webpack` currently depends on doesn't
  17963. // support `async` functions, and the nodes that we support don't all have
  17964. // `.finally`. Therefore, this is written a bit more convolutedly than it
  17965. // should really be.
  17966. var consumer = null;
  17967. var promise = new SourceMapConsumer(rawSourceMap, sourceMapUrl);
  17968. return promise.then(function(c) {
  17969. consumer = c;
  17970. return f(c);
  17971. }).then(function(x) {
  17972. if (consumer) {
  17973. consumer.destroy();
  17974. }
  17975. return x;
  17976. }, function(e) {
  17977. if (consumer) {
  17978. consumer.destroy();
  17979. }
  17980. throw e;
  17981. });
  17982. };
  17983. return SourceMapConsumer;
  17984. }();
  17985. /**
  17986. * The version of the source mapping spec that we are consuming.
  17987. */ SourceMapConsumer.prototype._version = 3;
  17988. SourceMapConsumer.GENERATED_ORDER = 1;
  17989. SourceMapConsumer.ORIGINAL_ORDER = 2;
  17990. SourceMapConsumer.GREATEST_LOWER_BOUND = 1;
  17991. SourceMapConsumer.LEAST_UPPER_BOUND = 2;
  17992. /**
  17993. * A BasicSourceMapConsumer instance represents a parsed source map which we can
  17994. * query for information about the original file positions by giving it a file
  17995. * position in the generated source.
  17996. *
  17997. * The first parameter is the raw source map (either as a JSON string, or
  17998. * already parsed to an object). According to the spec, source maps have the
  17999. * following attributes:
  18000. *
  18001. * - version: Which version of the source map spec this map is following.
  18002. * - sources: An array of URLs to the original source files.
  18003. * - names: An array of identifiers which can be referenced by individual mappings.
  18004. * - sourceRoot: Optional. The URL root from which all sources are relative.
  18005. * - sourcesContent: Optional. An array of contents of the original source files.
  18006. * - mappings: A string of base64 VLQs which contain the actual mappings.
  18007. * - file: Optional. The generated file this source map is associated with.
  18008. *
  18009. * Here is an example source map, taken from the source map spec[0]:
  18010. *
  18011. * {
  18012. * version : 3,
  18013. * file: "out.js",
  18014. * sourceRoot : "",
  18015. * sources: ["foo.js", "bar.js"],
  18016. * names: ["src", "maps", "are", "fun"],
  18017. * mappings: "AA,AB;;ABCDE;"
  18018. * }
  18019. *
  18020. * The second parameter, if given, is a string whose value is the URL
  18021. * at which the source map was found. This URL is used to compute the
  18022. * sources array.
  18023. *
  18024. * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1#
  18025. */ var BasicSourceMapConsumer = /*#__PURE__*/ function(SourceMapConsumer1) {
  18026. _inherits(BasicSourceMapConsumer, SourceMapConsumer1);
  18027. function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) {
  18028. var _this;
  18029. return _possibleConstructorReturn(_this, (_this = SourceMapConsumer1.call(this, INTERNAL) || this).then(function(that) {
  18030. var sourceMap = aSourceMap;
  18031. if (typeof aSourceMap === "string") {
  18032. sourceMap = util.parseSourceMapInput(aSourceMap);
  18033. }
  18034. var version = util.getArg(sourceMap, "version");
  18035. var sources = util.getArg(sourceMap, "sources");
  18036. // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which
  18037. // requires the array) to play nice here.
  18038. var names = util.getArg(sourceMap, "names", []);
  18039. var sourceRoot = util.getArg(sourceMap, "sourceRoot", null);
  18040. var sourcesContent = util.getArg(sourceMap, "sourcesContent", null);
  18041. var mappings = util.getArg(sourceMap, "mappings");
  18042. var file = util.getArg(sourceMap, "file", null);
  18043. // Once again, Sass deviates from the spec and supplies the version as a
  18044. // string rather than a number, so we use loose equality checking here.
  18045. if (version != that._version) {
  18046. throw new Error("Unsupported version: " + version);
  18047. }
  18048. if (sourceRoot) {
  18049. sourceRoot = util.normalize(sourceRoot);
  18050. }
  18051. sources = sources.map(String)// Some source maps produce relative source paths like "./foo.js" instead of
  18052. // "foo.js". Normalize these first so that future comparisons will succeed.
  18053. // See bugzil.la/1090768.
  18054. .map(util.normalize)// Always ensure that absolute sources are internally stored relative to
  18055. // the source root, if the source root is absolute. Not doing this would
  18056. // be particularly problematic when the source root is a prefix of the
  18057. // source (valid, but why??). See github issue #199 and bugzil.la/1188982.
  18058. .map(function(source) {
  18059. return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source) ? util.relative(sourceRoot, source) : source;
  18060. });
  18061. // Pass `true` below to allow duplicate names and sources. While source maps
  18062. // are intended to be compressed and deduplicated, the TypeScript compiler
  18063. // sometimes generates source maps with duplicates in them. See Github issue
  18064. // #72 and bugzil.la/889492.
  18065. that._names = ArraySet.fromArray(names.map(String), true);
  18066. that._sources = ArraySet.fromArray(sources, true);
  18067. that._absoluteSources = that._sources.toArray().map(function(s) {
  18068. return util.computeSourceURL(sourceRoot, s, aSourceMapURL);
  18069. });
  18070. that.sourceRoot = sourceRoot;
  18071. that.sourcesContent = sourcesContent;
  18072. that._mappings = mappings;
  18073. that._sourceMapURL = aSourceMapURL;
  18074. that.file = file;
  18075. that._computedColumnSpans = false;
  18076. that._mappingsPtr = 0;
  18077. that._wasm = null;
  18078. return wasm().then(function(w) {
  18079. that._wasm = w;
  18080. return that;
  18081. });
  18082. }));
  18083. }
  18084. var _proto = BasicSourceMapConsumer.prototype;
  18085. /**
  18086. * Utility function to find the index of a source. Returns -1 if not
  18087. * found.
  18088. */ _proto._findSourceIndex = function _findSourceIndex(aSource) {
  18089. var relativeSource = aSource;
  18090. if (this.sourceRoot != null) {
  18091. relativeSource = util.relative(this.sourceRoot, relativeSource);
  18092. }
  18093. if (this._sources.has(relativeSource)) {
  18094. return this._sources.indexOf(relativeSource);
  18095. }
  18096. // Maybe aSource is an absolute URL as returned by |sources|. In
  18097. // this case we can't simply undo the transform.
  18098. for(var i = 0; i < this._absoluteSources.length; ++i){
  18099. if (this._absoluteSources[i] == aSource) {
  18100. return i;
  18101. }
  18102. }
  18103. return -1;
  18104. };
  18105. _proto._getMappingsPtr = function _getMappingsPtr() {
  18106. if (this._mappingsPtr === 0) {
  18107. this._parseMappings(this._mappings, this.sourceRoot);
  18108. }
  18109. return this._mappingsPtr;
  18110. };
  18111. /**
  18112. * Parse the mappings in a string in to a data structure which we can easily
  18113. * query (the ordered arrays in the `this.__generatedMappings` and
  18114. * `this.__originalMappings` properties).
  18115. */ _proto._parseMappings = function _parseMappings(aStr, aSourceRoot) {
  18116. var size = aStr.length;
  18117. var mappingsBufPtr = this._wasm.exports.allocate_mappings(size);
  18118. var mappingsBuf = new Uint8Array(this._wasm.exports.memory.buffer, mappingsBufPtr, size);
  18119. for(var i = 0; i < size; i++){
  18120. mappingsBuf[i] = aStr.charCodeAt(i);
  18121. }
  18122. var mappingsPtr = this._wasm.exports.parse_mappings(mappingsBufPtr);
  18123. if (!mappingsPtr) {
  18124. var error = this._wasm.exports.get_last_error();
  18125. var msg = "Error parsing mappings (code " + error + "): ";
  18126. // XXX: keep these error codes in sync with `fitzgen/source-map-mappings`.
  18127. switch(error){
  18128. case 1:
  18129. msg += "the mappings contained a negative line, column, source index, or name index";
  18130. break;
  18131. case 2:
  18132. msg += "the mappings contained a number larger than 2**32";
  18133. break;
  18134. case 3:
  18135. msg += "reached EOF while in the middle of parsing a VLQ";
  18136. break;
  18137. case 4:
  18138. msg += "invalid base 64 character while parsing a VLQ";
  18139. break;
  18140. default:
  18141. msg += "unknown error code";
  18142. break;
  18143. }
  18144. throw new Error(msg);
  18145. }
  18146. this._mappingsPtr = mappingsPtr;
  18147. };
  18148. _proto.eachMapping = function eachMapping(aCallback, aContext, aOrder) {
  18149. var _this = this;
  18150. var context = aContext || null;
  18151. var order = aOrder || SourceMapConsumer.GENERATED_ORDER;
  18152. var sourceRoot = this.sourceRoot;
  18153. this._wasm.withMappingCallback(function(mapping) {
  18154. if (mapping.source !== null) {
  18155. mapping.source = _this._sources.at(mapping.source);
  18156. mapping.source = util.computeSourceURL(sourceRoot, mapping.source, _this._sourceMapURL);
  18157. if (mapping.name !== null) {
  18158. mapping.name = _this._names.at(mapping.name);
  18159. }
  18160. }
  18161. aCallback.call(context, mapping);
  18162. }, function() {
  18163. switch(order){
  18164. case SourceMapConsumer.GENERATED_ORDER:
  18165. _this._wasm.exports.by_generated_location(_this._getMappingsPtr());
  18166. break;
  18167. case SourceMapConsumer.ORIGINAL_ORDER:
  18168. _this._wasm.exports.by_original_location(_this._getMappingsPtr());
  18169. break;
  18170. default:
  18171. throw new Error("Unknown order of iteration.");
  18172. }
  18173. });
  18174. };
  18175. _proto.allGeneratedPositionsFor = function allGeneratedPositionsFor(aArgs) {
  18176. var _this = this;
  18177. var source = util.getArg(aArgs, "source");
  18178. var originalLine = util.getArg(aArgs, "line");
  18179. var originalColumn = aArgs.column || 0;
  18180. source = this._findSourceIndex(source);
  18181. if (source < 0) {
  18182. return [];
  18183. }
  18184. if (originalLine < 1) {
  18185. throw new Error("Line numbers must be >= 1");
  18186. }
  18187. if (originalColumn < 0) {
  18188. throw new Error("Column numbers must be >= 0");
  18189. }
  18190. var mappings = [];
  18191. this._wasm.withMappingCallback(function(m) {
  18192. var lastColumn = m.lastGeneratedColumn;
  18193. if (_this._computedColumnSpans && lastColumn === null) {
  18194. lastColumn = Infinity;
  18195. }
  18196. mappings.push({
  18197. line: m.generatedLine,
  18198. column: m.generatedColumn,
  18199. lastColumn: lastColumn
  18200. });
  18201. }, function() {
  18202. _this._wasm.exports.all_generated_locations_for(_this._getMappingsPtr(), source, originalLine - 1, "column" in aArgs, originalColumn);
  18203. });
  18204. return mappings;
  18205. };
  18206. _proto.destroy = function destroy() {
  18207. if (this._mappingsPtr !== 0) {
  18208. this._wasm.exports.free_mappings(this._mappingsPtr);
  18209. this._mappingsPtr = 0;
  18210. }
  18211. };
  18212. /**
  18213. * Compute the last column for each generated mapping. The last column is
  18214. * inclusive.
  18215. */ _proto.computeColumnSpans = function computeColumnSpans() {
  18216. if (this._computedColumnSpans) {
  18217. return;
  18218. }
  18219. this._wasm.exports.compute_column_spans(this._getMappingsPtr());
  18220. this._computedColumnSpans = true;
  18221. };
  18222. /**
  18223. * Returns the original source, line, and column information for the generated
  18224. * source's line and column positions provided. The only argument is an object
  18225. * with the following properties:
  18226. *
  18227. * - line: The line number in the generated source. The line number
  18228. * is 1-based.
  18229. * - column: The column number in the generated source. The column
  18230. * number is 0-based.
  18231. * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or
  18232. * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the
  18233. * closest element that is smaller than or greater than the one we are
  18234. * searching for, respectively, if the exact element cannot be found.
  18235. * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.
  18236. *
  18237. * and an object is returned with the following properties:
  18238. *
  18239. * - source: The original source file, or null.
  18240. * - line: The line number in the original source, or null. The
  18241. * line number is 1-based.
  18242. * - column: The column number in the original source, or null. The
  18243. * column number is 0-based.
  18244. * - name: The original identifier, or null.
  18245. */ _proto.originalPositionFor = function originalPositionFor(aArgs) {
  18246. var _this = this;
  18247. var needle = {
  18248. generatedLine: util.getArg(aArgs, "line"),
  18249. generatedColumn: util.getArg(aArgs, "column")
  18250. };
  18251. if (needle.generatedLine < 1) {
  18252. throw new Error("Line numbers must be >= 1");
  18253. }
  18254. if (needle.generatedColumn < 0) {
  18255. throw new Error("Column numbers must be >= 0");
  18256. }
  18257. var bias = util.getArg(aArgs, "bias", SourceMapConsumer.GREATEST_LOWER_BOUND);
  18258. if (bias == null) {
  18259. bias = SourceMapConsumer.GREATEST_LOWER_BOUND;
  18260. }
  18261. var mapping;
  18262. this._wasm.withMappingCallback(function(m) {
  18263. return mapping = m;
  18264. }, function() {
  18265. _this._wasm.exports.original_location_for(_this._getMappingsPtr(), needle.generatedLine - 1, needle.generatedColumn, bias);
  18266. });
  18267. if (mapping) {
  18268. if (mapping.generatedLine === needle.generatedLine) {
  18269. var source = util.getArg(mapping, "source", null);
  18270. if (source !== null) {
  18271. source = this._sources.at(source);
  18272. source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL);
  18273. }
  18274. var name = util.getArg(mapping, "name", null);
  18275. if (name !== null) {
  18276. name = this._names.at(name);
  18277. }
  18278. return {
  18279. source: source,
  18280. line: util.getArg(mapping, "originalLine", null),
  18281. column: util.getArg(mapping, "originalColumn", null),
  18282. name: name
  18283. };
  18284. }
  18285. }
  18286. return {
  18287. source: null,
  18288. line: null,
  18289. column: null,
  18290. name: null
  18291. };
  18292. };
  18293. /**
  18294. * Return true if we have the source content for every source in the source
  18295. * map, false otherwise.
  18296. */ _proto.hasContentsOfAllSources = function hasContentsOfAllSources() {
  18297. if (!this.sourcesContent) {
  18298. return false;
  18299. }
  18300. return this.sourcesContent.length >= this._sources.size() && !this.sourcesContent.some(function(sc) {
  18301. return sc == null;
  18302. });
  18303. };
  18304. /**
  18305. * Returns the original source content. The only argument is the url of the
  18306. * original source file. Returns null if no original source content is
  18307. * available.
  18308. */ _proto.sourceContentFor = function sourceContentFor(aSource, nullOnMissing) {
  18309. if (!this.sourcesContent) {
  18310. return null;
  18311. }
  18312. var index = this._findSourceIndex(aSource);
  18313. if (index >= 0) {
  18314. return this.sourcesContent[index];
  18315. }
  18316. var relativeSource = aSource;
  18317. if (this.sourceRoot != null) {
  18318. relativeSource = util.relative(this.sourceRoot, relativeSource);
  18319. }
  18320. var url;
  18321. if (this.sourceRoot != null && (url = util.urlParse(this.sourceRoot))) {
  18322. // XXX: file:// URIs and absolute paths lead to unexpected behavior for
  18323. // many users. We can help them out when they expect file:// URIs to
  18324. // behave like it would if they were running a local HTTP server. See
  18325. // https://bugzilla.mozilla.org/show_bug.cgi?id=885597.
  18326. var fileUriAbsPath = relativeSource.replace(/^file:\/\//, "");
  18327. if (url.scheme == "file" && this._sources.has(fileUriAbsPath)) {
  18328. return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)];
  18329. }
  18330. if ((!url.path || url.path == "/") && this._sources.has("/" + relativeSource)) {
  18331. return this.sourcesContent[this._sources.indexOf("/" + relativeSource)];
  18332. }
  18333. }
  18334. // This function is used recursively from
  18335. // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we
  18336. // don't want to throw if we can't find the source - we just want to
  18337. // return null, so we provide a flag to exit gracefully.
  18338. if (nullOnMissing) {
  18339. return null;
  18340. }
  18341. throw new Error('"' + relativeSource + '" is not in the SourceMap.');
  18342. };
  18343. /**
  18344. * Returns the generated line and column information for the original source,
  18345. * line, and column positions provided. The only argument is an object with
  18346. * the following properties:
  18347. *
  18348. * - source: The filename of the original source.
  18349. * - line: The line number in the original source. The line number
  18350. * is 1-based.
  18351. * - column: The column number in the original source. The column
  18352. * number is 0-based.
  18353. * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or
  18354. * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the
  18355. * closest element that is smaller than or greater than the one we are
  18356. * searching for, respectively, if the exact element cannot be found.
  18357. * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.
  18358. *
  18359. * and an object is returned with the following properties:
  18360. *
  18361. * - line: The line number in the generated source, or null. The
  18362. * line number is 1-based.
  18363. * - column: The column number in the generated source, or null.
  18364. * The column number is 0-based.
  18365. */ _proto.generatedPositionFor = function generatedPositionFor(aArgs) {
  18366. var _this = this;
  18367. var source = util.getArg(aArgs, "source");
  18368. source = this._findSourceIndex(source);
  18369. if (source < 0) {
  18370. return {
  18371. line: null,
  18372. column: null,
  18373. lastColumn: null
  18374. };
  18375. }
  18376. var needle = {
  18377. source: source,
  18378. originalLine: util.getArg(aArgs, "line"),
  18379. originalColumn: util.getArg(aArgs, "column")
  18380. };
  18381. if (needle.originalLine < 1) {
  18382. throw new Error("Line numbers must be >= 1");
  18383. }
  18384. if (needle.originalColumn < 0) {
  18385. throw new Error("Column numbers must be >= 0");
  18386. }
  18387. var bias = util.getArg(aArgs, "bias", SourceMapConsumer.GREATEST_LOWER_BOUND);
  18388. if (bias == null) {
  18389. bias = SourceMapConsumer.GREATEST_LOWER_BOUND;
  18390. }
  18391. var mapping;
  18392. this._wasm.withMappingCallback(function(m) {
  18393. return mapping = m;
  18394. }, function() {
  18395. _this._wasm.exports.generated_location_for(_this._getMappingsPtr(), needle.source, needle.originalLine - 1, needle.originalColumn, bias);
  18396. });
  18397. if (mapping) {
  18398. if (mapping.source === needle.source) {
  18399. var lastColumn = mapping.lastGeneratedColumn;
  18400. if (this._computedColumnSpans && lastColumn === null) {
  18401. lastColumn = Infinity;
  18402. }
  18403. return {
  18404. line: util.getArg(mapping, "generatedLine", null),
  18405. column: util.getArg(mapping, "generatedColumn", null),
  18406. lastColumn: lastColumn
  18407. };
  18408. }
  18409. }
  18410. return {
  18411. line: null,
  18412. column: null,
  18413. lastColumn: null
  18414. };
  18415. };
  18416. /**
  18417. * Create a BasicSourceMapConsumer from a SourceMapGenerator.
  18418. *
  18419. * @param SourceMapGenerator aSourceMap
  18420. * The source map that will be consumed.
  18421. * @param String aSourceMapURL
  18422. * The URL at which the source map can be found (optional)
  18423. * @returns BasicSourceMapConsumer
  18424. */ BasicSourceMapConsumer.fromSourceMap = function fromSourceMap(aSourceMap, aSourceMapURL) {
  18425. return new BasicSourceMapConsumer(aSourceMap.toString());
  18426. };
  18427. _createClass(BasicSourceMapConsumer, [
  18428. {
  18429. key: "sources",
  18430. get: function get() {
  18431. return this._absoluteSources.slice();
  18432. }
  18433. }
  18434. ]);
  18435. return BasicSourceMapConsumer;
  18436. }(SourceMapConsumer);
  18437. BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer;
  18438. /**
  18439. * An IndexedSourceMapConsumer instance represents a parsed source map which
  18440. * we can query for information. It differs from BasicSourceMapConsumer in
  18441. * that it takes "indexed" source maps (i.e. ones with a "sections" field) as
  18442. * input.
  18443. *
  18444. * The first parameter is a raw source map (either as a JSON string, or already
  18445. * parsed to an object). According to the spec for indexed source maps, they
  18446. * have the following attributes:
  18447. *
  18448. * - version: Which version of the source map spec this map is following.
  18449. * - file: Optional. The generated file this source map is associated with.
  18450. * - sections: A list of section definitions.
  18451. *
  18452. * Each value under the "sections" field has two fields:
  18453. * - offset: The offset into the original specified at which this section
  18454. * begins to apply, defined as an object with a "line" and "column"
  18455. * field.
  18456. * - map: A source map definition. This source map could also be indexed,
  18457. * but doesn't have to be.
  18458. *
  18459. * Instead of the "map" field, it's also possible to have a "url" field
  18460. * specifying a URL to retrieve a source map from, but that's currently
  18461. * unsupported.
  18462. *
  18463. * Here's an example source map, taken from the source map spec[0], but
  18464. * modified to omit a section which uses the "url" field.
  18465. *
  18466. * {
  18467. * version : 3,
  18468. * file: "app.js",
  18469. * sections: [{
  18470. * offset: {line:100, column:10},
  18471. * map: {
  18472. * version : 3,
  18473. * file: "section.js",
  18474. * sources: ["foo.js", "bar.js"],
  18475. * names: ["src", "maps", "are", "fun"],
  18476. * mappings: "AAAA,E;;ABCDE;"
  18477. * }
  18478. * }],
  18479. * }
  18480. *
  18481. * The second parameter, if given, is a string whose value is the URL
  18482. * at which the source map was found. This URL is used to compute the
  18483. * sources array.
  18484. *
  18485. * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt
  18486. */ var IndexedSourceMapConsumer = /*#__PURE__*/ function(SourceMapConsumer1) {
  18487. _inherits(IndexedSourceMapConsumer, SourceMapConsumer1);
  18488. function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) {
  18489. var _this;
  18490. return _possibleConstructorReturn(_this, (_this = SourceMapConsumer1.call(this, INTERNAL) || this).then(function(that) {
  18491. var sourceMap = aSourceMap;
  18492. if (typeof aSourceMap === "string") {
  18493. sourceMap = util.parseSourceMapInput(aSourceMap);
  18494. }
  18495. var version = util.getArg(sourceMap, "version");
  18496. var sections = util.getArg(sourceMap, "sections");
  18497. if (version != that._version) {
  18498. throw new Error("Unsupported version: " + version);
  18499. }
  18500. that._sources = new ArraySet();
  18501. that._names = new ArraySet();
  18502. that.__generatedMappings = null;
  18503. that.__originalMappings = null;
  18504. that.__generatedMappingsUnsorted = null;
  18505. that.__originalMappingsUnsorted = null;
  18506. var lastOffset = {
  18507. line: -1,
  18508. column: 0
  18509. };
  18510. return Promise.all(sections.map(function(s) {
  18511. if (s.url) {
  18512. // The url field will require support for asynchronicity.
  18513. // See https://github.com/mozilla/source-map/issues/16
  18514. throw new Error("Support for url field in sections not implemented.");
  18515. }
  18516. var offset = util.getArg(s, "offset");
  18517. var offsetLine = util.getArg(offset, "line");
  18518. var offsetColumn = util.getArg(offset, "column");
  18519. if (offsetLine < lastOffset.line || offsetLine === lastOffset.line && offsetColumn < lastOffset.column) {
  18520. throw new Error("Section offsets must be ordered and non-overlapping.");
  18521. }
  18522. lastOffset = offset;
  18523. var cons = new SourceMapConsumer(util.getArg(s, "map"), aSourceMapURL);
  18524. return cons.then(function(consumer) {
  18525. return {
  18526. generatedOffset: {
  18527. // The offset fields are 0-based, but we use 1-based indices when
  18528. // encoding/decoding from VLQ.
  18529. generatedLine: offsetLine + 1,
  18530. generatedColumn: offsetColumn + 1
  18531. },
  18532. consumer: consumer
  18533. };
  18534. });
  18535. })).then(function(s) {
  18536. that._sections = s;
  18537. return that;
  18538. });
  18539. }));
  18540. }
  18541. var _proto = IndexedSourceMapConsumer.prototype;
  18542. _proto._sortGeneratedMappings = function _sortGeneratedMappings() {
  18543. var mappings = this._generatedMappingsUnsorted;
  18544. mappings.sort(util.compareByGeneratedPositionsDeflated);
  18545. this.__generatedMappings = mappings;
  18546. };
  18547. _proto._sortOriginalMappings = function _sortOriginalMappings() {
  18548. var mappings = this._originalMappingsUnsorted;
  18549. mappings.sort(util.compareByOriginalPositions);
  18550. this.__originalMappings = mappings;
  18551. };
  18552. /**
  18553. * Returns the original source, line, and column information for the generated
  18554. * source's line and column positions provided. The only argument is an object
  18555. * with the following properties:
  18556. *
  18557. * - line: The line number in the generated source. The line number
  18558. * is 1-based.
  18559. * - column: The column number in the generated source. The column
  18560. * number is 0-based.
  18561. *
  18562. * and an object is returned with the following properties:
  18563. *
  18564. * - source: The original source file, or null.
  18565. * - line: The line number in the original source, or null. The
  18566. * line number is 1-based.
  18567. * - column: The column number in the original source, or null. The
  18568. * column number is 0-based.
  18569. * - name: The original identifier, or null.
  18570. */ _proto.originalPositionFor = function originalPositionFor(aArgs) {
  18571. var needle = {
  18572. generatedLine: util.getArg(aArgs, "line"),
  18573. generatedColumn: util.getArg(aArgs, "column")
  18574. };
  18575. // Find the section containing the generated position we're trying to map
  18576. // to an original position.
  18577. var sectionIndex = binarySearch.search(needle, this._sections, function(aNeedle, section) {
  18578. var cmp = aNeedle.generatedLine - section.generatedOffset.generatedLine;
  18579. if (cmp) {
  18580. return cmp;
  18581. }
  18582. return aNeedle.generatedColumn - section.generatedOffset.generatedColumn;
  18583. });
  18584. var section = this._sections[sectionIndex];
  18585. if (!section) {
  18586. return {
  18587. source: null,
  18588. line: null,
  18589. column: null,
  18590. name: null
  18591. };
  18592. }
  18593. return section.consumer.originalPositionFor({
  18594. line: needle.generatedLine - (section.generatedOffset.generatedLine - 1),
  18595. column: needle.generatedColumn - (section.generatedOffset.generatedLine === needle.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0),
  18596. bias: aArgs.bias
  18597. });
  18598. };
  18599. /**
  18600. * Return true if we have the source content for every source in the source
  18601. * map, false otherwise.
  18602. */ _proto.hasContentsOfAllSources = function hasContentsOfAllSources() {
  18603. return this._sections.every(function(s) {
  18604. return s.consumer.hasContentsOfAllSources();
  18605. });
  18606. };
  18607. /**
  18608. * Returns the original source content. The only argument is the url of the
  18609. * original source file. Returns null if no original source content is
  18610. * available.
  18611. */ _proto.sourceContentFor = function sourceContentFor(aSource, nullOnMissing) {
  18612. for(var i = 0; i < this._sections.length; i++){
  18613. var section = this._sections[i];
  18614. var content = section.consumer.sourceContentFor(aSource, true);
  18615. if (content) {
  18616. return content;
  18617. }
  18618. }
  18619. if (nullOnMissing) {
  18620. return null;
  18621. }
  18622. throw new Error('"' + aSource + '" is not in the SourceMap.');
  18623. };
  18624. /**
  18625. * Returns the generated line and column information for the original source,
  18626. * line, and column positions provided. The only argument is an object with
  18627. * the following properties:
  18628. *
  18629. * - source: The filename of the original source.
  18630. * - line: The line number in the original source. The line number
  18631. * is 1-based.
  18632. * - column: The column number in the original source. The column
  18633. * number is 0-based.
  18634. *
  18635. * and an object is returned with the following properties:
  18636. *
  18637. * - line: The line number in the generated source, or null. The
  18638. * line number is 1-based.
  18639. * - column: The column number in the generated source, or null.
  18640. * The column number is 0-based.
  18641. */ _proto.generatedPositionFor = function generatedPositionFor(aArgs) {
  18642. for(var i = 0; i < this._sections.length; i++){
  18643. var section = this._sections[i];
  18644. // Only consider this section if the requested source is in the list of
  18645. // sources of the consumer.
  18646. if (section.consumer._findSourceIndex(util.getArg(aArgs, "source")) === -1) {
  18647. continue;
  18648. }
  18649. var generatedPosition = section.consumer.generatedPositionFor(aArgs);
  18650. if (generatedPosition) {
  18651. var ret = {
  18652. line: generatedPosition.line + (section.generatedOffset.generatedLine - 1),
  18653. column: generatedPosition.column + (section.generatedOffset.generatedLine === generatedPosition.line ? section.generatedOffset.generatedColumn - 1 : 0)
  18654. };
  18655. return ret;
  18656. }
  18657. }
  18658. return {
  18659. line: null,
  18660. column: null
  18661. };
  18662. };
  18663. /**
  18664. * Parse the mappings in a string in to a data structure which we can easily
  18665. * query (the ordered arrays in the `this.__generatedMappings` and
  18666. * `this.__originalMappings` properties).
  18667. */ _proto._parseMappings = function _parseMappings(aStr, aSourceRoot) {
  18668. var _this = this, _loop = function(i) {
  18669. var section = _this._sections[i];
  18670. var sectionMappings = [];
  18671. section.consumer.eachMapping(function(m) {
  18672. return sectionMappings.push(m);
  18673. });
  18674. for(var j = 0; j < sectionMappings.length; j++){
  18675. var mapping = sectionMappings[j];
  18676. // TODO: test if null is correct here. The original code used
  18677. // `source`, which would actually have gotten used as null because
  18678. // var's get hoisted.
  18679. // See: https://github.com/mozilla/source-map/issues/333
  18680. var source = util.computeSourceURL(section.consumer.sourceRoot, null, _this._sourceMapURL);
  18681. _this._sources.add(source);
  18682. source = _this._sources.indexOf(source);
  18683. var name = null;
  18684. if (mapping.name) {
  18685. _this._names.add(mapping.name);
  18686. name = _this._names.indexOf(mapping.name);
  18687. }
  18688. // The mappings coming from the consumer for the section have
  18689. // generated positions relative to the start of the section, so we
  18690. // need to offset them to be relative to the start of the concatenated
  18691. // generated file.
  18692. var adjustedMapping = {
  18693. source: source,
  18694. generatedLine: mapping.generatedLine + (section.generatedOffset.generatedLine - 1),
  18695. generatedColumn: mapping.generatedColumn + (section.generatedOffset.generatedLine === mapping.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0),
  18696. originalLine: mapping.originalLine,
  18697. originalColumn: mapping.originalColumn,
  18698. name: name
  18699. };
  18700. generatedMappings.push(adjustedMapping);
  18701. if (typeof adjustedMapping.originalLine === "number") {
  18702. originalMappings.push(adjustedMapping);
  18703. }
  18704. }
  18705. };
  18706. var generatedMappings = this.__generatedMappingsUnsorted = [];
  18707. var originalMappings = this.__originalMappingsUnsorted = [];
  18708. for(var i = 0; i < this._sections.length; i++)_loop(i);
  18709. };
  18710. _proto.eachMapping = function eachMapping(aCallback, aContext, aOrder) {
  18711. var context = aContext || null;
  18712. var order = aOrder || SourceMapConsumer.GENERATED_ORDER;
  18713. var mappings;
  18714. switch(order){
  18715. case SourceMapConsumer.GENERATED_ORDER:
  18716. mappings = this._generatedMappings;
  18717. break;
  18718. case SourceMapConsumer.ORIGINAL_ORDER:
  18719. mappings = this._originalMappings;
  18720. break;
  18721. default:
  18722. throw new Error("Unknown order of iteration.");
  18723. }
  18724. var sourceRoot = this.sourceRoot;
  18725. mappings.map(function(mapping) {
  18726. var source = null;
  18727. if (mapping.source !== null) {
  18728. source = this._sources.at(mapping.source);
  18729. source = util.computeSourceURL(sourceRoot, source, this._sourceMapURL);
  18730. }
  18731. return {
  18732. source: source,
  18733. generatedLine: mapping.generatedLine,
  18734. generatedColumn: mapping.generatedColumn,
  18735. originalLine: mapping.originalLine,
  18736. originalColumn: mapping.originalColumn,
  18737. name: mapping.name === null ? null : this._names.at(mapping.name)
  18738. };
  18739. }, this).forEach(aCallback, context);
  18740. };
  18741. /**
  18742. * Find the mapping that best matches the hypothetical "needle" mapping that
  18743. * we are searching for in the given "haystack" of mappings.
  18744. */ _proto._findMapping = function _findMapping(aNeedle, aMappings, aLineName, aColumnName, aComparator, aBias) {
  18745. // To return the position we are searching for, we must first find the
  18746. // mapping for the given position and then return the opposite position it
  18747. // points to. Because the mappings are sorted, we can use binary search to
  18748. // find the best mapping.
  18749. if (aNeedle[aLineName] <= 0) {
  18750. throw new TypeError("Line must be greater than or equal to 1, got " + aNeedle[aLineName]);
  18751. }
  18752. if (aNeedle[aColumnName] < 0) {
  18753. throw new TypeError("Column must be greater than or equal to 0, got " + aNeedle[aColumnName]);
  18754. }
  18755. return binarySearch.search(aNeedle, aMappings, aComparator, aBias);
  18756. };
  18757. _proto.allGeneratedPositionsFor = function allGeneratedPositionsFor(aArgs) {
  18758. var line = util.getArg(aArgs, "line");
  18759. // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping
  18760. // returns the index of the closest mapping less than the needle. By
  18761. // setting needle.originalColumn to 0, we thus find the last mapping for
  18762. // the given line, provided such a mapping exists.
  18763. var needle = {
  18764. source: util.getArg(aArgs, "source"),
  18765. originalLine: line,
  18766. originalColumn: util.getArg(aArgs, "column", 0)
  18767. };
  18768. needle.source = this._findSourceIndex(needle.source);
  18769. if (needle.source < 0) {
  18770. return [];
  18771. }
  18772. if (needle.originalLine < 1) {
  18773. throw new Error("Line numbers must be >= 1");
  18774. }
  18775. if (needle.originalColumn < 0) {
  18776. throw new Error("Column numbers must be >= 0");
  18777. }
  18778. var mappings = [];
  18779. var index = this._findMapping(needle, this._originalMappings, "originalLine", "originalColumn", util.compareByOriginalPositions, binarySearch.LEAST_UPPER_BOUND);
  18780. if (index >= 0) {
  18781. var mapping = this._originalMappings[index];
  18782. if (aArgs.column === undefined) {
  18783. var originalLine = mapping.originalLine;
  18784. // Iterate until either we run out of mappings, or we run into
  18785. // a mapping for a different line than the one we found. Since
  18786. // mappings are sorted, this is guaranteed to find all mappings for
  18787. // the line we found.
  18788. while(mapping && mapping.originalLine === originalLine){
  18789. var lastColumn = mapping.lastGeneratedColumn;
  18790. if (this._computedColumnSpans && lastColumn === null) {
  18791. lastColumn = Infinity;
  18792. }
  18793. mappings.push({
  18794. line: util.getArg(mapping, "generatedLine", null),
  18795. column: util.getArg(mapping, "generatedColumn", null),
  18796. lastColumn: lastColumn
  18797. });
  18798. mapping = this._originalMappings[++index];
  18799. }
  18800. } else {
  18801. var originalColumn = mapping.originalColumn;
  18802. // Iterate until either we run out of mappings, or we run into
  18803. // a mapping for a different line than the one we were searching for.
  18804. // Since mappings are sorted, this is guaranteed to find all mappings for
  18805. // the line we are searching for.
  18806. while(mapping && mapping.originalLine === line && mapping.originalColumn == originalColumn){
  18807. var lastColumn1 = mapping.lastGeneratedColumn;
  18808. if (this._computedColumnSpans && lastColumn1 === null) {
  18809. lastColumn1 = Infinity;
  18810. }
  18811. mappings.push({
  18812. line: util.getArg(mapping, "generatedLine", null),
  18813. column: util.getArg(mapping, "generatedColumn", null),
  18814. lastColumn: lastColumn1
  18815. });
  18816. mapping = this._originalMappings[++index];
  18817. }
  18818. }
  18819. }
  18820. return mappings;
  18821. };
  18822. _proto.destroy = function destroy() {
  18823. for(var i = 0; i < this._sections.length; i++){
  18824. this._sections[i].consumer.destroy();
  18825. }
  18826. };
  18827. _createClass(IndexedSourceMapConsumer, [
  18828. {
  18829. key: "_generatedMappings",
  18830. get: // `__generatedMappings` and `__originalMappings` are arrays that hold the
  18831. // parsed mapping coordinates from the source map's "mappings" attribute. They
  18832. // are lazily instantiated, accessed via the `_generatedMappings` and
  18833. // `_originalMappings` getters respectively, and we only parse the mappings
  18834. // and create these arrays once queried for a source location. We jump through
  18835. // these hoops because there can be many thousands of mappings, and parsing
  18836. // them is expensive, so we only want to do it if we must.
  18837. //
  18838. // Each object in the arrays is of the form:
  18839. //
  18840. // {
  18841. // generatedLine: The line number in the generated code,
  18842. // generatedColumn: The column number in the generated code,
  18843. // source: The path to the original source file that generated this
  18844. // chunk of code,
  18845. // originalLine: The line number in the original source that
  18846. // corresponds to this chunk of generated code,
  18847. // originalColumn: The column number in the original source that
  18848. // corresponds to this chunk of generated code,
  18849. // name: The name of the original symbol which generated this chunk of
  18850. // code.
  18851. // }
  18852. //
  18853. // All properties except for `generatedLine` and `generatedColumn` can be
  18854. // `null`.
  18855. //
  18856. // `_generatedMappings` is ordered by the generated positions.
  18857. //
  18858. // `_originalMappings` is ordered by the original positions.
  18859. function get() {
  18860. if (!this.__generatedMappings) {
  18861. this._sortGeneratedMappings();
  18862. }
  18863. return this.__generatedMappings;
  18864. }
  18865. },
  18866. {
  18867. key: "_originalMappings",
  18868. get: function get() {
  18869. if (!this.__originalMappings) {
  18870. this._sortOriginalMappings();
  18871. }
  18872. return this.__originalMappings;
  18873. }
  18874. },
  18875. {
  18876. key: "_generatedMappingsUnsorted",
  18877. get: function get() {
  18878. if (!this.__generatedMappingsUnsorted) {
  18879. this._parseMappings(this._mappings, this.sourceRoot);
  18880. }
  18881. return this.__generatedMappingsUnsorted;
  18882. }
  18883. },
  18884. {
  18885. key: "_originalMappingsUnsorted",
  18886. get: function get() {
  18887. if (!this.__originalMappingsUnsorted) {
  18888. this._parseMappings(this._mappings, this.sourceRoot);
  18889. }
  18890. return this.__originalMappingsUnsorted;
  18891. }
  18892. },
  18893. {
  18894. key: "sources",
  18895. get: /**
  18896. * The list of original sources.
  18897. */ function get() {
  18898. var sources = [];
  18899. for(var i = 0; i < this._sections.length; i++){
  18900. for(var j = 0; j < this._sections[i].consumer.sources.length; j++){
  18901. sources.push(this._sections[i].consumer.sources[j]);
  18902. }
  18903. }
  18904. return sources;
  18905. }
  18906. }
  18907. ]);
  18908. return IndexedSourceMapConsumer;
  18909. }(SourceMapConsumer);
  18910. /*
  18911. * Cheat to get around inter-twingled classes. `factory()` can be at the end
  18912. * where it has access to non-hoisted classes, but it gets hoisted itself.
  18913. */ function _factory(aSourceMap, aSourceMapURL) {
  18914. var sourceMap = aSourceMap;
  18915. if (typeof aSourceMap === "string") {
  18916. sourceMap = util.parseSourceMapInput(aSourceMap);
  18917. }
  18918. var consumer = sourceMap.sections != null ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL) : new BasicSourceMapConsumer(sourceMap, aSourceMapURL);
  18919. return Promise.resolve(consumer);
  18920. }
  18921. function _factoryBSM(aSourceMap, aSourceMapURL) {
  18922. return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL);
  18923. }
  18924. var SourceMapGenerator = sourceMapGenerator.SourceMapGenerator;
  18925. var convertSourceMap = {};
  18926. var safeBuffer = {exports: {}};
  18927. (function(module, exports) {
  18928. var copyProps = // alternative to using Object.keys for old browsers
  18929. function copyProps(src, dst) {
  18930. for(var key in src){
  18931. dst[key] = src[key];
  18932. }
  18933. };
  18934. var SafeBuffer = function SafeBuffer(arg, encodingOrOffset, length) {
  18935. return Buffer(arg, encodingOrOffset, length);
  18936. };
  18937. var buffer = require$$0__default$1["default"];
  18938. var Buffer = buffer.Buffer;
  18939. if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {
  18940. module.exports = buffer;
  18941. } else {
  18942. // Copy properties from require('buffer')
  18943. copyProps(buffer, exports);
  18944. exports.Buffer = SafeBuffer;
  18945. }
  18946. // Copy static methods from Buffer
  18947. copyProps(Buffer, SafeBuffer);
  18948. SafeBuffer.from = function(arg, encodingOrOffset, length) {
  18949. if (typeof arg === "number") {
  18950. throw new TypeError("Argument must not be a number");
  18951. }
  18952. return Buffer(arg, encodingOrOffset, length);
  18953. };
  18954. SafeBuffer.alloc = function(size, fill, encoding) {
  18955. if (typeof size !== "number") {
  18956. throw new TypeError("Argument must be a number");
  18957. }
  18958. var buf = Buffer(size);
  18959. if (fill !== undefined) {
  18960. if (typeof encoding === "string") {
  18961. buf.fill(fill, encoding);
  18962. } else {
  18963. buf.fill(fill);
  18964. }
  18965. } else {
  18966. buf.fill(0);
  18967. }
  18968. return buf;
  18969. };
  18970. SafeBuffer.allocUnsafe = function(size) {
  18971. if (typeof size !== "number") {
  18972. throw new TypeError("Argument must be a number");
  18973. }
  18974. return Buffer(size);
  18975. };
  18976. SafeBuffer.allocUnsafeSlow = function(size) {
  18977. if (typeof size !== "number") {
  18978. throw new TypeError("Argument must be a number");
  18979. }
  18980. return buffer.SlowBuffer(size);
  18981. };
  18982. })(safeBuffer, safeBuffer.exports);
  18983. (function(exports) {
  18984. var decodeBase64 = function decodeBase64(base64) {
  18985. return SafeBuffer.Buffer.from(base64, "base64").toString();
  18986. };
  18987. var stripComment = function stripComment(sm) {
  18988. return sm.split(",").pop();
  18989. };
  18990. var readFromFileMap = function readFromFileMap(sm, dir) {
  18991. // NOTE: this will only work on the server since it attempts to read the map file
  18992. var r = exports.mapFileCommentRegex.exec(sm);
  18993. // for some odd reason //# .. captures in 1 and /* .. */ in 2
  18994. var filename = r[1] || r[2];
  18995. var filepath = path.resolve(dir, filename);
  18996. try {
  18997. return fs.readFileSync(filepath, "utf8");
  18998. } catch (e) {
  18999. throw new Error("An error occurred while trying to read the map file at " + filepath + "\n" + e);
  19000. }
  19001. };
  19002. var Converter = function Converter(sm, opts) {
  19003. opts = opts || {};
  19004. if (opts.isFileComment) sm = readFromFileMap(sm, opts.commentFileDir);
  19005. if (opts.hasComment) sm = stripComment(sm);
  19006. if (opts.isEncoded) sm = decodeBase64(sm);
  19007. if (opts.isJSON || opts.isEncoded) sm = JSON.parse(sm);
  19008. this.sourcemap = sm;
  19009. };
  19010. var fs = require$$0__default["default"];
  19011. var path = require$$1__default["default"];
  19012. var SafeBuffer = safeBuffer.exports;
  19013. Object.defineProperty(exports, "commentRegex", {
  19014. get: function getCommentRegex() {
  19015. return /^\s*\/(?:\/|\*)[@#]\s+sourceMappingURL=data:(?:application|text)\/json;(?:charset[:=]\S+?;)?base64,(?:.*)$/mg;
  19016. }
  19017. });
  19018. Object.defineProperty(exports, "mapFileCommentRegex", {
  19019. get: function getMapFileCommentRegex() {
  19020. // Matches sourceMappingURL in either // or /* comment styles.
  19021. return /(?:\/\/[@#][ \t]+sourceMappingURL=([^\s'"`]+?)[ \t]*$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^\*]+?)[ \t]*(?:\*\/){1}[ \t]*$)/mg;
  19022. }
  19023. });
  19024. Converter.prototype.toJSON = function(space) {
  19025. return JSON.stringify(this.sourcemap, null, space);
  19026. };
  19027. Converter.prototype.toBase64 = function() {
  19028. var json = this.toJSON();
  19029. return SafeBuffer.Buffer.from(json, "utf8").toString("base64");
  19030. };
  19031. Converter.prototype.toComment = function(options) {
  19032. var base64 = this.toBase64();
  19033. var data = "sourceMappingURL=data:application/json;charset=utf-8;base64," + base64;
  19034. return options && options.multiline ? "/*# " + data + " */" : "//# " + data;
  19035. };
  19036. // returns copy instead of original
  19037. Converter.prototype.toObject = function() {
  19038. return JSON.parse(this.toJSON());
  19039. };
  19040. Converter.prototype.addProperty = function(key, value) {
  19041. if (this.sourcemap.hasOwnProperty(key)) throw new Error('property "' + key + '" already exists on the sourcemap, use set property instead');
  19042. return this.setProperty(key, value);
  19043. };
  19044. Converter.prototype.setProperty = function(key, value) {
  19045. this.sourcemap[key] = value;
  19046. return this;
  19047. };
  19048. Converter.prototype.getProperty = function(key) {
  19049. return this.sourcemap[key];
  19050. };
  19051. exports.fromObject = function(obj) {
  19052. return new Converter(obj);
  19053. };
  19054. exports.fromJSON = function(json) {
  19055. return new Converter(json, {
  19056. isJSON: true
  19057. });
  19058. };
  19059. exports.fromBase64 = function(base64) {
  19060. return new Converter(base64, {
  19061. isEncoded: true
  19062. });
  19063. };
  19064. exports.fromComment = function(comment) {
  19065. comment = comment.replace(/^\/\*/g, "//").replace(/\*\/$/g, "");
  19066. return new Converter(comment, {
  19067. isEncoded: true,
  19068. hasComment: true
  19069. });
  19070. };
  19071. exports.fromMapFileComment = function(comment, dir) {
  19072. return new Converter(comment, {
  19073. commentFileDir: dir,
  19074. isFileComment: true,
  19075. isJSON: true
  19076. });
  19077. };
  19078. // Finds last sourcemap comment in file or returns null if none was found
  19079. exports.fromSource = function(content) {
  19080. var m = content.match(exports.commentRegex);
  19081. return m ? exports.fromComment(m.pop()) : null;
  19082. };
  19083. // Finds last sourcemap comment in file or returns null if none was found
  19084. exports.fromMapFileSource = function(content, dir) {
  19085. var m = content.match(exports.mapFileCommentRegex);
  19086. return m ? exports.fromMapFileComment(m.pop(), dir) : null;
  19087. };
  19088. exports.removeComments = function(src) {
  19089. return src.replace(exports.commentRegex, "");
  19090. };
  19091. exports.removeMapFileComments = function(src) {
  19092. return src.replace(exports.mapFileCommentRegex, "");
  19093. };
  19094. exports.generateMapFileComment = function(file, options) {
  19095. var data = "sourceMappingURL=" + file;
  19096. return options && options.multiline ? "/*# " + data + " */" : "//# " + data;
  19097. };
  19098. })(convertSourceMap);
  19099. var stylis$1 = {exports: {}};
  19100. (function(module, exports) {
  19101. (function(factory) {
  19102. module["exports"] = factory(null) ;
  19103. })(/** @param {*=} options */ function factory(options) {
  19104. var select = /**
  19105. * Select
  19106. *
  19107. * @param {Array<string>} parent
  19108. * @param {string} current
  19109. * @param {number} invert
  19110. * @return {Array<string>}
  19111. */ function select(parent, current, invert) {
  19112. var selectors = current.trim().split(selectorptn);
  19113. var out = selectors;
  19114. var length = selectors.length;
  19115. var l = parent.length;
  19116. switch(l){
  19117. // 0-1 parent selectors
  19118. case 0:
  19119. case 1:
  19120. {
  19121. for(var i = 0, selector = l === 0 ? "" : parent[0] + " "; i < length; ++i){
  19122. out[i] = scope(selector, out[i], invert, l).trim();
  19123. }
  19124. break;
  19125. }
  19126. // >2 parent selectors, nested
  19127. default:
  19128. {
  19129. for(var i = 0, j = 0, out = []; i < length; ++i){
  19130. for(var k = 0; k < l; ++k){
  19131. out[j++] = scope(parent[k] + " ", selectors[i], invert, l).trim();
  19132. }
  19133. }
  19134. }
  19135. }
  19136. return out;
  19137. };
  19138. var scope = /**
  19139. * Scope
  19140. *
  19141. * @param {string} parent
  19142. * @param {string} current
  19143. * @param {number} invert
  19144. * @param {number} level
  19145. * @return {string}
  19146. */ function scope(parent, current, invert, level) {
  19147. var selector = current;
  19148. var code = selector.charCodeAt(0);
  19149. // trim leading whitespace
  19150. if (code < 33) {
  19151. code = (selector = selector.trim()).charCodeAt(0);
  19152. }
  19153. switch(code){
  19154. // &
  19155. case AND:
  19156. {
  19157. switch(cascade + level){
  19158. case 0:
  19159. case 1:
  19160. {
  19161. if (parent.trim().length === 0) {
  19162. break;
  19163. }
  19164. }
  19165. default:
  19166. {
  19167. return selector.replace(andptn, "$1" + parent.trim());
  19168. }
  19169. }
  19170. break;
  19171. }
  19172. // :
  19173. case COLON:
  19174. {
  19175. switch(selector.charCodeAt(1)){
  19176. // g in :global
  19177. case 103:
  19178. {
  19179. if (escape > 0 && cascade > 0) {
  19180. return selector.replace(escapeptn, "$1").replace(andptn, "$1" + nscope);
  19181. }
  19182. break;
  19183. }
  19184. default:
  19185. {
  19186. // :hover
  19187. return parent.trim() + selector.replace(andptn, "$1" + parent.trim());
  19188. }
  19189. }
  19190. }
  19191. default:
  19192. {
  19193. // html &
  19194. if (invert * cascade > 0 && selector.indexOf("\f") > 0) {
  19195. return selector.replace(andptn, (parent.charCodeAt(0) === COLON ? "" : "$1") + parent.trim());
  19196. }
  19197. }
  19198. }
  19199. return parent + selector;
  19200. };
  19201. var vendor = /**
  19202. * Vendor
  19203. *
  19204. * @param {string} content
  19205. * @param {number} context
  19206. * @return {boolean}
  19207. */ function vendor(content, context) {
  19208. var index = content.indexOf(context === 1 ? ":" : "{");
  19209. var key = content.substring(0, context !== 3 ? index : 10);
  19210. var value = content.substring(index + 1, content.length - 1);
  19211. return should(context !== 2 ? key : key.replace(pseudofmt, "$1"), value, context);
  19212. };
  19213. var supports = /**
  19214. * Supports
  19215. *
  19216. * @param {string} match
  19217. * @param {string} group
  19218. * @return {string}
  19219. */ function supports(match, group) {
  19220. var out = property(group, group.charCodeAt(0), group.charCodeAt(1), group.charCodeAt(2));
  19221. return out !== group + ";" ? out.replace(propertyptn, " or ($1)").substring(4) : "(" + group + ")";
  19222. };
  19223. var animation = /**
  19224. * Animation
  19225. *
  19226. * @param {string} input
  19227. * @return {string}
  19228. */ function animation(input) {
  19229. var length = input.length;
  19230. var index = input.indexOf(":", 9) + 1;
  19231. var declare = input.substring(0, index).trim();
  19232. var out = input.substring(index, length - 1).trim();
  19233. switch(input.charCodeAt(9) * keyed){
  19234. case 0:
  19235. {
  19236. break;
  19237. }
  19238. // animation-*, -
  19239. case DASH:
  19240. {
  19241. // animation-name, n
  19242. if (input.charCodeAt(10) !== 110) {
  19243. break;
  19244. }
  19245. }
  19246. // animation/animation-name
  19247. default:
  19248. {
  19249. // split in case of multiple animations
  19250. var list = out.split((out = "", animationptn));
  19251. for(var i = 0, index = 0, length = list.length; i < length; index = 0, ++i){
  19252. var value = list[i];
  19253. var items = value.split(propertiesptn);
  19254. while(value = items[index]){
  19255. var peak = value.charCodeAt(0);
  19256. if (keyed === 1 && (// letters
  19257. (peak > AT && peak < 90) || peak > 96 && peak < 123 || peak === UNDERSCORE || // dash but not in sequence i.e --
  19258. (peak === DASH && value.charCodeAt(1) !== DASH))) {
  19259. // not a number/function
  19260. switch(isNaN(parseFloat(value)) + (value.indexOf("(") !== -1)){
  19261. case 1:
  19262. {
  19263. switch(value){
  19264. // not a valid reserved keyword
  19265. case "infinite":
  19266. case "alternate":
  19267. case "backwards":
  19268. case "running":
  19269. case "normal":
  19270. case "forwards":
  19271. case "both":
  19272. case "none":
  19273. case "linear":
  19274. case "ease":
  19275. case "ease-in":
  19276. case "ease-out":
  19277. case "ease-in-out":
  19278. case "paused":
  19279. case "reverse":
  19280. case "alternate-reverse":
  19281. case "inherit":
  19282. case "initial":
  19283. case "unset":
  19284. case "step-start":
  19285. case "step-end":
  19286. {
  19287. break;
  19288. }
  19289. default:
  19290. {
  19291. value += key;
  19292. }
  19293. }
  19294. }
  19295. }
  19296. }
  19297. items[index++] = value;
  19298. }
  19299. out += (i === 0 ? "" : ",") + items.join(" ");
  19300. }
  19301. }
  19302. }
  19303. out = declare + out + ";";
  19304. if (prefix === 1 || prefix === 2 && vendor(out, 1)) return webkit + out + out;
  19305. return out;
  19306. };
  19307. var isolate = /**
  19308. * Isolate
  19309. *
  19310. * @param {Array<string>} current
  19311. */ function isolate(current) {
  19312. for(var i = 0, length = current.length, selector = Array(length), padding, element; i < length; ++i){
  19313. // split individual elements in a selector i.e h1 h2 === [h1, h2]
  19314. var elements = current[i].split(elementptn);
  19315. var out = "";
  19316. for(var j = 0, size = 0, tail = 0, code = 0, l = elements.length; j < l; ++j){
  19317. // empty element
  19318. if ((size = (element = elements[j]).length) === 0 && l > 1) {
  19319. continue;
  19320. }
  19321. tail = out.charCodeAt(out.length - 1);
  19322. code = element.charCodeAt(0);
  19323. padding = "";
  19324. if (j !== 0) {
  19325. // determine if we need padding
  19326. switch(tail){
  19327. case STAR:
  19328. case TILDE:
  19329. case GREATERTHAN:
  19330. case PLUS:
  19331. case SPACE:
  19332. case OPENPARENTHESES:
  19333. {
  19334. break;
  19335. }
  19336. default:
  19337. {
  19338. padding = " ";
  19339. }
  19340. }
  19341. }
  19342. switch(code){
  19343. case AND:
  19344. {
  19345. element = padding + nscopealt;
  19346. }
  19347. case TILDE:
  19348. case GREATERTHAN:
  19349. case PLUS:
  19350. case SPACE:
  19351. case CLOSEPARENTHESES:
  19352. case OPENPARENTHESES:
  19353. {
  19354. break;
  19355. }
  19356. case OPENBRACKET:
  19357. {
  19358. element = padding + element + nscopealt;
  19359. break;
  19360. }
  19361. case COLON:
  19362. {
  19363. switch(element.charCodeAt(1) * 2 + element.charCodeAt(2) * 3){
  19364. // :global
  19365. case 530:
  19366. {
  19367. if (escape > 0) {
  19368. element = padding + element.substring(8, size - 1);
  19369. break;
  19370. }
  19371. }
  19372. // :hover, :nth-child(), ...
  19373. default:
  19374. {
  19375. if (j < 1 || elements[j - 1].length < 1) {
  19376. element = padding + nscopealt + element;
  19377. }
  19378. }
  19379. }
  19380. break;
  19381. }
  19382. case COMMA:
  19383. {
  19384. padding = "";
  19385. }
  19386. default:
  19387. {
  19388. if (size > 1 && element.indexOf(":") > 0) {
  19389. element = padding + element.replace(pseudoptn, "$1" + nscopealt + "$2");
  19390. } else {
  19391. element = padding + element + nscopealt;
  19392. }
  19393. }
  19394. }
  19395. out += element;
  19396. }
  19397. selector[i] = out.replace(formatptn, "").trim();
  19398. }
  19399. return selector;
  19400. };
  19401. var proxy = /**
  19402. * Proxy
  19403. *
  19404. * @param {number} context
  19405. * @param {string} content
  19406. * @param {Array<string>} selectors
  19407. * @param {Array<string>} parents
  19408. * @param {number} line
  19409. * @param {number} column
  19410. * @param {number} length
  19411. * @param {number} id
  19412. * @param {number} depth
  19413. * @param {number} at
  19414. * @return {(string|void|*)}
  19415. */ function proxy(context, content, selectors, parents, line, column, length, id, depth, at) {
  19416. for(var i = 0, out = content, next; i < plugged; ++i){
  19417. switch(next = plugins[i].call(stylis, context, out, selectors, parents, line, column, length, id, depth, at)){
  19418. case void 0:
  19419. case false:
  19420. case true:
  19421. case null:
  19422. {
  19423. break;
  19424. }
  19425. default:
  19426. {
  19427. out = next;
  19428. }
  19429. }
  19430. }
  19431. if (out !== content) {
  19432. return out;
  19433. }
  19434. };
  19435. var delimited = /**
  19436. * @param {number} code
  19437. * @param {number} index
  19438. * @param {number} length
  19439. * @param {string} body
  19440. * @return {number}
  19441. */ function delimited(code, index, length, body) {
  19442. for(var i = index + 1; i < length; ++i){
  19443. switch(body.charCodeAt(i)){
  19444. // /*
  19445. case FOWARDSLASH:
  19446. {
  19447. if (code === STAR) {
  19448. if (body.charCodeAt(i - 1) === STAR && index + 2 !== i) {
  19449. return i + 1;
  19450. }
  19451. }
  19452. break;
  19453. }
  19454. // //
  19455. case NEWLINE:
  19456. {
  19457. if (code === FOWARDSLASH) {
  19458. return i + 1;
  19459. }
  19460. }
  19461. }
  19462. }
  19463. return i;
  19464. };
  19465. var minify = /**
  19466. * Minify
  19467. *
  19468. * @param {(string|*)} output
  19469. * @return {string}
  19470. */ function minify(output) {
  19471. return output.replace(formatptn, "").replace(beforeptn, "").replace(afterptn, "$1").replace(tailptn, "$1").replace(whiteptn, " ");
  19472. };
  19473. /**
  19474. * Notes
  19475. *
  19476. * The ['<method name>'] pattern is used to support closure compiler
  19477. * the jsdoc signatures are also used to the same effect
  19478. *
  19479. * ----
  19480. *
  19481. * int + int + int === n4 [faster]
  19482. *
  19483. * vs
  19484. *
  19485. * int === n1 && int === n2 && int === n3
  19486. *
  19487. * ----
  19488. *
  19489. * switch (int) { case ints...} [faster]
  19490. *
  19491. * vs
  19492. *
  19493. * if (int == 1 && int === 2 ...)
  19494. *
  19495. * ----
  19496. *
  19497. * The (first*n1 + second*n2 + third*n3) format used in the property parser
  19498. * is a simple way to hash the sequence of characters
  19499. * taking into account the index they occur in
  19500. * since any number of 3 character sequences could produce duplicates.
  19501. *
  19502. * On the other hand sequences that are directly tied to the index of the character
  19503. * resolve a far more accurate measure, it's also faster
  19504. * to evaluate one condition in a switch statement
  19505. * than three in an if statement regardless of the added math.
  19506. *
  19507. * This allows the vendor prefixer to be both small and fast.
  19508. */ var nullptn = /^\0+/g /* matches leading null characters */ ;
  19509. var formatptn = /[\0\r\f]/g /* matches new line, null and formfeed characters */ ;
  19510. var colonptn = /: */g /* splits animation rules */ ;
  19511. var cursorptn = /zoo|gra/ /* assert cursor varient */ ;
  19512. var transformptn = /([,: ])(transform)/g /* vendor prefix transform, older webkit */ ;
  19513. var animationptn = /,+\s*(?![^(]*[)])/g /* splits multiple shorthand notation animations */ ;
  19514. var propertiesptn = / +\s*(?![^(]*[)])/g /* animation properties */ ;
  19515. var elementptn = / *[\0] */g /* selector elements */ ;
  19516. var selectorptn = /,\r+?/g /* splits selectors */ ;
  19517. var andptn = /([\t\r\n ])*\f?&/g /* match & */ ;
  19518. var escapeptn = /:global\(((?:[^\(\)\[\]]*|\[.*\]|\([^\(\)]*\))*)\)/g /* matches :global(.*) */ ;
  19519. var invalidptn = /\W+/g /* removes invalid characters from keyframes */ ;
  19520. var keyframeptn = /@(k\w+)\s*(\S*)\s*/ /* matches @keyframes $1 */ ;
  19521. var plcholdrptn = /::(place)/g /* match ::placeholder varient */ ;
  19522. var readonlyptn = /:(read-only)/g /* match :read-only varient */ ;
  19523. var beforeptn = /\s+(?=[{\];=:>])/g /* matches \s before ] ; = : */ ;
  19524. var afterptn = /([[}=:>])\s+/g /* matches \s after characters [ } = : */ ;
  19525. var tailptn = /(\{[^{]+?);(?=\})/g /* matches tail semi-colons ;} */ ;
  19526. var whiteptn = /\s{2,}/g /* matches repeating whitespace */ ;
  19527. var pseudoptn = /([^\(])(:+) */g /* pseudo element */ ;
  19528. var writingptn = /[svh]\w+-[tblr]{2}/ /* match writing mode property values */ ;
  19529. var supportsptn = /\(\s*(.*)\s*\)/g /* match supports (groups) */ ;
  19530. var propertyptn = /([\s\S]*?);/g /* match properties leading semicolon */ ;
  19531. var selfptn = /-self|flex-/g /* match flex- and -self in align-self: flex-*; */ ;
  19532. var pseudofmt = /[^]*?(:[rp][el]a[\w-]+)[^]*/ /* extrats :readonly or :placholder from selector */ ;
  19533. var dimensionptn = /stretch|:\s*\w+\-(?:conte|avail)/ /* match max/min/fit-content, fill-available */ ;
  19534. var imgsrcptn = /([^-])(image-set\()/;
  19535. /* vendors */ var webkit = "-webkit-";
  19536. var moz = "-moz-";
  19537. var ms = "-ms-";
  19538. /* character codes */ var SEMICOLON = 59 /* ; */ ;
  19539. var CLOSEBRACES = 125 /* } */ ;
  19540. var OPENBRACES = 123 /* { */ ;
  19541. var OPENPARENTHESES = 40 /* ( */ ;
  19542. var CLOSEPARENTHESES = 41 /* ) */ ;
  19543. var OPENBRACKET = 91 /* [ */ ;
  19544. var CLOSEBRACKET = 93 /* ] */ ;
  19545. var NEWLINE = 10 /* \n */ ;
  19546. var CARRIAGE = 13 /* \r */ ;
  19547. var TAB = 9 /* \t */ ;
  19548. var AT = 64 /* @ */ ;
  19549. var SPACE = 32 /* */ ;
  19550. var AND = 38 /* & */ ;
  19551. var DASH = 45 /* - */ ;
  19552. var UNDERSCORE = 95 /* _ */ ;
  19553. var STAR = 42 /* * */ ;
  19554. var COMMA = 44 /* , */ ;
  19555. var COLON = 58 /* : */ ;
  19556. var SINGLEQUOTE = 39 /* ' */ ;
  19557. var DOUBLEQUOTE = 34 /* " */ ;
  19558. var FOWARDSLASH = 47 /* / */ ;
  19559. var GREATERTHAN = 62 /* > */ ;
  19560. var PLUS = 43 /* + */ ;
  19561. var TILDE = 126 /* ~ */ ;
  19562. var NULL = 0 /* \0 */ ;
  19563. var FORMFEED = 12 /* \f */ ;
  19564. var VERTICALTAB = 11 /* \v */ ;
  19565. /* special identifiers */ var KEYFRAME = 107 /* k */ ;
  19566. var MEDIA = 109 /* m */ ;
  19567. var SUPPORTS = 115 /* s */ ;
  19568. var PLACEHOLDER = 112 /* p */ ;
  19569. var READONLY = 111 /* o */ ;
  19570. var IMPORT = 105 /* <at>i */ ;
  19571. var CHARSET = 99 /* <at>c */ ;
  19572. var DOCUMENT = 100 /* <at>d */ ;
  19573. var PAGE = 112 /* <at>p */ ;
  19574. var column = 1 /* current column */ ;
  19575. var line = 1 /* current line numebr */ ;
  19576. var pattern = 0 /* :pattern */ ;
  19577. var cascade = 1 /* #id h1 h2 vs h1#id h2#id */ ;
  19578. var prefix = 1 /* vendor prefix */ ;
  19579. var escape = 1 /* escape :global() pattern */ ;
  19580. var compress = 0 /* compress output */ ;
  19581. var semicolon = 0 /* no/semicolon option */ ;
  19582. var preserve = 0 /* preserve empty selectors */ ;
  19583. /* empty reference */ var array = [];
  19584. /* plugins */ var plugins = [];
  19585. var plugged = 0;
  19586. var should = null;
  19587. /* plugin context */ var POSTS = -2;
  19588. var PREPS = -1;
  19589. var UNKWN = 0;
  19590. var PROPS = 1;
  19591. var BLCKS = 2;
  19592. var ATRUL = 3;
  19593. /* plugin newline context */ var unkwn = 0;
  19594. /* keyframe animation */ var keyed = 1;
  19595. var key = "";
  19596. /* selector namespace */ var nscopealt = "";
  19597. var nscope = "";
  19598. /**
  19599. * Compile
  19600. *
  19601. * @param {Array<string>} parent
  19602. * @param {Array<string>} current
  19603. * @param {string} body
  19604. * @param {number} id
  19605. * @param {number} depth
  19606. * @return {string}
  19607. */ function compile(parent, current, body, id, depth) {
  19608. var bracket = 0 /* brackets [] */ ;
  19609. var comment = 0 /* comments /* // or /* */ ;
  19610. var parentheses = 0 /* functions () */ ;
  19611. var quote = 0 /* quotes '', "" */ ;
  19612. var first = 0 /* first character code */ ;
  19613. var second = 0 /* second character code */ ;
  19614. var code = 0 /* current character code */ ;
  19615. var tail = 0 /* previous character code */ ;
  19616. var trail = 0 /* character before previous code */ ;
  19617. var peak = 0 /* previous non-whitespace code */ ;
  19618. var counter = 0 /* count sequence termination */ ;
  19619. var context = 0 /* track current context */ ;
  19620. var atrule = 0 /* track @at-rule context */ ;
  19621. var pseudo = 0 /* track pseudo token index */ ;
  19622. var caret = 0 /* current character index */ ;
  19623. var format = 0 /* control character formating context */ ;
  19624. var insert = 0 /* auto semicolon insertion */ ;
  19625. var invert = 0 /* inverted selector pattern */ ;
  19626. var length = 0 /* generic length address */ ;
  19627. var eof = body.length /* end of file(length) */ ;
  19628. var eol = eof - 1 /* end of file(characters) */ ;
  19629. var char = "" /* current character */ ;
  19630. var chars = "" /* current buffer of characters */ ;
  19631. var child = "" /* next buffer of characters */ ;
  19632. var out = "" /* compiled body */ ;
  19633. var children = "" /* compiled children */ ;
  19634. var flat = "" /* compiled leafs */ ;
  19635. var selector /* generic selector address */ ;
  19636. var result /* generic address */ ;
  19637. // ...build body
  19638. while(caret < eof){
  19639. code = body.charCodeAt(caret);
  19640. // eof varient
  19641. if (caret === eol) {
  19642. // last character + noop context, add synthetic padding for noop context to terminate
  19643. if (comment + quote + parentheses + bracket !== 0) {
  19644. if (comment !== 0) {
  19645. code = comment === FOWARDSLASH ? NEWLINE : FOWARDSLASH;
  19646. }
  19647. quote = parentheses = bracket = 0;
  19648. eof++;
  19649. eol++;
  19650. }
  19651. }
  19652. if (comment + quote + parentheses + bracket === 0) {
  19653. // eof varient
  19654. if (caret === eol) {
  19655. if (format > 0) {
  19656. chars = chars.replace(formatptn, "");
  19657. }
  19658. if (chars.trim().length > 0) {
  19659. switch(code){
  19660. case SPACE:
  19661. case TAB:
  19662. case SEMICOLON:
  19663. case CARRIAGE:
  19664. case NEWLINE:
  19665. {
  19666. break;
  19667. }
  19668. default:
  19669. {
  19670. chars += body.charAt(caret);
  19671. }
  19672. }
  19673. code = SEMICOLON;
  19674. }
  19675. }
  19676. // auto semicolon insertion
  19677. if (insert === 1) {
  19678. switch(code){
  19679. // false flags
  19680. case OPENBRACES:
  19681. case CLOSEBRACES:
  19682. case SEMICOLON:
  19683. case DOUBLEQUOTE:
  19684. case SINGLEQUOTE:
  19685. case OPENPARENTHESES:
  19686. case CLOSEPARENTHESES:
  19687. case COMMA:
  19688. {
  19689. insert = 0;
  19690. }
  19691. // ignore
  19692. case TAB:
  19693. case CARRIAGE:
  19694. case NEWLINE:
  19695. case SPACE:
  19696. {
  19697. break;
  19698. }
  19699. // valid
  19700. default:
  19701. {
  19702. insert = 0;
  19703. length = caret;
  19704. first = code;
  19705. caret--;
  19706. code = SEMICOLON;
  19707. while(length < eof){
  19708. switch(body.charCodeAt(length++)){
  19709. case NEWLINE:
  19710. case CARRIAGE:
  19711. case SEMICOLON:
  19712. {
  19713. ++caret;
  19714. code = first;
  19715. length = eof;
  19716. break;
  19717. }
  19718. case COLON:
  19719. {
  19720. if (format > 0) {
  19721. ++caret;
  19722. code = first;
  19723. }
  19724. }
  19725. case OPENBRACES:
  19726. {
  19727. length = eof;
  19728. }
  19729. }
  19730. }
  19731. }
  19732. }
  19733. }
  19734. // token varient
  19735. switch(code){
  19736. case OPENBRACES:
  19737. {
  19738. chars = chars.trim();
  19739. first = chars.charCodeAt(0);
  19740. counter = 1;
  19741. length = ++caret;
  19742. while(caret < eof){
  19743. switch(code = body.charCodeAt(caret)){
  19744. case OPENBRACES:
  19745. {
  19746. counter++;
  19747. break;
  19748. }
  19749. case CLOSEBRACES:
  19750. {
  19751. counter--;
  19752. break;
  19753. }
  19754. case FOWARDSLASH:
  19755. {
  19756. switch(second = body.charCodeAt(caret + 1)){
  19757. // /*, //
  19758. case STAR:
  19759. case FOWARDSLASH:
  19760. {
  19761. caret = delimited(second, caret, eol, body);
  19762. }
  19763. }
  19764. break;
  19765. }
  19766. // given "[" === 91 & "]" === 93 hence forth 91 + 1 + 1 === 93
  19767. case OPENBRACKET:
  19768. {
  19769. code++;
  19770. }
  19771. // given "(" === 40 & ")" === 41 hence forth 40 + 1 === 41
  19772. case OPENPARENTHESES:
  19773. {
  19774. code++;
  19775. }
  19776. // quote tail delimiter is identical to the head delimiter hence noop,
  19777. // fallthrough clauses have been shifted to the correct tail delimiter
  19778. case DOUBLEQUOTE:
  19779. case SINGLEQUOTE:
  19780. {
  19781. while(caret++ < eol){
  19782. if (body.charCodeAt(caret) === code) {
  19783. break;
  19784. }
  19785. }
  19786. }
  19787. }
  19788. if (counter === 0) {
  19789. break;
  19790. }
  19791. caret++;
  19792. }
  19793. child = body.substring(length, caret);
  19794. if (first === NULL) {
  19795. first = (chars = chars.replace(nullptn, "").trim()).charCodeAt(0);
  19796. }
  19797. switch(first){
  19798. // @at-rule
  19799. case AT:
  19800. {
  19801. if (format > 0) {
  19802. chars = chars.replace(formatptn, "");
  19803. }
  19804. second = chars.charCodeAt(1);
  19805. switch(second){
  19806. case DOCUMENT:
  19807. case MEDIA:
  19808. case SUPPORTS:
  19809. case DASH:
  19810. {
  19811. selector = current;
  19812. break;
  19813. }
  19814. default:
  19815. {
  19816. selector = array;
  19817. }
  19818. }
  19819. child = compile(current, selector, child, second, depth + 1);
  19820. length = child.length;
  19821. // preserve empty @at-rule
  19822. if (preserve > 0 && length === 0) {
  19823. length = chars.length;
  19824. }
  19825. // execute plugins, @at-rule context
  19826. if (plugged > 0) {
  19827. selector = select(array, chars, invert);
  19828. result = proxy(ATRUL, child, selector, current, line, column, length, second, depth, id);
  19829. chars = selector.join("");
  19830. if (result !== void 0) {
  19831. if ((length = (child = result.trim()).length) === 0) {
  19832. second = 0;
  19833. child = "";
  19834. }
  19835. }
  19836. }
  19837. if (length > 0) {
  19838. switch(second){
  19839. case SUPPORTS:
  19840. {
  19841. chars = chars.replace(supportsptn, supports);
  19842. }
  19843. case DOCUMENT:
  19844. case MEDIA:
  19845. case DASH:
  19846. {
  19847. child = chars + "{" + child + "}";
  19848. break;
  19849. }
  19850. case KEYFRAME:
  19851. {
  19852. chars = chars.replace(keyframeptn, "$1 $2" + (keyed > 0 ? key : ""));
  19853. child = chars + "{" + child + "}";
  19854. if (prefix === 1 || prefix === 2 && vendor("@" + child, 3)) {
  19855. child = "@" + webkit + child + "@" + child;
  19856. } else {
  19857. child = "@" + child;
  19858. }
  19859. break;
  19860. }
  19861. default:
  19862. {
  19863. child = chars + child;
  19864. if (id === PAGE) {
  19865. child = (out += child, "");
  19866. }
  19867. }
  19868. }
  19869. } else {
  19870. child = "";
  19871. }
  19872. break;
  19873. }
  19874. // selector
  19875. default:
  19876. {
  19877. child = compile(current, select(current, chars, invert), child, id, depth + 1);
  19878. }
  19879. }
  19880. children += child;
  19881. // reset
  19882. context = 0;
  19883. insert = 0;
  19884. pseudo = 0;
  19885. format = 0;
  19886. invert = 0;
  19887. atrule = 0;
  19888. chars = "";
  19889. child = "";
  19890. code = body.charCodeAt(++caret);
  19891. break;
  19892. }
  19893. case CLOSEBRACES:
  19894. case SEMICOLON:
  19895. {
  19896. chars = (format > 0 ? chars.replace(formatptn, "") : chars).trim();
  19897. if ((length = chars.length) > 1) {
  19898. // monkey-patch missing colon
  19899. if (pseudo === 0) {
  19900. first = chars.charCodeAt(0);
  19901. // first character is a letter or dash, buffer has a space character
  19902. if (first === DASH || first > 96 && first < 123) {
  19903. length = (chars = chars.replace(" ", ":")).length;
  19904. }
  19905. }
  19906. // execute plugins, property context
  19907. if (plugged > 0) {
  19908. if ((result = proxy(PROPS, chars, current, parent, line, column, out.length, id, depth, id)) !== void 0) {
  19909. if ((length = (chars = result.trim()).length) === 0) {
  19910. chars = "\0\0";
  19911. }
  19912. }
  19913. }
  19914. first = chars.charCodeAt(0);
  19915. second = chars.charCodeAt(1);
  19916. switch(first){
  19917. case NULL:
  19918. {
  19919. break;
  19920. }
  19921. case AT:
  19922. {
  19923. if (second === IMPORT || second === CHARSET) {
  19924. flat += chars + body.charAt(caret);
  19925. break;
  19926. }
  19927. }
  19928. default:
  19929. {
  19930. if (chars.charCodeAt(length - 1) === COLON) {
  19931. break;
  19932. }
  19933. out += property(chars, first, second, chars.charCodeAt(2));
  19934. }
  19935. }
  19936. }
  19937. // reset
  19938. context = 0;
  19939. insert = 0;
  19940. pseudo = 0;
  19941. format = 0;
  19942. invert = 0;
  19943. chars = "";
  19944. code = body.charCodeAt(++caret);
  19945. break;
  19946. }
  19947. }
  19948. }
  19949. // parse characters
  19950. switch(code){
  19951. case CARRIAGE:
  19952. case NEWLINE:
  19953. {
  19954. // auto insert semicolon
  19955. if (comment + quote + parentheses + bracket + semicolon === 0) {
  19956. // valid non-whitespace characters that
  19957. // may precede a newline
  19958. switch(peak){
  19959. case CLOSEPARENTHESES:
  19960. case SINGLEQUOTE:
  19961. case DOUBLEQUOTE:
  19962. case AT:
  19963. case TILDE:
  19964. case GREATERTHAN:
  19965. case STAR:
  19966. case PLUS:
  19967. case FOWARDSLASH:
  19968. case DASH:
  19969. case COLON:
  19970. case COMMA:
  19971. case SEMICOLON:
  19972. case OPENBRACES:
  19973. case CLOSEBRACES:
  19974. {
  19975. break;
  19976. }
  19977. default:
  19978. {
  19979. // current buffer has a colon
  19980. if (pseudo > 0) {
  19981. insert = 1;
  19982. }
  19983. }
  19984. }
  19985. }
  19986. // terminate line comment
  19987. if (comment === FOWARDSLASH) {
  19988. comment = 0;
  19989. } else if (cascade + context === 0 && id !== KEYFRAME && chars.length > 0) {
  19990. format = 1;
  19991. chars += "\0";
  19992. }
  19993. // execute plugins, newline context
  19994. if (plugged * unkwn > 0) {
  19995. proxy(UNKWN, chars, current, parent, line, column, out.length, id, depth, id);
  19996. }
  19997. // next line, reset column position
  19998. column = 1;
  19999. line++;
  20000. break;
  20001. }
  20002. case SEMICOLON:
  20003. case CLOSEBRACES:
  20004. {
  20005. if (comment + quote + parentheses + bracket === 0) {
  20006. column++;
  20007. break;
  20008. }
  20009. }
  20010. default:
  20011. {
  20012. // increment column position
  20013. column++;
  20014. // current character
  20015. char = body.charAt(caret);
  20016. // remove comments, escape functions, strings, attributes and prepare selectors
  20017. switch(code){
  20018. case TAB:
  20019. case SPACE:
  20020. {
  20021. if (quote + bracket + comment === 0) {
  20022. switch(tail){
  20023. case COMMA:
  20024. case COLON:
  20025. case TAB:
  20026. case SPACE:
  20027. {
  20028. char = "";
  20029. break;
  20030. }
  20031. default:
  20032. {
  20033. if (code !== SPACE) {
  20034. char = " ";
  20035. }
  20036. }
  20037. }
  20038. }
  20039. break;
  20040. }
  20041. // escape breaking control characters
  20042. case NULL:
  20043. {
  20044. char = "\\0";
  20045. break;
  20046. }
  20047. case FORMFEED:
  20048. {
  20049. char = "\\f";
  20050. break;
  20051. }
  20052. case VERTICALTAB:
  20053. {
  20054. char = "\\v";
  20055. break;
  20056. }
  20057. // &
  20058. case AND:
  20059. {
  20060. // inverted selector pattern i.e html &
  20061. if (quote + comment + bracket === 0 && cascade > 0) {
  20062. invert = 1;
  20063. format = 1;
  20064. char = "\f" + char;
  20065. }
  20066. break;
  20067. }
  20068. // ::p<l>aceholder, l
  20069. // :read-on<l>y, l
  20070. case 108:
  20071. {
  20072. if (quote + comment + bracket + pattern === 0 && pseudo > 0) {
  20073. switch(caret - pseudo){
  20074. // ::placeholder
  20075. case 2:
  20076. {
  20077. if (tail === PLACEHOLDER && body.charCodeAt(caret - 3) === COLON) {
  20078. pattern = tail;
  20079. }
  20080. }
  20081. // :read-only
  20082. case 8:
  20083. {
  20084. if (trail === READONLY) {
  20085. pattern = trail;
  20086. }
  20087. }
  20088. }
  20089. }
  20090. break;
  20091. }
  20092. // :<pattern>
  20093. case COLON:
  20094. {
  20095. if (quote + comment + bracket === 0) {
  20096. pseudo = caret;
  20097. }
  20098. break;
  20099. }
  20100. // selectors
  20101. case COMMA:
  20102. {
  20103. if (comment + parentheses + quote + bracket === 0) {
  20104. format = 1;
  20105. char += "\r";
  20106. }
  20107. break;
  20108. }
  20109. // quotes
  20110. case DOUBLEQUOTE:
  20111. case SINGLEQUOTE:
  20112. {
  20113. if (comment === 0) {
  20114. quote = quote === code ? 0 : quote === 0 ? code : quote;
  20115. }
  20116. break;
  20117. }
  20118. // attributes
  20119. case OPENBRACKET:
  20120. {
  20121. if (quote + comment + parentheses === 0) {
  20122. bracket++;
  20123. }
  20124. break;
  20125. }
  20126. case CLOSEBRACKET:
  20127. {
  20128. if (quote + comment + parentheses === 0) {
  20129. bracket--;
  20130. }
  20131. break;
  20132. }
  20133. // functions
  20134. case CLOSEPARENTHESES:
  20135. {
  20136. if (quote + comment + bracket === 0) {
  20137. parentheses--;
  20138. }
  20139. break;
  20140. }
  20141. case OPENPARENTHESES:
  20142. {
  20143. if (quote + comment + bracket === 0) {
  20144. if (context === 0) {
  20145. switch(tail * 2 + trail * 3){
  20146. // :matches
  20147. case 533:
  20148. {
  20149. break;
  20150. }
  20151. // :global, :not, :nth-child etc...
  20152. default:
  20153. {
  20154. counter = 0;
  20155. context = 1;
  20156. }
  20157. }
  20158. }
  20159. parentheses++;
  20160. }
  20161. break;
  20162. }
  20163. case AT:
  20164. {
  20165. if (comment + parentheses + quote + bracket + pseudo + atrule === 0) {
  20166. atrule = 1;
  20167. }
  20168. break;
  20169. }
  20170. // block/line comments
  20171. case STAR:
  20172. case FOWARDSLASH:
  20173. {
  20174. if (quote + bracket + parentheses > 0) {
  20175. break;
  20176. }
  20177. switch(comment){
  20178. // initialize line/block comment context
  20179. case 0:
  20180. {
  20181. switch(code * 2 + body.charCodeAt(caret + 1) * 3){
  20182. // //
  20183. case 235:
  20184. {
  20185. comment = FOWARDSLASH;
  20186. break;
  20187. }
  20188. // /*
  20189. case 220:
  20190. {
  20191. length = caret;
  20192. comment = STAR;
  20193. break;
  20194. }
  20195. }
  20196. break;
  20197. }
  20198. // end block comment context
  20199. case STAR:
  20200. {
  20201. if (code === FOWARDSLASH && tail === STAR && length + 2 !== caret) {
  20202. // /*<!> ... */, !
  20203. if (body.charCodeAt(length + 2) === 33) {
  20204. out += body.substring(length, caret + 1);
  20205. }
  20206. char = "";
  20207. comment = 0;
  20208. }
  20209. }
  20210. }
  20211. }
  20212. }
  20213. // ignore comment blocks
  20214. if (comment === 0) {
  20215. // aggressive isolation mode, divide each individual selector
  20216. // including selectors in :not function but excluding selectors in :global function
  20217. if (cascade + quote + bracket + atrule === 0 && id !== KEYFRAME && code !== SEMICOLON) {
  20218. switch(code){
  20219. case COMMA:
  20220. case TILDE:
  20221. case GREATERTHAN:
  20222. case PLUS:
  20223. case CLOSEPARENTHESES:
  20224. case OPENPARENTHESES:
  20225. {
  20226. if (context === 0) {
  20227. // outside of an isolated context i.e nth-child(<...>)
  20228. switch(tail){
  20229. case TAB:
  20230. case SPACE:
  20231. case NEWLINE:
  20232. case CARRIAGE:
  20233. {
  20234. char = char + "\0";
  20235. break;
  20236. }
  20237. default:
  20238. {
  20239. char = "\0" + char + (code === COMMA ? "" : "\0");
  20240. }
  20241. }
  20242. format = 1;
  20243. } else {
  20244. // within an isolated context, sleep untill it's terminated
  20245. switch(code){
  20246. case OPENPARENTHESES:
  20247. {
  20248. // :globa<l>(
  20249. if (pseudo + 7 === caret && tail === 108) {
  20250. pseudo = 0;
  20251. }
  20252. context = ++counter;
  20253. break;
  20254. }
  20255. case CLOSEPARENTHESES:
  20256. {
  20257. if ((context = --counter) === 0) {
  20258. format = 1;
  20259. char += "\0";
  20260. }
  20261. break;
  20262. }
  20263. }
  20264. }
  20265. break;
  20266. }
  20267. case TAB:
  20268. case SPACE:
  20269. {
  20270. switch(tail){
  20271. case NULL:
  20272. case OPENBRACES:
  20273. case CLOSEBRACES:
  20274. case SEMICOLON:
  20275. case COMMA:
  20276. case FORMFEED:
  20277. case TAB:
  20278. case SPACE:
  20279. case NEWLINE:
  20280. case CARRIAGE:
  20281. {
  20282. break;
  20283. }
  20284. default:
  20285. {
  20286. // ignore in isolated contexts
  20287. if (context === 0) {
  20288. format = 1;
  20289. char += "\0";
  20290. }
  20291. }
  20292. }
  20293. }
  20294. }
  20295. }
  20296. // concat buffer of characters
  20297. chars += char;
  20298. // previous non-whitespace character code
  20299. if (code !== SPACE && code !== TAB) {
  20300. peak = code;
  20301. }
  20302. }
  20303. }
  20304. }
  20305. // tail character codes
  20306. trail = tail;
  20307. tail = code;
  20308. // visit every character
  20309. caret++;
  20310. }
  20311. length = out.length;
  20312. // preserve empty selector
  20313. if (preserve > 0) {
  20314. if (length === 0 && children.length === 0 && current[0].length === 0 === false) {
  20315. if (id !== MEDIA || current.length === 1 && (cascade > 0 ? nscopealt : nscope) === current[0]) {
  20316. length = current.join(",").length + 2;
  20317. }
  20318. }
  20319. }
  20320. if (length > 0) {
  20321. // cascade isolation mode?
  20322. selector = cascade === 0 && id !== KEYFRAME ? isolate(current) : current;
  20323. // execute plugins, block context
  20324. if (plugged > 0) {
  20325. result = proxy(BLCKS, out, selector, parent, line, column, length, id, depth, id);
  20326. if (result !== void 0 && (out = result).length === 0) {
  20327. return flat + out + children;
  20328. }
  20329. }
  20330. out = selector.join(",") + "{" + out + "}";
  20331. if (prefix * pattern !== 0) {
  20332. if (prefix === 2 && !vendor(out, 2)) pattern = 0;
  20333. switch(pattern){
  20334. // ::read-only
  20335. case READONLY:
  20336. {
  20337. out = out.replace(readonlyptn, ":" + moz + "$1") + out;
  20338. break;
  20339. }
  20340. // ::placeholder
  20341. case PLACEHOLDER:
  20342. {
  20343. out = out.replace(plcholdrptn, "::" + webkit + "input-$1") + out.replace(plcholdrptn, "::" + moz + "$1") + out.replace(plcholdrptn, ":" + ms + "input-$1") + out;
  20344. break;
  20345. }
  20346. }
  20347. pattern = 0;
  20348. }
  20349. }
  20350. return flat + out + children;
  20351. }
  20352. /**
  20353. * Property
  20354. *
  20355. * @param {string} input
  20356. * @param {number} first
  20357. * @param {number} second
  20358. * @param {number} third
  20359. * @return {string}
  20360. */ function property(input, first, second, third) {
  20361. var index = 0;
  20362. var out = input + ";";
  20363. var hash = first * 2 + second * 3 + third * 4;
  20364. var cache;
  20365. // animation: a, n, i characters
  20366. if (hash === 944) {
  20367. return animation(out);
  20368. } else if (prefix === 0 || prefix === 2 && !vendor(out, 1)) {
  20369. return out;
  20370. }
  20371. // vendor prefix
  20372. switch(hash){
  20373. // text-decoration/text-size-adjust/text-shadow/text-align/text-transform: t, e, x
  20374. case 1015:
  20375. {
  20376. // text-shadow/text-align/text-transform, a
  20377. return out.charCodeAt(10) === 97 ? webkit + out + out : out;
  20378. }
  20379. // filter/fill f, i, l
  20380. case 951:
  20381. {
  20382. // filter, t
  20383. return out.charCodeAt(3) === 116 ? webkit + out + out : out;
  20384. }
  20385. // color/column, c, o, l
  20386. case 963:
  20387. {
  20388. // column, n
  20389. return out.charCodeAt(5) === 110 ? webkit + out + out : out;
  20390. }
  20391. // box-decoration-break, b, o, x
  20392. case 1009:
  20393. {
  20394. if (out.charCodeAt(4) !== 100) {
  20395. break;
  20396. }
  20397. }
  20398. // mask, m, a, s
  20399. // clip-path, c, l, i
  20400. case 969:
  20401. case 942:
  20402. {
  20403. return webkit + out + out;
  20404. }
  20405. // appearance: a, p, p
  20406. case 978:
  20407. {
  20408. return webkit + out + moz + out + out;
  20409. }
  20410. // hyphens: h, y, p
  20411. // user-select: u, s, e
  20412. case 1019:
  20413. case 983:
  20414. {
  20415. return webkit + out + moz + out + ms + out + out;
  20416. }
  20417. // background/backface-visibility, b, a, c
  20418. case 883:
  20419. {
  20420. // backface-visibility, -
  20421. if (out.charCodeAt(8) === DASH) {
  20422. return webkit + out + out;
  20423. }
  20424. // image-set(...)
  20425. if (out.indexOf("image-set(", 11) > 0) {
  20426. return out.replace(imgsrcptn, "$1" + webkit + "$2") + out;
  20427. }
  20428. return out;
  20429. }
  20430. // flex: f, l, e
  20431. case 932:
  20432. {
  20433. if (out.charCodeAt(4) === DASH) {
  20434. switch(out.charCodeAt(5)){
  20435. // flex-grow, g
  20436. case 103:
  20437. {
  20438. return webkit + "box-" + out.replace("-grow", "") + webkit + out + ms + out.replace("grow", "positive") + out;
  20439. }
  20440. // flex-shrink, s
  20441. case 115:
  20442. {
  20443. return webkit + out + ms + out.replace("shrink", "negative") + out;
  20444. }
  20445. // flex-basis, b
  20446. case 98:
  20447. {
  20448. return webkit + out + ms + out.replace("basis", "preferred-size") + out;
  20449. }
  20450. }
  20451. }
  20452. return webkit + out + ms + out + out;
  20453. }
  20454. // order: o, r, d
  20455. case 964:
  20456. {
  20457. return webkit + out + ms + "flex" + "-" + out + out;
  20458. }
  20459. // justify-items/justify-content, j, u, s
  20460. case 1023:
  20461. {
  20462. // justify-content, c
  20463. if (out.charCodeAt(8) !== 99) {
  20464. break;
  20465. }
  20466. cache = out.substring(out.indexOf(":", 15)).replace("flex-", "").replace("space-between", "justify");
  20467. return webkit + "box-pack" + cache + webkit + out + ms + "flex-pack" + cache + out;
  20468. }
  20469. // cursor, c, u, r
  20470. case 1005:
  20471. {
  20472. return cursorptn.test(out) ? out.replace(colonptn, ":" + webkit) + out.replace(colonptn, ":" + moz) + out : out;
  20473. }
  20474. // writing-mode, w, r, i
  20475. case 1000:
  20476. {
  20477. cache = out.substring(13).trim();
  20478. index = cache.indexOf("-") + 1;
  20479. switch(cache.charCodeAt(0) + cache.charCodeAt(index)){
  20480. // vertical-lr
  20481. case 226:
  20482. {
  20483. cache = out.replace(writingptn, "tb");
  20484. break;
  20485. }
  20486. // vertical-rl
  20487. case 232:
  20488. {
  20489. cache = out.replace(writingptn, "tb-rl");
  20490. break;
  20491. }
  20492. // horizontal-tb
  20493. case 220:
  20494. {
  20495. cache = out.replace(writingptn, "lr");
  20496. break;
  20497. }
  20498. default:
  20499. {
  20500. return out;
  20501. }
  20502. }
  20503. return webkit + out + ms + cache + out;
  20504. }
  20505. // position: sticky
  20506. case 1017:
  20507. {
  20508. if (out.indexOf("sticky", 9) === -1) {
  20509. return out;
  20510. }
  20511. }
  20512. // display(flex/inline-flex/inline-box): d, i, s
  20513. case 975:
  20514. {
  20515. index = (out = input).length - 10;
  20516. cache = (out.charCodeAt(index) === 33 ? out.substring(0, index) : out).substring(input.indexOf(":", 7) + 1).trim();
  20517. switch(hash = cache.charCodeAt(0) + (cache.charCodeAt(7) | 0)){
  20518. // inline-
  20519. case 203:
  20520. {
  20521. // inline-box
  20522. if (cache.charCodeAt(8) < 111) {
  20523. break;
  20524. }
  20525. }
  20526. // inline-box/sticky
  20527. case 115:
  20528. {
  20529. out = out.replace(cache, webkit + cache) + ";" + out;
  20530. break;
  20531. }
  20532. // inline-flex
  20533. // flex
  20534. case 207:
  20535. case 102:
  20536. {
  20537. out = out.replace(cache, webkit + (hash > 102 ? "inline-" : "") + "box") + ";" + out.replace(cache, webkit + cache) + ";" + out.replace(cache, ms + cache + "box") + ";" + out;
  20538. }
  20539. }
  20540. return out + ";";
  20541. }
  20542. // align-items, align-center, align-self: a, l, i, -
  20543. case 938:
  20544. {
  20545. if (out.charCodeAt(5) === DASH) {
  20546. switch(out.charCodeAt(6)){
  20547. // align-items, i
  20548. case 105:
  20549. {
  20550. cache = out.replace("-items", "");
  20551. return webkit + out + webkit + "box-" + cache + ms + "flex-" + cache + out;
  20552. }
  20553. // align-self, s
  20554. case 115:
  20555. {
  20556. return webkit + out + ms + "flex-item-" + out.replace(selfptn, "") + out;
  20557. }
  20558. // align-content
  20559. default:
  20560. {
  20561. return webkit + out + ms + "flex-line-pack" + out.replace("align-content", "").replace(selfptn, "") + out;
  20562. }
  20563. }
  20564. }
  20565. break;
  20566. }
  20567. // min/max
  20568. case 973:
  20569. case 989:
  20570. {
  20571. // min-/max- height/width/block-size/inline-size
  20572. if (out.charCodeAt(3) !== DASH || out.charCodeAt(4) === 122) {
  20573. break;
  20574. }
  20575. }
  20576. // height/width: min-content / width: max-content
  20577. case 931:
  20578. case 953:
  20579. {
  20580. if (dimensionptn.test(input) === true) {
  20581. // stretch
  20582. if ((cache = input.substring(input.indexOf(":") + 1)).charCodeAt(0) === 115) return property(input.replace("stretch", "fill-available"), first, second, third).replace(":fill-available", ":stretch");
  20583. else return out.replace(cache, webkit + cache) + out.replace(cache, moz + cache.replace("fill-", "")) + out;
  20584. }
  20585. break;
  20586. }
  20587. // transform, transition: t, r, a
  20588. case 962:
  20589. {
  20590. out = webkit + out + (out.charCodeAt(5) === 102 ? ms + out : "") + out;
  20591. // transitions
  20592. if (second + third === 211 && out.charCodeAt(13) === 105 && out.indexOf("transform", 10) > 0) {
  20593. return out.substring(0, out.indexOf(";", 27) + 1).replace(transformptn, "$1" + webkit + "$2") + out;
  20594. }
  20595. break;
  20596. }
  20597. }
  20598. return out;
  20599. }
  20600. /**
  20601. * Use
  20602. *
  20603. * @param {(Array<function(...?)>|function(...?)|number|void)?} plugin
  20604. */ function use(plugin) {
  20605. switch(plugin){
  20606. case void 0:
  20607. case null:
  20608. {
  20609. plugged = plugins.length = 0;
  20610. break;
  20611. }
  20612. default:
  20613. {
  20614. if (typeof plugin === "function") {
  20615. plugins[plugged++] = plugin;
  20616. } else if (typeof plugin === "object") {
  20617. for(var i = 0, length = plugin.length; i < length; ++i){
  20618. use(plugin[i]);
  20619. }
  20620. } else {
  20621. unkwn = !!plugin | 0;
  20622. }
  20623. }
  20624. }
  20625. return use;
  20626. }
  20627. /**
  20628. * Set
  20629. *
  20630. * @param {*} options
  20631. */ function set(options) {
  20632. for(var name in options){
  20633. var value = options[name];
  20634. switch(name){
  20635. case "keyframe":
  20636. keyed = value | 0;
  20637. break;
  20638. case "global":
  20639. escape = value | 0;
  20640. break;
  20641. case "cascade":
  20642. cascade = value | 0;
  20643. break;
  20644. case "compress":
  20645. compress = value | 0;
  20646. break;
  20647. case "semicolon":
  20648. semicolon = value | 0;
  20649. break;
  20650. case "preserve":
  20651. preserve = value | 0;
  20652. break;
  20653. case "prefix":
  20654. should = null;
  20655. if (!value) {
  20656. prefix = 0;
  20657. } else if (typeof value !== "function") {
  20658. prefix = 1;
  20659. } else {
  20660. prefix = 2;
  20661. should = value;
  20662. }
  20663. }
  20664. }
  20665. return set;
  20666. }
  20667. /**
  20668. * Stylis
  20669. *
  20670. * @param {string} selector
  20671. * @param {string} input
  20672. * @return {*}
  20673. */ function stylis(selector, input) {
  20674. if (this !== void 0 && this.constructor === stylis) {
  20675. return factory(selector);
  20676. }
  20677. // setup
  20678. var ns = selector;
  20679. var code = ns.charCodeAt(0);
  20680. // trim leading whitespace
  20681. if (code < 33) {
  20682. code = (ns = ns.trim()).charCodeAt(0);
  20683. }
  20684. // keyframe/animation namespace
  20685. if (keyed > 0) {
  20686. key = ns.replace(invalidptn, code === OPENBRACKET ? "" : "-");
  20687. }
  20688. // reset, used to assert if a plugin is moneky-patching the return value
  20689. code = 1;
  20690. // cascade/isolate
  20691. if (cascade === 1) {
  20692. nscope = ns;
  20693. } else {
  20694. nscopealt = ns;
  20695. }
  20696. var selectors = [
  20697. nscope
  20698. ];
  20699. var result;
  20700. // execute plugins, pre-process context
  20701. if (plugged > 0) {
  20702. result = proxy(PREPS, input, selectors, selectors, line, column, 0, 0, 0, 0);
  20703. if (result !== void 0 && typeof result === "string") {
  20704. input = result;
  20705. }
  20706. }
  20707. // build
  20708. var output = compile(array, selectors, input, 0, 0);
  20709. // execute plugins, post-process context
  20710. if (plugged > 0) {
  20711. result = proxy(POSTS, output, selectors, selectors, line, column, output.length, 0, 0, 0);
  20712. // bypass minification
  20713. if (result !== void 0 && typeof (output = result) !== "string") {
  20714. code = 0;
  20715. }
  20716. }
  20717. // reset
  20718. key = "";
  20719. nscope = "";
  20720. nscopealt = "";
  20721. pattern = 0;
  20722. line = 1;
  20723. column = 1;
  20724. return compress * code === 0 ? output : minify(output);
  20725. }
  20726. stylis["use"] = use;
  20727. stylis["set"] = set;
  20728. if (options !== void 0) {
  20729. set(options);
  20730. }
  20731. return stylis;
  20732. });
  20733. })(stylis$1);
  20734. var Stylis = stylis$1.exports;
  20735. var stylisRuleSheet$1 = {exports: {}};
  20736. (function(module, exports) {
  20737. (function(factory) {
  20738. module["exports"] = factory() ;
  20739. })(function() {
  20740. return function(insertRule) {
  20741. var toSheet = function toSheet(block) {
  20742. if (block) try {
  20743. insertRule(block + "}");
  20744. } catch (e) {}
  20745. };
  20746. var delimiter = "/*|*/";
  20747. var needle = delimiter + "}";
  20748. return function ruleSheet(context, content, selectors, parents, line, column, length, ns, depth, at) {
  20749. switch(context){
  20750. // property
  20751. case 1:
  20752. // @import
  20753. if (depth === 0 && content.charCodeAt(0) === 64) return insertRule(content + ";"), "";
  20754. break;
  20755. // selector
  20756. case 2:
  20757. if (ns === 0) return content + delimiter;
  20758. break;
  20759. // at-rule
  20760. case 3:
  20761. switch(ns){
  20762. // @font-face, @page
  20763. case 102:
  20764. case 112:
  20765. return insertRule(selectors[0] + content), "";
  20766. default:
  20767. return content + (at === 0 ? delimiter : "");
  20768. }
  20769. case -2:
  20770. content.split(needle).forEach(toSheet);
  20771. }
  20772. };
  20773. };
  20774. });
  20775. })(stylisRuleSheet$1);
  20776. var stylisRuleSheet = stylisRuleSheet$1.exports;
  20777. var stylis = new Stylis();
  20778. function disableNestingPlugin() {
  20779. for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
  20780. args[_key] = arguments[_key];
  20781. }
  20782. var context = args[0], tmp = args[3], parent = tmp === void 0 ? [] : tmp, line = args[4], column = args[5];
  20783. if (context === 2) {
  20784. // replace null characters and trim
  20785. // eslint-disable-next-line no-control-regex
  20786. parent = (parent[0] || "").replace(/\u0000/g, "").trim();
  20787. if (parent.length > 0 && parent.charAt(0) !== "@") {
  20788. throw new Error("Nesting detected at " + line + ":" + column + ". " + "Unfortunately nesting is not supported by styled-jsx.");
  20789. }
  20790. }
  20791. }
  20792. var generator;
  20793. var filename;
  20794. var offset;
  20795. function sourceMapsPlugin() {
  20796. for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
  20797. args[_key] = arguments[_key];
  20798. }
  20799. var context = args[0], line = args[4], column = args[5], length = args[6];
  20800. // Pre-processed, init source map
  20801. if (context === -1 && generator !== undefined) {
  20802. generator.addMapping({
  20803. generated: {
  20804. line: 1,
  20805. column: 0
  20806. },
  20807. source: filename,
  20808. original: offset
  20809. });
  20810. return;
  20811. }
  20812. // Post-processed
  20813. if (context === -2 && generator !== undefined) {
  20814. generator = undefined;
  20815. offset = undefined;
  20816. filename = undefined;
  20817. return;
  20818. }
  20819. // Selector/property, update source map
  20820. if ((context === 1 || context === 2) && generator !== undefined) {
  20821. generator.addMapping({
  20822. generated: {
  20823. line: 1,
  20824. column: length
  20825. },
  20826. source: filename,
  20827. original: {
  20828. line: line + offset.line,
  20829. column: column + offset.column
  20830. }
  20831. });
  20832. }
  20833. }
  20834. /**
  20835. * splitRulesPlugin
  20836. * Used to split a blob of css into an array of rules
  20837. * that can inserted via sheet.insertRule
  20838. */ var splitRules = [];
  20839. var splitRulesPlugin = stylisRuleSheet(function(rule) {
  20840. splitRules.push(rule);
  20841. });
  20842. stylis.use(disableNestingPlugin);
  20843. stylis.use(sourceMapsPlugin);
  20844. stylis.use(splitRulesPlugin);
  20845. stylis.set({
  20846. cascade: false,
  20847. compress: true
  20848. });
  20849. /**
  20850. * Public transform function
  20851. *
  20852. * @param {String} hash
  20853. * @param {String} styles
  20854. * @param {Object} settings
  20855. * @return {string}
  20856. */ function transform(hash, styles, settings) {
  20857. if (settings === void 0) settings = {};
  20858. generator = settings.generator;
  20859. offset = settings.offset;
  20860. filename = settings.filename;
  20861. splitRules = [];
  20862. stylis.set({
  20863. prefix: typeof settings.vendorPrefixes === "boolean" ? settings.vendorPrefixes : true
  20864. });
  20865. stylis(hash, styles);
  20866. if (settings.splitRules) {
  20867. return splitRules;
  20868. }
  20869. return splitRules.join("");
  20870. }
  20871. var GLOBAL_ATTRIBUTE = "global";
  20872. var STYLE_ATTRIBUTE = "jsx";
  20873. var STYLE_COMPONENT = "_JSXStyle";
  20874. var STYLE_COMPONENT_DYNAMIC = "dynamic";
  20875. var STYLE_COMPONENT_ID = "id";
  20876. function _extends$2() {
  20877. _extends$2 = Object.assign || function(target) {
  20878. for(var i = 1; i < arguments.length; i++){
  20879. var source = arguments[i];
  20880. for(var key in source){
  20881. if (Object.prototype.hasOwnProperty.call(source, key)) {
  20882. target[key] = source[key];
  20883. }
  20884. }
  20885. }
  20886. return target;
  20887. };
  20888. return _extends$2.apply(this, arguments);
  20889. }
  20890. var _typeof = function(obj) {
  20891. "@swc/helpers - typeof";
  20892. return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
  20893. };
  20894. var concat = function(a, b) {
  20895. return lib$1.binaryExpression("+", a, b);
  20896. };
  20897. var and = function(a, b) {
  20898. return lib$1.logicalExpression("&&", a, b);
  20899. };
  20900. var or = function(a, b) {
  20901. return lib$1.logicalExpression("||", a, b);
  20902. };
  20903. var joinSpreads = function(spreads) {
  20904. return spreads.reduce(function(acc, curr) {
  20905. return or(acc, curr);
  20906. });
  20907. };
  20908. var hashString = function(str) {
  20909. return String(stringHash(str));
  20910. };
  20911. var addClassName = function(path, jsxId) {
  20912. var jsxIdWithSpace = concat(jsxId, lib$1.stringLiteral(" "));
  20913. var attributes = path.get("attributes");
  20914. var spreads = [];
  20915. var className = null;
  20916. // Find className and collect spreads
  20917. for(var i = attributes.length - 1, attr; attr = attributes[i]; i--){
  20918. var node = attr.node;
  20919. if (lib$1.isJSXSpreadAttribute(attr)) {
  20920. if (lib$1.isObjectExpression(node.argument)) {
  20921. var properties = node.argument.properties;
  20922. var index = properties.findIndex(function(property) {
  20923. return property.key.name === "className";
  20924. });
  20925. if (~index) {
  20926. className = attr.get("argument").get("properties." + index);
  20927. // Remove jsx spread attribute if there is only className property
  20928. if (properties.length === 1) {
  20929. attr.remove();
  20930. }
  20931. break;
  20932. }
  20933. }
  20934. if (lib$1.isMemberExpression(node.argument) || lib$1.isIdentifier(node.argument)) {
  20935. var name = node.argument.name;
  20936. var spreadObj = lib$1.isMemberExpression(node.argument) ? node.argument : lib$1.identifier(name);
  20937. var attrNameDotClassName = lib$1.memberExpression(spreadObj, lib$1.identifier("className"));
  20938. spreads.push(// `${name} && ${name}.className != null && ${name}.className`
  20939. and(spreadObj, and(lib$1.binaryExpression("!=", attrNameDotClassName, lib$1.nullLiteral()), attrNameDotClassName)));
  20940. }
  20941. continue;
  20942. }
  20943. if (lib$1.isJSXAttribute(attr) && node.name.name === "className") {
  20944. className = attributes[i];
  20945. break;
  20946. }
  20947. }
  20948. if (className) {
  20949. var newClassName = className.node.value.expression || className.node.value;
  20950. newClassName = lib$1.isStringLiteral(newClassName) || lib$1.isTemplateLiteral(newClassName) ? newClassName : or(newClassName, lib$1.stringLiteral(""));
  20951. className.remove();
  20952. className = lib$1.jSXExpressionContainer(spreads.length === 0 ? concat(jsxIdWithSpace, newClassName) : concat(jsxIdWithSpace, or(joinSpreads(spreads), newClassName)));
  20953. } else {
  20954. className = lib$1.jSXExpressionContainer(spreads.length === 0 ? jsxId : concat(jsxIdWithSpace, or(joinSpreads(spreads), lib$1.stringLiteral(""))));
  20955. }
  20956. path.node.attributes.push(lib$1.jSXAttribute(lib$1.jSXIdentifier("className"), className));
  20957. };
  20958. var getScope = function(path) {
  20959. return (path.findParent(function(path) {
  20960. return path.isFunctionDeclaration() || path.isArrowFunctionExpression() || path.isClassMethod();
  20961. }) || path).scope;
  20962. };
  20963. var isGlobalEl = function(el) {
  20964. return el && el.attributes.some(function(param) {
  20965. var name = param.name;
  20966. return name && name.name === GLOBAL_ATTRIBUTE;
  20967. });
  20968. };
  20969. var isStyledJsx = function(param) {
  20970. var el = param.node;
  20971. return lib$1.isJSXElement(el) && el.openingElement.name.name === "style" && el.openingElement.attributes.some(function(attr) {
  20972. return attr.name.name === STYLE_ATTRIBUTE;
  20973. });
  20974. };
  20975. var findStyles = function(path) {
  20976. if (isStyledJsx(path)) {
  20977. var node = path.node;
  20978. return isGlobalEl(node.openingElement) ? [
  20979. path
  20980. ] : [];
  20981. }
  20982. return path.get("children").filter(isStyledJsx);
  20983. };
  20984. var validateExternalExpressionsVisitor = {
  20985. Identifier: function Identifier(path) {
  20986. if (lib$1.isMemberExpression(path.parentPath)) {
  20987. return;
  20988. }
  20989. var name = path.node.name;
  20990. if (!path.scope.hasBinding(name)) {
  20991. throw path.buildCodeFrameError(path.getSource());
  20992. }
  20993. },
  20994. MemberExpression: function MemberExpression(path) {
  20995. var node = path.node;
  20996. if (!lib$1.isIdentifier(node.object)) {
  20997. return;
  20998. }
  20999. if (!path.scope.hasBinding(node.object.name)) {
  21000. throw path.buildCodeFrameError(path.getSource());
  21001. }
  21002. },
  21003. ThisExpression: function ThisExpression(path) {
  21004. throw new Error(path.parentPath.getSource());
  21005. }
  21006. };
  21007. var validateExternalExpressions = function(path) {
  21008. try {
  21009. path.traverse(validateExternalExpressionsVisitor);
  21010. } catch (error) {
  21011. throw path.buildCodeFrameError("\n Found an `undefined` or invalid value in your styles: `" + error.message + "`.\n\n If you are trying to use dynamic styles in external files this is unfortunately not possible yet.\n Please put the dynamic parts alongside the component. E.g.\n\n <button>\n <style jsx>{externalStylesReference}</style>\n <style jsx>{`\n button { background-color: ${" + error.message + "} }\n `}</style>\n </button>\n ");
  21012. }
  21013. };
  21014. var getJSXStyleInfo = function(expr, scope) {
  21015. var node = expr.node;
  21016. var location = node.loc;
  21017. // Assume string literal
  21018. if (lib$1.isStringLiteral(node)) {
  21019. return {
  21020. hash: hashString(node.value),
  21021. css: node.value,
  21022. expressions: [],
  21023. dynamic: false,
  21024. location: location
  21025. };
  21026. }
  21027. // Simple template literal without expressions
  21028. if (node.expressions.length === 0) {
  21029. return {
  21030. hash: hashString(node.quasis[0].value.raw),
  21031. css: node.quasis[0].value.raw,
  21032. expressions: [],
  21033. dynamic: false,
  21034. location: location
  21035. };
  21036. }
  21037. // Special treatment for template literals that contain expressions:
  21038. //
  21039. // Expressions are replaced with a placeholder
  21040. // so that the CSS compiler can parse and
  21041. // transform the css source string
  21042. // without having to know about js literal expressions.
  21043. // Later expressions are restored.
  21044. //
  21045. // e.g.
  21046. // p { color: ${myConstant}; }
  21047. // becomes
  21048. // p { color: %%styled-jsx-placeholder-${id}%%; }
  21049. var quasis = node.quasis, expressions = node.expressions;
  21050. var hash = hashString(expr.getSource().slice(1, -1));
  21051. var dynamic = Boolean(scope);
  21052. if (dynamic) {
  21053. try {
  21054. var val = expr.evaluate();
  21055. if (val.confident) {
  21056. dynamic = false;
  21057. } else if (val.deopt) {
  21058. var computedObject = val.deopt.get("object").resolve().evaluate();
  21059. dynamic = !computedObject.confident;
  21060. }
  21061. } catch (_) {}
  21062. }
  21063. var css = quasis.reduce(function(css, quasi, index) {
  21064. return "" + css + quasi.value.raw + (quasis.length === index + 1 ? "" : "%%styled-jsx-placeholder-" + index + "%%");
  21065. }, "");
  21066. return {
  21067. hash: hash,
  21068. css: css,
  21069. expressions: expressions,
  21070. dynamic: dynamic,
  21071. location: location
  21072. };
  21073. };
  21074. var computeClassNames = function(styles, externalJsxId, styleComponentImportName) {
  21075. if (styles.length === 0) {
  21076. return {
  21077. className: externalJsxId
  21078. };
  21079. }
  21080. var hashes = styles.reduce(function(acc, styles) {
  21081. if (styles.dynamic === false) {
  21082. acc.static.push(styles.hash);
  21083. } else {
  21084. acc.dynamic.push(styles);
  21085. }
  21086. return acc;
  21087. }, {
  21088. static: [],
  21089. dynamic: []
  21090. });
  21091. var staticClassName = "jsx-" + hashString(hashes.static.join(","));
  21092. // Static and optionally external classes. E.g.
  21093. // '[jsx-externalClasses] jsx-staticClasses'
  21094. if (hashes.dynamic.length === 0) {
  21095. return {
  21096. staticClassName: staticClassName,
  21097. className: externalJsxId ? concat(lib$1.stringLiteral(staticClassName + " "), externalJsxId) : lib$1.stringLiteral(staticClassName)
  21098. };
  21099. }
  21100. // _JSXStyle.dynamic([ ['1234', [props.foo, bar, fn(props)]], ... ])
  21101. var dynamic = lib$1.callExpression(// Callee: _JSXStyle.dynamic
  21102. lib$1.memberExpression(lib$1.identifier(styleComponentImportName), lib$1.identifier(STYLE_COMPONENT_DYNAMIC)), // Arguments
  21103. [
  21104. lib$1.arrayExpression(hashes.dynamic.map(function(styles) {
  21105. return lib$1.arrayExpression([
  21106. lib$1.stringLiteral(hashString(styles.hash + staticClassName)),
  21107. lib$1.arrayExpression(styles.expressions)
  21108. ]);
  21109. }))
  21110. ]);
  21111. // Dynamic and optionally external classes. E.g.
  21112. // '[jsx-externalClasses] ' + _JSXStyle.dynamic([ ['1234', [props.foo, bar, fn(props)]], ... ])
  21113. if (hashes.static.length === 0) {
  21114. return {
  21115. staticClassName: staticClassName,
  21116. className: externalJsxId ? concat(concat(externalJsxId, lib$1.stringLiteral(" ")), dynamic) : dynamic
  21117. };
  21118. }
  21119. // Static, dynamic and optionally external classes. E.g.
  21120. // '[jsx-externalClasses] jsx-staticClasses ' + _JSXStyle.dynamic([ ['5678', [props.foo, bar, fn(props)]], ... ])
  21121. return {
  21122. staticClassName: staticClassName,
  21123. className: externalJsxId ? concat(concat(externalJsxId, lib$1.stringLiteral(" " + staticClassName + " ")), dynamic) : concat(lib$1.stringLiteral("" + staticClassName + " "), dynamic)
  21124. };
  21125. };
  21126. var templateLiteralFromPreprocessedCss = function(css, expressions) {
  21127. var quasis = [];
  21128. var finalExpressions = [];
  21129. var parts = css.split(/(?:%%styled-jsx-placeholder-(\d+)%%)/g);
  21130. if (parts.length === 1) {
  21131. return lib$1.stringLiteral(css);
  21132. }
  21133. parts.forEach(function(part, index) {
  21134. if (index % 2 > 0) {
  21135. // This is necessary because, after preprocessing, declarations might have been alterate.
  21136. // eg. properties are auto prefixed and therefore expressions need to match.
  21137. finalExpressions.push(expressions[part]);
  21138. } else {
  21139. quasis.push(part);
  21140. }
  21141. });
  21142. return lib$1.templateLiteral(quasis.map(function(quasi, index) {
  21143. return lib$1.templateElement({
  21144. raw: quasi,
  21145. cooked: quasi
  21146. }, quasis.length === index + 1);
  21147. }), finalExpressions);
  21148. };
  21149. var cssToBabelType = function(css) {
  21150. if (typeof css === "string") {
  21151. return lib$1.stringLiteral(css);
  21152. }
  21153. if (Array.isArray(css)) {
  21154. return lib$1.arrayExpression(css);
  21155. }
  21156. return lib$1.cloneDeep(css);
  21157. };
  21158. var makeStyledJsxTag = function(id, transformedCss, expressions, styleComponentImportName) {
  21159. if (expressions === void 0) expressions = [];
  21160. var css = cssToBabelType(transformedCss);
  21161. var attributes = [
  21162. lib$1.jSXAttribute(lib$1.jSXIdentifier(STYLE_COMPONENT_ID), lib$1.jSXExpressionContainer(typeof id === "string" ? lib$1.stringLiteral(id) : id))
  21163. ];
  21164. if (expressions.length > 0) {
  21165. attributes.push(lib$1.jSXAttribute(lib$1.jSXIdentifier(STYLE_COMPONENT_DYNAMIC), lib$1.jSXExpressionContainer(lib$1.arrayExpression(expressions))));
  21166. }
  21167. return lib$1.jSXElement(lib$1.jSXOpeningElement(lib$1.jSXIdentifier(styleComponentImportName), attributes), lib$1.jSXClosingElement(lib$1.jSXIdentifier(styleComponentImportName)), [
  21168. lib$1.jSXExpressionContainer(css)
  21169. ]);
  21170. };
  21171. var makeSourceMapGenerator = function(file) {
  21172. var filename = file.sourceFileName;
  21173. var generator = new SourceMapGenerator({
  21174. file: filename,
  21175. sourceRoot: file.sourceRoot
  21176. });
  21177. generator.setSourceContent(filename, file.code);
  21178. return generator;
  21179. };
  21180. var addSourceMaps = function(code, generator, filename) {
  21181. var sourceMaps = [
  21182. convertSourceMap.fromObject(generator).toComment({
  21183. multiline: true
  21184. }),
  21185. "/*@ sourceURL=" + filename.replace(/\\/g, "\\\\") + " */"
  21186. ];
  21187. if (Array.isArray(code)) {
  21188. return code.concat(sourceMaps);
  21189. }
  21190. return [
  21191. code
  21192. ].concat(sourceMaps).join("\n");
  21193. };
  21194. var combinedPluginsCache = {
  21195. plugins: null,
  21196. combined: null
  21197. };
  21198. var combinePlugins = function(plugins) {
  21199. if (!plugins) {
  21200. return function(css) {
  21201. return css;
  21202. };
  21203. }
  21204. var pluginsToString = JSON.stringify(plugins);
  21205. if (combinedPluginsCache.plugins === pluginsToString) {
  21206. return combinedPluginsCache.combined;
  21207. }
  21208. if (!Array.isArray(plugins) || plugins.some(function(p) {
  21209. return !Array.isArray(p) && typeof p !== "string";
  21210. })) {
  21211. throw new Error("`plugins` must be an array of plugins names (string) or an array `[plugin-name, {options}]`");
  21212. }
  21213. combinedPluginsCache.plugins = pluginsToString;
  21214. combinedPluginsCache.combined = plugins.map(function(plugin, i) {
  21215. var options = {};
  21216. if (Array.isArray(plugin)) {
  21217. options = plugin[1] || {};
  21218. plugin = plugin[0];
  21219. if (Object.prototype.hasOwnProperty.call(options, "babel")) {
  21220. throw new Error("\n Error while trying to register the styled-jsx plugin: " + plugin + "\n The option name `babel` is reserved.\n ");
  21221. }
  21222. }
  21223. log("Loading plugin from path: " + plugin);
  21224. var p = require(plugin);
  21225. if (p.default) {
  21226. p = p.default;
  21227. }
  21228. var type = typeof p === "undefined" ? "undefined" : _typeof(p);
  21229. if (type !== "function") {
  21230. throw new Error("Expected plugin " + plugins[i] + " to be a function but instead got " + type);
  21231. }
  21232. return {
  21233. plugin: p,
  21234. options: options
  21235. };
  21236. }).reduce(function(previous, param) {
  21237. var plugin = param.plugin, options = param.options;
  21238. return function(css, babelOptions) {
  21239. return plugin(previous ? previous(css, babelOptions) : css, _extends$2({}, options, {
  21240. babel: babelOptions
  21241. }));
  21242. };
  21243. }, null);
  21244. return combinedPluginsCache.combined;
  21245. };
  21246. var getPrefix = function(isDynamic, id) {
  21247. return isDynamic ? ".__jsx-style-dynamic-selector" : "." + id;
  21248. };
  21249. var processCss = function(stylesInfo, options) {
  21250. var hash = stylesInfo.hash, css = stylesInfo.css, expressions = stylesInfo.expressions, dynamic = stylesInfo.dynamic, location = stylesInfo.location, file = stylesInfo.file, isGlobal = stylesInfo.isGlobal, plugins = stylesInfo.plugins, vendorPrefixes = stylesInfo.vendorPrefixes, sourceMaps = stylesInfo.sourceMaps;
  21251. var fileInfo = {
  21252. code: file.code,
  21253. sourceRoot: file.opts.sourceRoot,
  21254. filename: file.opts.filename || file.filename
  21255. };
  21256. fileInfo.sourceFileName = file.opts.sourceFileName || file.sourceFileName || // According to https://babeljs.io/docs/en/options#source-map-options
  21257. // filenameRelative = path.relative(file.opts.cwd, file.opts.filename)
  21258. // sourceFileName = path.basename(filenameRelative)
  21259. // or simply
  21260. // sourceFileName = path.basename(file.opts.filename)
  21261. (fileInfo.filename && require$$1__default["default"].basename(fileInfo.filename));
  21262. var staticClassName = stylesInfo.staticClassName || "jsx-" + hashString(hash);
  21263. var splitRules = options.splitRules;
  21264. var useSourceMaps = Boolean(sourceMaps) && !splitRules;
  21265. var pluginsOptions = {
  21266. location: {
  21267. start: _extends$2({}, location.start),
  21268. end: _extends$2({}, location.end)
  21269. },
  21270. vendorPrefixes: vendorPrefixes,
  21271. sourceMaps: useSourceMaps,
  21272. isGlobal: isGlobal,
  21273. filename: fileInfo.filename
  21274. };
  21275. var transformedCss;
  21276. if (useSourceMaps) {
  21277. var generator = makeSourceMapGenerator(fileInfo);
  21278. var filename = fileInfo.sourceFileName;
  21279. transformedCss = addSourceMaps(transform(isGlobal ? "" : getPrefix(dynamic, staticClassName), plugins(css, pluginsOptions), {
  21280. generator: generator,
  21281. offset: location.start,
  21282. filename: filename,
  21283. splitRules: splitRules,
  21284. vendorPrefixes: vendorPrefixes
  21285. }), generator, filename);
  21286. } else {
  21287. transformedCss = transform(isGlobal ? "" : getPrefix(dynamic, staticClassName), plugins(css, pluginsOptions), {
  21288. splitRules: splitRules,
  21289. vendorPrefixes: vendorPrefixes
  21290. });
  21291. }
  21292. if (expressions.length > 0) {
  21293. if (typeof transformedCss === "string") {
  21294. transformedCss = templateLiteralFromPreprocessedCss(transformedCss, expressions);
  21295. } else {
  21296. transformedCss = transformedCss.map(function(transformedCss) {
  21297. return templateLiteralFromPreprocessedCss(transformedCss, expressions);
  21298. });
  21299. }
  21300. } else if (Array.isArray(transformedCss)) {
  21301. transformedCss = transformedCss.map(function(transformedCss) {
  21302. return lib$1.stringLiteral(transformedCss);
  21303. });
  21304. }
  21305. return {
  21306. hash: dynamic ? hashString(hash + staticClassName) : hashString(hash),
  21307. css: transformedCss,
  21308. expressions: dynamic && expressions
  21309. };
  21310. };
  21311. var booleanOption = function(opts) {
  21312. var ret;
  21313. opts.some(function(opt) {
  21314. if (typeof opt === "boolean") {
  21315. ret = opt;
  21316. return true;
  21317. }
  21318. return false;
  21319. });
  21320. return ret;
  21321. };
  21322. var createReactComponentImportDeclaration = function(state) {
  21323. return lib$1.importDeclaration([
  21324. lib$1.importDefaultSpecifier(lib$1.identifier(state.styleComponentImportName))
  21325. ], lib$1.stringLiteral(state.styleModule));
  21326. };
  21327. var setStateOptions = function(state) {
  21328. var vendorPrefixes = booleanOption([
  21329. state.opts.vendorPrefixes,
  21330. state.file.opts.vendorPrefixes
  21331. ]);
  21332. state.opts.vendorPrefixes = typeof vendorPrefixes === "boolean" ? vendorPrefixes : true;
  21333. var sourceMaps = booleanOption([
  21334. state.opts.sourceMaps,
  21335. state.file.opts.sourceMaps
  21336. ]);
  21337. state.opts.sourceMaps = Boolean(sourceMaps);
  21338. if (!state.plugins) {
  21339. state.plugins = combinePlugins(state.opts.plugins);
  21340. }
  21341. state.styleModule = typeof state.opts.styleModule === "string" ? state.opts.styleModule : "styled-jsx/style";
  21342. };
  21343. function log(message) {
  21344. console.log("[styled-jsx] " + message);
  21345. }
  21346. function _extends$1() {
  21347. _extends$1 = Object.assign || function(target) {
  21348. for(var i = 1; i < arguments.length; i++){
  21349. var source = arguments[i];
  21350. for(var key in source){
  21351. if (Object.prototype.hasOwnProperty.call(source, key)) {
  21352. target[key] = source[key];
  21353. }
  21354. }
  21355. }
  21356. return target;
  21357. };
  21358. return _extends$1.apply(this, arguments);
  21359. }
  21360. var isModuleExports = lib$1.buildMatchMemberExpression("module.exports");
  21361. function processTaggedTemplateExpression(param) {
  21362. var type = param.type, path = param.path, file = param.file, splitRules = param.splitRules, plugins = param.plugins, vendorPrefixes = param.vendorPrefixes, sourceMaps = param.sourceMaps, styleComponentImportName = param.styleComponentImportName;
  21363. var templateLiteral = path.get("quasi");
  21364. var scope;
  21365. // Check whether there are undefined references or
  21366. // references to this.something (e.g. props or state).
  21367. // We allow dynamic styles only when resolving styles.
  21368. if (type !== "resolve") {
  21369. validateExternalExpressions(templateLiteral);
  21370. } else if (!path.scope.path.isProgram()) {
  21371. scope = getScope(path);
  21372. }
  21373. var stylesInfo = getJSXStyleInfo(templateLiteral, scope);
  21374. var ref = computeClassNames([
  21375. stylesInfo
  21376. ], undefined, styleComponentImportName), staticClassName = ref.staticClassName, className = ref.className;
  21377. var styles = processCss(_extends$1({}, stylesInfo, {
  21378. staticClassName: staticClassName,
  21379. file: file,
  21380. isGlobal: type === "global",
  21381. plugins: plugins,
  21382. vendorPrefixes: vendorPrefixes,
  21383. sourceMaps: sourceMaps
  21384. }), {
  21385. splitRules: splitRules
  21386. });
  21387. if (type === "resolve") {
  21388. var hash = styles.hash, css = styles.css, expressions = styles.expressions;
  21389. path.replaceWith(// {
  21390. // styles: <_JSXStyle ... />,
  21391. // className: 'jsx-123'
  21392. // }
  21393. lib$1.objectExpression([
  21394. lib$1.objectProperty(lib$1.identifier("styles"), makeStyledJsxTag(hash, css, expressions, styleComponentImportName)),
  21395. lib$1.objectProperty(lib$1.identifier("className"), className)
  21396. ]));
  21397. return;
  21398. }
  21399. var id = path.parentPath.node.id;
  21400. var baseExportName = id ? id.name : "default";
  21401. var parentPath = baseExportName === "default" ? path.parentPath : path.findParent(function(path) {
  21402. return path.isVariableDeclaration() || path.isAssignmentExpression() && isModuleExports(path.get("left").node);
  21403. });
  21404. if (baseExportName !== "default" && !parentPath.parentPath.isProgram()) {
  21405. parentPath = parentPath.parentPath;
  21406. }
  21407. var css1 = cssToBabelType(styles.css);
  21408. var newPath = lib$1.isArrayExpression(css1) ? css1 : lib$1.newExpression(lib$1.identifier("String"), [
  21409. css1
  21410. ]);
  21411. // default exports
  21412. if (baseExportName === "default") {
  21413. var defaultExportIdentifier = path.scope.generateUidIdentifier("defaultExport");
  21414. parentPath.insertBefore(lib$1.variableDeclaration("const", [
  21415. lib$1.variableDeclarator(defaultExportIdentifier, newPath)
  21416. ]));
  21417. parentPath.insertBefore(addHash(defaultExportIdentifier, styles.hash));
  21418. path.replaceWith(defaultExportIdentifier);
  21419. return;
  21420. }
  21421. // local and named exports
  21422. parentPath.insertAfter(addHash(lib$1.identifier(baseExportName), styles.hash));
  21423. path.replaceWith(newPath);
  21424. }
  21425. function addHash(exportIdentifier, hash) {
  21426. var value = typeof hash === "string" ? lib$1.stringLiteral(hash) : hash;
  21427. return lib$1.expressionStatement(lib$1.assignmentExpression("=", lib$1.memberExpression(exportIdentifier, lib$1.identifier("__hash")), value));
  21428. }
  21429. var visitor = {
  21430. ImportDeclaration: function ImportDeclaration(path, state) {
  21431. // import css from 'styled-jsx/css'
  21432. if (path.node.source.value !== "styled-jsx/css") {
  21433. return;
  21434. }
  21435. // Find all the imported specifiers.
  21436. // e.g import css, { global, resolve } from 'styled-jsx/css'
  21437. // -> ['css', 'global', 'resolve']
  21438. var specifiersNames = path.node.specifiers.map(function(specifier) {
  21439. return specifier.local.name;
  21440. });
  21441. specifiersNames.forEach(function(tagName) {
  21442. // Get all the reference paths i.e. the places that use the tagName above
  21443. // eg.
  21444. // css`div { color: red }`
  21445. // css.global`div { color: red }`
  21446. // global`div { color: red `
  21447. var binding = path.scope.getBinding(tagName);
  21448. if (!binding || !Array.isArray(binding.referencePaths)) {
  21449. return;
  21450. }
  21451. // Produces an object containing all the TaggedTemplateExpression paths detected.
  21452. // The object contains { scoped, global, resolve }
  21453. var taggedTemplateExpressions = binding.referencePaths.map(function(ref) {
  21454. return ref.parentPath;
  21455. }).reduce(function(result, path) {
  21456. var taggedTemplateExpression;
  21457. if (path.isTaggedTemplateExpression()) {
  21458. // css`` global`` resolve``
  21459. taggedTemplateExpression = path;
  21460. } else if (path.parentPath && path.isMemberExpression() && path.parentPath.isTaggedTemplateExpression()) {
  21461. // This part is for css.global`` or css.resolve``
  21462. // using the default import css
  21463. taggedTemplateExpression = path.parentPath;
  21464. } else {
  21465. return result;
  21466. }
  21467. var tag = taggedTemplateExpression.get("tag");
  21468. var id = tag.isIdentifier() ? tag.node.name : tag.get("property").node.name;
  21469. if (result[id]) {
  21470. result[id].push(taggedTemplateExpression);
  21471. } else {
  21472. result.scoped.push(taggedTemplateExpression);
  21473. }
  21474. return result;
  21475. }, {
  21476. scoped: [],
  21477. global: [],
  21478. resolve: []
  21479. });
  21480. var hasJSXStyle = false;
  21481. var _opts = state.opts, vendorPrefixes = _opts.vendorPrefixes, sourceMaps = _opts.sourceMaps;
  21482. Object.keys(taggedTemplateExpressions).forEach(function(type) {
  21483. return taggedTemplateExpressions[type].forEach(function(path) {
  21484. hasJSXStyle = true;
  21485. // Process each css block
  21486. processTaggedTemplateExpression({
  21487. type: type,
  21488. path: path,
  21489. file: state.file,
  21490. splitRules: typeof state.opts.optimizeForSpeed === "boolean" ? state.opts.optimizeForSpeed : process.env.NODE_ENV === "production",
  21491. plugins: state.plugins,
  21492. vendorPrefixes: vendorPrefixes,
  21493. sourceMaps: sourceMaps,
  21494. styleComponentImportName: state.styleComponentImportName
  21495. });
  21496. });
  21497. });
  21498. var hasCssResolve = hasJSXStyle && taggedTemplateExpressions.resolve.length > 0;
  21499. // When using the `resolve` helper we need to add an import
  21500. // for the _JSXStyle component `styled-jsx/style`
  21501. if (hasCssResolve) {
  21502. state.file.hasCssResolve = true;
  21503. }
  21504. });
  21505. // Finally remove the import
  21506. path.remove();
  21507. }
  21508. };
  21509. function babelMacro(param) {
  21510. var createMacro = param.createMacro, MacroError = param.MacroError;
  21511. var styledJsxMacro = function styledJsxMacro(param) {
  21512. var references = param.references, state = param.state;
  21513. setStateOptions(state);
  21514. // Holds a reference to all the lines where strings are tagged using the `css` tag name.
  21515. // We print a warning at the end of the macro in case there is any reference to css,
  21516. // because `css` is generally used as default import name for 'styled-jsx/css'.
  21517. // People who want to migrate from this macro to pure styled-jsx might have name conflicts issues.
  21518. var cssReferences = [];
  21519. // references looks like this
  21520. // {
  21521. // default: [path, path],
  21522. // resolve: [path],
  21523. // }
  21524. Object.keys(references).forEach(function(refName) {
  21525. // Enforce `resolve` as named import so people
  21526. // can only import { resolve } from 'styled-jsx/macro'
  21527. // or an alias of it eg. { resolve as foo }
  21528. if (refName !== "default" && refName !== "resolve") {
  21529. throw new MacroError("Imported an invalid named import: " + refName + ". Please import: resolve");
  21530. }
  21531. // Start processing the references for refName
  21532. references[refName].forEach(function(path) {
  21533. // We grab the parent path. Eg.
  21534. // path -> css
  21535. // path.parenPath -> css`div { color: red }`
  21536. var templateExpression = path.parentPath;
  21537. // templateExpression member expression?
  21538. // path -> css
  21539. // path.parentPath -> css.resolve
  21540. if (templateExpression.isMemberExpression()) {
  21541. // grab .resolve
  21542. var tagPropertyName = templateExpression.get("property").node.name;
  21543. // Member expressions are only valid on default imports
  21544. // eg. import css from 'styled-jsx/macro'
  21545. if (refName !== "default") {
  21546. throw new MacroError("Can't use named import " + path.node.name + " as a member expression: " + path.node.name + "." + tagPropertyName + "`div { color: red }` Please use it directly: " + path.node.name + "`div { color: red }`");
  21547. }
  21548. // Otherwise enforce `css.resolve`
  21549. if (tagPropertyName !== "resolve") {
  21550. throw new MacroError("Using an invalid tag: " + tagPropertyName + ". Please use " + templateExpression.get("object").node.name + ".resolve");
  21551. }
  21552. // Grab the TaggedTemplateExpression
  21553. // i.e. css.resolve`div { color: red }`
  21554. templateExpression = templateExpression.parentPath;
  21555. } else {
  21556. if (refName === "default") {
  21557. var name = path.node.name;
  21558. throw new MacroError("Can't use default import directly eg. " + name + "`div { color: red }`. Please use " + name + ".resolve`div { color: red }` instead.");
  21559. }
  21560. if (path.node.name === "css") {
  21561. // If the path node name is `css` we push it to the references above to emit a warning later.
  21562. cssReferences.push(path.node.loc.start.line);
  21563. }
  21564. }
  21565. if (!state.styleComponentImportName) {
  21566. var programPath = path.findParent(function(p) {
  21567. return p.isProgram();
  21568. });
  21569. state.styleComponentImportName = programPath.scope.generateUidIdentifier(STYLE_COMPONENT).name;
  21570. var importDeclaration = createReactComponentImportDeclaration(state);
  21571. programPath.unshiftContainer("body", importDeclaration);
  21572. }
  21573. // Finally transform the path :)
  21574. processTaggedTemplateExpression({
  21575. type: "resolve",
  21576. path: templateExpression,
  21577. file: state.file,
  21578. splitRules: typeof state.opts.optimizeForSpeed === "boolean" ? state.opts.optimizeForSpeed : process.env.NODE_ENV === "production",
  21579. plugins: state.plugins,
  21580. vendorPrefixes: state.opts.vendorPrefixes,
  21581. sourceMaps: state.opts.sourceMaps,
  21582. styleComponentImportName: state.styleComponentImportName
  21583. });
  21584. });
  21585. });
  21586. if (cssReferences.length > 0) {
  21587. console.warn("styled-jsx - Warning - We detected that you named your tag as `css` at lines: " + cssReferences.join(", ") + ".\n" + "This tag name is usually used as default import name for `styled-jsx/css`.\n" + "Porting macro code to pure styled-jsx in the future might be a bit problematic.");
  21588. }
  21589. };
  21590. return createMacro(styledJsxMacro);
  21591. }
  21592. function babelTest() {
  21593. return {
  21594. inherits: default_1,
  21595. visitor: {
  21596. JSXOpeningElement: function JSXOpeningElement(path) {
  21597. var el = path.node;
  21598. var name = (el.name || {}).name;
  21599. if (name !== "style") {
  21600. return;
  21601. }
  21602. el.attributes = el.attributes.filter(function(a) {
  21603. var name = a.name.name;
  21604. return name !== "jsx" && name !== "global";
  21605. });
  21606. }
  21607. }
  21608. };
  21609. }
  21610. function _arrayLikeToArray(arr, len) {
  21611. if (len == null || len > arr.length) len = arr.length;
  21612. for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
  21613. return arr2;
  21614. }
  21615. function _arrayWithoutHoles(arr) {
  21616. if (Array.isArray(arr)) return _arrayLikeToArray(arr);
  21617. }
  21618. function _extends() {
  21619. _extends = Object.assign || function(target) {
  21620. for(var i = 1; i < arguments.length; i++){
  21621. var source = arguments[i];
  21622. for(var key in source){
  21623. if (Object.prototype.hasOwnProperty.call(source, key)) {
  21624. target[key] = source[key];
  21625. }
  21626. }
  21627. }
  21628. return target;
  21629. };
  21630. return _extends.apply(this, arguments);
  21631. }
  21632. function _iterableToArray(iter) {
  21633. if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
  21634. }
  21635. function _nonIterableSpread() {
  21636. throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  21637. }
  21638. function _toConsumableArray(arr) {
  21639. return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
  21640. }
  21641. function _unsupportedIterableToArray(o, minLen) {
  21642. if (!o) return;
  21643. if (typeof o === "string") return _arrayLikeToArray(o, minLen);
  21644. var n = Object.prototype.toString.call(o).slice(8, -1);
  21645. if (n === "Object" && o.constructor) n = o.constructor.name;
  21646. if (n === "Map" || n === "Set") return Array.from(n);
  21647. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
  21648. }
  21649. function macro() {
  21650. return babelMacro(require("babel-plugin-macros"));
  21651. }
  21652. function test() {
  21653. return babelTest;
  21654. }
  21655. function babel(param) {
  21656. var t = param.types;
  21657. var jsxVisitors = {
  21658. JSXOpeningElement: function JSXOpeningElement(path, state) {
  21659. var el = path.node;
  21660. var name = (el.name || {}).name;
  21661. if (!state.hasJSXStyle) {
  21662. return;
  21663. }
  21664. if (state.ignoreClosing === null) {
  21665. // We keep a counter of elements inside so that we
  21666. // can keep track of when we exit the parent to reset state
  21667. // note: if we wished to add an option to turn off
  21668. // selectors to reach parent elements, it would suffice to
  21669. // set this to `1` and do an early return instead
  21670. state.ignoreClosing = 0;
  21671. }
  21672. var tag = path.get("name");
  21673. if (name && name !== "style" && name !== state.styleComponentImportName && (name.charAt(0) !== name.charAt(0).toUpperCase() || Object.values(path.scope.bindings).some(function(binding) {
  21674. return binding.referencePaths.some(function(r) {
  21675. return r === tag;
  21676. });
  21677. }))) {
  21678. if (state.className) {
  21679. addClassName(path, state.className);
  21680. }
  21681. }
  21682. state.ignoreClosing++;
  21683. // Next visit will be: JSXElement exit()
  21684. },
  21685. JSXElement: {
  21686. enter: function enter(path, state) {
  21687. if (state.hasJSXStyle !== null) {
  21688. return;
  21689. }
  21690. var styles = findStyles(path);
  21691. if (styles.length === 0) {
  21692. return;
  21693. }
  21694. state.styles = [];
  21695. state.externalStyles = [];
  21696. var scope = getScope(path);
  21697. for(var _i = 0; _i < styles.length; _i++){
  21698. var style = styles[_i];
  21699. // Compute children excluding whitespace
  21700. var children = style.get("children").filter(function(c) {
  21701. return t.isJSXExpressionContainer(c.node) || // Ignore whitespace around the expression container
  21702. (t.isJSXText(c.node) && c.node.value.trim() !== "");
  21703. });
  21704. if (children.length !== 1) {
  21705. throw path.buildCodeFrameError("Expected one child under " + ("JSX Style tag, but got " + children.length + " ") + "(eg: <style jsx>{`hi`}</style>)");
  21706. }
  21707. var child = children[0];
  21708. if (!t.isJSXExpressionContainer(child)) {
  21709. throw path.buildCodeFrameError("Expected a child of " + "type JSXExpressionContainer under JSX Style tag " + ("(eg: <style jsx>{`hi`}</style>), got " + child.type));
  21710. }
  21711. var expression = child.get("expression");
  21712. if (t.isIdentifier(expression)) {
  21713. var idName = expression.node.name;
  21714. if (expression.scope.hasBinding(idName)) {
  21715. var externalStylesIdentifier = t.identifier(idName);
  21716. var isGlobal = isGlobalEl(style.get("openingElement").node);
  21717. state.externalStyles.push([
  21718. t.memberExpression(externalStylesIdentifier, t.identifier("__hash")),
  21719. externalStylesIdentifier,
  21720. isGlobal
  21721. ]);
  21722. continue;
  21723. }
  21724. throw path.buildCodeFrameError("The Identifier " + ("`" + expression.getSource() + "` is either `undefined` or ") + "it is not an external StyleSheet reference i.e. " + "it doesn't come from an `import` or `require` statement");
  21725. }
  21726. if (!t.isTemplateLiteral(expression) && !t.isStringLiteral(expression)) {
  21727. throw path.buildCodeFrameError("Expected a template " + "literal or String literal as the child of the " + "JSX Style tag (eg: <style jsx>{`some css`}</style>)," + (" but got " + expression.type));
  21728. }
  21729. state.styles.push(getJSXStyleInfo(expression, scope));
  21730. }
  21731. var externalJsxId;
  21732. if (state.externalStyles.length > 0) {
  21733. var expressions = state.externalStyles// Remove globals
  21734. .filter(function(s) {
  21735. return !s[2];
  21736. }).map(function(s) {
  21737. return s[0];
  21738. });
  21739. var expressionsLength = expressions.length;
  21740. if (expressionsLength === 0) {
  21741. externalJsxId = null;
  21742. } else {
  21743. // Construct a template literal of this form:
  21744. // `jsx-${styles.__scopedHash} jsx-${otherStyles.__scopedHash}`
  21745. externalJsxId = t.templateLiteral([
  21746. t.templateElement({
  21747. raw: "jsx-",
  21748. cooked: "jsx-"
  21749. })
  21750. ].concat(_toConsumableArray([].concat(new Array(expressionsLength - 1).fill(null)).map(function() {
  21751. return t.templateElement({
  21752. raw: " jsx-",
  21753. cooked: " jsx-"
  21754. });
  21755. })), [
  21756. t.templateElement({
  21757. raw: "",
  21758. cooked: ""
  21759. }, true)
  21760. ]), expressions);
  21761. }
  21762. }
  21763. if (state.styles.length > 0 || externalJsxId) {
  21764. var ref = computeClassNames(state.styles, externalJsxId, state.styleComponentImportName), staticClassName = ref.staticClassName, className = ref.className;
  21765. state.className = className;
  21766. state.staticClassName = staticClassName;
  21767. }
  21768. state.hasJSXStyle = true;
  21769. state.file.hasJSXStyle = true;
  21770. // Next visit will be: JSXOpeningElement
  21771. },
  21772. exit: function exit(path, state) {
  21773. var isGlobal = isGlobalEl(path.node.openingElement);
  21774. if (state.hasJSXStyle && !--state.ignoreClosing && !isGlobal) {
  21775. state.hasJSXStyle = null;
  21776. state.className = null;
  21777. state.externalJsxId = null;
  21778. }
  21779. if (!state.hasJSXStyle || !isStyledJsx(path)) {
  21780. return;
  21781. }
  21782. if (state.ignoreClosing > 1) {
  21783. var styleTagSrc;
  21784. try {
  21785. styleTagSrc = path.getSource();
  21786. } catch (error) {}
  21787. throw path.buildCodeFrameError("Detected nested style tag" + (styleTagSrc ? ": \n\n" + styleTagSrc + "\n\n" : " ") + "styled-jsx only allows style tags " + "to be direct descendants (children) of the outermost " + "JSX element i.e. the subtree root.");
  21788. }
  21789. if (state.externalStyles.length > 0 && path.get("children").filter(function(child) {
  21790. if (!t.isJSXExpressionContainer(child)) {
  21791. return false;
  21792. }
  21793. var expression = child.get("expression");
  21794. return expression && expression.isIdentifier();
  21795. }).length === 1) {
  21796. var ref = state.externalStyles.shift(), id = ref[0], css = ref[1];
  21797. path.replaceWith(makeStyledJsxTag(id, css, [], state.styleComponentImportName));
  21798. return;
  21799. }
  21800. var _opts = state.opts, vendorPrefixes = _opts.vendorPrefixes, sourceMaps = _opts.sourceMaps;
  21801. var stylesInfo = _extends({}, state.styles.shift(), {
  21802. file: state.file,
  21803. staticClassName: state.staticClassName,
  21804. isGlobal: isGlobal,
  21805. plugins: state.plugins,
  21806. vendorPrefixes: vendorPrefixes,
  21807. sourceMaps: sourceMaps
  21808. });
  21809. var splitRules = typeof state.opts.optimizeForSpeed === "boolean" ? state.opts.optimizeForSpeed : process.env.NODE_ENV === "production";
  21810. var ref1 = processCss(stylesInfo, {
  21811. splitRules: splitRules
  21812. }), hash = ref1.hash, css1 = ref1.css, expressions = ref1.expressions;
  21813. path.replaceWith(makeStyledJsxTag(hash, css1, expressions, state.styleComponentImportName));
  21814. }
  21815. }
  21816. };
  21817. // only apply JSXFragment visitor if supported
  21818. if (t.isJSXFragment) {
  21819. jsxVisitors.JSXFragment = jsxVisitors.JSXElement;
  21820. jsxVisitors.JSXOpeningFragment = {
  21821. enter: function enter(path, state) {
  21822. if (!state.hasJSXStyle) {
  21823. return;
  21824. }
  21825. if (state.ignoreClosing === null) {
  21826. // We keep a counter of elements inside so that we
  21827. // can keep track of when we exit the parent to reset state
  21828. // note: if we wished to add an option to turn off
  21829. // selectors to reach parent elements, it would suffice to
  21830. // set this to `1` and do an early return instead
  21831. state.ignoreClosing = 0;
  21832. }
  21833. state.ignoreClosing++;
  21834. }
  21835. };
  21836. }
  21837. var visitors = {
  21838. inherits: default_1,
  21839. visitor: {
  21840. Program: {
  21841. enter: function enter(path, state) {
  21842. setStateOptions(state);
  21843. state.hasJSXStyle = null;
  21844. state.ignoreClosing = null;
  21845. state.file.hasJSXStyle = false;
  21846. state.file.hasCssResolve = false;
  21847. // create unique identifier for _JSXStyle component
  21848. state.styleComponentImportName = path.scope.generateUidIdentifier(STYLE_COMPONENT).name;
  21849. // we need to beat the arrow function transform and
  21850. // possibly others so we traverse from here or else
  21851. // dynamic values in classNames could be incorrect
  21852. path.traverse(jsxVisitors, state);
  21853. // Transpile external styles
  21854. path.traverse(visitor, state);
  21855. },
  21856. exit: function exit(path, state) {
  21857. if (!state.file.hasJSXStyle && !state.file.hasCssResolve) {
  21858. return;
  21859. }
  21860. state.file.hasJSXStyle = true;
  21861. var importDeclaration = createReactComponentImportDeclaration(state);
  21862. path.unshiftContainer("body", importDeclaration);
  21863. }
  21864. }
  21865. }
  21866. };
  21867. return visitors;
  21868. }
  21869. exports["default"] = babel;
  21870. exports.macro = macro;
  21871. exports.test = test;