dep-b541373d.js 719 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063
  1. 'use strict';
  2. var build = require('./dep-1be34a63.js');
  3. var compilerDom_cjs$2 = {};
  4. /**
  5. * Make a map and return a function for checking if a key
  6. * is in that map.
  7. * IMPORTANT: all calls of this function must be prefixed with
  8. * \/\*#\_\_PURE\_\_\*\/
  9. * So that rollup can tree-shake them if necessary.
  10. */
  11. function makeMap(str, expectsLowerCase) {
  12. const map = Object.create(null);
  13. const list = str.split(',');
  14. for (let i = 0; i < list.length; i++) {
  15. map[list[i]] = true;
  16. }
  17. return expectsLowerCase ? val => !!map[val.toLowerCase()] : val => !!map[val];
  18. }
  19. /**
  20. * dev only flag -> name mapping
  21. */
  22. const PatchFlagNames = {
  23. [1 /* TEXT */]: `TEXT`,
  24. [2 /* CLASS */]: `CLASS`,
  25. [4 /* STYLE */]: `STYLE`,
  26. [8 /* PROPS */]: `PROPS`,
  27. [16 /* FULL_PROPS */]: `FULL_PROPS`,
  28. [32 /* HYDRATE_EVENTS */]: `HYDRATE_EVENTS`,
  29. [64 /* STABLE_FRAGMENT */]: `STABLE_FRAGMENT`,
  30. [128 /* KEYED_FRAGMENT */]: `KEYED_FRAGMENT`,
  31. [256 /* UNKEYED_FRAGMENT */]: `UNKEYED_FRAGMENT`,
  32. [512 /* NEED_PATCH */]: `NEED_PATCH`,
  33. [1024 /* DYNAMIC_SLOTS */]: `DYNAMIC_SLOTS`,
  34. [2048 /* DEV_ROOT_FRAGMENT */]: `DEV_ROOT_FRAGMENT`,
  35. [-1 /* HOISTED */]: `HOISTED`,
  36. [-2 /* BAIL */]: `BAIL`
  37. };
  38. /**
  39. * Dev only
  40. */
  41. const slotFlagsText = {
  42. [1 /* STABLE */]: 'STABLE',
  43. [2 /* DYNAMIC */]: 'DYNAMIC',
  44. [3 /* FORWARDED */]: 'FORWARDED'
  45. };
  46. const GLOBALS_WHITE_LISTED = 'Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,' +
  47. 'decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,' +
  48. 'Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt';
  49. const isGloballyWhitelisted = /*#__PURE__*/ makeMap(GLOBALS_WHITE_LISTED);
  50. const range = 2;
  51. function generateCodeFrame(source, start = 0, end = source.length) {
  52. // Split the content into individual lines but capture the newline sequence
  53. // that separated each line. This is important because the actual sequence is
  54. // needed to properly take into account the full line length for offset
  55. // comparison
  56. let lines = source.split(/(\r?\n)/);
  57. // Separate the lines and newline sequences into separate arrays for easier referencing
  58. const newlineSequences = lines.filter((_, idx) => idx % 2 === 1);
  59. lines = lines.filter((_, idx) => idx % 2 === 0);
  60. let count = 0;
  61. const res = [];
  62. for (let i = 0; i < lines.length; i++) {
  63. count +=
  64. lines[i].length +
  65. ((newlineSequences[i] && newlineSequences[i].length) || 0);
  66. if (count >= start) {
  67. for (let j = i - range; j <= i + range || end > count; j++) {
  68. if (j < 0 || j >= lines.length)
  69. continue;
  70. const line = j + 1;
  71. res.push(`${line}${' '.repeat(Math.max(3 - String(line).length, 0))}| ${lines[j]}`);
  72. const lineLength = lines[j].length;
  73. const newLineSeqLength = (newlineSequences[j] && newlineSequences[j].length) || 0;
  74. if (j === i) {
  75. // push underline
  76. const pad = start - (count - (lineLength + newLineSeqLength));
  77. const length = Math.max(1, end > count ? lineLength - pad : end - start);
  78. res.push(` | ` + ' '.repeat(pad) + '^'.repeat(length));
  79. }
  80. else if (j > i) {
  81. if (end > count) {
  82. const length = Math.max(Math.min(end - count, lineLength), 1);
  83. res.push(` | ` + '^'.repeat(length));
  84. }
  85. count += lineLength + newLineSeqLength;
  86. }
  87. }
  88. break;
  89. }
  90. }
  91. return res.join('\n');
  92. }
  93. /**
  94. * On the client we only need to offer special cases for boolean attributes that
  95. * have different names from their corresponding dom properties:
  96. * - itemscope -> N/A
  97. * - allowfullscreen -> allowFullscreen
  98. * - formnovalidate -> formNoValidate
  99. * - ismap -> isMap
  100. * - nomodule -> noModule
  101. * - novalidate -> noValidate
  102. * - readonly -> readOnly
  103. */
  104. const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
  105. const isSpecialBooleanAttr = /*#__PURE__*/ makeMap(specialBooleanAttrs);
  106. /**
  107. * The full list is needed during SSR to produce the correct initial markup.
  108. */
  109. const isBooleanAttr = /*#__PURE__*/ makeMap(specialBooleanAttrs +
  110. `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,` +
  111. `loop,open,required,reversed,scoped,seamless,` +
  112. `checked,muted,multiple,selected`);
  113. /**
  114. * Boolean attributes should be included if the value is truthy or ''.
  115. * e.g. <select multiple> compiles to { multiple: '' }
  116. */
  117. function includeBooleanAttr(value) {
  118. return !!value || value === '';
  119. }
  120. const unsafeAttrCharRE = /[>/="'\u0009\u000a\u000c\u0020]/;
  121. const attrValidationCache = {};
  122. function isSSRSafeAttrName(name) {
  123. if (attrValidationCache.hasOwnProperty(name)) {
  124. return attrValidationCache[name];
  125. }
  126. const isUnsafe = unsafeAttrCharRE.test(name);
  127. if (isUnsafe) {
  128. console.error(`unsafe attribute name: ${name}`);
  129. }
  130. return (attrValidationCache[name] = !isUnsafe);
  131. }
  132. const propsToAttrMap = {
  133. acceptCharset: 'accept-charset',
  134. className: 'class',
  135. htmlFor: 'for',
  136. httpEquiv: 'http-equiv'
  137. };
  138. /**
  139. * CSS properties that accept plain numbers
  140. */
  141. const isNoUnitNumericStyleProp = /*#__PURE__*/ makeMap(`animation-iteration-count,border-image-outset,border-image-slice,` +
  142. `border-image-width,box-flex,box-flex-group,box-ordinal-group,column-count,` +
  143. `columns,flex,flex-grow,flex-positive,flex-shrink,flex-negative,flex-order,` +
  144. `grid-row,grid-row-end,grid-row-span,grid-row-start,grid-column,` +
  145. `grid-column-end,grid-column-span,grid-column-start,font-weight,line-clamp,` +
  146. `line-height,opacity,order,orphans,tab-size,widows,z-index,zoom,` +
  147. // SVG
  148. `fill-opacity,flood-opacity,stop-opacity,stroke-dasharray,stroke-dashoffset,` +
  149. `stroke-miterlimit,stroke-opacity,stroke-width`);
  150. /**
  151. * Known attributes, this is used for stringification of runtime static nodes
  152. * so that we don't stringify bindings that cannot be set from HTML.
  153. * Don't also forget to allow `data-*` and `aria-*`!
  154. * Generated from https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes
  155. */
  156. const isKnownHtmlAttr = /*#__PURE__*/ makeMap(`accept,accept-charset,accesskey,action,align,allow,alt,async,` +
  157. `autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,` +
  158. `border,buffered,capture,challenge,charset,checked,cite,class,code,` +
  159. `codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,` +
  160. `coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,` +
  161. `disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,` +
  162. `formaction,formenctype,formmethod,formnovalidate,formtarget,headers,` +
  163. `height,hidden,high,href,hreflang,http-equiv,icon,id,importance,integrity,` +
  164. `ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,` +
  165. `manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,` +
  166. `open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,` +
  167. `referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,` +
  168. `selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,` +
  169. `start,step,style,summary,tabindex,target,title,translate,type,usemap,` +
  170. `value,width,wrap`);
  171. /**
  172. * Generated from https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute
  173. */
  174. const isKnownSvgAttr = /*#__PURE__*/ makeMap(`xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,` +
  175. `arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,` +
  176. `baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,` +
  177. `clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,` +
  178. `color-interpolation-filters,color-profile,color-rendering,` +
  179. `contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,` +
  180. `descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,` +
  181. `dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,` +
  182. `fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,` +
  183. `font-family,font-size,font-size-adjust,font-stretch,font-style,` +
  184. `font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,` +
  185. `glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,` +
  186. `gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,` +
  187. `horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,` +
  188. `k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,` +
  189. `lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,` +
  190. `marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,` +
  191. `mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,` +
  192. `name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,` +
  193. `overflow,overline-position,overline-thickness,panose-1,paint-order,path,` +
  194. `pathLength,patternContentUnits,patternTransform,patternUnits,ping,` +
  195. `pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,` +
  196. `preserveAspectRatio,primitiveUnits,r,radius,referrerPolicy,refX,refY,rel,` +
  197. `rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,` +
  198. `restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,` +
  199. `specularConstant,specularExponent,speed,spreadMethod,startOffset,` +
  200. `stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,` +
  201. `strikethrough-position,strikethrough-thickness,string,stroke,` +
  202. `stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,` +
  203. `stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,` +
  204. `systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,` +
  205. `text-decoration,text-rendering,textLength,to,transform,transform-origin,` +
  206. `type,u1,u2,underline-position,underline-thickness,unicode,unicode-bidi,` +
  207. `unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,` +
  208. `v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,` +
  209. `vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,` +
  210. `writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,` +
  211. `xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xml:base,xml:lang,` +
  212. `xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan`);
  213. function normalizeStyle(value) {
  214. if (isArray(value)) {
  215. const res = {};
  216. for (let i = 0; i < value.length; i++) {
  217. const item = value[i];
  218. const normalized = isString(item)
  219. ? parseStringStyle(item)
  220. : normalizeStyle(item);
  221. if (normalized) {
  222. for (const key in normalized) {
  223. res[key] = normalized[key];
  224. }
  225. }
  226. }
  227. return res;
  228. }
  229. else if (isString(value)) {
  230. return value;
  231. }
  232. else if (isObject(value)) {
  233. return value;
  234. }
  235. }
  236. const listDelimiterRE = /;(?![^(]*\))/g;
  237. const propertyDelimiterRE = /:(.+)/;
  238. function parseStringStyle(cssText) {
  239. const ret = {};
  240. cssText.split(listDelimiterRE).forEach(item => {
  241. if (item) {
  242. const tmp = item.split(propertyDelimiterRE);
  243. tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
  244. }
  245. });
  246. return ret;
  247. }
  248. function stringifyStyle(styles) {
  249. let ret = '';
  250. if (!styles || isString(styles)) {
  251. return ret;
  252. }
  253. for (const key in styles) {
  254. const value = styles[key];
  255. const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key);
  256. if (isString(value) ||
  257. (typeof value === 'number' && isNoUnitNumericStyleProp(normalizedKey))) {
  258. // only render valid values
  259. ret += `${normalizedKey}:${value};`;
  260. }
  261. }
  262. return ret;
  263. }
  264. function normalizeClass(value) {
  265. let res = '';
  266. if (isString(value)) {
  267. res = value;
  268. }
  269. else if (isArray(value)) {
  270. for (let i = 0; i < value.length; i++) {
  271. const normalized = normalizeClass(value[i]);
  272. if (normalized) {
  273. res += normalized + ' ';
  274. }
  275. }
  276. }
  277. else if (isObject(value)) {
  278. for (const name in value) {
  279. if (value[name]) {
  280. res += name + ' ';
  281. }
  282. }
  283. }
  284. return res.trim();
  285. }
  286. function normalizeProps(props) {
  287. if (!props)
  288. return null;
  289. let { class: klass, style } = props;
  290. if (klass && !isString(klass)) {
  291. props.class = normalizeClass(klass);
  292. }
  293. if (style) {
  294. props.style = normalizeStyle(style);
  295. }
  296. return props;
  297. }
  298. // These tag configs are shared between compiler-dom and runtime-dom, so they
  299. // https://developer.mozilla.org/en-US/docs/Web/HTML/Element
  300. const HTML_TAGS = 'html,body,base,head,link,meta,style,title,address,article,aside,footer,' +
  301. 'header,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,' +
  302. 'figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,' +
  303. 'data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,' +
  304. 'time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,' +
  305. 'canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,' +
  306. 'th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,' +
  307. 'option,output,progress,select,textarea,details,dialog,menu,' +
  308. 'summary,template,blockquote,iframe,tfoot';
  309. // https://developer.mozilla.org/en-US/docs/Web/SVG/Element
  310. const SVG_TAGS = 'svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,' +
  311. 'defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,' +
  312. 'feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,' +
  313. 'feDistanceLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,' +
  314. 'feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,' +
  315. 'fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,' +
  316. 'foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,' +
  317. 'mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,' +
  318. 'polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,' +
  319. 'text,textPath,title,tspan,unknown,use,view';
  320. const VOID_TAGS = 'area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr';
  321. const isHTMLTag = /*#__PURE__*/ makeMap(HTML_TAGS);
  322. const isSVGTag = /*#__PURE__*/ makeMap(SVG_TAGS);
  323. const isVoidTag = /*#__PURE__*/ makeMap(VOID_TAGS);
  324. const escapeRE = /["'&<>]/;
  325. function escapeHtml(string) {
  326. const str = '' + string;
  327. const match = escapeRE.exec(str);
  328. if (!match) {
  329. return str;
  330. }
  331. let html = '';
  332. let escaped;
  333. let index;
  334. let lastIndex = 0;
  335. for (index = match.index; index < str.length; index++) {
  336. switch (str.charCodeAt(index)) {
  337. case 34: // "
  338. escaped = '&quot;';
  339. break;
  340. case 38: // &
  341. escaped = '&amp;';
  342. break;
  343. case 39: // '
  344. escaped = '&#39;';
  345. break;
  346. case 60: // <
  347. escaped = '&lt;';
  348. break;
  349. case 62: // >
  350. escaped = '&gt;';
  351. break;
  352. default:
  353. continue;
  354. }
  355. if (lastIndex !== index) {
  356. html += str.substring(lastIndex, index);
  357. }
  358. lastIndex = index + 1;
  359. html += escaped;
  360. }
  361. return lastIndex !== index ? html + str.substring(lastIndex, index) : html;
  362. }
  363. // https://www.w3.org/TR/html52/syntax.html#comments
  364. const commentStripRE = /^-?>|<!--|-->|--!>|<!-$/g;
  365. function escapeHtmlComment(src) {
  366. return src.replace(commentStripRE, '');
  367. }
  368. function looseCompareArrays(a, b) {
  369. if (a.length !== b.length)
  370. return false;
  371. let equal = true;
  372. for (let i = 0; equal && i < a.length; i++) {
  373. equal = looseEqual(a[i], b[i]);
  374. }
  375. return equal;
  376. }
  377. function looseEqual(a, b) {
  378. if (a === b)
  379. return true;
  380. let aValidType = isDate(a);
  381. let bValidType = isDate(b);
  382. if (aValidType || bValidType) {
  383. return aValidType && bValidType ? a.getTime() === b.getTime() : false;
  384. }
  385. aValidType = isArray(a);
  386. bValidType = isArray(b);
  387. if (aValidType || bValidType) {
  388. return aValidType && bValidType ? looseCompareArrays(a, b) : false;
  389. }
  390. aValidType = isObject(a);
  391. bValidType = isObject(b);
  392. if (aValidType || bValidType) {
  393. /* istanbul ignore if: this if will probably never be called */
  394. if (!aValidType || !bValidType) {
  395. return false;
  396. }
  397. const aKeysCount = Object.keys(a).length;
  398. const bKeysCount = Object.keys(b).length;
  399. if (aKeysCount !== bKeysCount) {
  400. return false;
  401. }
  402. for (const key in a) {
  403. const aHasKey = a.hasOwnProperty(key);
  404. const bHasKey = b.hasOwnProperty(key);
  405. if ((aHasKey && !bHasKey) ||
  406. (!aHasKey && bHasKey) ||
  407. !looseEqual(a[key], b[key])) {
  408. return false;
  409. }
  410. }
  411. }
  412. return String(a) === String(b);
  413. }
  414. function looseIndexOf(arr, val) {
  415. return arr.findIndex(item => looseEqual(item, val));
  416. }
  417. /**
  418. * For converting {{ interpolation }} values to displayed strings.
  419. * @private
  420. */
  421. const toDisplayString = (val) => {
  422. return val == null
  423. ? ''
  424. : isArray(val) ||
  425. (isObject(val) &&
  426. (val.toString === objectToString$1 || !isFunction$1(val.toString)))
  427. ? JSON.stringify(val, replacer, 2)
  428. : String(val);
  429. };
  430. const replacer = (_key, val) => {
  431. // can't use isRef here since @vue/shared has no deps
  432. if (val && val.__v_isRef) {
  433. return replacer(_key, val.value);
  434. }
  435. else if (isMap(val)) {
  436. return {
  437. [`Map(${val.size})`]: [...val.entries()].reduce((entries, [key, val]) => {
  438. entries[`${key} =>`] = val;
  439. return entries;
  440. }, {})
  441. };
  442. }
  443. else if (isSet(val)) {
  444. return {
  445. [`Set(${val.size})`]: [...val.values()]
  446. };
  447. }
  448. else if (isObject(val) && !isArray(val) && !isPlainObject$1(val)) {
  449. return String(val);
  450. }
  451. return val;
  452. };
  453. /**
  454. * List of @babel/parser plugins that are used for template expression
  455. * transforms and SFC script transforms. By default we enable proposals slated
  456. * for ES2020. This will need to be updated as the spec moves forward.
  457. * Full list at https://babeljs.io/docs/en/next/babel-parser#plugins
  458. */
  459. const babelParserDefaultPlugins = [
  460. 'bigInt',
  461. 'optionalChaining',
  462. 'nullishCoalescingOperator'
  463. ];
  464. const EMPTY_OBJ = (process.env.NODE_ENV !== 'production')
  465. ? Object.freeze({})
  466. : {};
  467. const EMPTY_ARR = (process.env.NODE_ENV !== 'production') ? Object.freeze([]) : [];
  468. const NOOP = () => { };
  469. /**
  470. * Always return false.
  471. */
  472. const NO = () => false;
  473. const onRE = /^on[^a-z]/;
  474. const isOn = (key) => onRE.test(key);
  475. const isModelListener = (key) => key.startsWith('onUpdate:');
  476. const extend = Object.assign;
  477. const remove = (arr, el) => {
  478. const i = arr.indexOf(el);
  479. if (i > -1) {
  480. arr.splice(i, 1);
  481. }
  482. };
  483. const hasOwnProperty = Object.prototype.hasOwnProperty;
  484. const hasOwn = (val, key) => hasOwnProperty.call(val, key);
  485. const isArray = Array.isArray;
  486. const isMap = (val) => toTypeString(val) === '[object Map]';
  487. const isSet = (val) => toTypeString(val) === '[object Set]';
  488. const isDate = (val) => val instanceof Date;
  489. const isFunction$1 = (val) => typeof val === 'function';
  490. const isString = (val) => typeof val === 'string';
  491. const isSymbol = (val) => typeof val === 'symbol';
  492. const isObject = (val) => val !== null && typeof val === 'object';
  493. const isPromise = (val) => {
  494. return isObject(val) && isFunction$1(val.then) && isFunction$1(val.catch);
  495. };
  496. const objectToString$1 = Object.prototype.toString;
  497. const toTypeString = (value) => objectToString$1.call(value);
  498. const toRawType = (value) => {
  499. // extract "RawType" from strings like "[object RawType]"
  500. return toTypeString(value).slice(8, -1);
  501. };
  502. const isPlainObject$1 = (val) => toTypeString(val) === '[object Object]';
  503. const isIntegerKey = (key) => isString(key) &&
  504. key !== 'NaN' &&
  505. key[0] !== '-' &&
  506. '' + parseInt(key, 10) === key;
  507. const isReservedProp = /*#__PURE__*/ makeMap(
  508. // the leading comma is intentional so empty string "" is also included
  509. ',key,ref,' +
  510. 'onVnodeBeforeMount,onVnodeMounted,' +
  511. 'onVnodeBeforeUpdate,onVnodeUpdated,' +
  512. 'onVnodeBeforeUnmount,onVnodeUnmounted');
  513. const cacheStringFunction$1 = (fn) => {
  514. const cache = Object.create(null);
  515. return ((str) => {
  516. const hit = cache[str];
  517. return hit || (cache[str] = fn(str));
  518. });
  519. };
  520. const camelizeRE$1 = /-(\w)/g;
  521. /**
  522. * @private
  523. */
  524. const camelize$1 = cacheStringFunction$1((str) => {
  525. return str.replace(camelizeRE$1, (_, c) => (c ? c.toUpperCase() : ''));
  526. });
  527. const hyphenateRE = /\B([A-Z])/g;
  528. /**
  529. * @private
  530. */
  531. const hyphenate = cacheStringFunction$1((str) => str.replace(hyphenateRE, '-$1').toLowerCase());
  532. /**
  533. * @private
  534. */
  535. const capitalize = cacheStringFunction$1((str) => str.charAt(0).toUpperCase() + str.slice(1));
  536. /**
  537. * @private
  538. */
  539. const toHandlerKey = cacheStringFunction$1((str) => str ? `on${capitalize(str)}` : ``);
  540. // compare whether a value has changed, accounting for NaN.
  541. const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
  542. const invokeArrayFns = (fns, arg) => {
  543. for (let i = 0; i < fns.length; i++) {
  544. fns[i](arg);
  545. }
  546. };
  547. const def = (obj, key, value) => {
  548. Object.defineProperty(obj, key, {
  549. configurable: true,
  550. enumerable: false,
  551. value
  552. });
  553. };
  554. const toNumber = (val) => {
  555. const n = parseFloat(val);
  556. return isNaN(n) ? val : n;
  557. };
  558. let _globalThis;
  559. const getGlobalThis = () => {
  560. return (_globalThis ||
  561. (_globalThis =
  562. typeof globalThis !== 'undefined'
  563. ? globalThis
  564. : typeof self !== 'undefined'
  565. ? self
  566. : typeof window !== 'undefined'
  567. ? window
  568. : typeof global !== 'undefined'
  569. ? global
  570. : {}));
  571. };
  572. var shared_esmBundler = {
  573. __proto__: null,
  574. EMPTY_ARR: EMPTY_ARR,
  575. EMPTY_OBJ: EMPTY_OBJ,
  576. NO: NO,
  577. NOOP: NOOP,
  578. PatchFlagNames: PatchFlagNames,
  579. babelParserDefaultPlugins: babelParserDefaultPlugins,
  580. camelize: camelize$1,
  581. capitalize: capitalize,
  582. def: def,
  583. escapeHtml: escapeHtml,
  584. escapeHtmlComment: escapeHtmlComment,
  585. extend: extend,
  586. generateCodeFrame: generateCodeFrame,
  587. getGlobalThis: getGlobalThis,
  588. hasChanged: hasChanged,
  589. hasOwn: hasOwn,
  590. hyphenate: hyphenate,
  591. includeBooleanAttr: includeBooleanAttr,
  592. invokeArrayFns: invokeArrayFns,
  593. isArray: isArray,
  594. isBooleanAttr: isBooleanAttr,
  595. isDate: isDate,
  596. isFunction: isFunction$1,
  597. isGloballyWhitelisted: isGloballyWhitelisted,
  598. isHTMLTag: isHTMLTag,
  599. isIntegerKey: isIntegerKey,
  600. isKnownHtmlAttr: isKnownHtmlAttr,
  601. isKnownSvgAttr: isKnownSvgAttr,
  602. isMap: isMap,
  603. isModelListener: isModelListener,
  604. isNoUnitNumericStyleProp: isNoUnitNumericStyleProp,
  605. isObject: isObject,
  606. isOn: isOn,
  607. isPlainObject: isPlainObject$1,
  608. isPromise: isPromise,
  609. isReservedProp: isReservedProp,
  610. isSSRSafeAttrName: isSSRSafeAttrName,
  611. isSVGTag: isSVGTag,
  612. isSet: isSet,
  613. isSpecialBooleanAttr: isSpecialBooleanAttr,
  614. isString: isString,
  615. isSymbol: isSymbol,
  616. isVoidTag: isVoidTag,
  617. looseEqual: looseEqual,
  618. looseIndexOf: looseIndexOf,
  619. makeMap: makeMap,
  620. normalizeClass: normalizeClass,
  621. normalizeProps: normalizeProps,
  622. normalizeStyle: normalizeStyle,
  623. objectToString: objectToString$1,
  624. parseStringStyle: parseStringStyle,
  625. propsToAttrMap: propsToAttrMap,
  626. remove: remove,
  627. slotFlagsText: slotFlagsText,
  628. stringifyStyle: stringifyStyle,
  629. toDisplayString: toDisplayString,
  630. toHandlerKey: toHandlerKey,
  631. toNumber: toNumber,
  632. toRawType: toRawType,
  633. toTypeString: toTypeString
  634. };
  635. var lib$1 = {};
  636. var isReactComponent$1 = {};
  637. var buildMatchMemberExpression$1 = {};
  638. var matchesPattern$1 = {};
  639. var generated$4 = {};
  640. var shallowEqual$1 = {};
  641. Object.defineProperty(shallowEqual$1, "__esModule", {
  642. value: true
  643. });
  644. shallowEqual$1.default = shallowEqual;
  645. function shallowEqual(actual, expected) {
  646. const keys = Object.keys(expected);
  647. for (const key of keys) {
  648. if (actual[key] !== expected[key]) {
  649. return false;
  650. }
  651. }
  652. return true;
  653. }
  654. Object.defineProperty(generated$4, "__esModule", {
  655. value: true
  656. });
  657. generated$4.isArrayExpression = isArrayExpression;
  658. generated$4.isAssignmentExpression = isAssignmentExpression;
  659. generated$4.isBinaryExpression = isBinaryExpression;
  660. generated$4.isInterpreterDirective = isInterpreterDirective;
  661. generated$4.isDirective = isDirective;
  662. generated$4.isDirectiveLiteral = isDirectiveLiteral;
  663. generated$4.isBlockStatement = isBlockStatement;
  664. generated$4.isBreakStatement = isBreakStatement;
  665. generated$4.isCallExpression = isCallExpression;
  666. generated$4.isCatchClause = isCatchClause;
  667. generated$4.isConditionalExpression = isConditionalExpression;
  668. generated$4.isContinueStatement = isContinueStatement;
  669. generated$4.isDebuggerStatement = isDebuggerStatement;
  670. generated$4.isDoWhileStatement = isDoWhileStatement;
  671. generated$4.isEmptyStatement = isEmptyStatement;
  672. generated$4.isExpressionStatement = isExpressionStatement;
  673. generated$4.isFile = isFile;
  674. generated$4.isForInStatement = isForInStatement;
  675. generated$4.isForStatement = isForStatement;
  676. generated$4.isFunctionDeclaration = isFunctionDeclaration;
  677. generated$4.isFunctionExpression = isFunctionExpression;
  678. generated$4.isIdentifier = isIdentifier;
  679. generated$4.isIfStatement = isIfStatement;
  680. generated$4.isLabeledStatement = isLabeledStatement;
  681. generated$4.isStringLiteral = isStringLiteral;
  682. generated$4.isNumericLiteral = isNumericLiteral;
  683. generated$4.isNullLiteral = isNullLiteral;
  684. generated$4.isBooleanLiteral = isBooleanLiteral;
  685. generated$4.isRegExpLiteral = isRegExpLiteral;
  686. generated$4.isLogicalExpression = isLogicalExpression;
  687. generated$4.isMemberExpression = isMemberExpression$1;
  688. generated$4.isNewExpression = isNewExpression;
  689. generated$4.isProgram = isProgram;
  690. generated$4.isObjectExpression = isObjectExpression;
  691. generated$4.isObjectMethod = isObjectMethod;
  692. generated$4.isObjectProperty = isObjectProperty;
  693. generated$4.isRestElement = isRestElement;
  694. generated$4.isReturnStatement = isReturnStatement;
  695. generated$4.isSequenceExpression = isSequenceExpression;
  696. generated$4.isParenthesizedExpression = isParenthesizedExpression;
  697. generated$4.isSwitchCase = isSwitchCase;
  698. generated$4.isSwitchStatement = isSwitchStatement;
  699. generated$4.isThisExpression = isThisExpression;
  700. generated$4.isThrowStatement = isThrowStatement;
  701. generated$4.isTryStatement = isTryStatement;
  702. generated$4.isUnaryExpression = isUnaryExpression;
  703. generated$4.isUpdateExpression = isUpdateExpression;
  704. generated$4.isVariableDeclaration = isVariableDeclaration;
  705. generated$4.isVariableDeclarator = isVariableDeclarator;
  706. generated$4.isWhileStatement = isWhileStatement;
  707. generated$4.isWithStatement = isWithStatement;
  708. generated$4.isAssignmentPattern = isAssignmentPattern;
  709. generated$4.isArrayPattern = isArrayPattern;
  710. generated$4.isArrowFunctionExpression = isArrowFunctionExpression;
  711. generated$4.isClassBody = isClassBody;
  712. generated$4.isClassExpression = isClassExpression;
  713. generated$4.isClassDeclaration = isClassDeclaration;
  714. generated$4.isExportAllDeclaration = isExportAllDeclaration;
  715. generated$4.isExportDefaultDeclaration = isExportDefaultDeclaration;
  716. generated$4.isExportNamedDeclaration = isExportNamedDeclaration;
  717. generated$4.isExportSpecifier = isExportSpecifier;
  718. generated$4.isForOfStatement = isForOfStatement;
  719. generated$4.isImportDeclaration = isImportDeclaration;
  720. generated$4.isImportDefaultSpecifier = isImportDefaultSpecifier;
  721. generated$4.isImportNamespaceSpecifier = isImportNamespaceSpecifier;
  722. generated$4.isImportSpecifier = isImportSpecifier;
  723. generated$4.isMetaProperty = isMetaProperty;
  724. generated$4.isClassMethod = isClassMethod;
  725. generated$4.isObjectPattern = isObjectPattern;
  726. generated$4.isSpreadElement = isSpreadElement;
  727. generated$4.isSuper = isSuper;
  728. generated$4.isTaggedTemplateExpression = isTaggedTemplateExpression;
  729. generated$4.isTemplateElement = isTemplateElement;
  730. generated$4.isTemplateLiteral = isTemplateLiteral;
  731. generated$4.isYieldExpression = isYieldExpression;
  732. generated$4.isAwaitExpression = isAwaitExpression;
  733. generated$4.isImport = isImport;
  734. generated$4.isBigIntLiteral = isBigIntLiteral;
  735. generated$4.isExportNamespaceSpecifier = isExportNamespaceSpecifier;
  736. generated$4.isOptionalMemberExpression = isOptionalMemberExpression;
  737. generated$4.isOptionalCallExpression = isOptionalCallExpression;
  738. generated$4.isClassProperty = isClassProperty;
  739. generated$4.isClassPrivateProperty = isClassPrivateProperty;
  740. generated$4.isClassPrivateMethod = isClassPrivateMethod;
  741. generated$4.isPrivateName = isPrivateName;
  742. generated$4.isAnyTypeAnnotation = isAnyTypeAnnotation;
  743. generated$4.isArrayTypeAnnotation = isArrayTypeAnnotation;
  744. generated$4.isBooleanTypeAnnotation = isBooleanTypeAnnotation;
  745. generated$4.isBooleanLiteralTypeAnnotation = isBooleanLiteralTypeAnnotation;
  746. generated$4.isNullLiteralTypeAnnotation = isNullLiteralTypeAnnotation;
  747. generated$4.isClassImplements = isClassImplements;
  748. generated$4.isDeclareClass = isDeclareClass;
  749. generated$4.isDeclareFunction = isDeclareFunction;
  750. generated$4.isDeclareInterface = isDeclareInterface;
  751. generated$4.isDeclareModule = isDeclareModule;
  752. generated$4.isDeclareModuleExports = isDeclareModuleExports;
  753. generated$4.isDeclareTypeAlias = isDeclareTypeAlias;
  754. generated$4.isDeclareOpaqueType = isDeclareOpaqueType;
  755. generated$4.isDeclareVariable = isDeclareVariable;
  756. generated$4.isDeclareExportDeclaration = isDeclareExportDeclaration;
  757. generated$4.isDeclareExportAllDeclaration = isDeclareExportAllDeclaration;
  758. generated$4.isDeclaredPredicate = isDeclaredPredicate;
  759. generated$4.isExistsTypeAnnotation = isExistsTypeAnnotation;
  760. generated$4.isFunctionTypeAnnotation = isFunctionTypeAnnotation;
  761. generated$4.isFunctionTypeParam = isFunctionTypeParam;
  762. generated$4.isGenericTypeAnnotation = isGenericTypeAnnotation;
  763. generated$4.isInferredPredicate = isInferredPredicate;
  764. generated$4.isInterfaceExtends = isInterfaceExtends;
  765. generated$4.isInterfaceDeclaration = isInterfaceDeclaration;
  766. generated$4.isInterfaceTypeAnnotation = isInterfaceTypeAnnotation;
  767. generated$4.isIntersectionTypeAnnotation = isIntersectionTypeAnnotation;
  768. generated$4.isMixedTypeAnnotation = isMixedTypeAnnotation;
  769. generated$4.isEmptyTypeAnnotation = isEmptyTypeAnnotation;
  770. generated$4.isNullableTypeAnnotation = isNullableTypeAnnotation;
  771. generated$4.isNumberLiteralTypeAnnotation = isNumberLiteralTypeAnnotation;
  772. generated$4.isNumberTypeAnnotation = isNumberTypeAnnotation;
  773. generated$4.isObjectTypeAnnotation = isObjectTypeAnnotation;
  774. generated$4.isObjectTypeInternalSlot = isObjectTypeInternalSlot;
  775. generated$4.isObjectTypeCallProperty = isObjectTypeCallProperty;
  776. generated$4.isObjectTypeIndexer = isObjectTypeIndexer;
  777. generated$4.isObjectTypeProperty = isObjectTypeProperty;
  778. generated$4.isObjectTypeSpreadProperty = isObjectTypeSpreadProperty;
  779. generated$4.isOpaqueType = isOpaqueType;
  780. generated$4.isQualifiedTypeIdentifier = isQualifiedTypeIdentifier;
  781. generated$4.isStringLiteralTypeAnnotation = isStringLiteralTypeAnnotation;
  782. generated$4.isStringTypeAnnotation = isStringTypeAnnotation;
  783. generated$4.isSymbolTypeAnnotation = isSymbolTypeAnnotation;
  784. generated$4.isThisTypeAnnotation = isThisTypeAnnotation;
  785. generated$4.isTupleTypeAnnotation = isTupleTypeAnnotation;
  786. generated$4.isTypeofTypeAnnotation = isTypeofTypeAnnotation;
  787. generated$4.isTypeAlias = isTypeAlias;
  788. generated$4.isTypeAnnotation = isTypeAnnotation;
  789. generated$4.isTypeCastExpression = isTypeCastExpression;
  790. generated$4.isTypeParameter = isTypeParameter;
  791. generated$4.isTypeParameterDeclaration = isTypeParameterDeclaration;
  792. generated$4.isTypeParameterInstantiation = isTypeParameterInstantiation;
  793. generated$4.isUnionTypeAnnotation = isUnionTypeAnnotation;
  794. generated$4.isVariance = isVariance;
  795. generated$4.isVoidTypeAnnotation = isVoidTypeAnnotation;
  796. generated$4.isEnumDeclaration = isEnumDeclaration;
  797. generated$4.isEnumBooleanBody = isEnumBooleanBody;
  798. generated$4.isEnumNumberBody = isEnumNumberBody;
  799. generated$4.isEnumStringBody = isEnumStringBody;
  800. generated$4.isEnumSymbolBody = isEnumSymbolBody;
  801. generated$4.isEnumBooleanMember = isEnumBooleanMember;
  802. generated$4.isEnumNumberMember = isEnumNumberMember;
  803. generated$4.isEnumStringMember = isEnumStringMember;
  804. generated$4.isEnumDefaultedMember = isEnumDefaultedMember;
  805. generated$4.isIndexedAccessType = isIndexedAccessType;
  806. generated$4.isOptionalIndexedAccessType = isOptionalIndexedAccessType;
  807. generated$4.isJSXAttribute = isJSXAttribute;
  808. generated$4.isJSXClosingElement = isJSXClosingElement;
  809. generated$4.isJSXElement = isJSXElement;
  810. generated$4.isJSXEmptyExpression = isJSXEmptyExpression;
  811. generated$4.isJSXExpressionContainer = isJSXExpressionContainer;
  812. generated$4.isJSXSpreadChild = isJSXSpreadChild;
  813. generated$4.isJSXIdentifier = isJSXIdentifier;
  814. generated$4.isJSXMemberExpression = isJSXMemberExpression;
  815. generated$4.isJSXNamespacedName = isJSXNamespacedName;
  816. generated$4.isJSXOpeningElement = isJSXOpeningElement;
  817. generated$4.isJSXSpreadAttribute = isJSXSpreadAttribute;
  818. generated$4.isJSXText = isJSXText;
  819. generated$4.isJSXFragment = isJSXFragment;
  820. generated$4.isJSXOpeningFragment = isJSXOpeningFragment;
  821. generated$4.isJSXClosingFragment = isJSXClosingFragment;
  822. generated$4.isNoop = isNoop;
  823. generated$4.isPlaceholder = isPlaceholder;
  824. generated$4.isV8IntrinsicIdentifier = isV8IntrinsicIdentifier;
  825. generated$4.isArgumentPlaceholder = isArgumentPlaceholder;
  826. generated$4.isBindExpression = isBindExpression;
  827. generated$4.isImportAttribute = isImportAttribute;
  828. generated$4.isDecorator = isDecorator;
  829. generated$4.isDoExpression = isDoExpression;
  830. generated$4.isExportDefaultSpecifier = isExportDefaultSpecifier;
  831. generated$4.isRecordExpression = isRecordExpression;
  832. generated$4.isTupleExpression = isTupleExpression;
  833. generated$4.isDecimalLiteral = isDecimalLiteral;
  834. generated$4.isStaticBlock = isStaticBlock;
  835. generated$4.isModuleExpression = isModuleExpression;
  836. generated$4.isTopicReference = isTopicReference;
  837. generated$4.isPipelineTopicExpression = isPipelineTopicExpression;
  838. generated$4.isPipelineBareFunction = isPipelineBareFunction;
  839. generated$4.isPipelinePrimaryTopicReference = isPipelinePrimaryTopicReference;
  840. generated$4.isTSParameterProperty = isTSParameterProperty;
  841. generated$4.isTSDeclareFunction = isTSDeclareFunction;
  842. generated$4.isTSDeclareMethod = isTSDeclareMethod;
  843. generated$4.isTSQualifiedName = isTSQualifiedName;
  844. generated$4.isTSCallSignatureDeclaration = isTSCallSignatureDeclaration;
  845. generated$4.isTSConstructSignatureDeclaration = isTSConstructSignatureDeclaration;
  846. generated$4.isTSPropertySignature = isTSPropertySignature;
  847. generated$4.isTSMethodSignature = isTSMethodSignature;
  848. generated$4.isTSIndexSignature = isTSIndexSignature;
  849. generated$4.isTSAnyKeyword = isTSAnyKeyword;
  850. generated$4.isTSBooleanKeyword = isTSBooleanKeyword;
  851. generated$4.isTSBigIntKeyword = isTSBigIntKeyword;
  852. generated$4.isTSIntrinsicKeyword = isTSIntrinsicKeyword;
  853. generated$4.isTSNeverKeyword = isTSNeverKeyword;
  854. generated$4.isTSNullKeyword = isTSNullKeyword;
  855. generated$4.isTSNumberKeyword = isTSNumberKeyword;
  856. generated$4.isTSObjectKeyword = isTSObjectKeyword;
  857. generated$4.isTSStringKeyword = isTSStringKeyword;
  858. generated$4.isTSSymbolKeyword = isTSSymbolKeyword;
  859. generated$4.isTSUndefinedKeyword = isTSUndefinedKeyword;
  860. generated$4.isTSUnknownKeyword = isTSUnknownKeyword;
  861. generated$4.isTSVoidKeyword = isTSVoidKeyword;
  862. generated$4.isTSThisType = isTSThisType;
  863. generated$4.isTSFunctionType = isTSFunctionType;
  864. generated$4.isTSConstructorType = isTSConstructorType;
  865. generated$4.isTSTypeReference = isTSTypeReference;
  866. generated$4.isTSTypePredicate = isTSTypePredicate;
  867. generated$4.isTSTypeQuery = isTSTypeQuery;
  868. generated$4.isTSTypeLiteral = isTSTypeLiteral;
  869. generated$4.isTSArrayType = isTSArrayType;
  870. generated$4.isTSTupleType = isTSTupleType;
  871. generated$4.isTSOptionalType = isTSOptionalType;
  872. generated$4.isTSRestType = isTSRestType;
  873. generated$4.isTSNamedTupleMember = isTSNamedTupleMember;
  874. generated$4.isTSUnionType = isTSUnionType;
  875. generated$4.isTSIntersectionType = isTSIntersectionType;
  876. generated$4.isTSConditionalType = isTSConditionalType;
  877. generated$4.isTSInferType = isTSInferType;
  878. generated$4.isTSParenthesizedType = isTSParenthesizedType;
  879. generated$4.isTSTypeOperator = isTSTypeOperator;
  880. generated$4.isTSIndexedAccessType = isTSIndexedAccessType;
  881. generated$4.isTSMappedType = isTSMappedType;
  882. generated$4.isTSLiteralType = isTSLiteralType;
  883. generated$4.isTSExpressionWithTypeArguments = isTSExpressionWithTypeArguments;
  884. generated$4.isTSInterfaceDeclaration = isTSInterfaceDeclaration;
  885. generated$4.isTSInterfaceBody = isTSInterfaceBody;
  886. generated$4.isTSTypeAliasDeclaration = isTSTypeAliasDeclaration;
  887. generated$4.isTSAsExpression = isTSAsExpression;
  888. generated$4.isTSTypeAssertion = isTSTypeAssertion;
  889. generated$4.isTSEnumDeclaration = isTSEnumDeclaration;
  890. generated$4.isTSEnumMember = isTSEnumMember;
  891. generated$4.isTSModuleDeclaration = isTSModuleDeclaration;
  892. generated$4.isTSModuleBlock = isTSModuleBlock;
  893. generated$4.isTSImportType = isTSImportType;
  894. generated$4.isTSImportEqualsDeclaration = isTSImportEqualsDeclaration;
  895. generated$4.isTSExternalModuleReference = isTSExternalModuleReference;
  896. generated$4.isTSNonNullExpression = isTSNonNullExpression;
  897. generated$4.isTSExportAssignment = isTSExportAssignment;
  898. generated$4.isTSNamespaceExportDeclaration = isTSNamespaceExportDeclaration;
  899. generated$4.isTSTypeAnnotation = isTSTypeAnnotation;
  900. generated$4.isTSTypeParameterInstantiation = isTSTypeParameterInstantiation;
  901. generated$4.isTSTypeParameterDeclaration = isTSTypeParameterDeclaration;
  902. generated$4.isTSTypeParameter = isTSTypeParameter;
  903. generated$4.isExpression = isExpression;
  904. generated$4.isBinary = isBinary;
  905. generated$4.isScopable = isScopable;
  906. generated$4.isBlockParent = isBlockParent;
  907. generated$4.isBlock = isBlock;
  908. generated$4.isStatement = isStatement;
  909. generated$4.isTerminatorless = isTerminatorless;
  910. generated$4.isCompletionStatement = isCompletionStatement;
  911. generated$4.isConditional = isConditional;
  912. generated$4.isLoop = isLoop;
  913. generated$4.isWhile = isWhile;
  914. generated$4.isExpressionWrapper = isExpressionWrapper;
  915. generated$4.isFor = isFor;
  916. generated$4.isForXStatement = isForXStatement;
  917. generated$4.isFunction = isFunction;
  918. generated$4.isFunctionParent = isFunctionParent;
  919. generated$4.isPureish = isPureish;
  920. generated$4.isDeclaration = isDeclaration;
  921. generated$4.isPatternLike = isPatternLike;
  922. generated$4.isLVal = isLVal;
  923. generated$4.isTSEntityName = isTSEntityName;
  924. generated$4.isLiteral = isLiteral;
  925. generated$4.isImmutable = isImmutable$2;
  926. generated$4.isUserWhitespacable = isUserWhitespacable;
  927. generated$4.isMethod = isMethod;
  928. generated$4.isObjectMember = isObjectMember;
  929. generated$4.isProperty = isProperty;
  930. generated$4.isUnaryLike = isUnaryLike;
  931. generated$4.isPattern = isPattern;
  932. generated$4.isClass = isClass;
  933. generated$4.isModuleDeclaration = isModuleDeclaration;
  934. generated$4.isExportDeclaration = isExportDeclaration;
  935. generated$4.isModuleSpecifier = isModuleSpecifier;
  936. generated$4.isPrivate = isPrivate;
  937. generated$4.isFlow = isFlow;
  938. generated$4.isFlowType = isFlowType;
  939. generated$4.isFlowBaseAnnotation = isFlowBaseAnnotation;
  940. generated$4.isFlowDeclaration = isFlowDeclaration;
  941. generated$4.isFlowPredicate = isFlowPredicate;
  942. generated$4.isEnumBody = isEnumBody;
  943. generated$4.isEnumMember = isEnumMember;
  944. generated$4.isJSX = isJSX;
  945. generated$4.isTSTypeElement = isTSTypeElement;
  946. generated$4.isTSType = isTSType;
  947. generated$4.isTSBaseType = isTSBaseType;
  948. generated$4.isNumberLiteral = isNumberLiteral;
  949. generated$4.isRegexLiteral = isRegexLiteral;
  950. generated$4.isRestProperty = isRestProperty;
  951. generated$4.isSpreadProperty = isSpreadProperty;
  952. var _shallowEqual$1 = shallowEqual$1;
  953. function isArrayExpression(node, opts) {
  954. if (!node) return false;
  955. const nodeType = node.type;
  956. if (nodeType === "ArrayExpression") {
  957. if (typeof opts === "undefined") {
  958. return true;
  959. } else {
  960. return (0, _shallowEqual$1.default)(node, opts);
  961. }
  962. }
  963. return false;
  964. }
  965. function isAssignmentExpression(node, opts) {
  966. if (!node) return false;
  967. const nodeType = node.type;
  968. if (nodeType === "AssignmentExpression") {
  969. if (typeof opts === "undefined") {
  970. return true;
  971. } else {
  972. return (0, _shallowEqual$1.default)(node, opts);
  973. }
  974. }
  975. return false;
  976. }
  977. function isBinaryExpression(node, opts) {
  978. if (!node) return false;
  979. const nodeType = node.type;
  980. if (nodeType === "BinaryExpression") {
  981. if (typeof opts === "undefined") {
  982. return true;
  983. } else {
  984. return (0, _shallowEqual$1.default)(node, opts);
  985. }
  986. }
  987. return false;
  988. }
  989. function isInterpreterDirective(node, opts) {
  990. if (!node) return false;
  991. const nodeType = node.type;
  992. if (nodeType === "InterpreterDirective") {
  993. if (typeof opts === "undefined") {
  994. return true;
  995. } else {
  996. return (0, _shallowEqual$1.default)(node, opts);
  997. }
  998. }
  999. return false;
  1000. }
  1001. function isDirective(node, opts) {
  1002. if (!node) return false;
  1003. const nodeType = node.type;
  1004. if (nodeType === "Directive") {
  1005. if (typeof opts === "undefined") {
  1006. return true;
  1007. } else {
  1008. return (0, _shallowEqual$1.default)(node, opts);
  1009. }
  1010. }
  1011. return false;
  1012. }
  1013. function isDirectiveLiteral(node, opts) {
  1014. if (!node) return false;
  1015. const nodeType = node.type;
  1016. if (nodeType === "DirectiveLiteral") {
  1017. if (typeof opts === "undefined") {
  1018. return true;
  1019. } else {
  1020. return (0, _shallowEqual$1.default)(node, opts);
  1021. }
  1022. }
  1023. return false;
  1024. }
  1025. function isBlockStatement(node, opts) {
  1026. if (!node) return false;
  1027. const nodeType = node.type;
  1028. if (nodeType === "BlockStatement") {
  1029. if (typeof opts === "undefined") {
  1030. return true;
  1031. } else {
  1032. return (0, _shallowEqual$1.default)(node, opts);
  1033. }
  1034. }
  1035. return false;
  1036. }
  1037. function isBreakStatement(node, opts) {
  1038. if (!node) return false;
  1039. const nodeType = node.type;
  1040. if (nodeType === "BreakStatement") {
  1041. if (typeof opts === "undefined") {
  1042. return true;
  1043. } else {
  1044. return (0, _shallowEqual$1.default)(node, opts);
  1045. }
  1046. }
  1047. return false;
  1048. }
  1049. function isCallExpression(node, opts) {
  1050. if (!node) return false;
  1051. const nodeType = node.type;
  1052. if (nodeType === "CallExpression") {
  1053. if (typeof opts === "undefined") {
  1054. return true;
  1055. } else {
  1056. return (0, _shallowEqual$1.default)(node, opts);
  1057. }
  1058. }
  1059. return false;
  1060. }
  1061. function isCatchClause(node, opts) {
  1062. if (!node) return false;
  1063. const nodeType = node.type;
  1064. if (nodeType === "CatchClause") {
  1065. if (typeof opts === "undefined") {
  1066. return true;
  1067. } else {
  1068. return (0, _shallowEqual$1.default)(node, opts);
  1069. }
  1070. }
  1071. return false;
  1072. }
  1073. function isConditionalExpression(node, opts) {
  1074. if (!node) return false;
  1075. const nodeType = node.type;
  1076. if (nodeType === "ConditionalExpression") {
  1077. if (typeof opts === "undefined") {
  1078. return true;
  1079. } else {
  1080. return (0, _shallowEqual$1.default)(node, opts);
  1081. }
  1082. }
  1083. return false;
  1084. }
  1085. function isContinueStatement(node, opts) {
  1086. if (!node) return false;
  1087. const nodeType = node.type;
  1088. if (nodeType === "ContinueStatement") {
  1089. if (typeof opts === "undefined") {
  1090. return true;
  1091. } else {
  1092. return (0, _shallowEqual$1.default)(node, opts);
  1093. }
  1094. }
  1095. return false;
  1096. }
  1097. function isDebuggerStatement(node, opts) {
  1098. if (!node) return false;
  1099. const nodeType = node.type;
  1100. if (nodeType === "DebuggerStatement") {
  1101. if (typeof opts === "undefined") {
  1102. return true;
  1103. } else {
  1104. return (0, _shallowEqual$1.default)(node, opts);
  1105. }
  1106. }
  1107. return false;
  1108. }
  1109. function isDoWhileStatement(node, opts) {
  1110. if (!node) return false;
  1111. const nodeType = node.type;
  1112. if (nodeType === "DoWhileStatement") {
  1113. if (typeof opts === "undefined") {
  1114. return true;
  1115. } else {
  1116. return (0, _shallowEqual$1.default)(node, opts);
  1117. }
  1118. }
  1119. return false;
  1120. }
  1121. function isEmptyStatement(node, opts) {
  1122. if (!node) return false;
  1123. const nodeType = node.type;
  1124. if (nodeType === "EmptyStatement") {
  1125. if (typeof opts === "undefined") {
  1126. return true;
  1127. } else {
  1128. return (0, _shallowEqual$1.default)(node, opts);
  1129. }
  1130. }
  1131. return false;
  1132. }
  1133. function isExpressionStatement(node, opts) {
  1134. if (!node) return false;
  1135. const nodeType = node.type;
  1136. if (nodeType === "ExpressionStatement") {
  1137. if (typeof opts === "undefined") {
  1138. return true;
  1139. } else {
  1140. return (0, _shallowEqual$1.default)(node, opts);
  1141. }
  1142. }
  1143. return false;
  1144. }
  1145. function isFile(node, opts) {
  1146. if (!node) return false;
  1147. const nodeType = node.type;
  1148. if (nodeType === "File") {
  1149. if (typeof opts === "undefined") {
  1150. return true;
  1151. } else {
  1152. return (0, _shallowEqual$1.default)(node, opts);
  1153. }
  1154. }
  1155. return false;
  1156. }
  1157. function isForInStatement(node, opts) {
  1158. if (!node) return false;
  1159. const nodeType = node.type;
  1160. if (nodeType === "ForInStatement") {
  1161. if (typeof opts === "undefined") {
  1162. return true;
  1163. } else {
  1164. return (0, _shallowEqual$1.default)(node, opts);
  1165. }
  1166. }
  1167. return false;
  1168. }
  1169. function isForStatement(node, opts) {
  1170. if (!node) return false;
  1171. const nodeType = node.type;
  1172. if (nodeType === "ForStatement") {
  1173. if (typeof opts === "undefined") {
  1174. return true;
  1175. } else {
  1176. return (0, _shallowEqual$1.default)(node, opts);
  1177. }
  1178. }
  1179. return false;
  1180. }
  1181. function isFunctionDeclaration(node, opts) {
  1182. if (!node) return false;
  1183. const nodeType = node.type;
  1184. if (nodeType === "FunctionDeclaration") {
  1185. if (typeof opts === "undefined") {
  1186. return true;
  1187. } else {
  1188. return (0, _shallowEqual$1.default)(node, opts);
  1189. }
  1190. }
  1191. return false;
  1192. }
  1193. function isFunctionExpression(node, opts) {
  1194. if (!node) return false;
  1195. const nodeType = node.type;
  1196. if (nodeType === "FunctionExpression") {
  1197. if (typeof opts === "undefined") {
  1198. return true;
  1199. } else {
  1200. return (0, _shallowEqual$1.default)(node, opts);
  1201. }
  1202. }
  1203. return false;
  1204. }
  1205. function isIdentifier(node, opts) {
  1206. if (!node) return false;
  1207. const nodeType = node.type;
  1208. if (nodeType === "Identifier") {
  1209. if (typeof opts === "undefined") {
  1210. return true;
  1211. } else {
  1212. return (0, _shallowEqual$1.default)(node, opts);
  1213. }
  1214. }
  1215. return false;
  1216. }
  1217. function isIfStatement(node, opts) {
  1218. if (!node) return false;
  1219. const nodeType = node.type;
  1220. if (nodeType === "IfStatement") {
  1221. if (typeof opts === "undefined") {
  1222. return true;
  1223. } else {
  1224. return (0, _shallowEqual$1.default)(node, opts);
  1225. }
  1226. }
  1227. return false;
  1228. }
  1229. function isLabeledStatement(node, opts) {
  1230. if (!node) return false;
  1231. const nodeType = node.type;
  1232. if (nodeType === "LabeledStatement") {
  1233. if (typeof opts === "undefined") {
  1234. return true;
  1235. } else {
  1236. return (0, _shallowEqual$1.default)(node, opts);
  1237. }
  1238. }
  1239. return false;
  1240. }
  1241. function isStringLiteral(node, opts) {
  1242. if (!node) return false;
  1243. const nodeType = node.type;
  1244. if (nodeType === "StringLiteral") {
  1245. if (typeof opts === "undefined") {
  1246. return true;
  1247. } else {
  1248. return (0, _shallowEqual$1.default)(node, opts);
  1249. }
  1250. }
  1251. return false;
  1252. }
  1253. function isNumericLiteral(node, opts) {
  1254. if (!node) return false;
  1255. const nodeType = node.type;
  1256. if (nodeType === "NumericLiteral") {
  1257. if (typeof opts === "undefined") {
  1258. return true;
  1259. } else {
  1260. return (0, _shallowEqual$1.default)(node, opts);
  1261. }
  1262. }
  1263. return false;
  1264. }
  1265. function isNullLiteral(node, opts) {
  1266. if (!node) return false;
  1267. const nodeType = node.type;
  1268. if (nodeType === "NullLiteral") {
  1269. if (typeof opts === "undefined") {
  1270. return true;
  1271. } else {
  1272. return (0, _shallowEqual$1.default)(node, opts);
  1273. }
  1274. }
  1275. return false;
  1276. }
  1277. function isBooleanLiteral(node, opts) {
  1278. if (!node) return false;
  1279. const nodeType = node.type;
  1280. if (nodeType === "BooleanLiteral") {
  1281. if (typeof opts === "undefined") {
  1282. return true;
  1283. } else {
  1284. return (0, _shallowEqual$1.default)(node, opts);
  1285. }
  1286. }
  1287. return false;
  1288. }
  1289. function isRegExpLiteral(node, opts) {
  1290. if (!node) return false;
  1291. const nodeType = node.type;
  1292. if (nodeType === "RegExpLiteral") {
  1293. if (typeof opts === "undefined") {
  1294. return true;
  1295. } else {
  1296. return (0, _shallowEqual$1.default)(node, opts);
  1297. }
  1298. }
  1299. return false;
  1300. }
  1301. function isLogicalExpression(node, opts) {
  1302. if (!node) return false;
  1303. const nodeType = node.type;
  1304. if (nodeType === "LogicalExpression") {
  1305. if (typeof opts === "undefined") {
  1306. return true;
  1307. } else {
  1308. return (0, _shallowEqual$1.default)(node, opts);
  1309. }
  1310. }
  1311. return false;
  1312. }
  1313. function isMemberExpression$1(node, opts) {
  1314. if (!node) return false;
  1315. const nodeType = node.type;
  1316. if (nodeType === "MemberExpression") {
  1317. if (typeof opts === "undefined") {
  1318. return true;
  1319. } else {
  1320. return (0, _shallowEqual$1.default)(node, opts);
  1321. }
  1322. }
  1323. return false;
  1324. }
  1325. function isNewExpression(node, opts) {
  1326. if (!node) return false;
  1327. const nodeType = node.type;
  1328. if (nodeType === "NewExpression") {
  1329. if (typeof opts === "undefined") {
  1330. return true;
  1331. } else {
  1332. return (0, _shallowEqual$1.default)(node, opts);
  1333. }
  1334. }
  1335. return false;
  1336. }
  1337. function isProgram(node, opts) {
  1338. if (!node) return false;
  1339. const nodeType = node.type;
  1340. if (nodeType === "Program") {
  1341. if (typeof opts === "undefined") {
  1342. return true;
  1343. } else {
  1344. return (0, _shallowEqual$1.default)(node, opts);
  1345. }
  1346. }
  1347. return false;
  1348. }
  1349. function isObjectExpression(node, opts) {
  1350. if (!node) return false;
  1351. const nodeType = node.type;
  1352. if (nodeType === "ObjectExpression") {
  1353. if (typeof opts === "undefined") {
  1354. return true;
  1355. } else {
  1356. return (0, _shallowEqual$1.default)(node, opts);
  1357. }
  1358. }
  1359. return false;
  1360. }
  1361. function isObjectMethod(node, opts) {
  1362. if (!node) return false;
  1363. const nodeType = node.type;
  1364. if (nodeType === "ObjectMethod") {
  1365. if (typeof opts === "undefined") {
  1366. return true;
  1367. } else {
  1368. return (0, _shallowEqual$1.default)(node, opts);
  1369. }
  1370. }
  1371. return false;
  1372. }
  1373. function isObjectProperty(node, opts) {
  1374. if (!node) return false;
  1375. const nodeType = node.type;
  1376. if (nodeType === "ObjectProperty") {
  1377. if (typeof opts === "undefined") {
  1378. return true;
  1379. } else {
  1380. return (0, _shallowEqual$1.default)(node, opts);
  1381. }
  1382. }
  1383. return false;
  1384. }
  1385. function isRestElement(node, opts) {
  1386. if (!node) return false;
  1387. const nodeType = node.type;
  1388. if (nodeType === "RestElement") {
  1389. if (typeof opts === "undefined") {
  1390. return true;
  1391. } else {
  1392. return (0, _shallowEqual$1.default)(node, opts);
  1393. }
  1394. }
  1395. return false;
  1396. }
  1397. function isReturnStatement(node, opts) {
  1398. if (!node) return false;
  1399. const nodeType = node.type;
  1400. if (nodeType === "ReturnStatement") {
  1401. if (typeof opts === "undefined") {
  1402. return true;
  1403. } else {
  1404. return (0, _shallowEqual$1.default)(node, opts);
  1405. }
  1406. }
  1407. return false;
  1408. }
  1409. function isSequenceExpression(node, opts) {
  1410. if (!node) return false;
  1411. const nodeType = node.type;
  1412. if (nodeType === "SequenceExpression") {
  1413. if (typeof opts === "undefined") {
  1414. return true;
  1415. } else {
  1416. return (0, _shallowEqual$1.default)(node, opts);
  1417. }
  1418. }
  1419. return false;
  1420. }
  1421. function isParenthesizedExpression(node, opts) {
  1422. if (!node) return false;
  1423. const nodeType = node.type;
  1424. if (nodeType === "ParenthesizedExpression") {
  1425. if (typeof opts === "undefined") {
  1426. return true;
  1427. } else {
  1428. return (0, _shallowEqual$1.default)(node, opts);
  1429. }
  1430. }
  1431. return false;
  1432. }
  1433. function isSwitchCase(node, opts) {
  1434. if (!node) return false;
  1435. const nodeType = node.type;
  1436. if (nodeType === "SwitchCase") {
  1437. if (typeof opts === "undefined") {
  1438. return true;
  1439. } else {
  1440. return (0, _shallowEqual$1.default)(node, opts);
  1441. }
  1442. }
  1443. return false;
  1444. }
  1445. function isSwitchStatement(node, opts) {
  1446. if (!node) return false;
  1447. const nodeType = node.type;
  1448. if (nodeType === "SwitchStatement") {
  1449. if (typeof opts === "undefined") {
  1450. return true;
  1451. } else {
  1452. return (0, _shallowEqual$1.default)(node, opts);
  1453. }
  1454. }
  1455. return false;
  1456. }
  1457. function isThisExpression(node, opts) {
  1458. if (!node) return false;
  1459. const nodeType = node.type;
  1460. if (nodeType === "ThisExpression") {
  1461. if (typeof opts === "undefined") {
  1462. return true;
  1463. } else {
  1464. return (0, _shallowEqual$1.default)(node, opts);
  1465. }
  1466. }
  1467. return false;
  1468. }
  1469. function isThrowStatement(node, opts) {
  1470. if (!node) return false;
  1471. const nodeType = node.type;
  1472. if (nodeType === "ThrowStatement") {
  1473. if (typeof opts === "undefined") {
  1474. return true;
  1475. } else {
  1476. return (0, _shallowEqual$1.default)(node, opts);
  1477. }
  1478. }
  1479. return false;
  1480. }
  1481. function isTryStatement(node, opts) {
  1482. if (!node) return false;
  1483. const nodeType = node.type;
  1484. if (nodeType === "TryStatement") {
  1485. if (typeof opts === "undefined") {
  1486. return true;
  1487. } else {
  1488. return (0, _shallowEqual$1.default)(node, opts);
  1489. }
  1490. }
  1491. return false;
  1492. }
  1493. function isUnaryExpression(node, opts) {
  1494. if (!node) return false;
  1495. const nodeType = node.type;
  1496. if (nodeType === "UnaryExpression") {
  1497. if (typeof opts === "undefined") {
  1498. return true;
  1499. } else {
  1500. return (0, _shallowEqual$1.default)(node, opts);
  1501. }
  1502. }
  1503. return false;
  1504. }
  1505. function isUpdateExpression(node, opts) {
  1506. if (!node) return false;
  1507. const nodeType = node.type;
  1508. if (nodeType === "UpdateExpression") {
  1509. if (typeof opts === "undefined") {
  1510. return true;
  1511. } else {
  1512. return (0, _shallowEqual$1.default)(node, opts);
  1513. }
  1514. }
  1515. return false;
  1516. }
  1517. function isVariableDeclaration(node, opts) {
  1518. if (!node) return false;
  1519. const nodeType = node.type;
  1520. if (nodeType === "VariableDeclaration") {
  1521. if (typeof opts === "undefined") {
  1522. return true;
  1523. } else {
  1524. return (0, _shallowEqual$1.default)(node, opts);
  1525. }
  1526. }
  1527. return false;
  1528. }
  1529. function isVariableDeclarator(node, opts) {
  1530. if (!node) return false;
  1531. const nodeType = node.type;
  1532. if (nodeType === "VariableDeclarator") {
  1533. if (typeof opts === "undefined") {
  1534. return true;
  1535. } else {
  1536. return (0, _shallowEqual$1.default)(node, opts);
  1537. }
  1538. }
  1539. return false;
  1540. }
  1541. function isWhileStatement(node, opts) {
  1542. if (!node) return false;
  1543. const nodeType = node.type;
  1544. if (nodeType === "WhileStatement") {
  1545. if (typeof opts === "undefined") {
  1546. return true;
  1547. } else {
  1548. return (0, _shallowEqual$1.default)(node, opts);
  1549. }
  1550. }
  1551. return false;
  1552. }
  1553. function isWithStatement(node, opts) {
  1554. if (!node) return false;
  1555. const nodeType = node.type;
  1556. if (nodeType === "WithStatement") {
  1557. if (typeof opts === "undefined") {
  1558. return true;
  1559. } else {
  1560. return (0, _shallowEqual$1.default)(node, opts);
  1561. }
  1562. }
  1563. return false;
  1564. }
  1565. function isAssignmentPattern(node, opts) {
  1566. if (!node) return false;
  1567. const nodeType = node.type;
  1568. if (nodeType === "AssignmentPattern") {
  1569. if (typeof opts === "undefined") {
  1570. return true;
  1571. } else {
  1572. return (0, _shallowEqual$1.default)(node, opts);
  1573. }
  1574. }
  1575. return false;
  1576. }
  1577. function isArrayPattern(node, opts) {
  1578. if (!node) return false;
  1579. const nodeType = node.type;
  1580. if (nodeType === "ArrayPattern") {
  1581. if (typeof opts === "undefined") {
  1582. return true;
  1583. } else {
  1584. return (0, _shallowEqual$1.default)(node, opts);
  1585. }
  1586. }
  1587. return false;
  1588. }
  1589. function isArrowFunctionExpression(node, opts) {
  1590. if (!node) return false;
  1591. const nodeType = node.type;
  1592. if (nodeType === "ArrowFunctionExpression") {
  1593. if (typeof opts === "undefined") {
  1594. return true;
  1595. } else {
  1596. return (0, _shallowEqual$1.default)(node, opts);
  1597. }
  1598. }
  1599. return false;
  1600. }
  1601. function isClassBody(node, opts) {
  1602. if (!node) return false;
  1603. const nodeType = node.type;
  1604. if (nodeType === "ClassBody") {
  1605. if (typeof opts === "undefined") {
  1606. return true;
  1607. } else {
  1608. return (0, _shallowEqual$1.default)(node, opts);
  1609. }
  1610. }
  1611. return false;
  1612. }
  1613. function isClassExpression(node, opts) {
  1614. if (!node) return false;
  1615. const nodeType = node.type;
  1616. if (nodeType === "ClassExpression") {
  1617. if (typeof opts === "undefined") {
  1618. return true;
  1619. } else {
  1620. return (0, _shallowEqual$1.default)(node, opts);
  1621. }
  1622. }
  1623. return false;
  1624. }
  1625. function isClassDeclaration(node, opts) {
  1626. if (!node) return false;
  1627. const nodeType = node.type;
  1628. if (nodeType === "ClassDeclaration") {
  1629. if (typeof opts === "undefined") {
  1630. return true;
  1631. } else {
  1632. return (0, _shallowEqual$1.default)(node, opts);
  1633. }
  1634. }
  1635. return false;
  1636. }
  1637. function isExportAllDeclaration(node, opts) {
  1638. if (!node) return false;
  1639. const nodeType = node.type;
  1640. if (nodeType === "ExportAllDeclaration") {
  1641. if (typeof opts === "undefined") {
  1642. return true;
  1643. } else {
  1644. return (0, _shallowEqual$1.default)(node, opts);
  1645. }
  1646. }
  1647. return false;
  1648. }
  1649. function isExportDefaultDeclaration(node, opts) {
  1650. if (!node) return false;
  1651. const nodeType = node.type;
  1652. if (nodeType === "ExportDefaultDeclaration") {
  1653. if (typeof opts === "undefined") {
  1654. return true;
  1655. } else {
  1656. return (0, _shallowEqual$1.default)(node, opts);
  1657. }
  1658. }
  1659. return false;
  1660. }
  1661. function isExportNamedDeclaration(node, opts) {
  1662. if (!node) return false;
  1663. const nodeType = node.type;
  1664. if (nodeType === "ExportNamedDeclaration") {
  1665. if (typeof opts === "undefined") {
  1666. return true;
  1667. } else {
  1668. return (0, _shallowEqual$1.default)(node, opts);
  1669. }
  1670. }
  1671. return false;
  1672. }
  1673. function isExportSpecifier(node, opts) {
  1674. if (!node) return false;
  1675. const nodeType = node.type;
  1676. if (nodeType === "ExportSpecifier") {
  1677. if (typeof opts === "undefined") {
  1678. return true;
  1679. } else {
  1680. return (0, _shallowEqual$1.default)(node, opts);
  1681. }
  1682. }
  1683. return false;
  1684. }
  1685. function isForOfStatement(node, opts) {
  1686. if (!node) return false;
  1687. const nodeType = node.type;
  1688. if (nodeType === "ForOfStatement") {
  1689. if (typeof opts === "undefined") {
  1690. return true;
  1691. } else {
  1692. return (0, _shallowEqual$1.default)(node, opts);
  1693. }
  1694. }
  1695. return false;
  1696. }
  1697. function isImportDeclaration(node, opts) {
  1698. if (!node) return false;
  1699. const nodeType = node.type;
  1700. if (nodeType === "ImportDeclaration") {
  1701. if (typeof opts === "undefined") {
  1702. return true;
  1703. } else {
  1704. return (0, _shallowEqual$1.default)(node, opts);
  1705. }
  1706. }
  1707. return false;
  1708. }
  1709. function isImportDefaultSpecifier(node, opts) {
  1710. if (!node) return false;
  1711. const nodeType = node.type;
  1712. if (nodeType === "ImportDefaultSpecifier") {
  1713. if (typeof opts === "undefined") {
  1714. return true;
  1715. } else {
  1716. return (0, _shallowEqual$1.default)(node, opts);
  1717. }
  1718. }
  1719. return false;
  1720. }
  1721. function isImportNamespaceSpecifier(node, opts) {
  1722. if (!node) return false;
  1723. const nodeType = node.type;
  1724. if (nodeType === "ImportNamespaceSpecifier") {
  1725. if (typeof opts === "undefined") {
  1726. return true;
  1727. } else {
  1728. return (0, _shallowEqual$1.default)(node, opts);
  1729. }
  1730. }
  1731. return false;
  1732. }
  1733. function isImportSpecifier(node, opts) {
  1734. if (!node) return false;
  1735. const nodeType = node.type;
  1736. if (nodeType === "ImportSpecifier") {
  1737. if (typeof opts === "undefined") {
  1738. return true;
  1739. } else {
  1740. return (0, _shallowEqual$1.default)(node, opts);
  1741. }
  1742. }
  1743. return false;
  1744. }
  1745. function isMetaProperty(node, opts) {
  1746. if (!node) return false;
  1747. const nodeType = node.type;
  1748. if (nodeType === "MetaProperty") {
  1749. if (typeof opts === "undefined") {
  1750. return true;
  1751. } else {
  1752. return (0, _shallowEqual$1.default)(node, opts);
  1753. }
  1754. }
  1755. return false;
  1756. }
  1757. function isClassMethod(node, opts) {
  1758. if (!node) return false;
  1759. const nodeType = node.type;
  1760. if (nodeType === "ClassMethod") {
  1761. if (typeof opts === "undefined") {
  1762. return true;
  1763. } else {
  1764. return (0, _shallowEqual$1.default)(node, opts);
  1765. }
  1766. }
  1767. return false;
  1768. }
  1769. function isObjectPattern(node, opts) {
  1770. if (!node) return false;
  1771. const nodeType = node.type;
  1772. if (nodeType === "ObjectPattern") {
  1773. if (typeof opts === "undefined") {
  1774. return true;
  1775. } else {
  1776. return (0, _shallowEqual$1.default)(node, opts);
  1777. }
  1778. }
  1779. return false;
  1780. }
  1781. function isSpreadElement(node, opts) {
  1782. if (!node) return false;
  1783. const nodeType = node.type;
  1784. if (nodeType === "SpreadElement") {
  1785. if (typeof opts === "undefined") {
  1786. return true;
  1787. } else {
  1788. return (0, _shallowEqual$1.default)(node, opts);
  1789. }
  1790. }
  1791. return false;
  1792. }
  1793. function isSuper(node, opts) {
  1794. if (!node) return false;
  1795. const nodeType = node.type;
  1796. if (nodeType === "Super") {
  1797. if (typeof opts === "undefined") {
  1798. return true;
  1799. } else {
  1800. return (0, _shallowEqual$1.default)(node, opts);
  1801. }
  1802. }
  1803. return false;
  1804. }
  1805. function isTaggedTemplateExpression(node, opts) {
  1806. if (!node) return false;
  1807. const nodeType = node.type;
  1808. if (nodeType === "TaggedTemplateExpression") {
  1809. if (typeof opts === "undefined") {
  1810. return true;
  1811. } else {
  1812. return (0, _shallowEqual$1.default)(node, opts);
  1813. }
  1814. }
  1815. return false;
  1816. }
  1817. function isTemplateElement(node, opts) {
  1818. if (!node) return false;
  1819. const nodeType = node.type;
  1820. if (nodeType === "TemplateElement") {
  1821. if (typeof opts === "undefined") {
  1822. return true;
  1823. } else {
  1824. return (0, _shallowEqual$1.default)(node, opts);
  1825. }
  1826. }
  1827. return false;
  1828. }
  1829. function isTemplateLiteral(node, opts) {
  1830. if (!node) return false;
  1831. const nodeType = node.type;
  1832. if (nodeType === "TemplateLiteral") {
  1833. if (typeof opts === "undefined") {
  1834. return true;
  1835. } else {
  1836. return (0, _shallowEqual$1.default)(node, opts);
  1837. }
  1838. }
  1839. return false;
  1840. }
  1841. function isYieldExpression(node, opts) {
  1842. if (!node) return false;
  1843. const nodeType = node.type;
  1844. if (nodeType === "YieldExpression") {
  1845. if (typeof opts === "undefined") {
  1846. return true;
  1847. } else {
  1848. return (0, _shallowEqual$1.default)(node, opts);
  1849. }
  1850. }
  1851. return false;
  1852. }
  1853. function isAwaitExpression(node, opts) {
  1854. if (!node) return false;
  1855. const nodeType = node.type;
  1856. if (nodeType === "AwaitExpression") {
  1857. if (typeof opts === "undefined") {
  1858. return true;
  1859. } else {
  1860. return (0, _shallowEqual$1.default)(node, opts);
  1861. }
  1862. }
  1863. return false;
  1864. }
  1865. function isImport(node, opts) {
  1866. if (!node) return false;
  1867. const nodeType = node.type;
  1868. if (nodeType === "Import") {
  1869. if (typeof opts === "undefined") {
  1870. return true;
  1871. } else {
  1872. return (0, _shallowEqual$1.default)(node, opts);
  1873. }
  1874. }
  1875. return false;
  1876. }
  1877. function isBigIntLiteral(node, opts) {
  1878. if (!node) return false;
  1879. const nodeType = node.type;
  1880. if (nodeType === "BigIntLiteral") {
  1881. if (typeof opts === "undefined") {
  1882. return true;
  1883. } else {
  1884. return (0, _shallowEqual$1.default)(node, opts);
  1885. }
  1886. }
  1887. return false;
  1888. }
  1889. function isExportNamespaceSpecifier(node, opts) {
  1890. if (!node) return false;
  1891. const nodeType = node.type;
  1892. if (nodeType === "ExportNamespaceSpecifier") {
  1893. if (typeof opts === "undefined") {
  1894. return true;
  1895. } else {
  1896. return (0, _shallowEqual$1.default)(node, opts);
  1897. }
  1898. }
  1899. return false;
  1900. }
  1901. function isOptionalMemberExpression(node, opts) {
  1902. if (!node) return false;
  1903. const nodeType = node.type;
  1904. if (nodeType === "OptionalMemberExpression") {
  1905. if (typeof opts === "undefined") {
  1906. return true;
  1907. } else {
  1908. return (0, _shallowEqual$1.default)(node, opts);
  1909. }
  1910. }
  1911. return false;
  1912. }
  1913. function isOptionalCallExpression(node, opts) {
  1914. if (!node) return false;
  1915. const nodeType = node.type;
  1916. if (nodeType === "OptionalCallExpression") {
  1917. if (typeof opts === "undefined") {
  1918. return true;
  1919. } else {
  1920. return (0, _shallowEqual$1.default)(node, opts);
  1921. }
  1922. }
  1923. return false;
  1924. }
  1925. function isClassProperty(node, opts) {
  1926. if (!node) return false;
  1927. const nodeType = node.type;
  1928. if (nodeType === "ClassProperty") {
  1929. if (typeof opts === "undefined") {
  1930. return true;
  1931. } else {
  1932. return (0, _shallowEqual$1.default)(node, opts);
  1933. }
  1934. }
  1935. return false;
  1936. }
  1937. function isClassPrivateProperty(node, opts) {
  1938. if (!node) return false;
  1939. const nodeType = node.type;
  1940. if (nodeType === "ClassPrivateProperty") {
  1941. if (typeof opts === "undefined") {
  1942. return true;
  1943. } else {
  1944. return (0, _shallowEqual$1.default)(node, opts);
  1945. }
  1946. }
  1947. return false;
  1948. }
  1949. function isClassPrivateMethod(node, opts) {
  1950. if (!node) return false;
  1951. const nodeType = node.type;
  1952. if (nodeType === "ClassPrivateMethod") {
  1953. if (typeof opts === "undefined") {
  1954. return true;
  1955. } else {
  1956. return (0, _shallowEqual$1.default)(node, opts);
  1957. }
  1958. }
  1959. return false;
  1960. }
  1961. function isPrivateName(node, opts) {
  1962. if (!node) return false;
  1963. const nodeType = node.type;
  1964. if (nodeType === "PrivateName") {
  1965. if (typeof opts === "undefined") {
  1966. return true;
  1967. } else {
  1968. return (0, _shallowEqual$1.default)(node, opts);
  1969. }
  1970. }
  1971. return false;
  1972. }
  1973. function isAnyTypeAnnotation(node, opts) {
  1974. if (!node) return false;
  1975. const nodeType = node.type;
  1976. if (nodeType === "AnyTypeAnnotation") {
  1977. if (typeof opts === "undefined") {
  1978. return true;
  1979. } else {
  1980. return (0, _shallowEqual$1.default)(node, opts);
  1981. }
  1982. }
  1983. return false;
  1984. }
  1985. function isArrayTypeAnnotation(node, opts) {
  1986. if (!node) return false;
  1987. const nodeType = node.type;
  1988. if (nodeType === "ArrayTypeAnnotation") {
  1989. if (typeof opts === "undefined") {
  1990. return true;
  1991. } else {
  1992. return (0, _shallowEqual$1.default)(node, opts);
  1993. }
  1994. }
  1995. return false;
  1996. }
  1997. function isBooleanTypeAnnotation(node, opts) {
  1998. if (!node) return false;
  1999. const nodeType = node.type;
  2000. if (nodeType === "BooleanTypeAnnotation") {
  2001. if (typeof opts === "undefined") {
  2002. return true;
  2003. } else {
  2004. return (0, _shallowEqual$1.default)(node, opts);
  2005. }
  2006. }
  2007. return false;
  2008. }
  2009. function isBooleanLiteralTypeAnnotation(node, opts) {
  2010. if (!node) return false;
  2011. const nodeType = node.type;
  2012. if (nodeType === "BooleanLiteralTypeAnnotation") {
  2013. if (typeof opts === "undefined") {
  2014. return true;
  2015. } else {
  2016. return (0, _shallowEqual$1.default)(node, opts);
  2017. }
  2018. }
  2019. return false;
  2020. }
  2021. function isNullLiteralTypeAnnotation(node, opts) {
  2022. if (!node) return false;
  2023. const nodeType = node.type;
  2024. if (nodeType === "NullLiteralTypeAnnotation") {
  2025. if (typeof opts === "undefined") {
  2026. return true;
  2027. } else {
  2028. return (0, _shallowEqual$1.default)(node, opts);
  2029. }
  2030. }
  2031. return false;
  2032. }
  2033. function isClassImplements(node, opts) {
  2034. if (!node) return false;
  2035. const nodeType = node.type;
  2036. if (nodeType === "ClassImplements") {
  2037. if (typeof opts === "undefined") {
  2038. return true;
  2039. } else {
  2040. return (0, _shallowEqual$1.default)(node, opts);
  2041. }
  2042. }
  2043. return false;
  2044. }
  2045. function isDeclareClass(node, opts) {
  2046. if (!node) return false;
  2047. const nodeType = node.type;
  2048. if (nodeType === "DeclareClass") {
  2049. if (typeof opts === "undefined") {
  2050. return true;
  2051. } else {
  2052. return (0, _shallowEqual$1.default)(node, opts);
  2053. }
  2054. }
  2055. return false;
  2056. }
  2057. function isDeclareFunction(node, opts) {
  2058. if (!node) return false;
  2059. const nodeType = node.type;
  2060. if (nodeType === "DeclareFunction") {
  2061. if (typeof opts === "undefined") {
  2062. return true;
  2063. } else {
  2064. return (0, _shallowEqual$1.default)(node, opts);
  2065. }
  2066. }
  2067. return false;
  2068. }
  2069. function isDeclareInterface(node, opts) {
  2070. if (!node) return false;
  2071. const nodeType = node.type;
  2072. if (nodeType === "DeclareInterface") {
  2073. if (typeof opts === "undefined") {
  2074. return true;
  2075. } else {
  2076. return (0, _shallowEqual$1.default)(node, opts);
  2077. }
  2078. }
  2079. return false;
  2080. }
  2081. function isDeclareModule(node, opts) {
  2082. if (!node) return false;
  2083. const nodeType = node.type;
  2084. if (nodeType === "DeclareModule") {
  2085. if (typeof opts === "undefined") {
  2086. return true;
  2087. } else {
  2088. return (0, _shallowEqual$1.default)(node, opts);
  2089. }
  2090. }
  2091. return false;
  2092. }
  2093. function isDeclareModuleExports(node, opts) {
  2094. if (!node) return false;
  2095. const nodeType = node.type;
  2096. if (nodeType === "DeclareModuleExports") {
  2097. if (typeof opts === "undefined") {
  2098. return true;
  2099. } else {
  2100. return (0, _shallowEqual$1.default)(node, opts);
  2101. }
  2102. }
  2103. return false;
  2104. }
  2105. function isDeclareTypeAlias(node, opts) {
  2106. if (!node) return false;
  2107. const nodeType = node.type;
  2108. if (nodeType === "DeclareTypeAlias") {
  2109. if (typeof opts === "undefined") {
  2110. return true;
  2111. } else {
  2112. return (0, _shallowEqual$1.default)(node, opts);
  2113. }
  2114. }
  2115. return false;
  2116. }
  2117. function isDeclareOpaqueType(node, opts) {
  2118. if (!node) return false;
  2119. const nodeType = node.type;
  2120. if (nodeType === "DeclareOpaqueType") {
  2121. if (typeof opts === "undefined") {
  2122. return true;
  2123. } else {
  2124. return (0, _shallowEqual$1.default)(node, opts);
  2125. }
  2126. }
  2127. return false;
  2128. }
  2129. function isDeclareVariable(node, opts) {
  2130. if (!node) return false;
  2131. const nodeType = node.type;
  2132. if (nodeType === "DeclareVariable") {
  2133. if (typeof opts === "undefined") {
  2134. return true;
  2135. } else {
  2136. return (0, _shallowEqual$1.default)(node, opts);
  2137. }
  2138. }
  2139. return false;
  2140. }
  2141. function isDeclareExportDeclaration(node, opts) {
  2142. if (!node) return false;
  2143. const nodeType = node.type;
  2144. if (nodeType === "DeclareExportDeclaration") {
  2145. if (typeof opts === "undefined") {
  2146. return true;
  2147. } else {
  2148. return (0, _shallowEqual$1.default)(node, opts);
  2149. }
  2150. }
  2151. return false;
  2152. }
  2153. function isDeclareExportAllDeclaration(node, opts) {
  2154. if (!node) return false;
  2155. const nodeType = node.type;
  2156. if (nodeType === "DeclareExportAllDeclaration") {
  2157. if (typeof opts === "undefined") {
  2158. return true;
  2159. } else {
  2160. return (0, _shallowEqual$1.default)(node, opts);
  2161. }
  2162. }
  2163. return false;
  2164. }
  2165. function isDeclaredPredicate(node, opts) {
  2166. if (!node) return false;
  2167. const nodeType = node.type;
  2168. if (nodeType === "DeclaredPredicate") {
  2169. if (typeof opts === "undefined") {
  2170. return true;
  2171. } else {
  2172. return (0, _shallowEqual$1.default)(node, opts);
  2173. }
  2174. }
  2175. return false;
  2176. }
  2177. function isExistsTypeAnnotation(node, opts) {
  2178. if (!node) return false;
  2179. const nodeType = node.type;
  2180. if (nodeType === "ExistsTypeAnnotation") {
  2181. if (typeof opts === "undefined") {
  2182. return true;
  2183. } else {
  2184. return (0, _shallowEqual$1.default)(node, opts);
  2185. }
  2186. }
  2187. return false;
  2188. }
  2189. function isFunctionTypeAnnotation(node, opts) {
  2190. if (!node) return false;
  2191. const nodeType = node.type;
  2192. if (nodeType === "FunctionTypeAnnotation") {
  2193. if (typeof opts === "undefined") {
  2194. return true;
  2195. } else {
  2196. return (0, _shallowEqual$1.default)(node, opts);
  2197. }
  2198. }
  2199. return false;
  2200. }
  2201. function isFunctionTypeParam(node, opts) {
  2202. if (!node) return false;
  2203. const nodeType = node.type;
  2204. if (nodeType === "FunctionTypeParam") {
  2205. if (typeof opts === "undefined") {
  2206. return true;
  2207. } else {
  2208. return (0, _shallowEqual$1.default)(node, opts);
  2209. }
  2210. }
  2211. return false;
  2212. }
  2213. function isGenericTypeAnnotation(node, opts) {
  2214. if (!node) return false;
  2215. const nodeType = node.type;
  2216. if (nodeType === "GenericTypeAnnotation") {
  2217. if (typeof opts === "undefined") {
  2218. return true;
  2219. } else {
  2220. return (0, _shallowEqual$1.default)(node, opts);
  2221. }
  2222. }
  2223. return false;
  2224. }
  2225. function isInferredPredicate(node, opts) {
  2226. if (!node) return false;
  2227. const nodeType = node.type;
  2228. if (nodeType === "InferredPredicate") {
  2229. if (typeof opts === "undefined") {
  2230. return true;
  2231. } else {
  2232. return (0, _shallowEqual$1.default)(node, opts);
  2233. }
  2234. }
  2235. return false;
  2236. }
  2237. function isInterfaceExtends(node, opts) {
  2238. if (!node) return false;
  2239. const nodeType = node.type;
  2240. if (nodeType === "InterfaceExtends") {
  2241. if (typeof opts === "undefined") {
  2242. return true;
  2243. } else {
  2244. return (0, _shallowEqual$1.default)(node, opts);
  2245. }
  2246. }
  2247. return false;
  2248. }
  2249. function isInterfaceDeclaration(node, opts) {
  2250. if (!node) return false;
  2251. const nodeType = node.type;
  2252. if (nodeType === "InterfaceDeclaration") {
  2253. if (typeof opts === "undefined") {
  2254. return true;
  2255. } else {
  2256. return (0, _shallowEqual$1.default)(node, opts);
  2257. }
  2258. }
  2259. return false;
  2260. }
  2261. function isInterfaceTypeAnnotation(node, opts) {
  2262. if (!node) return false;
  2263. const nodeType = node.type;
  2264. if (nodeType === "InterfaceTypeAnnotation") {
  2265. if (typeof opts === "undefined") {
  2266. return true;
  2267. } else {
  2268. return (0, _shallowEqual$1.default)(node, opts);
  2269. }
  2270. }
  2271. return false;
  2272. }
  2273. function isIntersectionTypeAnnotation(node, opts) {
  2274. if (!node) return false;
  2275. const nodeType = node.type;
  2276. if (nodeType === "IntersectionTypeAnnotation") {
  2277. if (typeof opts === "undefined") {
  2278. return true;
  2279. } else {
  2280. return (0, _shallowEqual$1.default)(node, opts);
  2281. }
  2282. }
  2283. return false;
  2284. }
  2285. function isMixedTypeAnnotation(node, opts) {
  2286. if (!node) return false;
  2287. const nodeType = node.type;
  2288. if (nodeType === "MixedTypeAnnotation") {
  2289. if (typeof opts === "undefined") {
  2290. return true;
  2291. } else {
  2292. return (0, _shallowEqual$1.default)(node, opts);
  2293. }
  2294. }
  2295. return false;
  2296. }
  2297. function isEmptyTypeAnnotation(node, opts) {
  2298. if (!node) return false;
  2299. const nodeType = node.type;
  2300. if (nodeType === "EmptyTypeAnnotation") {
  2301. if (typeof opts === "undefined") {
  2302. return true;
  2303. } else {
  2304. return (0, _shallowEqual$1.default)(node, opts);
  2305. }
  2306. }
  2307. return false;
  2308. }
  2309. function isNullableTypeAnnotation(node, opts) {
  2310. if (!node) return false;
  2311. const nodeType = node.type;
  2312. if (nodeType === "NullableTypeAnnotation") {
  2313. if (typeof opts === "undefined") {
  2314. return true;
  2315. } else {
  2316. return (0, _shallowEqual$1.default)(node, opts);
  2317. }
  2318. }
  2319. return false;
  2320. }
  2321. function isNumberLiteralTypeAnnotation(node, opts) {
  2322. if (!node) return false;
  2323. const nodeType = node.type;
  2324. if (nodeType === "NumberLiteralTypeAnnotation") {
  2325. if (typeof opts === "undefined") {
  2326. return true;
  2327. } else {
  2328. return (0, _shallowEqual$1.default)(node, opts);
  2329. }
  2330. }
  2331. return false;
  2332. }
  2333. function isNumberTypeAnnotation(node, opts) {
  2334. if (!node) return false;
  2335. const nodeType = node.type;
  2336. if (nodeType === "NumberTypeAnnotation") {
  2337. if (typeof opts === "undefined") {
  2338. return true;
  2339. } else {
  2340. return (0, _shallowEqual$1.default)(node, opts);
  2341. }
  2342. }
  2343. return false;
  2344. }
  2345. function isObjectTypeAnnotation(node, opts) {
  2346. if (!node) return false;
  2347. const nodeType = node.type;
  2348. if (nodeType === "ObjectTypeAnnotation") {
  2349. if (typeof opts === "undefined") {
  2350. return true;
  2351. } else {
  2352. return (0, _shallowEqual$1.default)(node, opts);
  2353. }
  2354. }
  2355. return false;
  2356. }
  2357. function isObjectTypeInternalSlot(node, opts) {
  2358. if (!node) return false;
  2359. const nodeType = node.type;
  2360. if (nodeType === "ObjectTypeInternalSlot") {
  2361. if (typeof opts === "undefined") {
  2362. return true;
  2363. } else {
  2364. return (0, _shallowEqual$1.default)(node, opts);
  2365. }
  2366. }
  2367. return false;
  2368. }
  2369. function isObjectTypeCallProperty(node, opts) {
  2370. if (!node) return false;
  2371. const nodeType = node.type;
  2372. if (nodeType === "ObjectTypeCallProperty") {
  2373. if (typeof opts === "undefined") {
  2374. return true;
  2375. } else {
  2376. return (0, _shallowEqual$1.default)(node, opts);
  2377. }
  2378. }
  2379. return false;
  2380. }
  2381. function isObjectTypeIndexer(node, opts) {
  2382. if (!node) return false;
  2383. const nodeType = node.type;
  2384. if (nodeType === "ObjectTypeIndexer") {
  2385. if (typeof opts === "undefined") {
  2386. return true;
  2387. } else {
  2388. return (0, _shallowEqual$1.default)(node, opts);
  2389. }
  2390. }
  2391. return false;
  2392. }
  2393. function isObjectTypeProperty(node, opts) {
  2394. if (!node) return false;
  2395. const nodeType = node.type;
  2396. if (nodeType === "ObjectTypeProperty") {
  2397. if (typeof opts === "undefined") {
  2398. return true;
  2399. } else {
  2400. return (0, _shallowEqual$1.default)(node, opts);
  2401. }
  2402. }
  2403. return false;
  2404. }
  2405. function isObjectTypeSpreadProperty(node, opts) {
  2406. if (!node) return false;
  2407. const nodeType = node.type;
  2408. if (nodeType === "ObjectTypeSpreadProperty") {
  2409. if (typeof opts === "undefined") {
  2410. return true;
  2411. } else {
  2412. return (0, _shallowEqual$1.default)(node, opts);
  2413. }
  2414. }
  2415. return false;
  2416. }
  2417. function isOpaqueType(node, opts) {
  2418. if (!node) return false;
  2419. const nodeType = node.type;
  2420. if (nodeType === "OpaqueType") {
  2421. if (typeof opts === "undefined") {
  2422. return true;
  2423. } else {
  2424. return (0, _shallowEqual$1.default)(node, opts);
  2425. }
  2426. }
  2427. return false;
  2428. }
  2429. function isQualifiedTypeIdentifier(node, opts) {
  2430. if (!node) return false;
  2431. const nodeType = node.type;
  2432. if (nodeType === "QualifiedTypeIdentifier") {
  2433. if (typeof opts === "undefined") {
  2434. return true;
  2435. } else {
  2436. return (0, _shallowEqual$1.default)(node, opts);
  2437. }
  2438. }
  2439. return false;
  2440. }
  2441. function isStringLiteralTypeAnnotation(node, opts) {
  2442. if (!node) return false;
  2443. const nodeType = node.type;
  2444. if (nodeType === "StringLiteralTypeAnnotation") {
  2445. if (typeof opts === "undefined") {
  2446. return true;
  2447. } else {
  2448. return (0, _shallowEqual$1.default)(node, opts);
  2449. }
  2450. }
  2451. return false;
  2452. }
  2453. function isStringTypeAnnotation(node, opts) {
  2454. if (!node) return false;
  2455. const nodeType = node.type;
  2456. if (nodeType === "StringTypeAnnotation") {
  2457. if (typeof opts === "undefined") {
  2458. return true;
  2459. } else {
  2460. return (0, _shallowEqual$1.default)(node, opts);
  2461. }
  2462. }
  2463. return false;
  2464. }
  2465. function isSymbolTypeAnnotation(node, opts) {
  2466. if (!node) return false;
  2467. const nodeType = node.type;
  2468. if (nodeType === "SymbolTypeAnnotation") {
  2469. if (typeof opts === "undefined") {
  2470. return true;
  2471. } else {
  2472. return (0, _shallowEqual$1.default)(node, opts);
  2473. }
  2474. }
  2475. return false;
  2476. }
  2477. function isThisTypeAnnotation(node, opts) {
  2478. if (!node) return false;
  2479. const nodeType = node.type;
  2480. if (nodeType === "ThisTypeAnnotation") {
  2481. if (typeof opts === "undefined") {
  2482. return true;
  2483. } else {
  2484. return (0, _shallowEqual$1.default)(node, opts);
  2485. }
  2486. }
  2487. return false;
  2488. }
  2489. function isTupleTypeAnnotation(node, opts) {
  2490. if (!node) return false;
  2491. const nodeType = node.type;
  2492. if (nodeType === "TupleTypeAnnotation") {
  2493. if (typeof opts === "undefined") {
  2494. return true;
  2495. } else {
  2496. return (0, _shallowEqual$1.default)(node, opts);
  2497. }
  2498. }
  2499. return false;
  2500. }
  2501. function isTypeofTypeAnnotation(node, opts) {
  2502. if (!node) return false;
  2503. const nodeType = node.type;
  2504. if (nodeType === "TypeofTypeAnnotation") {
  2505. if (typeof opts === "undefined") {
  2506. return true;
  2507. } else {
  2508. return (0, _shallowEqual$1.default)(node, opts);
  2509. }
  2510. }
  2511. return false;
  2512. }
  2513. function isTypeAlias(node, opts) {
  2514. if (!node) return false;
  2515. const nodeType = node.type;
  2516. if (nodeType === "TypeAlias") {
  2517. if (typeof opts === "undefined") {
  2518. return true;
  2519. } else {
  2520. return (0, _shallowEqual$1.default)(node, opts);
  2521. }
  2522. }
  2523. return false;
  2524. }
  2525. function isTypeAnnotation(node, opts) {
  2526. if (!node) return false;
  2527. const nodeType = node.type;
  2528. if (nodeType === "TypeAnnotation") {
  2529. if (typeof opts === "undefined") {
  2530. return true;
  2531. } else {
  2532. return (0, _shallowEqual$1.default)(node, opts);
  2533. }
  2534. }
  2535. return false;
  2536. }
  2537. function isTypeCastExpression(node, opts) {
  2538. if (!node) return false;
  2539. const nodeType = node.type;
  2540. if (nodeType === "TypeCastExpression") {
  2541. if (typeof opts === "undefined") {
  2542. return true;
  2543. } else {
  2544. return (0, _shallowEqual$1.default)(node, opts);
  2545. }
  2546. }
  2547. return false;
  2548. }
  2549. function isTypeParameter(node, opts) {
  2550. if (!node) return false;
  2551. const nodeType = node.type;
  2552. if (nodeType === "TypeParameter") {
  2553. if (typeof opts === "undefined") {
  2554. return true;
  2555. } else {
  2556. return (0, _shallowEqual$1.default)(node, opts);
  2557. }
  2558. }
  2559. return false;
  2560. }
  2561. function isTypeParameterDeclaration(node, opts) {
  2562. if (!node) return false;
  2563. const nodeType = node.type;
  2564. if (nodeType === "TypeParameterDeclaration") {
  2565. if (typeof opts === "undefined") {
  2566. return true;
  2567. } else {
  2568. return (0, _shallowEqual$1.default)(node, opts);
  2569. }
  2570. }
  2571. return false;
  2572. }
  2573. function isTypeParameterInstantiation(node, opts) {
  2574. if (!node) return false;
  2575. const nodeType = node.type;
  2576. if (nodeType === "TypeParameterInstantiation") {
  2577. if (typeof opts === "undefined") {
  2578. return true;
  2579. } else {
  2580. return (0, _shallowEqual$1.default)(node, opts);
  2581. }
  2582. }
  2583. return false;
  2584. }
  2585. function isUnionTypeAnnotation(node, opts) {
  2586. if (!node) return false;
  2587. const nodeType = node.type;
  2588. if (nodeType === "UnionTypeAnnotation") {
  2589. if (typeof opts === "undefined") {
  2590. return true;
  2591. } else {
  2592. return (0, _shallowEqual$1.default)(node, opts);
  2593. }
  2594. }
  2595. return false;
  2596. }
  2597. function isVariance(node, opts) {
  2598. if (!node) return false;
  2599. const nodeType = node.type;
  2600. if (nodeType === "Variance") {
  2601. if (typeof opts === "undefined") {
  2602. return true;
  2603. } else {
  2604. return (0, _shallowEqual$1.default)(node, opts);
  2605. }
  2606. }
  2607. return false;
  2608. }
  2609. function isVoidTypeAnnotation(node, opts) {
  2610. if (!node) return false;
  2611. const nodeType = node.type;
  2612. if (nodeType === "VoidTypeAnnotation") {
  2613. if (typeof opts === "undefined") {
  2614. return true;
  2615. } else {
  2616. return (0, _shallowEqual$1.default)(node, opts);
  2617. }
  2618. }
  2619. return false;
  2620. }
  2621. function isEnumDeclaration(node, opts) {
  2622. if (!node) return false;
  2623. const nodeType = node.type;
  2624. if (nodeType === "EnumDeclaration") {
  2625. if (typeof opts === "undefined") {
  2626. return true;
  2627. } else {
  2628. return (0, _shallowEqual$1.default)(node, opts);
  2629. }
  2630. }
  2631. return false;
  2632. }
  2633. function isEnumBooleanBody(node, opts) {
  2634. if (!node) return false;
  2635. const nodeType = node.type;
  2636. if (nodeType === "EnumBooleanBody") {
  2637. if (typeof opts === "undefined") {
  2638. return true;
  2639. } else {
  2640. return (0, _shallowEqual$1.default)(node, opts);
  2641. }
  2642. }
  2643. return false;
  2644. }
  2645. function isEnumNumberBody(node, opts) {
  2646. if (!node) return false;
  2647. const nodeType = node.type;
  2648. if (nodeType === "EnumNumberBody") {
  2649. if (typeof opts === "undefined") {
  2650. return true;
  2651. } else {
  2652. return (0, _shallowEqual$1.default)(node, opts);
  2653. }
  2654. }
  2655. return false;
  2656. }
  2657. function isEnumStringBody(node, opts) {
  2658. if (!node) return false;
  2659. const nodeType = node.type;
  2660. if (nodeType === "EnumStringBody") {
  2661. if (typeof opts === "undefined") {
  2662. return true;
  2663. } else {
  2664. return (0, _shallowEqual$1.default)(node, opts);
  2665. }
  2666. }
  2667. return false;
  2668. }
  2669. function isEnumSymbolBody(node, opts) {
  2670. if (!node) return false;
  2671. const nodeType = node.type;
  2672. if (nodeType === "EnumSymbolBody") {
  2673. if (typeof opts === "undefined") {
  2674. return true;
  2675. } else {
  2676. return (0, _shallowEqual$1.default)(node, opts);
  2677. }
  2678. }
  2679. return false;
  2680. }
  2681. function isEnumBooleanMember(node, opts) {
  2682. if (!node) return false;
  2683. const nodeType = node.type;
  2684. if (nodeType === "EnumBooleanMember") {
  2685. if (typeof opts === "undefined") {
  2686. return true;
  2687. } else {
  2688. return (0, _shallowEqual$1.default)(node, opts);
  2689. }
  2690. }
  2691. return false;
  2692. }
  2693. function isEnumNumberMember(node, opts) {
  2694. if (!node) return false;
  2695. const nodeType = node.type;
  2696. if (nodeType === "EnumNumberMember") {
  2697. if (typeof opts === "undefined") {
  2698. return true;
  2699. } else {
  2700. return (0, _shallowEqual$1.default)(node, opts);
  2701. }
  2702. }
  2703. return false;
  2704. }
  2705. function isEnumStringMember(node, opts) {
  2706. if (!node) return false;
  2707. const nodeType = node.type;
  2708. if (nodeType === "EnumStringMember") {
  2709. if (typeof opts === "undefined") {
  2710. return true;
  2711. } else {
  2712. return (0, _shallowEqual$1.default)(node, opts);
  2713. }
  2714. }
  2715. return false;
  2716. }
  2717. function isEnumDefaultedMember(node, opts) {
  2718. if (!node) return false;
  2719. const nodeType = node.type;
  2720. if (nodeType === "EnumDefaultedMember") {
  2721. if (typeof opts === "undefined") {
  2722. return true;
  2723. } else {
  2724. return (0, _shallowEqual$1.default)(node, opts);
  2725. }
  2726. }
  2727. return false;
  2728. }
  2729. function isIndexedAccessType(node, opts) {
  2730. if (!node) return false;
  2731. const nodeType = node.type;
  2732. if (nodeType === "IndexedAccessType") {
  2733. if (typeof opts === "undefined") {
  2734. return true;
  2735. } else {
  2736. return (0, _shallowEqual$1.default)(node, opts);
  2737. }
  2738. }
  2739. return false;
  2740. }
  2741. function isOptionalIndexedAccessType(node, opts) {
  2742. if (!node) return false;
  2743. const nodeType = node.type;
  2744. if (nodeType === "OptionalIndexedAccessType") {
  2745. if (typeof opts === "undefined") {
  2746. return true;
  2747. } else {
  2748. return (0, _shallowEqual$1.default)(node, opts);
  2749. }
  2750. }
  2751. return false;
  2752. }
  2753. function isJSXAttribute(node, opts) {
  2754. if (!node) return false;
  2755. const nodeType = node.type;
  2756. if (nodeType === "JSXAttribute") {
  2757. if (typeof opts === "undefined") {
  2758. return true;
  2759. } else {
  2760. return (0, _shallowEqual$1.default)(node, opts);
  2761. }
  2762. }
  2763. return false;
  2764. }
  2765. function isJSXClosingElement(node, opts) {
  2766. if (!node) return false;
  2767. const nodeType = node.type;
  2768. if (nodeType === "JSXClosingElement") {
  2769. if (typeof opts === "undefined") {
  2770. return true;
  2771. } else {
  2772. return (0, _shallowEqual$1.default)(node, opts);
  2773. }
  2774. }
  2775. return false;
  2776. }
  2777. function isJSXElement(node, opts) {
  2778. if (!node) return false;
  2779. const nodeType = node.type;
  2780. if (nodeType === "JSXElement") {
  2781. if (typeof opts === "undefined") {
  2782. return true;
  2783. } else {
  2784. return (0, _shallowEqual$1.default)(node, opts);
  2785. }
  2786. }
  2787. return false;
  2788. }
  2789. function isJSXEmptyExpression(node, opts) {
  2790. if (!node) return false;
  2791. const nodeType = node.type;
  2792. if (nodeType === "JSXEmptyExpression") {
  2793. if (typeof opts === "undefined") {
  2794. return true;
  2795. } else {
  2796. return (0, _shallowEqual$1.default)(node, opts);
  2797. }
  2798. }
  2799. return false;
  2800. }
  2801. function isJSXExpressionContainer(node, opts) {
  2802. if (!node) return false;
  2803. const nodeType = node.type;
  2804. if (nodeType === "JSXExpressionContainer") {
  2805. if (typeof opts === "undefined") {
  2806. return true;
  2807. } else {
  2808. return (0, _shallowEqual$1.default)(node, opts);
  2809. }
  2810. }
  2811. return false;
  2812. }
  2813. function isJSXSpreadChild(node, opts) {
  2814. if (!node) return false;
  2815. const nodeType = node.type;
  2816. if (nodeType === "JSXSpreadChild") {
  2817. if (typeof opts === "undefined") {
  2818. return true;
  2819. } else {
  2820. return (0, _shallowEqual$1.default)(node, opts);
  2821. }
  2822. }
  2823. return false;
  2824. }
  2825. function isJSXIdentifier(node, opts) {
  2826. if (!node) return false;
  2827. const nodeType = node.type;
  2828. if (nodeType === "JSXIdentifier") {
  2829. if (typeof opts === "undefined") {
  2830. return true;
  2831. } else {
  2832. return (0, _shallowEqual$1.default)(node, opts);
  2833. }
  2834. }
  2835. return false;
  2836. }
  2837. function isJSXMemberExpression(node, opts) {
  2838. if (!node) return false;
  2839. const nodeType = node.type;
  2840. if (nodeType === "JSXMemberExpression") {
  2841. if (typeof opts === "undefined") {
  2842. return true;
  2843. } else {
  2844. return (0, _shallowEqual$1.default)(node, opts);
  2845. }
  2846. }
  2847. return false;
  2848. }
  2849. function isJSXNamespacedName(node, opts) {
  2850. if (!node) return false;
  2851. const nodeType = node.type;
  2852. if (nodeType === "JSXNamespacedName") {
  2853. if (typeof opts === "undefined") {
  2854. return true;
  2855. } else {
  2856. return (0, _shallowEqual$1.default)(node, opts);
  2857. }
  2858. }
  2859. return false;
  2860. }
  2861. function isJSXOpeningElement(node, opts) {
  2862. if (!node) return false;
  2863. const nodeType = node.type;
  2864. if (nodeType === "JSXOpeningElement") {
  2865. if (typeof opts === "undefined") {
  2866. return true;
  2867. } else {
  2868. return (0, _shallowEqual$1.default)(node, opts);
  2869. }
  2870. }
  2871. return false;
  2872. }
  2873. function isJSXSpreadAttribute(node, opts) {
  2874. if (!node) return false;
  2875. const nodeType = node.type;
  2876. if (nodeType === "JSXSpreadAttribute") {
  2877. if (typeof opts === "undefined") {
  2878. return true;
  2879. } else {
  2880. return (0, _shallowEqual$1.default)(node, opts);
  2881. }
  2882. }
  2883. return false;
  2884. }
  2885. function isJSXText(node, opts) {
  2886. if (!node) return false;
  2887. const nodeType = node.type;
  2888. if (nodeType === "JSXText") {
  2889. if (typeof opts === "undefined") {
  2890. return true;
  2891. } else {
  2892. return (0, _shallowEqual$1.default)(node, opts);
  2893. }
  2894. }
  2895. return false;
  2896. }
  2897. function isJSXFragment(node, opts) {
  2898. if (!node) return false;
  2899. const nodeType = node.type;
  2900. if (nodeType === "JSXFragment") {
  2901. if (typeof opts === "undefined") {
  2902. return true;
  2903. } else {
  2904. return (0, _shallowEqual$1.default)(node, opts);
  2905. }
  2906. }
  2907. return false;
  2908. }
  2909. function isJSXOpeningFragment(node, opts) {
  2910. if (!node) return false;
  2911. const nodeType = node.type;
  2912. if (nodeType === "JSXOpeningFragment") {
  2913. if (typeof opts === "undefined") {
  2914. return true;
  2915. } else {
  2916. return (0, _shallowEqual$1.default)(node, opts);
  2917. }
  2918. }
  2919. return false;
  2920. }
  2921. function isJSXClosingFragment(node, opts) {
  2922. if (!node) return false;
  2923. const nodeType = node.type;
  2924. if (nodeType === "JSXClosingFragment") {
  2925. if (typeof opts === "undefined") {
  2926. return true;
  2927. } else {
  2928. return (0, _shallowEqual$1.default)(node, opts);
  2929. }
  2930. }
  2931. return false;
  2932. }
  2933. function isNoop(node, opts) {
  2934. if (!node) return false;
  2935. const nodeType = node.type;
  2936. if (nodeType === "Noop") {
  2937. if (typeof opts === "undefined") {
  2938. return true;
  2939. } else {
  2940. return (0, _shallowEqual$1.default)(node, opts);
  2941. }
  2942. }
  2943. return false;
  2944. }
  2945. function isPlaceholder(node, opts) {
  2946. if (!node) return false;
  2947. const nodeType = node.type;
  2948. if (nodeType === "Placeholder") {
  2949. if (typeof opts === "undefined") {
  2950. return true;
  2951. } else {
  2952. return (0, _shallowEqual$1.default)(node, opts);
  2953. }
  2954. }
  2955. return false;
  2956. }
  2957. function isV8IntrinsicIdentifier(node, opts) {
  2958. if (!node) return false;
  2959. const nodeType = node.type;
  2960. if (nodeType === "V8IntrinsicIdentifier") {
  2961. if (typeof opts === "undefined") {
  2962. return true;
  2963. } else {
  2964. return (0, _shallowEqual$1.default)(node, opts);
  2965. }
  2966. }
  2967. return false;
  2968. }
  2969. function isArgumentPlaceholder(node, opts) {
  2970. if (!node) return false;
  2971. const nodeType = node.type;
  2972. if (nodeType === "ArgumentPlaceholder") {
  2973. if (typeof opts === "undefined") {
  2974. return true;
  2975. } else {
  2976. return (0, _shallowEqual$1.default)(node, opts);
  2977. }
  2978. }
  2979. return false;
  2980. }
  2981. function isBindExpression(node, opts) {
  2982. if (!node) return false;
  2983. const nodeType = node.type;
  2984. if (nodeType === "BindExpression") {
  2985. if (typeof opts === "undefined") {
  2986. return true;
  2987. } else {
  2988. return (0, _shallowEqual$1.default)(node, opts);
  2989. }
  2990. }
  2991. return false;
  2992. }
  2993. function isImportAttribute(node, opts) {
  2994. if (!node) return false;
  2995. const nodeType = node.type;
  2996. if (nodeType === "ImportAttribute") {
  2997. if (typeof opts === "undefined") {
  2998. return true;
  2999. } else {
  3000. return (0, _shallowEqual$1.default)(node, opts);
  3001. }
  3002. }
  3003. return false;
  3004. }
  3005. function isDecorator(node, opts) {
  3006. if (!node) return false;
  3007. const nodeType = node.type;
  3008. if (nodeType === "Decorator") {
  3009. if (typeof opts === "undefined") {
  3010. return true;
  3011. } else {
  3012. return (0, _shallowEqual$1.default)(node, opts);
  3013. }
  3014. }
  3015. return false;
  3016. }
  3017. function isDoExpression(node, opts) {
  3018. if (!node) return false;
  3019. const nodeType = node.type;
  3020. if (nodeType === "DoExpression") {
  3021. if (typeof opts === "undefined") {
  3022. return true;
  3023. } else {
  3024. return (0, _shallowEqual$1.default)(node, opts);
  3025. }
  3026. }
  3027. return false;
  3028. }
  3029. function isExportDefaultSpecifier(node, opts) {
  3030. if (!node) return false;
  3031. const nodeType = node.type;
  3032. if (nodeType === "ExportDefaultSpecifier") {
  3033. if (typeof opts === "undefined") {
  3034. return true;
  3035. } else {
  3036. return (0, _shallowEqual$1.default)(node, opts);
  3037. }
  3038. }
  3039. return false;
  3040. }
  3041. function isRecordExpression(node, opts) {
  3042. if (!node) return false;
  3043. const nodeType = node.type;
  3044. if (nodeType === "RecordExpression") {
  3045. if (typeof opts === "undefined") {
  3046. return true;
  3047. } else {
  3048. return (0, _shallowEqual$1.default)(node, opts);
  3049. }
  3050. }
  3051. return false;
  3052. }
  3053. function isTupleExpression(node, opts) {
  3054. if (!node) return false;
  3055. const nodeType = node.type;
  3056. if (nodeType === "TupleExpression") {
  3057. if (typeof opts === "undefined") {
  3058. return true;
  3059. } else {
  3060. return (0, _shallowEqual$1.default)(node, opts);
  3061. }
  3062. }
  3063. return false;
  3064. }
  3065. function isDecimalLiteral(node, opts) {
  3066. if (!node) return false;
  3067. const nodeType = node.type;
  3068. if (nodeType === "DecimalLiteral") {
  3069. if (typeof opts === "undefined") {
  3070. return true;
  3071. } else {
  3072. return (0, _shallowEqual$1.default)(node, opts);
  3073. }
  3074. }
  3075. return false;
  3076. }
  3077. function isStaticBlock(node, opts) {
  3078. if (!node) return false;
  3079. const nodeType = node.type;
  3080. if (nodeType === "StaticBlock") {
  3081. if (typeof opts === "undefined") {
  3082. return true;
  3083. } else {
  3084. return (0, _shallowEqual$1.default)(node, opts);
  3085. }
  3086. }
  3087. return false;
  3088. }
  3089. function isModuleExpression(node, opts) {
  3090. if (!node) return false;
  3091. const nodeType = node.type;
  3092. if (nodeType === "ModuleExpression") {
  3093. if (typeof opts === "undefined") {
  3094. return true;
  3095. } else {
  3096. return (0, _shallowEqual$1.default)(node, opts);
  3097. }
  3098. }
  3099. return false;
  3100. }
  3101. function isTopicReference(node, opts) {
  3102. if (!node) return false;
  3103. const nodeType = node.type;
  3104. if (nodeType === "TopicReference") {
  3105. if (typeof opts === "undefined") {
  3106. return true;
  3107. } else {
  3108. return (0, _shallowEqual$1.default)(node, opts);
  3109. }
  3110. }
  3111. return false;
  3112. }
  3113. function isPipelineTopicExpression(node, opts) {
  3114. if (!node) return false;
  3115. const nodeType = node.type;
  3116. if (nodeType === "PipelineTopicExpression") {
  3117. if (typeof opts === "undefined") {
  3118. return true;
  3119. } else {
  3120. return (0, _shallowEqual$1.default)(node, opts);
  3121. }
  3122. }
  3123. return false;
  3124. }
  3125. function isPipelineBareFunction(node, opts) {
  3126. if (!node) return false;
  3127. const nodeType = node.type;
  3128. if (nodeType === "PipelineBareFunction") {
  3129. if (typeof opts === "undefined") {
  3130. return true;
  3131. } else {
  3132. return (0, _shallowEqual$1.default)(node, opts);
  3133. }
  3134. }
  3135. return false;
  3136. }
  3137. function isPipelinePrimaryTopicReference(node, opts) {
  3138. if (!node) return false;
  3139. const nodeType = node.type;
  3140. if (nodeType === "PipelinePrimaryTopicReference") {
  3141. if (typeof opts === "undefined") {
  3142. return true;
  3143. } else {
  3144. return (0, _shallowEqual$1.default)(node, opts);
  3145. }
  3146. }
  3147. return false;
  3148. }
  3149. function isTSParameterProperty(node, opts) {
  3150. if (!node) return false;
  3151. const nodeType = node.type;
  3152. if (nodeType === "TSParameterProperty") {
  3153. if (typeof opts === "undefined") {
  3154. return true;
  3155. } else {
  3156. return (0, _shallowEqual$1.default)(node, opts);
  3157. }
  3158. }
  3159. return false;
  3160. }
  3161. function isTSDeclareFunction(node, opts) {
  3162. if (!node) return false;
  3163. const nodeType = node.type;
  3164. if (nodeType === "TSDeclareFunction") {
  3165. if (typeof opts === "undefined") {
  3166. return true;
  3167. } else {
  3168. return (0, _shallowEqual$1.default)(node, opts);
  3169. }
  3170. }
  3171. return false;
  3172. }
  3173. function isTSDeclareMethod(node, opts) {
  3174. if (!node) return false;
  3175. const nodeType = node.type;
  3176. if (nodeType === "TSDeclareMethod") {
  3177. if (typeof opts === "undefined") {
  3178. return true;
  3179. } else {
  3180. return (0, _shallowEqual$1.default)(node, opts);
  3181. }
  3182. }
  3183. return false;
  3184. }
  3185. function isTSQualifiedName(node, opts) {
  3186. if (!node) return false;
  3187. const nodeType = node.type;
  3188. if (nodeType === "TSQualifiedName") {
  3189. if (typeof opts === "undefined") {
  3190. return true;
  3191. } else {
  3192. return (0, _shallowEqual$1.default)(node, opts);
  3193. }
  3194. }
  3195. return false;
  3196. }
  3197. function isTSCallSignatureDeclaration(node, opts) {
  3198. if (!node) return false;
  3199. const nodeType = node.type;
  3200. if (nodeType === "TSCallSignatureDeclaration") {
  3201. if (typeof opts === "undefined") {
  3202. return true;
  3203. } else {
  3204. return (0, _shallowEqual$1.default)(node, opts);
  3205. }
  3206. }
  3207. return false;
  3208. }
  3209. function isTSConstructSignatureDeclaration(node, opts) {
  3210. if (!node) return false;
  3211. const nodeType = node.type;
  3212. if (nodeType === "TSConstructSignatureDeclaration") {
  3213. if (typeof opts === "undefined") {
  3214. return true;
  3215. } else {
  3216. return (0, _shallowEqual$1.default)(node, opts);
  3217. }
  3218. }
  3219. return false;
  3220. }
  3221. function isTSPropertySignature(node, opts) {
  3222. if (!node) return false;
  3223. const nodeType = node.type;
  3224. if (nodeType === "TSPropertySignature") {
  3225. if (typeof opts === "undefined") {
  3226. return true;
  3227. } else {
  3228. return (0, _shallowEqual$1.default)(node, opts);
  3229. }
  3230. }
  3231. return false;
  3232. }
  3233. function isTSMethodSignature(node, opts) {
  3234. if (!node) return false;
  3235. const nodeType = node.type;
  3236. if (nodeType === "TSMethodSignature") {
  3237. if (typeof opts === "undefined") {
  3238. return true;
  3239. } else {
  3240. return (0, _shallowEqual$1.default)(node, opts);
  3241. }
  3242. }
  3243. return false;
  3244. }
  3245. function isTSIndexSignature(node, opts) {
  3246. if (!node) return false;
  3247. const nodeType = node.type;
  3248. if (nodeType === "TSIndexSignature") {
  3249. if (typeof opts === "undefined") {
  3250. return true;
  3251. } else {
  3252. return (0, _shallowEqual$1.default)(node, opts);
  3253. }
  3254. }
  3255. return false;
  3256. }
  3257. function isTSAnyKeyword(node, opts) {
  3258. if (!node) return false;
  3259. const nodeType = node.type;
  3260. if (nodeType === "TSAnyKeyword") {
  3261. if (typeof opts === "undefined") {
  3262. return true;
  3263. } else {
  3264. return (0, _shallowEqual$1.default)(node, opts);
  3265. }
  3266. }
  3267. return false;
  3268. }
  3269. function isTSBooleanKeyword(node, opts) {
  3270. if (!node) return false;
  3271. const nodeType = node.type;
  3272. if (nodeType === "TSBooleanKeyword") {
  3273. if (typeof opts === "undefined") {
  3274. return true;
  3275. } else {
  3276. return (0, _shallowEqual$1.default)(node, opts);
  3277. }
  3278. }
  3279. return false;
  3280. }
  3281. function isTSBigIntKeyword(node, opts) {
  3282. if (!node) return false;
  3283. const nodeType = node.type;
  3284. if (nodeType === "TSBigIntKeyword") {
  3285. if (typeof opts === "undefined") {
  3286. return true;
  3287. } else {
  3288. return (0, _shallowEqual$1.default)(node, opts);
  3289. }
  3290. }
  3291. return false;
  3292. }
  3293. function isTSIntrinsicKeyword(node, opts) {
  3294. if (!node) return false;
  3295. const nodeType = node.type;
  3296. if (nodeType === "TSIntrinsicKeyword") {
  3297. if (typeof opts === "undefined") {
  3298. return true;
  3299. } else {
  3300. return (0, _shallowEqual$1.default)(node, opts);
  3301. }
  3302. }
  3303. return false;
  3304. }
  3305. function isTSNeverKeyword(node, opts) {
  3306. if (!node) return false;
  3307. const nodeType = node.type;
  3308. if (nodeType === "TSNeverKeyword") {
  3309. if (typeof opts === "undefined") {
  3310. return true;
  3311. } else {
  3312. return (0, _shallowEqual$1.default)(node, opts);
  3313. }
  3314. }
  3315. return false;
  3316. }
  3317. function isTSNullKeyword(node, opts) {
  3318. if (!node) return false;
  3319. const nodeType = node.type;
  3320. if (nodeType === "TSNullKeyword") {
  3321. if (typeof opts === "undefined") {
  3322. return true;
  3323. } else {
  3324. return (0, _shallowEqual$1.default)(node, opts);
  3325. }
  3326. }
  3327. return false;
  3328. }
  3329. function isTSNumberKeyword(node, opts) {
  3330. if (!node) return false;
  3331. const nodeType = node.type;
  3332. if (nodeType === "TSNumberKeyword") {
  3333. if (typeof opts === "undefined") {
  3334. return true;
  3335. } else {
  3336. return (0, _shallowEqual$1.default)(node, opts);
  3337. }
  3338. }
  3339. return false;
  3340. }
  3341. function isTSObjectKeyword(node, opts) {
  3342. if (!node) return false;
  3343. const nodeType = node.type;
  3344. if (nodeType === "TSObjectKeyword") {
  3345. if (typeof opts === "undefined") {
  3346. return true;
  3347. } else {
  3348. return (0, _shallowEqual$1.default)(node, opts);
  3349. }
  3350. }
  3351. return false;
  3352. }
  3353. function isTSStringKeyword(node, opts) {
  3354. if (!node) return false;
  3355. const nodeType = node.type;
  3356. if (nodeType === "TSStringKeyword") {
  3357. if (typeof opts === "undefined") {
  3358. return true;
  3359. } else {
  3360. return (0, _shallowEqual$1.default)(node, opts);
  3361. }
  3362. }
  3363. return false;
  3364. }
  3365. function isTSSymbolKeyword(node, opts) {
  3366. if (!node) return false;
  3367. const nodeType = node.type;
  3368. if (nodeType === "TSSymbolKeyword") {
  3369. if (typeof opts === "undefined") {
  3370. return true;
  3371. } else {
  3372. return (0, _shallowEqual$1.default)(node, opts);
  3373. }
  3374. }
  3375. return false;
  3376. }
  3377. function isTSUndefinedKeyword(node, opts) {
  3378. if (!node) return false;
  3379. const nodeType = node.type;
  3380. if (nodeType === "TSUndefinedKeyword") {
  3381. if (typeof opts === "undefined") {
  3382. return true;
  3383. } else {
  3384. return (0, _shallowEqual$1.default)(node, opts);
  3385. }
  3386. }
  3387. return false;
  3388. }
  3389. function isTSUnknownKeyword(node, opts) {
  3390. if (!node) return false;
  3391. const nodeType = node.type;
  3392. if (nodeType === "TSUnknownKeyword") {
  3393. if (typeof opts === "undefined") {
  3394. return true;
  3395. } else {
  3396. return (0, _shallowEqual$1.default)(node, opts);
  3397. }
  3398. }
  3399. return false;
  3400. }
  3401. function isTSVoidKeyword(node, opts) {
  3402. if (!node) return false;
  3403. const nodeType = node.type;
  3404. if (nodeType === "TSVoidKeyword") {
  3405. if (typeof opts === "undefined") {
  3406. return true;
  3407. } else {
  3408. return (0, _shallowEqual$1.default)(node, opts);
  3409. }
  3410. }
  3411. return false;
  3412. }
  3413. function isTSThisType(node, opts) {
  3414. if (!node) return false;
  3415. const nodeType = node.type;
  3416. if (nodeType === "TSThisType") {
  3417. if (typeof opts === "undefined") {
  3418. return true;
  3419. } else {
  3420. return (0, _shallowEqual$1.default)(node, opts);
  3421. }
  3422. }
  3423. return false;
  3424. }
  3425. function isTSFunctionType(node, opts) {
  3426. if (!node) return false;
  3427. const nodeType = node.type;
  3428. if (nodeType === "TSFunctionType") {
  3429. if (typeof opts === "undefined") {
  3430. return true;
  3431. } else {
  3432. return (0, _shallowEqual$1.default)(node, opts);
  3433. }
  3434. }
  3435. return false;
  3436. }
  3437. function isTSConstructorType(node, opts) {
  3438. if (!node) return false;
  3439. const nodeType = node.type;
  3440. if (nodeType === "TSConstructorType") {
  3441. if (typeof opts === "undefined") {
  3442. return true;
  3443. } else {
  3444. return (0, _shallowEqual$1.default)(node, opts);
  3445. }
  3446. }
  3447. return false;
  3448. }
  3449. function isTSTypeReference(node, opts) {
  3450. if (!node) return false;
  3451. const nodeType = node.type;
  3452. if (nodeType === "TSTypeReference") {
  3453. if (typeof opts === "undefined") {
  3454. return true;
  3455. } else {
  3456. return (0, _shallowEqual$1.default)(node, opts);
  3457. }
  3458. }
  3459. return false;
  3460. }
  3461. function isTSTypePredicate(node, opts) {
  3462. if (!node) return false;
  3463. const nodeType = node.type;
  3464. if (nodeType === "TSTypePredicate") {
  3465. if (typeof opts === "undefined") {
  3466. return true;
  3467. } else {
  3468. return (0, _shallowEqual$1.default)(node, opts);
  3469. }
  3470. }
  3471. return false;
  3472. }
  3473. function isTSTypeQuery(node, opts) {
  3474. if (!node) return false;
  3475. const nodeType = node.type;
  3476. if (nodeType === "TSTypeQuery") {
  3477. if (typeof opts === "undefined") {
  3478. return true;
  3479. } else {
  3480. return (0, _shallowEqual$1.default)(node, opts);
  3481. }
  3482. }
  3483. return false;
  3484. }
  3485. function isTSTypeLiteral(node, opts) {
  3486. if (!node) return false;
  3487. const nodeType = node.type;
  3488. if (nodeType === "TSTypeLiteral") {
  3489. if (typeof opts === "undefined") {
  3490. return true;
  3491. } else {
  3492. return (0, _shallowEqual$1.default)(node, opts);
  3493. }
  3494. }
  3495. return false;
  3496. }
  3497. function isTSArrayType(node, opts) {
  3498. if (!node) return false;
  3499. const nodeType = node.type;
  3500. if (nodeType === "TSArrayType") {
  3501. if (typeof opts === "undefined") {
  3502. return true;
  3503. } else {
  3504. return (0, _shallowEqual$1.default)(node, opts);
  3505. }
  3506. }
  3507. return false;
  3508. }
  3509. function isTSTupleType(node, opts) {
  3510. if (!node) return false;
  3511. const nodeType = node.type;
  3512. if (nodeType === "TSTupleType") {
  3513. if (typeof opts === "undefined") {
  3514. return true;
  3515. } else {
  3516. return (0, _shallowEqual$1.default)(node, opts);
  3517. }
  3518. }
  3519. return false;
  3520. }
  3521. function isTSOptionalType(node, opts) {
  3522. if (!node) return false;
  3523. const nodeType = node.type;
  3524. if (nodeType === "TSOptionalType") {
  3525. if (typeof opts === "undefined") {
  3526. return true;
  3527. } else {
  3528. return (0, _shallowEqual$1.default)(node, opts);
  3529. }
  3530. }
  3531. return false;
  3532. }
  3533. function isTSRestType(node, opts) {
  3534. if (!node) return false;
  3535. const nodeType = node.type;
  3536. if (nodeType === "TSRestType") {
  3537. if (typeof opts === "undefined") {
  3538. return true;
  3539. } else {
  3540. return (0, _shallowEqual$1.default)(node, opts);
  3541. }
  3542. }
  3543. return false;
  3544. }
  3545. function isTSNamedTupleMember(node, opts) {
  3546. if (!node) return false;
  3547. const nodeType = node.type;
  3548. if (nodeType === "TSNamedTupleMember") {
  3549. if (typeof opts === "undefined") {
  3550. return true;
  3551. } else {
  3552. return (0, _shallowEqual$1.default)(node, opts);
  3553. }
  3554. }
  3555. return false;
  3556. }
  3557. function isTSUnionType(node, opts) {
  3558. if (!node) return false;
  3559. const nodeType = node.type;
  3560. if (nodeType === "TSUnionType") {
  3561. if (typeof opts === "undefined") {
  3562. return true;
  3563. } else {
  3564. return (0, _shallowEqual$1.default)(node, opts);
  3565. }
  3566. }
  3567. return false;
  3568. }
  3569. function isTSIntersectionType(node, opts) {
  3570. if (!node) return false;
  3571. const nodeType = node.type;
  3572. if (nodeType === "TSIntersectionType") {
  3573. if (typeof opts === "undefined") {
  3574. return true;
  3575. } else {
  3576. return (0, _shallowEqual$1.default)(node, opts);
  3577. }
  3578. }
  3579. return false;
  3580. }
  3581. function isTSConditionalType(node, opts) {
  3582. if (!node) return false;
  3583. const nodeType = node.type;
  3584. if (nodeType === "TSConditionalType") {
  3585. if (typeof opts === "undefined") {
  3586. return true;
  3587. } else {
  3588. return (0, _shallowEqual$1.default)(node, opts);
  3589. }
  3590. }
  3591. return false;
  3592. }
  3593. function isTSInferType(node, opts) {
  3594. if (!node) return false;
  3595. const nodeType = node.type;
  3596. if (nodeType === "TSInferType") {
  3597. if (typeof opts === "undefined") {
  3598. return true;
  3599. } else {
  3600. return (0, _shallowEqual$1.default)(node, opts);
  3601. }
  3602. }
  3603. return false;
  3604. }
  3605. function isTSParenthesizedType(node, opts) {
  3606. if (!node) return false;
  3607. const nodeType = node.type;
  3608. if (nodeType === "TSParenthesizedType") {
  3609. if (typeof opts === "undefined") {
  3610. return true;
  3611. } else {
  3612. return (0, _shallowEqual$1.default)(node, opts);
  3613. }
  3614. }
  3615. return false;
  3616. }
  3617. function isTSTypeOperator(node, opts) {
  3618. if (!node) return false;
  3619. const nodeType = node.type;
  3620. if (nodeType === "TSTypeOperator") {
  3621. if (typeof opts === "undefined") {
  3622. return true;
  3623. } else {
  3624. return (0, _shallowEqual$1.default)(node, opts);
  3625. }
  3626. }
  3627. return false;
  3628. }
  3629. function isTSIndexedAccessType(node, opts) {
  3630. if (!node) return false;
  3631. const nodeType = node.type;
  3632. if (nodeType === "TSIndexedAccessType") {
  3633. if (typeof opts === "undefined") {
  3634. return true;
  3635. } else {
  3636. return (0, _shallowEqual$1.default)(node, opts);
  3637. }
  3638. }
  3639. return false;
  3640. }
  3641. function isTSMappedType(node, opts) {
  3642. if (!node) return false;
  3643. const nodeType = node.type;
  3644. if (nodeType === "TSMappedType") {
  3645. if (typeof opts === "undefined") {
  3646. return true;
  3647. } else {
  3648. return (0, _shallowEqual$1.default)(node, opts);
  3649. }
  3650. }
  3651. return false;
  3652. }
  3653. function isTSLiteralType(node, opts) {
  3654. if (!node) return false;
  3655. const nodeType = node.type;
  3656. if (nodeType === "TSLiteralType") {
  3657. if (typeof opts === "undefined") {
  3658. return true;
  3659. } else {
  3660. return (0, _shallowEqual$1.default)(node, opts);
  3661. }
  3662. }
  3663. return false;
  3664. }
  3665. function isTSExpressionWithTypeArguments(node, opts) {
  3666. if (!node) return false;
  3667. const nodeType = node.type;
  3668. if (nodeType === "TSExpressionWithTypeArguments") {
  3669. if (typeof opts === "undefined") {
  3670. return true;
  3671. } else {
  3672. return (0, _shallowEqual$1.default)(node, opts);
  3673. }
  3674. }
  3675. return false;
  3676. }
  3677. function isTSInterfaceDeclaration(node, opts) {
  3678. if (!node) return false;
  3679. const nodeType = node.type;
  3680. if (nodeType === "TSInterfaceDeclaration") {
  3681. if (typeof opts === "undefined") {
  3682. return true;
  3683. } else {
  3684. return (0, _shallowEqual$1.default)(node, opts);
  3685. }
  3686. }
  3687. return false;
  3688. }
  3689. function isTSInterfaceBody(node, opts) {
  3690. if (!node) return false;
  3691. const nodeType = node.type;
  3692. if (nodeType === "TSInterfaceBody") {
  3693. if (typeof opts === "undefined") {
  3694. return true;
  3695. } else {
  3696. return (0, _shallowEqual$1.default)(node, opts);
  3697. }
  3698. }
  3699. return false;
  3700. }
  3701. function isTSTypeAliasDeclaration(node, opts) {
  3702. if (!node) return false;
  3703. const nodeType = node.type;
  3704. if (nodeType === "TSTypeAliasDeclaration") {
  3705. if (typeof opts === "undefined") {
  3706. return true;
  3707. } else {
  3708. return (0, _shallowEqual$1.default)(node, opts);
  3709. }
  3710. }
  3711. return false;
  3712. }
  3713. function isTSAsExpression(node, opts) {
  3714. if (!node) return false;
  3715. const nodeType = node.type;
  3716. if (nodeType === "TSAsExpression") {
  3717. if (typeof opts === "undefined") {
  3718. return true;
  3719. } else {
  3720. return (0, _shallowEqual$1.default)(node, opts);
  3721. }
  3722. }
  3723. return false;
  3724. }
  3725. function isTSTypeAssertion(node, opts) {
  3726. if (!node) return false;
  3727. const nodeType = node.type;
  3728. if (nodeType === "TSTypeAssertion") {
  3729. if (typeof opts === "undefined") {
  3730. return true;
  3731. } else {
  3732. return (0, _shallowEqual$1.default)(node, opts);
  3733. }
  3734. }
  3735. return false;
  3736. }
  3737. function isTSEnumDeclaration(node, opts) {
  3738. if (!node) return false;
  3739. const nodeType = node.type;
  3740. if (nodeType === "TSEnumDeclaration") {
  3741. if (typeof opts === "undefined") {
  3742. return true;
  3743. } else {
  3744. return (0, _shallowEqual$1.default)(node, opts);
  3745. }
  3746. }
  3747. return false;
  3748. }
  3749. function isTSEnumMember(node, opts) {
  3750. if (!node) return false;
  3751. const nodeType = node.type;
  3752. if (nodeType === "TSEnumMember") {
  3753. if (typeof opts === "undefined") {
  3754. return true;
  3755. } else {
  3756. return (0, _shallowEqual$1.default)(node, opts);
  3757. }
  3758. }
  3759. return false;
  3760. }
  3761. function isTSModuleDeclaration(node, opts) {
  3762. if (!node) return false;
  3763. const nodeType = node.type;
  3764. if (nodeType === "TSModuleDeclaration") {
  3765. if (typeof opts === "undefined") {
  3766. return true;
  3767. } else {
  3768. return (0, _shallowEqual$1.default)(node, opts);
  3769. }
  3770. }
  3771. return false;
  3772. }
  3773. function isTSModuleBlock(node, opts) {
  3774. if (!node) return false;
  3775. const nodeType = node.type;
  3776. if (nodeType === "TSModuleBlock") {
  3777. if (typeof opts === "undefined") {
  3778. return true;
  3779. } else {
  3780. return (0, _shallowEqual$1.default)(node, opts);
  3781. }
  3782. }
  3783. return false;
  3784. }
  3785. function isTSImportType(node, opts) {
  3786. if (!node) return false;
  3787. const nodeType = node.type;
  3788. if (nodeType === "TSImportType") {
  3789. if (typeof opts === "undefined") {
  3790. return true;
  3791. } else {
  3792. return (0, _shallowEqual$1.default)(node, opts);
  3793. }
  3794. }
  3795. return false;
  3796. }
  3797. function isTSImportEqualsDeclaration(node, opts) {
  3798. if (!node) return false;
  3799. const nodeType = node.type;
  3800. if (nodeType === "TSImportEqualsDeclaration") {
  3801. if (typeof opts === "undefined") {
  3802. return true;
  3803. } else {
  3804. return (0, _shallowEqual$1.default)(node, opts);
  3805. }
  3806. }
  3807. return false;
  3808. }
  3809. function isTSExternalModuleReference(node, opts) {
  3810. if (!node) return false;
  3811. const nodeType = node.type;
  3812. if (nodeType === "TSExternalModuleReference") {
  3813. if (typeof opts === "undefined") {
  3814. return true;
  3815. } else {
  3816. return (0, _shallowEqual$1.default)(node, opts);
  3817. }
  3818. }
  3819. return false;
  3820. }
  3821. function isTSNonNullExpression(node, opts) {
  3822. if (!node) return false;
  3823. const nodeType = node.type;
  3824. if (nodeType === "TSNonNullExpression") {
  3825. if (typeof opts === "undefined") {
  3826. return true;
  3827. } else {
  3828. return (0, _shallowEqual$1.default)(node, opts);
  3829. }
  3830. }
  3831. return false;
  3832. }
  3833. function isTSExportAssignment(node, opts) {
  3834. if (!node) return false;
  3835. const nodeType = node.type;
  3836. if (nodeType === "TSExportAssignment") {
  3837. if (typeof opts === "undefined") {
  3838. return true;
  3839. } else {
  3840. return (0, _shallowEqual$1.default)(node, opts);
  3841. }
  3842. }
  3843. return false;
  3844. }
  3845. function isTSNamespaceExportDeclaration(node, opts) {
  3846. if (!node) return false;
  3847. const nodeType = node.type;
  3848. if (nodeType === "TSNamespaceExportDeclaration") {
  3849. if (typeof opts === "undefined") {
  3850. return true;
  3851. } else {
  3852. return (0, _shallowEqual$1.default)(node, opts);
  3853. }
  3854. }
  3855. return false;
  3856. }
  3857. function isTSTypeAnnotation(node, opts) {
  3858. if (!node) return false;
  3859. const nodeType = node.type;
  3860. if (nodeType === "TSTypeAnnotation") {
  3861. if (typeof opts === "undefined") {
  3862. return true;
  3863. } else {
  3864. return (0, _shallowEqual$1.default)(node, opts);
  3865. }
  3866. }
  3867. return false;
  3868. }
  3869. function isTSTypeParameterInstantiation(node, opts) {
  3870. if (!node) return false;
  3871. const nodeType = node.type;
  3872. if (nodeType === "TSTypeParameterInstantiation") {
  3873. if (typeof opts === "undefined") {
  3874. return true;
  3875. } else {
  3876. return (0, _shallowEqual$1.default)(node, opts);
  3877. }
  3878. }
  3879. return false;
  3880. }
  3881. function isTSTypeParameterDeclaration(node, opts) {
  3882. if (!node) return false;
  3883. const nodeType = node.type;
  3884. if (nodeType === "TSTypeParameterDeclaration") {
  3885. if (typeof opts === "undefined") {
  3886. return true;
  3887. } else {
  3888. return (0, _shallowEqual$1.default)(node, opts);
  3889. }
  3890. }
  3891. return false;
  3892. }
  3893. function isTSTypeParameter(node, opts) {
  3894. if (!node) return false;
  3895. const nodeType = node.type;
  3896. if (nodeType === "TSTypeParameter") {
  3897. if (typeof opts === "undefined") {
  3898. return true;
  3899. } else {
  3900. return (0, _shallowEqual$1.default)(node, opts);
  3901. }
  3902. }
  3903. return false;
  3904. }
  3905. function isExpression(node, opts) {
  3906. if (!node) return false;
  3907. const nodeType = node.type;
  3908. 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)) {
  3909. if (typeof opts === "undefined") {
  3910. return true;
  3911. } else {
  3912. return (0, _shallowEqual$1.default)(node, opts);
  3913. }
  3914. }
  3915. return false;
  3916. }
  3917. function isBinary(node, opts) {
  3918. if (!node) return false;
  3919. const nodeType = node.type;
  3920. if ("BinaryExpression" === nodeType || "LogicalExpression" === nodeType) {
  3921. if (typeof opts === "undefined") {
  3922. return true;
  3923. } else {
  3924. return (0, _shallowEqual$1.default)(node, opts);
  3925. }
  3926. }
  3927. return false;
  3928. }
  3929. function isScopable(node, opts) {
  3930. if (!node) return false;
  3931. const nodeType = node.type;
  3932. 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) {
  3933. if (typeof opts === "undefined") {
  3934. return true;
  3935. } else {
  3936. return (0, _shallowEqual$1.default)(node, opts);
  3937. }
  3938. }
  3939. return false;
  3940. }
  3941. function isBlockParent(node, opts) {
  3942. if (!node) return false;
  3943. const nodeType = node.type;
  3944. 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) {
  3945. if (typeof opts === "undefined") {
  3946. return true;
  3947. } else {
  3948. return (0, _shallowEqual$1.default)(node, opts);
  3949. }
  3950. }
  3951. return false;
  3952. }
  3953. function isBlock(node, opts) {
  3954. if (!node) return false;
  3955. const nodeType = node.type;
  3956. if ("BlockStatement" === nodeType || "Program" === nodeType || "TSModuleBlock" === nodeType || nodeType === "Placeholder" && "BlockStatement" === node.expectedNode) {
  3957. if (typeof opts === "undefined") {
  3958. return true;
  3959. } else {
  3960. return (0, _shallowEqual$1.default)(node, opts);
  3961. }
  3962. }
  3963. return false;
  3964. }
  3965. function isStatement(node, opts) {
  3966. if (!node) return false;
  3967. const nodeType = node.type;
  3968. 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)) {
  3969. if (typeof opts === "undefined") {
  3970. return true;
  3971. } else {
  3972. return (0, _shallowEqual$1.default)(node, opts);
  3973. }
  3974. }
  3975. return false;
  3976. }
  3977. function isTerminatorless(node, opts) {
  3978. if (!node) return false;
  3979. const nodeType = node.type;
  3980. if ("BreakStatement" === nodeType || "ContinueStatement" === nodeType || "ReturnStatement" === nodeType || "ThrowStatement" === nodeType || "YieldExpression" === nodeType || "AwaitExpression" === nodeType) {
  3981. if (typeof opts === "undefined") {
  3982. return true;
  3983. } else {
  3984. return (0, _shallowEqual$1.default)(node, opts);
  3985. }
  3986. }
  3987. return false;
  3988. }
  3989. function isCompletionStatement(node, opts) {
  3990. if (!node) return false;
  3991. const nodeType = node.type;
  3992. if ("BreakStatement" === nodeType || "ContinueStatement" === nodeType || "ReturnStatement" === nodeType || "ThrowStatement" === nodeType) {
  3993. if (typeof opts === "undefined") {
  3994. return true;
  3995. } else {
  3996. return (0, _shallowEqual$1.default)(node, opts);
  3997. }
  3998. }
  3999. return false;
  4000. }
  4001. function isConditional(node, opts) {
  4002. if (!node) return false;
  4003. const nodeType = node.type;
  4004. if ("ConditionalExpression" === nodeType || "IfStatement" === nodeType) {
  4005. if (typeof opts === "undefined") {
  4006. return true;
  4007. } else {
  4008. return (0, _shallowEqual$1.default)(node, opts);
  4009. }
  4010. }
  4011. return false;
  4012. }
  4013. function isLoop(node, opts) {
  4014. if (!node) return false;
  4015. const nodeType = node.type;
  4016. if ("DoWhileStatement" === nodeType || "ForInStatement" === nodeType || "ForStatement" === nodeType || "WhileStatement" === nodeType || "ForOfStatement" === nodeType) {
  4017. if (typeof opts === "undefined") {
  4018. return true;
  4019. } else {
  4020. return (0, _shallowEqual$1.default)(node, opts);
  4021. }
  4022. }
  4023. return false;
  4024. }
  4025. function isWhile(node, opts) {
  4026. if (!node) return false;
  4027. const nodeType = node.type;
  4028. if ("DoWhileStatement" === nodeType || "WhileStatement" === nodeType) {
  4029. if (typeof opts === "undefined") {
  4030. return true;
  4031. } else {
  4032. return (0, _shallowEqual$1.default)(node, opts);
  4033. }
  4034. }
  4035. return false;
  4036. }
  4037. function isExpressionWrapper(node, opts) {
  4038. if (!node) return false;
  4039. const nodeType = node.type;
  4040. if ("ExpressionStatement" === nodeType || "ParenthesizedExpression" === nodeType || "TypeCastExpression" === nodeType) {
  4041. if (typeof opts === "undefined") {
  4042. return true;
  4043. } else {
  4044. return (0, _shallowEqual$1.default)(node, opts);
  4045. }
  4046. }
  4047. return false;
  4048. }
  4049. function isFor(node, opts) {
  4050. if (!node) return false;
  4051. const nodeType = node.type;
  4052. if ("ForInStatement" === nodeType || "ForStatement" === nodeType || "ForOfStatement" === nodeType) {
  4053. if (typeof opts === "undefined") {
  4054. return true;
  4055. } else {
  4056. return (0, _shallowEqual$1.default)(node, opts);
  4057. }
  4058. }
  4059. return false;
  4060. }
  4061. function isForXStatement(node, opts) {
  4062. if (!node) return false;
  4063. const nodeType = node.type;
  4064. if ("ForInStatement" === nodeType || "ForOfStatement" === nodeType) {
  4065. if (typeof opts === "undefined") {
  4066. return true;
  4067. } else {
  4068. return (0, _shallowEqual$1.default)(node, opts);
  4069. }
  4070. }
  4071. return false;
  4072. }
  4073. function isFunction(node, opts) {
  4074. if (!node) return false;
  4075. const nodeType = node.type;
  4076. if ("FunctionDeclaration" === nodeType || "FunctionExpression" === nodeType || "ObjectMethod" === nodeType || "ArrowFunctionExpression" === nodeType || "ClassMethod" === nodeType || "ClassPrivateMethod" === nodeType) {
  4077. if (typeof opts === "undefined") {
  4078. return true;
  4079. } else {
  4080. return (0, _shallowEqual$1.default)(node, opts);
  4081. }
  4082. }
  4083. return false;
  4084. }
  4085. function isFunctionParent(node, opts) {
  4086. if (!node) return false;
  4087. const nodeType = node.type;
  4088. if ("FunctionDeclaration" === nodeType || "FunctionExpression" === nodeType || "ObjectMethod" === nodeType || "ArrowFunctionExpression" === nodeType || "ClassMethod" === nodeType || "ClassPrivateMethod" === nodeType) {
  4089. if (typeof opts === "undefined") {
  4090. return true;
  4091. } else {
  4092. return (0, _shallowEqual$1.default)(node, opts);
  4093. }
  4094. }
  4095. return false;
  4096. }
  4097. function isPureish(node, opts) {
  4098. if (!node) return false;
  4099. const nodeType = node.type;
  4100. 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) {
  4101. if (typeof opts === "undefined") {
  4102. return true;
  4103. } else {
  4104. return (0, _shallowEqual$1.default)(node, opts);
  4105. }
  4106. }
  4107. return false;
  4108. }
  4109. function isDeclaration(node, opts) {
  4110. if (!node) return false;
  4111. const nodeType = node.type;
  4112. 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) {
  4113. if (typeof opts === "undefined") {
  4114. return true;
  4115. } else {
  4116. return (0, _shallowEqual$1.default)(node, opts);
  4117. }
  4118. }
  4119. return false;
  4120. }
  4121. function isPatternLike(node, opts) {
  4122. if (!node) return false;
  4123. const nodeType = node.type;
  4124. if ("Identifier" === nodeType || "RestElement" === nodeType || "AssignmentPattern" === nodeType || "ArrayPattern" === nodeType || "ObjectPattern" === nodeType || nodeType === "Placeholder" && ("Pattern" === node.expectedNode || "Identifier" === node.expectedNode)) {
  4125. if (typeof opts === "undefined") {
  4126. return true;
  4127. } else {
  4128. return (0, _shallowEqual$1.default)(node, opts);
  4129. }
  4130. }
  4131. return false;
  4132. }
  4133. function isLVal(node, opts) {
  4134. if (!node) return false;
  4135. const nodeType = node.type;
  4136. if ("Identifier" === nodeType || "MemberExpression" === nodeType || "RestElement" === nodeType || "AssignmentPattern" === nodeType || "ArrayPattern" === nodeType || "ObjectPattern" === nodeType || "TSParameterProperty" === nodeType || nodeType === "Placeholder" && ("Pattern" === node.expectedNode || "Identifier" === node.expectedNode)) {
  4137. if (typeof opts === "undefined") {
  4138. return true;
  4139. } else {
  4140. return (0, _shallowEqual$1.default)(node, opts);
  4141. }
  4142. }
  4143. return false;
  4144. }
  4145. function isTSEntityName(node, opts) {
  4146. if (!node) return false;
  4147. const nodeType = node.type;
  4148. if ("Identifier" === nodeType || "TSQualifiedName" === nodeType || nodeType === "Placeholder" && "Identifier" === node.expectedNode) {
  4149. if (typeof opts === "undefined") {
  4150. return true;
  4151. } else {
  4152. return (0, _shallowEqual$1.default)(node, opts);
  4153. }
  4154. }
  4155. return false;
  4156. }
  4157. function isLiteral(node, opts) {
  4158. if (!node) return false;
  4159. const nodeType = node.type;
  4160. if ("StringLiteral" === nodeType || "NumericLiteral" === nodeType || "NullLiteral" === nodeType || "BooleanLiteral" === nodeType || "RegExpLiteral" === nodeType || "TemplateLiteral" === nodeType || "BigIntLiteral" === nodeType || "DecimalLiteral" === nodeType || nodeType === "Placeholder" && "StringLiteral" === node.expectedNode) {
  4161. if (typeof opts === "undefined") {
  4162. return true;
  4163. } else {
  4164. return (0, _shallowEqual$1.default)(node, opts);
  4165. }
  4166. }
  4167. return false;
  4168. }
  4169. function isImmutable$2(node, opts) {
  4170. if (!node) return false;
  4171. const nodeType = node.type;
  4172. 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) {
  4173. if (typeof opts === "undefined") {
  4174. return true;
  4175. } else {
  4176. return (0, _shallowEqual$1.default)(node, opts);
  4177. }
  4178. }
  4179. return false;
  4180. }
  4181. function isUserWhitespacable(node, opts) {
  4182. if (!node) return false;
  4183. const nodeType = node.type;
  4184. if ("ObjectMethod" === nodeType || "ObjectProperty" === nodeType || "ObjectTypeInternalSlot" === nodeType || "ObjectTypeCallProperty" === nodeType || "ObjectTypeIndexer" === nodeType || "ObjectTypeProperty" === nodeType || "ObjectTypeSpreadProperty" === nodeType) {
  4185. if (typeof opts === "undefined") {
  4186. return true;
  4187. } else {
  4188. return (0, _shallowEqual$1.default)(node, opts);
  4189. }
  4190. }
  4191. return false;
  4192. }
  4193. function isMethod(node, opts) {
  4194. if (!node) return false;
  4195. const nodeType = node.type;
  4196. if ("ObjectMethod" === nodeType || "ClassMethod" === nodeType || "ClassPrivateMethod" === nodeType) {
  4197. if (typeof opts === "undefined") {
  4198. return true;
  4199. } else {
  4200. return (0, _shallowEqual$1.default)(node, opts);
  4201. }
  4202. }
  4203. return false;
  4204. }
  4205. function isObjectMember(node, opts) {
  4206. if (!node) return false;
  4207. const nodeType = node.type;
  4208. if ("ObjectMethod" === nodeType || "ObjectProperty" === nodeType) {
  4209. if (typeof opts === "undefined") {
  4210. return true;
  4211. } else {
  4212. return (0, _shallowEqual$1.default)(node, opts);
  4213. }
  4214. }
  4215. return false;
  4216. }
  4217. function isProperty(node, opts) {
  4218. if (!node) return false;
  4219. const nodeType = node.type;
  4220. if ("ObjectProperty" === nodeType || "ClassProperty" === nodeType || "ClassPrivateProperty" === nodeType) {
  4221. if (typeof opts === "undefined") {
  4222. return true;
  4223. } else {
  4224. return (0, _shallowEqual$1.default)(node, opts);
  4225. }
  4226. }
  4227. return false;
  4228. }
  4229. function isUnaryLike(node, opts) {
  4230. if (!node) return false;
  4231. const nodeType = node.type;
  4232. if ("UnaryExpression" === nodeType || "SpreadElement" === nodeType) {
  4233. if (typeof opts === "undefined") {
  4234. return true;
  4235. } else {
  4236. return (0, _shallowEqual$1.default)(node, opts);
  4237. }
  4238. }
  4239. return false;
  4240. }
  4241. function isPattern(node, opts) {
  4242. if (!node) return false;
  4243. const nodeType = node.type;
  4244. if ("AssignmentPattern" === nodeType || "ArrayPattern" === nodeType || "ObjectPattern" === nodeType || nodeType === "Placeholder" && "Pattern" === node.expectedNode) {
  4245. if (typeof opts === "undefined") {
  4246. return true;
  4247. } else {
  4248. return (0, _shallowEqual$1.default)(node, opts);
  4249. }
  4250. }
  4251. return false;
  4252. }
  4253. function isClass(node, opts) {
  4254. if (!node) return false;
  4255. const nodeType = node.type;
  4256. if ("ClassExpression" === nodeType || "ClassDeclaration" === nodeType) {
  4257. if (typeof opts === "undefined") {
  4258. return true;
  4259. } else {
  4260. return (0, _shallowEqual$1.default)(node, opts);
  4261. }
  4262. }
  4263. return false;
  4264. }
  4265. function isModuleDeclaration(node, opts) {
  4266. if (!node) return false;
  4267. const nodeType = node.type;
  4268. if ("ExportAllDeclaration" === nodeType || "ExportDefaultDeclaration" === nodeType || "ExportNamedDeclaration" === nodeType || "ImportDeclaration" === nodeType) {
  4269. if (typeof opts === "undefined") {
  4270. return true;
  4271. } else {
  4272. return (0, _shallowEqual$1.default)(node, opts);
  4273. }
  4274. }
  4275. return false;
  4276. }
  4277. function isExportDeclaration(node, opts) {
  4278. if (!node) return false;
  4279. const nodeType = node.type;
  4280. if ("ExportAllDeclaration" === nodeType || "ExportDefaultDeclaration" === nodeType || "ExportNamedDeclaration" === nodeType) {
  4281. if (typeof opts === "undefined") {
  4282. return true;
  4283. } else {
  4284. return (0, _shallowEqual$1.default)(node, opts);
  4285. }
  4286. }
  4287. return false;
  4288. }
  4289. function isModuleSpecifier(node, opts) {
  4290. if (!node) return false;
  4291. const nodeType = node.type;
  4292. if ("ExportSpecifier" === nodeType || "ImportDefaultSpecifier" === nodeType || "ImportNamespaceSpecifier" === nodeType || "ImportSpecifier" === nodeType || "ExportNamespaceSpecifier" === nodeType || "ExportDefaultSpecifier" === nodeType) {
  4293. if (typeof opts === "undefined") {
  4294. return true;
  4295. } else {
  4296. return (0, _shallowEqual$1.default)(node, opts);
  4297. }
  4298. }
  4299. return false;
  4300. }
  4301. function isPrivate(node, opts) {
  4302. if (!node) return false;
  4303. const nodeType = node.type;
  4304. if ("ClassPrivateProperty" === nodeType || "ClassPrivateMethod" === nodeType || "PrivateName" === nodeType) {
  4305. if (typeof opts === "undefined") {
  4306. return true;
  4307. } else {
  4308. return (0, _shallowEqual$1.default)(node, opts);
  4309. }
  4310. }
  4311. return false;
  4312. }
  4313. function isFlow(node, opts) {
  4314. if (!node) return false;
  4315. const nodeType = node.type;
  4316. 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) {
  4317. if (typeof opts === "undefined") {
  4318. return true;
  4319. } else {
  4320. return (0, _shallowEqual$1.default)(node, opts);
  4321. }
  4322. }
  4323. return false;
  4324. }
  4325. function isFlowType(node, opts) {
  4326. if (!node) return false;
  4327. const nodeType = node.type;
  4328. 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) {
  4329. if (typeof opts === "undefined") {
  4330. return true;
  4331. } else {
  4332. return (0, _shallowEqual$1.default)(node, opts);
  4333. }
  4334. }
  4335. return false;
  4336. }
  4337. function isFlowBaseAnnotation(node, opts) {
  4338. if (!node) return false;
  4339. const nodeType = node.type;
  4340. if ("AnyTypeAnnotation" === nodeType || "BooleanTypeAnnotation" === nodeType || "NullLiteralTypeAnnotation" === nodeType || "MixedTypeAnnotation" === nodeType || "EmptyTypeAnnotation" === nodeType || "NumberTypeAnnotation" === nodeType || "StringTypeAnnotation" === nodeType || "SymbolTypeAnnotation" === nodeType || "ThisTypeAnnotation" === nodeType || "VoidTypeAnnotation" === nodeType) {
  4341. if (typeof opts === "undefined") {
  4342. return true;
  4343. } else {
  4344. return (0, _shallowEqual$1.default)(node, opts);
  4345. }
  4346. }
  4347. return false;
  4348. }
  4349. function isFlowDeclaration(node, opts) {
  4350. if (!node) return false;
  4351. const nodeType = node.type;
  4352. 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) {
  4353. if (typeof opts === "undefined") {
  4354. return true;
  4355. } else {
  4356. return (0, _shallowEqual$1.default)(node, opts);
  4357. }
  4358. }
  4359. return false;
  4360. }
  4361. function isFlowPredicate(node, opts) {
  4362. if (!node) return false;
  4363. const nodeType = node.type;
  4364. if ("DeclaredPredicate" === nodeType || "InferredPredicate" === nodeType) {
  4365. if (typeof opts === "undefined") {
  4366. return true;
  4367. } else {
  4368. return (0, _shallowEqual$1.default)(node, opts);
  4369. }
  4370. }
  4371. return false;
  4372. }
  4373. function isEnumBody(node, opts) {
  4374. if (!node) return false;
  4375. const nodeType = node.type;
  4376. if ("EnumBooleanBody" === nodeType || "EnumNumberBody" === nodeType || "EnumStringBody" === nodeType || "EnumSymbolBody" === nodeType) {
  4377. if (typeof opts === "undefined") {
  4378. return true;
  4379. } else {
  4380. return (0, _shallowEqual$1.default)(node, opts);
  4381. }
  4382. }
  4383. return false;
  4384. }
  4385. function isEnumMember(node, opts) {
  4386. if (!node) return false;
  4387. const nodeType = node.type;
  4388. if ("EnumBooleanMember" === nodeType || "EnumNumberMember" === nodeType || "EnumStringMember" === nodeType || "EnumDefaultedMember" === nodeType) {
  4389. if (typeof opts === "undefined") {
  4390. return true;
  4391. } else {
  4392. return (0, _shallowEqual$1.default)(node, opts);
  4393. }
  4394. }
  4395. return false;
  4396. }
  4397. function isJSX(node, opts) {
  4398. if (!node) return false;
  4399. const nodeType = node.type;
  4400. 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) {
  4401. if (typeof opts === "undefined") {
  4402. return true;
  4403. } else {
  4404. return (0, _shallowEqual$1.default)(node, opts);
  4405. }
  4406. }
  4407. return false;
  4408. }
  4409. function isTSTypeElement(node, opts) {
  4410. if (!node) return false;
  4411. const nodeType = node.type;
  4412. if ("TSCallSignatureDeclaration" === nodeType || "TSConstructSignatureDeclaration" === nodeType || "TSPropertySignature" === nodeType || "TSMethodSignature" === nodeType || "TSIndexSignature" === nodeType) {
  4413. if (typeof opts === "undefined") {
  4414. return true;
  4415. } else {
  4416. return (0, _shallowEqual$1.default)(node, opts);
  4417. }
  4418. }
  4419. return false;
  4420. }
  4421. function isTSType(node, opts) {
  4422. if (!node) return false;
  4423. const nodeType = node.type;
  4424. 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) {
  4425. if (typeof opts === "undefined") {
  4426. return true;
  4427. } else {
  4428. return (0, _shallowEqual$1.default)(node, opts);
  4429. }
  4430. }
  4431. return false;
  4432. }
  4433. function isTSBaseType(node, opts) {
  4434. if (!node) return false;
  4435. const nodeType = node.type;
  4436. 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) {
  4437. if (typeof opts === "undefined") {
  4438. return true;
  4439. } else {
  4440. return (0, _shallowEqual$1.default)(node, opts);
  4441. }
  4442. }
  4443. return false;
  4444. }
  4445. function isNumberLiteral(node, opts) {
  4446. console.trace("The node type NumberLiteral has been renamed to NumericLiteral");
  4447. if (!node) return false;
  4448. const nodeType = node.type;
  4449. if (nodeType === "NumberLiteral") {
  4450. if (typeof opts === "undefined") {
  4451. return true;
  4452. } else {
  4453. return (0, _shallowEqual$1.default)(node, opts);
  4454. }
  4455. }
  4456. return false;
  4457. }
  4458. function isRegexLiteral(node, opts) {
  4459. console.trace("The node type RegexLiteral has been renamed to RegExpLiteral");
  4460. if (!node) return false;
  4461. const nodeType = node.type;
  4462. if (nodeType === "RegexLiteral") {
  4463. if (typeof opts === "undefined") {
  4464. return true;
  4465. } else {
  4466. return (0, _shallowEqual$1.default)(node, opts);
  4467. }
  4468. }
  4469. return false;
  4470. }
  4471. function isRestProperty(node, opts) {
  4472. console.trace("The node type RestProperty has been renamed to RestElement");
  4473. if (!node) return false;
  4474. const nodeType = node.type;
  4475. if (nodeType === "RestProperty") {
  4476. if (typeof opts === "undefined") {
  4477. return true;
  4478. } else {
  4479. return (0, _shallowEqual$1.default)(node, opts);
  4480. }
  4481. }
  4482. return false;
  4483. }
  4484. function isSpreadProperty(node, opts) {
  4485. console.trace("The node type SpreadProperty has been renamed to SpreadElement");
  4486. if (!node) return false;
  4487. const nodeType = node.type;
  4488. if (nodeType === "SpreadProperty") {
  4489. if (typeof opts === "undefined") {
  4490. return true;
  4491. } else {
  4492. return (0, _shallowEqual$1.default)(node, opts);
  4493. }
  4494. }
  4495. return false;
  4496. }
  4497. Object.defineProperty(matchesPattern$1, "__esModule", {
  4498. value: true
  4499. });
  4500. matchesPattern$1.default = matchesPattern;
  4501. var _generated$o = generated$4;
  4502. function matchesPattern(member, match, allowPartial) {
  4503. if (!(0, _generated$o.isMemberExpression)(member)) return false;
  4504. const parts = Array.isArray(match) ? match : match.split(".");
  4505. const nodes = [];
  4506. let node;
  4507. for (node = member; (0, _generated$o.isMemberExpression)(node); node = node.object) {
  4508. nodes.push(node.property);
  4509. }
  4510. nodes.push(node);
  4511. if (nodes.length < parts.length) return false;
  4512. if (!allowPartial && nodes.length > parts.length) return false;
  4513. for (let i = 0, j = nodes.length - 1; i < parts.length; i++, j--) {
  4514. const node = nodes[j];
  4515. let value;
  4516. if ((0, _generated$o.isIdentifier)(node)) {
  4517. value = node.name;
  4518. } else if ((0, _generated$o.isStringLiteral)(node)) {
  4519. value = node.value;
  4520. } else if ((0, _generated$o.isThisExpression)(node)) {
  4521. value = "this";
  4522. } else {
  4523. return false;
  4524. }
  4525. if (parts[i] !== value) return false;
  4526. }
  4527. return true;
  4528. }
  4529. Object.defineProperty(buildMatchMemberExpression$1, "__esModule", {
  4530. value: true
  4531. });
  4532. buildMatchMemberExpression$1.default = buildMatchMemberExpression;
  4533. var _matchesPattern = matchesPattern$1;
  4534. function buildMatchMemberExpression(match, allowPartial) {
  4535. const parts = match.split(".");
  4536. return member => (0, _matchesPattern.default)(member, parts, allowPartial);
  4537. }
  4538. Object.defineProperty(isReactComponent$1, "__esModule", {
  4539. value: true
  4540. });
  4541. isReactComponent$1.default = void 0;
  4542. var _buildMatchMemberExpression = buildMatchMemberExpression$1;
  4543. const isReactComponent = (0, _buildMatchMemberExpression.default)("React.Component");
  4544. var _default$4 = isReactComponent;
  4545. isReactComponent$1.default = _default$4;
  4546. var isCompatTag$1 = {};
  4547. Object.defineProperty(isCompatTag$1, "__esModule", {
  4548. value: true
  4549. });
  4550. isCompatTag$1.default = isCompatTag;
  4551. function isCompatTag(tagName) {
  4552. return !!tagName && /^[a-z]/.test(tagName);
  4553. }
  4554. var buildChildren$1 = {};
  4555. var cleanJSXElementLiteralChild$1 = {};
  4556. var generated$3 = {};
  4557. var builder$1 = {};
  4558. var definitions = {};
  4559. var core = {};
  4560. var is$1 = {};
  4561. var isType$1 = {};
  4562. Object.defineProperty(isType$1, "__esModule", {
  4563. value: true
  4564. });
  4565. isType$1.default = isType;
  4566. var _definitions$a = definitions;
  4567. function isType(nodeType, targetType) {
  4568. if (nodeType === targetType) return true;
  4569. if (_definitions$a.ALIAS_KEYS[targetType]) return false;
  4570. const aliases = _definitions$a.FLIPPED_ALIAS_KEYS[targetType];
  4571. if (aliases) {
  4572. if (aliases[0] === nodeType) return true;
  4573. for (const alias of aliases) {
  4574. if (nodeType === alias) return true;
  4575. }
  4576. }
  4577. return false;
  4578. }
  4579. var isPlaceholderType$1 = {};
  4580. Object.defineProperty(isPlaceholderType$1, "__esModule", {
  4581. value: true
  4582. });
  4583. isPlaceholderType$1.default = isPlaceholderType;
  4584. var _definitions$9 = definitions;
  4585. function isPlaceholderType(placeholderType, targetType) {
  4586. if (placeholderType === targetType) return true;
  4587. const aliases = _definitions$9.PLACEHOLDERS_ALIAS[placeholderType];
  4588. if (aliases) {
  4589. for (const alias of aliases) {
  4590. if (targetType === alias) return true;
  4591. }
  4592. }
  4593. return false;
  4594. }
  4595. Object.defineProperty(is$1, "__esModule", {
  4596. value: true
  4597. });
  4598. is$1.default = is;
  4599. var _shallowEqual = shallowEqual$1;
  4600. var _isType$1 = isType$1;
  4601. var _isPlaceholderType = isPlaceholderType$1;
  4602. var _definitions$8 = definitions;
  4603. function is(type, node, opts) {
  4604. if (!node) return false;
  4605. const matches = (0, _isType$1.default)(node.type, type);
  4606. if (!matches) {
  4607. if (!opts && node.type === "Placeholder" && type in _definitions$8.FLIPPED_ALIAS_KEYS) {
  4608. return (0, _isPlaceholderType.default)(node.expectedNode, type);
  4609. }
  4610. return false;
  4611. }
  4612. if (typeof opts === "undefined") {
  4613. return true;
  4614. } else {
  4615. return (0, _shallowEqual.default)(node, opts);
  4616. }
  4617. }
  4618. var isValidIdentifier$1 = {};
  4619. var lib = {};
  4620. var identifier$1 = {};
  4621. Object.defineProperty(identifier$1, "__esModule", {
  4622. value: true
  4623. });
  4624. identifier$1.isIdentifierStart = isIdentifierStart;
  4625. identifier$1.isIdentifierChar = isIdentifierChar;
  4626. identifier$1.isIdentifierName = isIdentifierName;
  4627. let nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u08a0-\u08b4\u08b6-\u08c7\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\u9ffc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7bf\ua7c2-\ua7ca\ua7f5-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc";
  4628. let nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08d3-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf\u1ac0\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1df9\u1dfb-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f";
  4629. const nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]");
  4630. const nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]");
  4631. nonASCIIidentifierStartChars = nonASCIIidentifierChars = null;
  4632. const astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 157, 310, 10, 21, 11, 7, 153, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 349, 41, 7, 1, 79, 28, 11, 0, 9, 21, 107, 20, 28, 22, 13, 52, 76, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 85, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 230, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 35, 56, 264, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 190, 0, 80, 921, 103, 110, 18, 195, 2749, 1070, 4050, 582, 8634, 568, 8, 30, 114, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 43, 8, 8952, 286, 50, 2, 18, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 2357, 44, 11, 6, 17, 0, 370, 43, 1301, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42717, 35, 4148, 12, 221, 3, 5761, 15, 7472, 3104, 541, 1507, 4938];
  4633. const astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 370, 1, 154, 10, 176, 2, 54, 14, 32, 9, 16, 3, 46, 10, 54, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 161, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 19306, 9, 135, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 5319, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 262, 6, 10, 9, 419, 13, 1495, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];
  4634. function isInAstralSet(code, set) {
  4635. let pos = 0x10000;
  4636. for (let i = 0, length = set.length; i < length; i += 2) {
  4637. pos += set[i];
  4638. if (pos > code) return false;
  4639. pos += set[i + 1];
  4640. if (pos >= code) return true;
  4641. }
  4642. return false;
  4643. }
  4644. function isIdentifierStart(code) {
  4645. if (code < 65) return code === 36;
  4646. if (code <= 90) return true;
  4647. if (code < 97) return code === 95;
  4648. if (code <= 122) return true;
  4649. if (code <= 0xffff) {
  4650. return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code));
  4651. }
  4652. return isInAstralSet(code, astralIdentifierStartCodes);
  4653. }
  4654. function isIdentifierChar(code) {
  4655. if (code < 48) return code === 36;
  4656. if (code < 58) return true;
  4657. if (code < 65) return false;
  4658. if (code <= 90) return true;
  4659. if (code < 97) return code === 95;
  4660. if (code <= 122) return true;
  4661. if (code <= 0xffff) {
  4662. return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code));
  4663. }
  4664. return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes);
  4665. }
  4666. function isIdentifierName(name) {
  4667. let isFirst = true;
  4668. for (let i = 0; i < name.length; i++) {
  4669. let cp = name.charCodeAt(i);
  4670. if ((cp & 0xfc00) === 0xd800 && i + 1 < name.length) {
  4671. const trail = name.charCodeAt(++i);
  4672. if ((trail & 0xfc00) === 0xdc00) {
  4673. cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff);
  4674. }
  4675. }
  4676. if (isFirst) {
  4677. isFirst = false;
  4678. if (!isIdentifierStart(cp)) {
  4679. return false;
  4680. }
  4681. } else if (!isIdentifierChar(cp)) {
  4682. return false;
  4683. }
  4684. }
  4685. return !isFirst;
  4686. }
  4687. var keyword = {};
  4688. Object.defineProperty(keyword, "__esModule", {
  4689. value: true
  4690. });
  4691. keyword.isReservedWord = isReservedWord;
  4692. keyword.isStrictReservedWord = isStrictReservedWord;
  4693. keyword.isStrictBindOnlyReservedWord = isStrictBindOnlyReservedWord;
  4694. keyword.isStrictBindReservedWord = isStrictBindReservedWord;
  4695. keyword.isKeyword = isKeyword;
  4696. const reservedWords = {
  4697. keyword: ["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete"],
  4698. strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"],
  4699. strictBind: ["eval", "arguments"]
  4700. };
  4701. const keywords = new Set(reservedWords.keyword);
  4702. const reservedWordsStrictSet = new Set(reservedWords.strict);
  4703. const reservedWordsStrictBindSet = new Set(reservedWords.strictBind);
  4704. function isReservedWord(word, inModule) {
  4705. return inModule && word === "await" || word === "enum";
  4706. }
  4707. function isStrictReservedWord(word, inModule) {
  4708. return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word);
  4709. }
  4710. function isStrictBindOnlyReservedWord(word) {
  4711. return reservedWordsStrictBindSet.has(word);
  4712. }
  4713. function isStrictBindReservedWord(word, inModule) {
  4714. return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word);
  4715. }
  4716. function isKeyword(word) {
  4717. return keywords.has(word);
  4718. }
  4719. (function (exports) {
  4720. Object.defineProperty(exports, "__esModule", {
  4721. value: true
  4722. });
  4723. Object.defineProperty(exports, "isIdentifierName", {
  4724. enumerable: true,
  4725. get: function () {
  4726. return _identifier.isIdentifierName;
  4727. }
  4728. });
  4729. Object.defineProperty(exports, "isIdentifierChar", {
  4730. enumerable: true,
  4731. get: function () {
  4732. return _identifier.isIdentifierChar;
  4733. }
  4734. });
  4735. Object.defineProperty(exports, "isIdentifierStart", {
  4736. enumerable: true,
  4737. get: function () {
  4738. return _identifier.isIdentifierStart;
  4739. }
  4740. });
  4741. Object.defineProperty(exports, "isReservedWord", {
  4742. enumerable: true,
  4743. get: function () {
  4744. return _keyword.isReservedWord;
  4745. }
  4746. });
  4747. Object.defineProperty(exports, "isStrictBindOnlyReservedWord", {
  4748. enumerable: true,
  4749. get: function () {
  4750. return _keyword.isStrictBindOnlyReservedWord;
  4751. }
  4752. });
  4753. Object.defineProperty(exports, "isStrictBindReservedWord", {
  4754. enumerable: true,
  4755. get: function () {
  4756. return _keyword.isStrictBindReservedWord;
  4757. }
  4758. });
  4759. Object.defineProperty(exports, "isStrictReservedWord", {
  4760. enumerable: true,
  4761. get: function () {
  4762. return _keyword.isStrictReservedWord;
  4763. }
  4764. });
  4765. Object.defineProperty(exports, "isKeyword", {
  4766. enumerable: true,
  4767. get: function () {
  4768. return _keyword.isKeyword;
  4769. }
  4770. });
  4771. var _identifier = identifier$1;
  4772. var _keyword = keyword;
  4773. }(lib));
  4774. Object.defineProperty(isValidIdentifier$1, "__esModule", {
  4775. value: true
  4776. });
  4777. isValidIdentifier$1.default = isValidIdentifier;
  4778. var _helperValidatorIdentifier$2 = lib;
  4779. function isValidIdentifier(name, reserved = true) {
  4780. if (typeof name !== "string") return false;
  4781. if (reserved) {
  4782. if ((0, _helperValidatorIdentifier$2.isKeyword)(name) || (0, _helperValidatorIdentifier$2.isStrictReservedWord)(name, true)) {
  4783. return false;
  4784. }
  4785. }
  4786. return (0, _helperValidatorIdentifier$2.isIdentifierName)(name);
  4787. }
  4788. var constants = {};
  4789. Object.defineProperty(constants, "__esModule", {
  4790. value: true
  4791. });
  4792. 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;
  4793. const STATEMENT_OR_BLOCK_KEYS = ["consequent", "body", "alternate"];
  4794. constants.STATEMENT_OR_BLOCK_KEYS = STATEMENT_OR_BLOCK_KEYS;
  4795. const FLATTENABLE_KEYS = ["body", "expressions"];
  4796. constants.FLATTENABLE_KEYS = FLATTENABLE_KEYS;
  4797. const FOR_INIT_KEYS = ["left", "init"];
  4798. constants.FOR_INIT_KEYS = FOR_INIT_KEYS;
  4799. const COMMENT_KEYS = ["leadingComments", "trailingComments", "innerComments"];
  4800. constants.COMMENT_KEYS = COMMENT_KEYS;
  4801. const LOGICAL_OPERATORS = ["||", "&&", "??"];
  4802. constants.LOGICAL_OPERATORS = LOGICAL_OPERATORS;
  4803. const UPDATE_OPERATORS = ["++", "--"];
  4804. constants.UPDATE_OPERATORS = UPDATE_OPERATORS;
  4805. const BOOLEAN_NUMBER_BINARY_OPERATORS = [">", "<", ">=", "<="];
  4806. constants.BOOLEAN_NUMBER_BINARY_OPERATORS = BOOLEAN_NUMBER_BINARY_OPERATORS;
  4807. const EQUALITY_BINARY_OPERATORS = ["==", "===", "!=", "!=="];
  4808. constants.EQUALITY_BINARY_OPERATORS = EQUALITY_BINARY_OPERATORS;
  4809. const COMPARISON_BINARY_OPERATORS = [...EQUALITY_BINARY_OPERATORS, "in", "instanceof"];
  4810. constants.COMPARISON_BINARY_OPERATORS = COMPARISON_BINARY_OPERATORS;
  4811. const BOOLEAN_BINARY_OPERATORS = [...COMPARISON_BINARY_OPERATORS, ...BOOLEAN_NUMBER_BINARY_OPERATORS];
  4812. constants.BOOLEAN_BINARY_OPERATORS = BOOLEAN_BINARY_OPERATORS;
  4813. const NUMBER_BINARY_OPERATORS = ["-", "/", "%", "*", "**", "&", "|", ">>", ">>>", "<<", "^"];
  4814. constants.NUMBER_BINARY_OPERATORS = NUMBER_BINARY_OPERATORS;
  4815. const BINARY_OPERATORS = ["+", ...NUMBER_BINARY_OPERATORS, ...BOOLEAN_BINARY_OPERATORS];
  4816. constants.BINARY_OPERATORS = BINARY_OPERATORS;
  4817. const ASSIGNMENT_OPERATORS = ["=", "+=", ...NUMBER_BINARY_OPERATORS.map(op => op + "="), ...LOGICAL_OPERATORS.map(op => op + "=")];
  4818. constants.ASSIGNMENT_OPERATORS = ASSIGNMENT_OPERATORS;
  4819. const BOOLEAN_UNARY_OPERATORS = ["delete", "!"];
  4820. constants.BOOLEAN_UNARY_OPERATORS = BOOLEAN_UNARY_OPERATORS;
  4821. const NUMBER_UNARY_OPERATORS = ["+", "-", "~"];
  4822. constants.NUMBER_UNARY_OPERATORS = NUMBER_UNARY_OPERATORS;
  4823. const STRING_UNARY_OPERATORS = ["typeof"];
  4824. constants.STRING_UNARY_OPERATORS = STRING_UNARY_OPERATORS;
  4825. const UNARY_OPERATORS = ["void", "throw", ...BOOLEAN_UNARY_OPERATORS, ...NUMBER_UNARY_OPERATORS, ...STRING_UNARY_OPERATORS];
  4826. constants.UNARY_OPERATORS = UNARY_OPERATORS;
  4827. const INHERIT_KEYS = {
  4828. optional: ["typeAnnotation", "typeParameters", "returnType"],
  4829. force: ["start", "loc", "end"]
  4830. };
  4831. constants.INHERIT_KEYS = INHERIT_KEYS;
  4832. const BLOCK_SCOPED_SYMBOL = Symbol.for("var used to be block scoped");
  4833. constants.BLOCK_SCOPED_SYMBOL = BLOCK_SCOPED_SYMBOL;
  4834. const NOT_LOCAL_BINDING = Symbol.for("should not be considered a local binding");
  4835. constants.NOT_LOCAL_BINDING = NOT_LOCAL_BINDING;
  4836. var utils = {};
  4837. var validate$2 = {};
  4838. Object.defineProperty(validate$2, "__esModule", {
  4839. value: true
  4840. });
  4841. validate$2.default = validate$1;
  4842. validate$2.validateField = validateField;
  4843. validate$2.validateChild = validateChild;
  4844. var _definitions$7 = definitions;
  4845. function validate$1(node, key, val) {
  4846. if (!node) return;
  4847. const fields = _definitions$7.NODE_FIELDS[node.type];
  4848. if (!fields) return;
  4849. const field = fields[key];
  4850. validateField(node, key, val, field);
  4851. validateChild(node, key, val);
  4852. }
  4853. function validateField(node, key, val, field) {
  4854. if (!(field != null && field.validate)) return;
  4855. if (field.optional && val == null) return;
  4856. field.validate(node, key, val);
  4857. }
  4858. function validateChild(node, key, val) {
  4859. if (val == null) return;
  4860. const validate = _definitions$7.NODE_PARENT_VALIDATIONS[val.type];
  4861. if (!validate) return;
  4862. validate(node, key, val);
  4863. }
  4864. Object.defineProperty(utils, "__esModule", {
  4865. value: true
  4866. });
  4867. utils.validate = validate;
  4868. utils.typeIs = typeIs;
  4869. utils.validateType = validateType;
  4870. utils.validateOptional = validateOptional;
  4871. utils.validateOptionalType = validateOptionalType;
  4872. utils.arrayOf = arrayOf;
  4873. utils.arrayOfType = arrayOfType;
  4874. utils.validateArrayOfType = validateArrayOfType;
  4875. utils.assertEach = assertEach;
  4876. utils.assertOneOf = assertOneOf;
  4877. utils.assertNodeType = assertNodeType;
  4878. utils.assertNodeOrValueType = assertNodeOrValueType;
  4879. utils.assertValueType = assertValueType;
  4880. utils.assertShape = assertShape;
  4881. utils.assertOptionalChainStart = assertOptionalChainStart;
  4882. utils.chain = chain;
  4883. utils.default = defineType;
  4884. 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;
  4885. var _is$3 = is$1;
  4886. var _validate$1 = validate$2;
  4887. const VISITOR_KEYS = {};
  4888. utils.VISITOR_KEYS = VISITOR_KEYS;
  4889. const ALIAS_KEYS = {};
  4890. utils.ALIAS_KEYS = ALIAS_KEYS;
  4891. const FLIPPED_ALIAS_KEYS = {};
  4892. utils.FLIPPED_ALIAS_KEYS = FLIPPED_ALIAS_KEYS;
  4893. const NODE_FIELDS = {};
  4894. utils.NODE_FIELDS = NODE_FIELDS;
  4895. const BUILDER_KEYS = {};
  4896. utils.BUILDER_KEYS = BUILDER_KEYS;
  4897. const DEPRECATED_KEYS = {};
  4898. utils.DEPRECATED_KEYS = DEPRECATED_KEYS;
  4899. const NODE_PARENT_VALIDATIONS = {};
  4900. utils.NODE_PARENT_VALIDATIONS = NODE_PARENT_VALIDATIONS;
  4901. function getType(val) {
  4902. if (Array.isArray(val)) {
  4903. return "array";
  4904. } else if (val === null) {
  4905. return "null";
  4906. } else {
  4907. return typeof val;
  4908. }
  4909. }
  4910. function validate(validate) {
  4911. return {
  4912. validate
  4913. };
  4914. }
  4915. function typeIs(typeName) {
  4916. return typeof typeName === "string" ? assertNodeType(typeName) : assertNodeType(...typeName);
  4917. }
  4918. function validateType(typeName) {
  4919. return validate(typeIs(typeName));
  4920. }
  4921. function validateOptional(validate) {
  4922. return {
  4923. validate,
  4924. optional: true
  4925. };
  4926. }
  4927. function validateOptionalType(typeName) {
  4928. return {
  4929. validate: typeIs(typeName),
  4930. optional: true
  4931. };
  4932. }
  4933. function arrayOf(elementType) {
  4934. return chain(assertValueType("array"), assertEach(elementType));
  4935. }
  4936. function arrayOfType(typeName) {
  4937. return arrayOf(typeIs(typeName));
  4938. }
  4939. function validateArrayOfType(typeName) {
  4940. return validate(arrayOfType(typeName));
  4941. }
  4942. function assertEach(callback) {
  4943. function validator(node, key, val) {
  4944. if (!Array.isArray(val)) return;
  4945. for (let i = 0; i < val.length; i++) {
  4946. const subkey = `${key}[${i}]`;
  4947. const v = val[i];
  4948. callback(node, subkey, v);
  4949. if (process.env.BABEL_TYPES_8_BREAKING) (0, _validate$1.validateChild)(node, subkey, v);
  4950. }
  4951. }
  4952. validator.each = callback;
  4953. return validator;
  4954. }
  4955. function assertOneOf(...values) {
  4956. function validate(node, key, val) {
  4957. if (values.indexOf(val) < 0) {
  4958. throw new TypeError(`Property ${key} expected value to be one of ${JSON.stringify(values)} but got ${JSON.stringify(val)}`);
  4959. }
  4960. }
  4961. validate.oneOf = values;
  4962. return validate;
  4963. }
  4964. function assertNodeType(...types) {
  4965. function validate(node, key, val) {
  4966. for (const type of types) {
  4967. if ((0, _is$3.default)(type, val)) {
  4968. (0, _validate$1.validateChild)(node, key, val);
  4969. return;
  4970. }
  4971. }
  4972. 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)}`);
  4973. }
  4974. validate.oneOfNodeTypes = types;
  4975. return validate;
  4976. }
  4977. function assertNodeOrValueType(...types) {
  4978. function validate(node, key, val) {
  4979. for (const type of types) {
  4980. if (getType(val) === type || (0, _is$3.default)(type, val)) {
  4981. (0, _validate$1.validateChild)(node, key, val);
  4982. return;
  4983. }
  4984. }
  4985. 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)}`);
  4986. }
  4987. validate.oneOfNodeOrValueTypes = types;
  4988. return validate;
  4989. }
  4990. function assertValueType(type) {
  4991. function validate(node, key, val) {
  4992. const valid = getType(val) === type;
  4993. if (!valid) {
  4994. throw new TypeError(`Property ${key} expected type of ${type} but got ${getType(val)}`);
  4995. }
  4996. }
  4997. validate.type = type;
  4998. return validate;
  4999. }
  5000. function assertShape(shape) {
  5001. function validate(node, key, val) {
  5002. const errors = [];
  5003. for (const property of Object.keys(shape)) {
  5004. try {
  5005. (0, _validate$1.validateField)(node, property, val[property], shape[property]);
  5006. } catch (error) {
  5007. if (error instanceof TypeError) {
  5008. errors.push(error.message);
  5009. continue;
  5010. }
  5011. throw error;
  5012. }
  5013. }
  5014. if (errors.length) {
  5015. throw new TypeError(`Property ${key} of ${node.type} expected to have the following:\n${errors.join("\n")}`);
  5016. }
  5017. }
  5018. validate.shapeOf = shape;
  5019. return validate;
  5020. }
  5021. function assertOptionalChainStart() {
  5022. function validate(node) {
  5023. var _current;
  5024. let current = node;
  5025. while (node) {
  5026. const {
  5027. type
  5028. } = current;
  5029. if (type === "OptionalCallExpression") {
  5030. if (current.optional) return;
  5031. current = current.callee;
  5032. continue;
  5033. }
  5034. if (type === "OptionalMemberExpression") {
  5035. if (current.optional) return;
  5036. current = current.object;
  5037. continue;
  5038. }
  5039. break;
  5040. }
  5041. 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}`);
  5042. }
  5043. return validate;
  5044. }
  5045. function chain(...fns) {
  5046. function validate(...args) {
  5047. for (const fn of fns) {
  5048. fn(...args);
  5049. }
  5050. }
  5051. validate.chainOf = fns;
  5052. if (fns.length >= 2 && "type" in fns[0] && fns[0].type === "array" && !("each" in fns[1])) {
  5053. throw new Error(`An assertValueType("array") validator can only be followed by an assertEach(...) validator.`);
  5054. }
  5055. return validate;
  5056. }
  5057. const validTypeOpts = ["aliases", "builder", "deprecatedAlias", "fields", "inherits", "visitor", "validate"];
  5058. const validFieldKeys = ["default", "optional", "validate"];
  5059. function defineType(type, opts = {}) {
  5060. const inherits = opts.inherits && store[opts.inherits] || {};
  5061. let fields = opts.fields;
  5062. if (!fields) {
  5063. fields = {};
  5064. if (inherits.fields) {
  5065. const keys = Object.getOwnPropertyNames(inherits.fields);
  5066. for (const key of keys) {
  5067. const field = inherits.fields[key];
  5068. const def = field.default;
  5069. if (Array.isArray(def) ? def.length > 0 : def && typeof def === "object") {
  5070. throw new Error("field defaults can only be primitives or empty arrays currently");
  5071. }
  5072. fields[key] = {
  5073. default: Array.isArray(def) ? [] : def,
  5074. optional: field.optional,
  5075. validate: field.validate
  5076. };
  5077. }
  5078. }
  5079. }
  5080. const visitor = opts.visitor || inherits.visitor || [];
  5081. const aliases = opts.aliases || inherits.aliases || [];
  5082. const builder = opts.builder || inherits.builder || opts.visitor || [];
  5083. for (const k of Object.keys(opts)) {
  5084. if (validTypeOpts.indexOf(k) === -1) {
  5085. throw new Error(`Unknown type option "${k}" on ${type}`);
  5086. }
  5087. }
  5088. if (opts.deprecatedAlias) {
  5089. DEPRECATED_KEYS[opts.deprecatedAlias] = type;
  5090. }
  5091. for (const key of visitor.concat(builder)) {
  5092. fields[key] = fields[key] || {};
  5093. }
  5094. for (const key of Object.keys(fields)) {
  5095. const field = fields[key];
  5096. if (field.default !== undefined && builder.indexOf(key) === -1) {
  5097. field.optional = true;
  5098. }
  5099. if (field.default === undefined) {
  5100. field.default = null;
  5101. } else if (!field.validate && field.default != null) {
  5102. field.validate = assertValueType(getType(field.default));
  5103. }
  5104. for (const k of Object.keys(field)) {
  5105. if (validFieldKeys.indexOf(k) === -1) {
  5106. throw new Error(`Unknown field key "${k}" on ${type}.${key}`);
  5107. }
  5108. }
  5109. }
  5110. VISITOR_KEYS[type] = opts.visitor = visitor;
  5111. BUILDER_KEYS[type] = opts.builder = builder;
  5112. NODE_FIELDS[type] = opts.fields = fields;
  5113. ALIAS_KEYS[type] = opts.aliases = aliases;
  5114. aliases.forEach(alias => {
  5115. FLIPPED_ALIAS_KEYS[alias] = FLIPPED_ALIAS_KEYS[alias] || [];
  5116. FLIPPED_ALIAS_KEYS[alias].push(type);
  5117. });
  5118. if (opts.validate) {
  5119. NODE_PARENT_VALIDATIONS[type] = opts.validate;
  5120. }
  5121. store[type] = opts;
  5122. }
  5123. const store = {};
  5124. Object.defineProperty(core, "__esModule", {
  5125. value: true
  5126. });
  5127. core.classMethodOrDeclareMethodCommon = core.classMethodOrPropertyCommon = core.patternLikeCommon = core.functionDeclarationCommon = core.functionTypeAnnotationCommon = core.functionCommon = void 0;
  5128. var _is$2 = is$1;
  5129. var _isValidIdentifier$3 = isValidIdentifier$1;
  5130. var _helperValidatorIdentifier$1 = lib;
  5131. var _constants$5 = constants;
  5132. var _utils$6 = utils;
  5133. (0, _utils$6.default)("ArrayExpression", {
  5134. fields: {
  5135. elements: {
  5136. validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeOrValueType)("null", "Expression", "SpreadElement"))),
  5137. default: !process.env.BABEL_TYPES_8_BREAKING ? [] : undefined
  5138. }
  5139. },
  5140. visitor: ["elements"],
  5141. aliases: ["Expression"]
  5142. });
  5143. (0, _utils$6.default)("AssignmentExpression", {
  5144. fields: {
  5145. operator: {
  5146. validate: function () {
  5147. if (!process.env.BABEL_TYPES_8_BREAKING) {
  5148. return (0, _utils$6.assertValueType)("string");
  5149. }
  5150. const identifier = (0, _utils$6.assertOneOf)(..._constants$5.ASSIGNMENT_OPERATORS);
  5151. const pattern = (0, _utils$6.assertOneOf)("=");
  5152. return function (node, key, val) {
  5153. const validator = (0, _is$2.default)("Pattern", node.left) ? pattern : identifier;
  5154. validator(node, key, val);
  5155. };
  5156. }()
  5157. },
  5158. left: {
  5159. validate: !process.env.BABEL_TYPES_8_BREAKING ? (0, _utils$6.assertNodeType)("LVal") : (0, _utils$6.assertNodeType)("Identifier", "MemberExpression", "ArrayPattern", "ObjectPattern")
  5160. },
  5161. right: {
  5162. validate: (0, _utils$6.assertNodeType)("Expression")
  5163. }
  5164. },
  5165. builder: ["operator", "left", "right"],
  5166. visitor: ["left", "right"],
  5167. aliases: ["Expression"]
  5168. });
  5169. (0, _utils$6.default)("BinaryExpression", {
  5170. builder: ["operator", "left", "right"],
  5171. fields: {
  5172. operator: {
  5173. validate: (0, _utils$6.assertOneOf)(..._constants$5.BINARY_OPERATORS)
  5174. },
  5175. left: {
  5176. validate: function () {
  5177. const expression = (0, _utils$6.assertNodeType)("Expression");
  5178. const inOp = (0, _utils$6.assertNodeType)("Expression", "PrivateName");
  5179. const validator = function (node, key, val) {
  5180. const validator = node.operator === "in" ? inOp : expression;
  5181. validator(node, key, val);
  5182. };
  5183. validator.oneOfNodeTypes = ["Expression", "PrivateName"];
  5184. return validator;
  5185. }()
  5186. },
  5187. right: {
  5188. validate: (0, _utils$6.assertNodeType)("Expression")
  5189. }
  5190. },
  5191. visitor: ["left", "right"],
  5192. aliases: ["Binary", "Expression"]
  5193. });
  5194. (0, _utils$6.default)("InterpreterDirective", {
  5195. builder: ["value"],
  5196. fields: {
  5197. value: {
  5198. validate: (0, _utils$6.assertValueType)("string")
  5199. }
  5200. }
  5201. });
  5202. (0, _utils$6.default)("Directive", {
  5203. visitor: ["value"],
  5204. fields: {
  5205. value: {
  5206. validate: (0, _utils$6.assertNodeType)("DirectiveLiteral")
  5207. }
  5208. }
  5209. });
  5210. (0, _utils$6.default)("DirectiveLiteral", {
  5211. builder: ["value"],
  5212. fields: {
  5213. value: {
  5214. validate: (0, _utils$6.assertValueType)("string")
  5215. }
  5216. }
  5217. });
  5218. (0, _utils$6.default)("BlockStatement", {
  5219. builder: ["body", "directives"],
  5220. visitor: ["directives", "body"],
  5221. fields: {
  5222. directives: {
  5223. validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("Directive"))),
  5224. default: []
  5225. },
  5226. body: {
  5227. validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("Statement")))
  5228. }
  5229. },
  5230. aliases: ["Scopable", "BlockParent", "Block", "Statement"]
  5231. });
  5232. (0, _utils$6.default)("BreakStatement", {
  5233. visitor: ["label"],
  5234. fields: {
  5235. label: {
  5236. validate: (0, _utils$6.assertNodeType)("Identifier"),
  5237. optional: true
  5238. }
  5239. },
  5240. aliases: ["Statement", "Terminatorless", "CompletionStatement"]
  5241. });
  5242. (0, _utils$6.default)("CallExpression", {
  5243. visitor: ["callee", "arguments", "typeParameters", "typeArguments"],
  5244. builder: ["callee", "arguments"],
  5245. aliases: ["Expression"],
  5246. fields: Object.assign({
  5247. callee: {
  5248. validate: (0, _utils$6.assertNodeType)("Expression", "V8IntrinsicIdentifier")
  5249. },
  5250. arguments: {
  5251. validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("Expression", "SpreadElement", "JSXNamespacedName", "ArgumentPlaceholder")))
  5252. }
  5253. }, !process.env.BABEL_TYPES_8_BREAKING ? {
  5254. optional: {
  5255. validate: (0, _utils$6.assertOneOf)(true, false),
  5256. optional: true
  5257. }
  5258. } : {}, {
  5259. typeArguments: {
  5260. validate: (0, _utils$6.assertNodeType)("TypeParameterInstantiation"),
  5261. optional: true
  5262. },
  5263. typeParameters: {
  5264. validate: (0, _utils$6.assertNodeType)("TSTypeParameterInstantiation"),
  5265. optional: true
  5266. }
  5267. })
  5268. });
  5269. (0, _utils$6.default)("CatchClause", {
  5270. visitor: ["param", "body"],
  5271. fields: {
  5272. param: {
  5273. validate: (0, _utils$6.assertNodeType)("Identifier", "ArrayPattern", "ObjectPattern"),
  5274. optional: true
  5275. },
  5276. body: {
  5277. validate: (0, _utils$6.assertNodeType)("BlockStatement")
  5278. }
  5279. },
  5280. aliases: ["Scopable", "BlockParent"]
  5281. });
  5282. (0, _utils$6.default)("ConditionalExpression", {
  5283. visitor: ["test", "consequent", "alternate"],
  5284. fields: {
  5285. test: {
  5286. validate: (0, _utils$6.assertNodeType)("Expression")
  5287. },
  5288. consequent: {
  5289. validate: (0, _utils$6.assertNodeType)("Expression")
  5290. },
  5291. alternate: {
  5292. validate: (0, _utils$6.assertNodeType)("Expression")
  5293. }
  5294. },
  5295. aliases: ["Expression", "Conditional"]
  5296. });
  5297. (0, _utils$6.default)("ContinueStatement", {
  5298. visitor: ["label"],
  5299. fields: {
  5300. label: {
  5301. validate: (0, _utils$6.assertNodeType)("Identifier"),
  5302. optional: true
  5303. }
  5304. },
  5305. aliases: ["Statement", "Terminatorless", "CompletionStatement"]
  5306. });
  5307. (0, _utils$6.default)("DebuggerStatement", {
  5308. aliases: ["Statement"]
  5309. });
  5310. (0, _utils$6.default)("DoWhileStatement", {
  5311. visitor: ["test", "body"],
  5312. fields: {
  5313. test: {
  5314. validate: (0, _utils$6.assertNodeType)("Expression")
  5315. },
  5316. body: {
  5317. validate: (0, _utils$6.assertNodeType)("Statement")
  5318. }
  5319. },
  5320. aliases: ["Statement", "BlockParent", "Loop", "While", "Scopable"]
  5321. });
  5322. (0, _utils$6.default)("EmptyStatement", {
  5323. aliases: ["Statement"]
  5324. });
  5325. (0, _utils$6.default)("ExpressionStatement", {
  5326. visitor: ["expression"],
  5327. fields: {
  5328. expression: {
  5329. validate: (0, _utils$6.assertNodeType)("Expression")
  5330. }
  5331. },
  5332. aliases: ["Statement", "ExpressionWrapper"]
  5333. });
  5334. (0, _utils$6.default)("File", {
  5335. builder: ["program", "comments", "tokens"],
  5336. visitor: ["program"],
  5337. fields: {
  5338. program: {
  5339. validate: (0, _utils$6.assertNodeType)("Program")
  5340. },
  5341. comments: {
  5342. validate: !process.env.BABEL_TYPES_8_BREAKING ? Object.assign(() => {}, {
  5343. each: {
  5344. oneOfNodeTypes: ["CommentBlock", "CommentLine"]
  5345. }
  5346. }) : (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("CommentBlock", "CommentLine")),
  5347. optional: true
  5348. },
  5349. tokens: {
  5350. validate: (0, _utils$6.assertEach)(Object.assign(() => {}, {
  5351. type: "any"
  5352. })),
  5353. optional: true
  5354. }
  5355. }
  5356. });
  5357. (0, _utils$6.default)("ForInStatement", {
  5358. visitor: ["left", "right", "body"],
  5359. aliases: ["Scopable", "Statement", "For", "BlockParent", "Loop", "ForXStatement"],
  5360. fields: {
  5361. left: {
  5362. validate: !process.env.BABEL_TYPES_8_BREAKING ? (0, _utils$6.assertNodeType)("VariableDeclaration", "LVal") : (0, _utils$6.assertNodeType)("VariableDeclaration", "Identifier", "MemberExpression", "ArrayPattern", "ObjectPattern")
  5363. },
  5364. right: {
  5365. validate: (0, _utils$6.assertNodeType)("Expression")
  5366. },
  5367. body: {
  5368. validate: (0, _utils$6.assertNodeType)("Statement")
  5369. }
  5370. }
  5371. });
  5372. (0, _utils$6.default)("ForStatement", {
  5373. visitor: ["init", "test", "update", "body"],
  5374. aliases: ["Scopable", "Statement", "For", "BlockParent", "Loop"],
  5375. fields: {
  5376. init: {
  5377. validate: (0, _utils$6.assertNodeType)("VariableDeclaration", "Expression"),
  5378. optional: true
  5379. },
  5380. test: {
  5381. validate: (0, _utils$6.assertNodeType)("Expression"),
  5382. optional: true
  5383. },
  5384. update: {
  5385. validate: (0, _utils$6.assertNodeType)("Expression"),
  5386. optional: true
  5387. },
  5388. body: {
  5389. validate: (0, _utils$6.assertNodeType)("Statement")
  5390. }
  5391. }
  5392. });
  5393. const functionCommon = {
  5394. params: {
  5395. validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("Identifier", "Pattern", "RestElement")))
  5396. },
  5397. generator: {
  5398. default: false
  5399. },
  5400. async: {
  5401. default: false
  5402. }
  5403. };
  5404. core.functionCommon = functionCommon;
  5405. const functionTypeAnnotationCommon = {
  5406. returnType: {
  5407. validate: (0, _utils$6.assertNodeType)("TypeAnnotation", "TSTypeAnnotation", "Noop"),
  5408. optional: true
  5409. },
  5410. typeParameters: {
  5411. validate: (0, _utils$6.assertNodeType)("TypeParameterDeclaration", "TSTypeParameterDeclaration", "Noop"),
  5412. optional: true
  5413. }
  5414. };
  5415. core.functionTypeAnnotationCommon = functionTypeAnnotationCommon;
  5416. const functionDeclarationCommon = Object.assign({}, functionCommon, {
  5417. declare: {
  5418. validate: (0, _utils$6.assertValueType)("boolean"),
  5419. optional: true
  5420. },
  5421. id: {
  5422. validate: (0, _utils$6.assertNodeType)("Identifier"),
  5423. optional: true
  5424. }
  5425. });
  5426. core.functionDeclarationCommon = functionDeclarationCommon;
  5427. (0, _utils$6.default)("FunctionDeclaration", {
  5428. builder: ["id", "params", "body", "generator", "async"],
  5429. visitor: ["id", "params", "body", "returnType", "typeParameters"],
  5430. fields: Object.assign({}, functionDeclarationCommon, functionTypeAnnotationCommon, {
  5431. body: {
  5432. validate: (0, _utils$6.assertNodeType)("BlockStatement")
  5433. }
  5434. }),
  5435. aliases: ["Scopable", "Function", "BlockParent", "FunctionParent", "Statement", "Pureish", "Declaration"],
  5436. validate: function () {
  5437. if (!process.env.BABEL_TYPES_8_BREAKING) return () => {};
  5438. const identifier = (0, _utils$6.assertNodeType)("Identifier");
  5439. return function (parent, key, node) {
  5440. if (!(0, _is$2.default)("ExportDefaultDeclaration", parent)) {
  5441. identifier(node, "id", node.id);
  5442. }
  5443. };
  5444. }()
  5445. });
  5446. (0, _utils$6.default)("FunctionExpression", {
  5447. inherits: "FunctionDeclaration",
  5448. aliases: ["Scopable", "Function", "BlockParent", "FunctionParent", "Expression", "Pureish"],
  5449. fields: Object.assign({}, functionCommon, functionTypeAnnotationCommon, {
  5450. id: {
  5451. validate: (0, _utils$6.assertNodeType)("Identifier"),
  5452. optional: true
  5453. },
  5454. body: {
  5455. validate: (0, _utils$6.assertNodeType)("BlockStatement")
  5456. }
  5457. })
  5458. });
  5459. const patternLikeCommon = {
  5460. typeAnnotation: {
  5461. validate: (0, _utils$6.assertNodeType)("TypeAnnotation", "TSTypeAnnotation", "Noop"),
  5462. optional: true
  5463. },
  5464. decorators: {
  5465. validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("Decorator")))
  5466. }
  5467. };
  5468. core.patternLikeCommon = patternLikeCommon;
  5469. (0, _utils$6.default)("Identifier", {
  5470. builder: ["name"],
  5471. visitor: ["typeAnnotation", "decorators"],
  5472. aliases: ["Expression", "PatternLike", "LVal", "TSEntityName"],
  5473. fields: Object.assign({}, patternLikeCommon, {
  5474. name: {
  5475. validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("string"), Object.assign(function (node, key, val) {
  5476. if (!process.env.BABEL_TYPES_8_BREAKING) return;
  5477. if (!(0, _isValidIdentifier$3.default)(val, false)) {
  5478. throw new TypeError(`"${val}" is not a valid identifier name`);
  5479. }
  5480. }, {
  5481. type: "string"
  5482. }))
  5483. },
  5484. optional: {
  5485. validate: (0, _utils$6.assertValueType)("boolean"),
  5486. optional: true
  5487. }
  5488. }),
  5489. validate(parent, key, node) {
  5490. if (!process.env.BABEL_TYPES_8_BREAKING) return;
  5491. const match = /\.(\w+)$/.exec(key);
  5492. if (!match) return;
  5493. const [, parentKey] = match;
  5494. const nonComp = {
  5495. computed: false
  5496. };
  5497. if (parentKey === "property") {
  5498. if ((0, _is$2.default)("MemberExpression", parent, nonComp)) return;
  5499. if ((0, _is$2.default)("OptionalMemberExpression", parent, nonComp)) return;
  5500. } else if (parentKey === "key") {
  5501. if ((0, _is$2.default)("Property", parent, nonComp)) return;
  5502. if ((0, _is$2.default)("Method", parent, nonComp)) return;
  5503. } else if (parentKey === "exported") {
  5504. if ((0, _is$2.default)("ExportSpecifier", parent)) return;
  5505. } else if (parentKey === "imported") {
  5506. if ((0, _is$2.default)("ImportSpecifier", parent, {
  5507. imported: node
  5508. })) return;
  5509. } else if (parentKey === "meta") {
  5510. if ((0, _is$2.default)("MetaProperty", parent, {
  5511. meta: node
  5512. })) return;
  5513. }
  5514. if (((0, _helperValidatorIdentifier$1.isKeyword)(node.name) || (0, _helperValidatorIdentifier$1.isReservedWord)(node.name, false)) && node.name !== "this") {
  5515. throw new TypeError(`"${node.name}" is not a valid identifier`);
  5516. }
  5517. }
  5518. });
  5519. (0, _utils$6.default)("IfStatement", {
  5520. visitor: ["test", "consequent", "alternate"],
  5521. aliases: ["Statement", "Conditional"],
  5522. fields: {
  5523. test: {
  5524. validate: (0, _utils$6.assertNodeType)("Expression")
  5525. },
  5526. consequent: {
  5527. validate: (0, _utils$6.assertNodeType)("Statement")
  5528. },
  5529. alternate: {
  5530. optional: true,
  5531. validate: (0, _utils$6.assertNodeType)("Statement")
  5532. }
  5533. }
  5534. });
  5535. (0, _utils$6.default)("LabeledStatement", {
  5536. visitor: ["label", "body"],
  5537. aliases: ["Statement"],
  5538. fields: {
  5539. label: {
  5540. validate: (0, _utils$6.assertNodeType)("Identifier")
  5541. },
  5542. body: {
  5543. validate: (0, _utils$6.assertNodeType)("Statement")
  5544. }
  5545. }
  5546. });
  5547. (0, _utils$6.default)("StringLiteral", {
  5548. builder: ["value"],
  5549. fields: {
  5550. value: {
  5551. validate: (0, _utils$6.assertValueType)("string")
  5552. }
  5553. },
  5554. aliases: ["Expression", "Pureish", "Literal", "Immutable"]
  5555. });
  5556. (0, _utils$6.default)("NumericLiteral", {
  5557. builder: ["value"],
  5558. deprecatedAlias: "NumberLiteral",
  5559. fields: {
  5560. value: {
  5561. validate: (0, _utils$6.assertValueType)("number")
  5562. }
  5563. },
  5564. aliases: ["Expression", "Pureish", "Literal", "Immutable"]
  5565. });
  5566. (0, _utils$6.default)("NullLiteral", {
  5567. aliases: ["Expression", "Pureish", "Literal", "Immutable"]
  5568. });
  5569. (0, _utils$6.default)("BooleanLiteral", {
  5570. builder: ["value"],
  5571. fields: {
  5572. value: {
  5573. validate: (0, _utils$6.assertValueType)("boolean")
  5574. }
  5575. },
  5576. aliases: ["Expression", "Pureish", "Literal", "Immutable"]
  5577. });
  5578. (0, _utils$6.default)("RegExpLiteral", {
  5579. builder: ["pattern", "flags"],
  5580. deprecatedAlias: "RegexLiteral",
  5581. aliases: ["Expression", "Pureish", "Literal"],
  5582. fields: {
  5583. pattern: {
  5584. validate: (0, _utils$6.assertValueType)("string")
  5585. },
  5586. flags: {
  5587. validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("string"), Object.assign(function (node, key, val) {
  5588. if (!process.env.BABEL_TYPES_8_BREAKING) return;
  5589. const invalid = /[^gimsuy]/.exec(val);
  5590. if (invalid) {
  5591. throw new TypeError(`"${invalid[0]}" is not a valid RegExp flag`);
  5592. }
  5593. }, {
  5594. type: "string"
  5595. })),
  5596. default: ""
  5597. }
  5598. }
  5599. });
  5600. (0, _utils$6.default)("LogicalExpression", {
  5601. builder: ["operator", "left", "right"],
  5602. visitor: ["left", "right"],
  5603. aliases: ["Binary", "Expression"],
  5604. fields: {
  5605. operator: {
  5606. validate: (0, _utils$6.assertOneOf)(..._constants$5.LOGICAL_OPERATORS)
  5607. },
  5608. left: {
  5609. validate: (0, _utils$6.assertNodeType)("Expression")
  5610. },
  5611. right: {
  5612. validate: (0, _utils$6.assertNodeType)("Expression")
  5613. }
  5614. }
  5615. });
  5616. (0, _utils$6.default)("MemberExpression", {
  5617. builder: ["object", "property", "computed", ...(!process.env.BABEL_TYPES_8_BREAKING ? ["optional"] : [])],
  5618. visitor: ["object", "property"],
  5619. aliases: ["Expression", "LVal"],
  5620. fields: Object.assign({
  5621. object: {
  5622. validate: (0, _utils$6.assertNodeType)("Expression")
  5623. },
  5624. property: {
  5625. validate: function () {
  5626. const normal = (0, _utils$6.assertNodeType)("Identifier", "PrivateName");
  5627. const computed = (0, _utils$6.assertNodeType)("Expression");
  5628. const validator = function (node, key, val) {
  5629. const validator = node.computed ? computed : normal;
  5630. validator(node, key, val);
  5631. };
  5632. validator.oneOfNodeTypes = ["Expression", "Identifier", "PrivateName"];
  5633. return validator;
  5634. }()
  5635. },
  5636. computed: {
  5637. default: false
  5638. }
  5639. }, !process.env.BABEL_TYPES_8_BREAKING ? {
  5640. optional: {
  5641. validate: (0, _utils$6.assertOneOf)(true, false),
  5642. optional: true
  5643. }
  5644. } : {})
  5645. });
  5646. (0, _utils$6.default)("NewExpression", {
  5647. inherits: "CallExpression"
  5648. });
  5649. (0, _utils$6.default)("Program", {
  5650. visitor: ["directives", "body"],
  5651. builder: ["body", "directives", "sourceType", "interpreter"],
  5652. fields: {
  5653. sourceFile: {
  5654. validate: (0, _utils$6.assertValueType)("string")
  5655. },
  5656. sourceType: {
  5657. validate: (0, _utils$6.assertOneOf)("script", "module"),
  5658. default: "script"
  5659. },
  5660. interpreter: {
  5661. validate: (0, _utils$6.assertNodeType)("InterpreterDirective"),
  5662. default: null,
  5663. optional: true
  5664. },
  5665. directives: {
  5666. validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("Directive"))),
  5667. default: []
  5668. },
  5669. body: {
  5670. validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("Statement")))
  5671. }
  5672. },
  5673. aliases: ["Scopable", "BlockParent", "Block"]
  5674. });
  5675. (0, _utils$6.default)("ObjectExpression", {
  5676. visitor: ["properties"],
  5677. aliases: ["Expression"],
  5678. fields: {
  5679. properties: {
  5680. validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("ObjectMethod", "ObjectProperty", "SpreadElement")))
  5681. }
  5682. }
  5683. });
  5684. (0, _utils$6.default)("ObjectMethod", {
  5685. builder: ["kind", "key", "params", "body", "computed", "generator", "async"],
  5686. fields: Object.assign({}, functionCommon, functionTypeAnnotationCommon, {
  5687. kind: Object.assign({
  5688. validate: (0, _utils$6.assertOneOf)("method", "get", "set")
  5689. }, !process.env.BABEL_TYPES_8_BREAKING ? {
  5690. default: "method"
  5691. } : {}),
  5692. computed: {
  5693. default: false
  5694. },
  5695. key: {
  5696. validate: function () {
  5697. const normal = (0, _utils$6.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral");
  5698. const computed = (0, _utils$6.assertNodeType)("Expression");
  5699. const validator = function (node, key, val) {
  5700. const validator = node.computed ? computed : normal;
  5701. validator(node, key, val);
  5702. };
  5703. validator.oneOfNodeTypes = ["Expression", "Identifier", "StringLiteral", "NumericLiteral"];
  5704. return validator;
  5705. }()
  5706. },
  5707. decorators: {
  5708. validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("Decorator"))),
  5709. optional: true
  5710. },
  5711. body: {
  5712. validate: (0, _utils$6.assertNodeType)("BlockStatement")
  5713. }
  5714. }),
  5715. visitor: ["key", "params", "body", "decorators", "returnType", "typeParameters"],
  5716. aliases: ["UserWhitespacable", "Function", "Scopable", "BlockParent", "FunctionParent", "Method", "ObjectMember"]
  5717. });
  5718. (0, _utils$6.default)("ObjectProperty", {
  5719. builder: ["key", "value", "computed", "shorthand", ...(!process.env.BABEL_TYPES_8_BREAKING ? ["decorators"] : [])],
  5720. fields: {
  5721. computed: {
  5722. default: false
  5723. },
  5724. key: {
  5725. validate: function () {
  5726. const normal = (0, _utils$6.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral");
  5727. const computed = (0, _utils$6.assertNodeType)("Expression");
  5728. const validator = function (node, key, val) {
  5729. const validator = node.computed ? computed : normal;
  5730. validator(node, key, val);
  5731. };
  5732. validator.oneOfNodeTypes = ["Expression", "Identifier", "StringLiteral", "NumericLiteral"];
  5733. return validator;
  5734. }()
  5735. },
  5736. value: {
  5737. validate: (0, _utils$6.assertNodeType)("Expression", "PatternLike")
  5738. },
  5739. shorthand: {
  5740. validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("boolean"), Object.assign(function (node, key, val) {
  5741. if (!process.env.BABEL_TYPES_8_BREAKING) return;
  5742. if (val && node.computed) {
  5743. throw new TypeError("Property shorthand of ObjectProperty cannot be true if computed is true");
  5744. }
  5745. }, {
  5746. type: "boolean"
  5747. }), function (node, key, val) {
  5748. if (!process.env.BABEL_TYPES_8_BREAKING) return;
  5749. if (val && !(0, _is$2.default)("Identifier", node.key)) {
  5750. throw new TypeError("Property shorthand of ObjectProperty cannot be true if key is not an Identifier");
  5751. }
  5752. }),
  5753. default: false
  5754. },
  5755. decorators: {
  5756. validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("Decorator"))),
  5757. optional: true
  5758. }
  5759. },
  5760. visitor: ["key", "value", "decorators"],
  5761. aliases: ["UserWhitespacable", "Property", "ObjectMember"],
  5762. validate: function () {
  5763. const pattern = (0, _utils$6.assertNodeType)("Identifier", "Pattern");
  5764. const expression = (0, _utils$6.assertNodeType)("Expression");
  5765. return function (parent, key, node) {
  5766. if (!process.env.BABEL_TYPES_8_BREAKING) return;
  5767. const validator = (0, _is$2.default)("ObjectPattern", parent) ? pattern : expression;
  5768. validator(node, "value", node.value);
  5769. };
  5770. }()
  5771. });
  5772. (0, _utils$6.default)("RestElement", {
  5773. visitor: ["argument", "typeAnnotation"],
  5774. builder: ["argument"],
  5775. aliases: ["LVal", "PatternLike"],
  5776. deprecatedAlias: "RestProperty",
  5777. fields: Object.assign({}, patternLikeCommon, {
  5778. argument: {
  5779. validate: !process.env.BABEL_TYPES_8_BREAKING ? (0, _utils$6.assertNodeType)("LVal") : (0, _utils$6.assertNodeType)("Identifier", "Pattern", "MemberExpression")
  5780. },
  5781. optional: {
  5782. validate: (0, _utils$6.assertValueType)("boolean"),
  5783. optional: true
  5784. }
  5785. }),
  5786. validate(parent, key) {
  5787. if (!process.env.BABEL_TYPES_8_BREAKING) return;
  5788. const match = /(\w+)\[(\d+)\]/.exec(key);
  5789. if (!match) throw new Error("Internal Babel error: malformed key.");
  5790. const [, listKey, index] = match;
  5791. if (parent[listKey].length > index + 1) {
  5792. throw new TypeError(`RestElement must be last element of ${listKey}`);
  5793. }
  5794. }
  5795. });
  5796. (0, _utils$6.default)("ReturnStatement", {
  5797. visitor: ["argument"],
  5798. aliases: ["Statement", "Terminatorless", "CompletionStatement"],
  5799. fields: {
  5800. argument: {
  5801. validate: (0, _utils$6.assertNodeType)("Expression"),
  5802. optional: true
  5803. }
  5804. }
  5805. });
  5806. (0, _utils$6.default)("SequenceExpression", {
  5807. visitor: ["expressions"],
  5808. fields: {
  5809. expressions: {
  5810. validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("Expression")))
  5811. }
  5812. },
  5813. aliases: ["Expression"]
  5814. });
  5815. (0, _utils$6.default)("ParenthesizedExpression", {
  5816. visitor: ["expression"],
  5817. aliases: ["Expression", "ExpressionWrapper"],
  5818. fields: {
  5819. expression: {
  5820. validate: (0, _utils$6.assertNodeType)("Expression")
  5821. }
  5822. }
  5823. });
  5824. (0, _utils$6.default)("SwitchCase", {
  5825. visitor: ["test", "consequent"],
  5826. fields: {
  5827. test: {
  5828. validate: (0, _utils$6.assertNodeType)("Expression"),
  5829. optional: true
  5830. },
  5831. consequent: {
  5832. validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("Statement")))
  5833. }
  5834. }
  5835. });
  5836. (0, _utils$6.default)("SwitchStatement", {
  5837. visitor: ["discriminant", "cases"],
  5838. aliases: ["Statement", "BlockParent", "Scopable"],
  5839. fields: {
  5840. discriminant: {
  5841. validate: (0, _utils$6.assertNodeType)("Expression")
  5842. },
  5843. cases: {
  5844. validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("SwitchCase")))
  5845. }
  5846. }
  5847. });
  5848. (0, _utils$6.default)("ThisExpression", {
  5849. aliases: ["Expression"]
  5850. });
  5851. (0, _utils$6.default)("ThrowStatement", {
  5852. visitor: ["argument"],
  5853. aliases: ["Statement", "Terminatorless", "CompletionStatement"],
  5854. fields: {
  5855. argument: {
  5856. validate: (0, _utils$6.assertNodeType)("Expression")
  5857. }
  5858. }
  5859. });
  5860. (0, _utils$6.default)("TryStatement", {
  5861. visitor: ["block", "handler", "finalizer"],
  5862. aliases: ["Statement"],
  5863. fields: {
  5864. block: {
  5865. validate: (0, _utils$6.chain)((0, _utils$6.assertNodeType)("BlockStatement"), Object.assign(function (node) {
  5866. if (!process.env.BABEL_TYPES_8_BREAKING) return;
  5867. if (!node.handler && !node.finalizer) {
  5868. throw new TypeError("TryStatement expects either a handler or finalizer, or both");
  5869. }
  5870. }, {
  5871. oneOfNodeTypes: ["BlockStatement"]
  5872. }))
  5873. },
  5874. handler: {
  5875. optional: true,
  5876. validate: (0, _utils$6.assertNodeType)("CatchClause")
  5877. },
  5878. finalizer: {
  5879. optional: true,
  5880. validate: (0, _utils$6.assertNodeType)("BlockStatement")
  5881. }
  5882. }
  5883. });
  5884. (0, _utils$6.default)("UnaryExpression", {
  5885. builder: ["operator", "argument", "prefix"],
  5886. fields: {
  5887. prefix: {
  5888. default: true
  5889. },
  5890. argument: {
  5891. validate: (0, _utils$6.assertNodeType)("Expression")
  5892. },
  5893. operator: {
  5894. validate: (0, _utils$6.assertOneOf)(..._constants$5.UNARY_OPERATORS)
  5895. }
  5896. },
  5897. visitor: ["argument"],
  5898. aliases: ["UnaryLike", "Expression"]
  5899. });
  5900. (0, _utils$6.default)("UpdateExpression", {
  5901. builder: ["operator", "argument", "prefix"],
  5902. fields: {
  5903. prefix: {
  5904. default: false
  5905. },
  5906. argument: {
  5907. validate: !process.env.BABEL_TYPES_8_BREAKING ? (0, _utils$6.assertNodeType)("Expression") : (0, _utils$6.assertNodeType)("Identifier", "MemberExpression")
  5908. },
  5909. operator: {
  5910. validate: (0, _utils$6.assertOneOf)(..._constants$5.UPDATE_OPERATORS)
  5911. }
  5912. },
  5913. visitor: ["argument"],
  5914. aliases: ["Expression"]
  5915. });
  5916. (0, _utils$6.default)("VariableDeclaration", {
  5917. builder: ["kind", "declarations"],
  5918. visitor: ["declarations"],
  5919. aliases: ["Statement", "Declaration"],
  5920. fields: {
  5921. declare: {
  5922. validate: (0, _utils$6.assertValueType)("boolean"),
  5923. optional: true
  5924. },
  5925. kind: {
  5926. validate: (0, _utils$6.assertOneOf)("var", "let", "const")
  5927. },
  5928. declarations: {
  5929. validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("VariableDeclarator")))
  5930. }
  5931. },
  5932. validate(parent, key, node) {
  5933. if (!process.env.BABEL_TYPES_8_BREAKING) return;
  5934. if (!(0, _is$2.default)("ForXStatement", parent, {
  5935. left: node
  5936. })) return;
  5937. if (node.declarations.length !== 1) {
  5938. throw new TypeError(`Exactly one VariableDeclarator is required in the VariableDeclaration of a ${parent.type}`);
  5939. }
  5940. }
  5941. });
  5942. (0, _utils$6.default)("VariableDeclarator", {
  5943. visitor: ["id", "init"],
  5944. fields: {
  5945. id: {
  5946. validate: function () {
  5947. if (!process.env.BABEL_TYPES_8_BREAKING) {
  5948. return (0, _utils$6.assertNodeType)("LVal");
  5949. }
  5950. const normal = (0, _utils$6.assertNodeType)("Identifier", "ArrayPattern", "ObjectPattern");
  5951. const without = (0, _utils$6.assertNodeType)("Identifier");
  5952. return function (node, key, val) {
  5953. const validator = node.init ? normal : without;
  5954. validator(node, key, val);
  5955. };
  5956. }()
  5957. },
  5958. definite: {
  5959. optional: true,
  5960. validate: (0, _utils$6.assertValueType)("boolean")
  5961. },
  5962. init: {
  5963. optional: true,
  5964. validate: (0, _utils$6.assertNodeType)("Expression")
  5965. }
  5966. }
  5967. });
  5968. (0, _utils$6.default)("WhileStatement", {
  5969. visitor: ["test", "body"],
  5970. aliases: ["Statement", "BlockParent", "Loop", "While", "Scopable"],
  5971. fields: {
  5972. test: {
  5973. validate: (0, _utils$6.assertNodeType)("Expression")
  5974. },
  5975. body: {
  5976. validate: (0, _utils$6.assertNodeType)("Statement")
  5977. }
  5978. }
  5979. });
  5980. (0, _utils$6.default)("WithStatement", {
  5981. visitor: ["object", "body"],
  5982. aliases: ["Statement"],
  5983. fields: {
  5984. object: {
  5985. validate: (0, _utils$6.assertNodeType)("Expression")
  5986. },
  5987. body: {
  5988. validate: (0, _utils$6.assertNodeType)("Statement")
  5989. }
  5990. }
  5991. });
  5992. (0, _utils$6.default)("AssignmentPattern", {
  5993. visitor: ["left", "right", "decorators"],
  5994. builder: ["left", "right"],
  5995. aliases: ["Pattern", "PatternLike", "LVal"],
  5996. fields: Object.assign({}, patternLikeCommon, {
  5997. left: {
  5998. validate: (0, _utils$6.assertNodeType)("Identifier", "ObjectPattern", "ArrayPattern", "MemberExpression")
  5999. },
  6000. right: {
  6001. validate: (0, _utils$6.assertNodeType)("Expression")
  6002. },
  6003. decorators: {
  6004. validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("Decorator"))),
  6005. optional: true
  6006. }
  6007. })
  6008. });
  6009. (0, _utils$6.default)("ArrayPattern", {
  6010. visitor: ["elements", "typeAnnotation"],
  6011. builder: ["elements"],
  6012. aliases: ["Pattern", "PatternLike", "LVal"],
  6013. fields: Object.assign({}, patternLikeCommon, {
  6014. elements: {
  6015. validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeOrValueType)("null", "PatternLike")))
  6016. },
  6017. decorators: {
  6018. validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("Decorator"))),
  6019. optional: true
  6020. },
  6021. optional: {
  6022. validate: (0, _utils$6.assertValueType)("boolean"),
  6023. optional: true
  6024. }
  6025. })
  6026. });
  6027. (0, _utils$6.default)("ArrowFunctionExpression", {
  6028. builder: ["params", "body", "async"],
  6029. visitor: ["params", "body", "returnType", "typeParameters"],
  6030. aliases: ["Scopable", "Function", "BlockParent", "FunctionParent", "Expression", "Pureish"],
  6031. fields: Object.assign({}, functionCommon, functionTypeAnnotationCommon, {
  6032. expression: {
  6033. validate: (0, _utils$6.assertValueType)("boolean")
  6034. },
  6035. body: {
  6036. validate: (0, _utils$6.assertNodeType)("BlockStatement", "Expression")
  6037. }
  6038. })
  6039. });
  6040. (0, _utils$6.default)("ClassBody", {
  6041. visitor: ["body"],
  6042. fields: {
  6043. body: {
  6044. validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("ClassMethod", "ClassPrivateMethod", "ClassProperty", "ClassPrivateProperty", "TSDeclareMethod", "TSIndexSignature")))
  6045. }
  6046. }
  6047. });
  6048. (0, _utils$6.default)("ClassExpression", {
  6049. builder: ["id", "superClass", "body", "decorators"],
  6050. visitor: ["id", "body", "superClass", "mixins", "typeParameters", "superTypeParameters", "implements", "decorators"],
  6051. aliases: ["Scopable", "Class", "Expression"],
  6052. fields: {
  6053. id: {
  6054. validate: (0, _utils$6.assertNodeType)("Identifier"),
  6055. optional: true
  6056. },
  6057. typeParameters: {
  6058. validate: (0, _utils$6.assertNodeType)("TypeParameterDeclaration", "TSTypeParameterDeclaration", "Noop"),
  6059. optional: true
  6060. },
  6061. body: {
  6062. validate: (0, _utils$6.assertNodeType)("ClassBody")
  6063. },
  6064. superClass: {
  6065. optional: true,
  6066. validate: (0, _utils$6.assertNodeType)("Expression")
  6067. },
  6068. superTypeParameters: {
  6069. validate: (0, _utils$6.assertNodeType)("TypeParameterInstantiation", "TSTypeParameterInstantiation"),
  6070. optional: true
  6071. },
  6072. implements: {
  6073. validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("TSExpressionWithTypeArguments", "ClassImplements"))),
  6074. optional: true
  6075. },
  6076. decorators: {
  6077. validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("Decorator"))),
  6078. optional: true
  6079. },
  6080. mixins: {
  6081. validate: (0, _utils$6.assertNodeType)("InterfaceExtends"),
  6082. optional: true
  6083. }
  6084. }
  6085. });
  6086. (0, _utils$6.default)("ClassDeclaration", {
  6087. inherits: "ClassExpression",
  6088. aliases: ["Scopable", "Class", "Statement", "Declaration"],
  6089. fields: {
  6090. id: {
  6091. validate: (0, _utils$6.assertNodeType)("Identifier")
  6092. },
  6093. typeParameters: {
  6094. validate: (0, _utils$6.assertNodeType)("TypeParameterDeclaration", "TSTypeParameterDeclaration", "Noop"),
  6095. optional: true
  6096. },
  6097. body: {
  6098. validate: (0, _utils$6.assertNodeType)("ClassBody")
  6099. },
  6100. superClass: {
  6101. optional: true,
  6102. validate: (0, _utils$6.assertNodeType)("Expression")
  6103. },
  6104. superTypeParameters: {
  6105. validate: (0, _utils$6.assertNodeType)("TypeParameterInstantiation", "TSTypeParameterInstantiation"),
  6106. optional: true
  6107. },
  6108. implements: {
  6109. validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("TSExpressionWithTypeArguments", "ClassImplements"))),
  6110. optional: true
  6111. },
  6112. decorators: {
  6113. validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("Decorator"))),
  6114. optional: true
  6115. },
  6116. mixins: {
  6117. validate: (0, _utils$6.assertNodeType)("InterfaceExtends"),
  6118. optional: true
  6119. },
  6120. declare: {
  6121. validate: (0, _utils$6.assertValueType)("boolean"),
  6122. optional: true
  6123. },
  6124. abstract: {
  6125. validate: (0, _utils$6.assertValueType)("boolean"),
  6126. optional: true
  6127. }
  6128. },
  6129. validate: function () {
  6130. const identifier = (0, _utils$6.assertNodeType)("Identifier");
  6131. return function (parent, key, node) {
  6132. if (!process.env.BABEL_TYPES_8_BREAKING) return;
  6133. if (!(0, _is$2.default)("ExportDefaultDeclaration", parent)) {
  6134. identifier(node, "id", node.id);
  6135. }
  6136. };
  6137. }()
  6138. });
  6139. (0, _utils$6.default)("ExportAllDeclaration", {
  6140. visitor: ["source"],
  6141. aliases: ["Statement", "Declaration", "ModuleDeclaration", "ExportDeclaration"],
  6142. fields: {
  6143. source: {
  6144. validate: (0, _utils$6.assertNodeType)("StringLiteral")
  6145. },
  6146. exportKind: (0, _utils$6.validateOptional)((0, _utils$6.assertOneOf)("type", "value")),
  6147. assertions: {
  6148. optional: true,
  6149. validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("ImportAttribute")))
  6150. }
  6151. }
  6152. });
  6153. (0, _utils$6.default)("ExportDefaultDeclaration", {
  6154. visitor: ["declaration"],
  6155. aliases: ["Statement", "Declaration", "ModuleDeclaration", "ExportDeclaration"],
  6156. fields: {
  6157. declaration: {
  6158. validate: (0, _utils$6.assertNodeType)("FunctionDeclaration", "TSDeclareFunction", "ClassDeclaration", "Expression")
  6159. },
  6160. exportKind: (0, _utils$6.validateOptional)((0, _utils$6.assertOneOf)("value"))
  6161. }
  6162. });
  6163. (0, _utils$6.default)("ExportNamedDeclaration", {
  6164. visitor: ["declaration", "specifiers", "source"],
  6165. aliases: ["Statement", "Declaration", "ModuleDeclaration", "ExportDeclaration"],
  6166. fields: {
  6167. declaration: {
  6168. optional: true,
  6169. validate: (0, _utils$6.chain)((0, _utils$6.assertNodeType)("Declaration"), Object.assign(function (node, key, val) {
  6170. if (!process.env.BABEL_TYPES_8_BREAKING) return;
  6171. if (val && node.specifiers.length) {
  6172. throw new TypeError("Only declaration or specifiers is allowed on ExportNamedDeclaration");
  6173. }
  6174. }, {
  6175. oneOfNodeTypes: ["Declaration"]
  6176. }), function (node, key, val) {
  6177. if (!process.env.BABEL_TYPES_8_BREAKING) return;
  6178. if (val && node.source) {
  6179. throw new TypeError("Cannot export a declaration from a source");
  6180. }
  6181. })
  6182. },
  6183. assertions: {
  6184. optional: true,
  6185. validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("ImportAttribute")))
  6186. },
  6187. specifiers: {
  6188. default: [],
  6189. validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)(function () {
  6190. const sourced = (0, _utils$6.assertNodeType)("ExportSpecifier", "ExportDefaultSpecifier", "ExportNamespaceSpecifier");
  6191. const sourceless = (0, _utils$6.assertNodeType)("ExportSpecifier");
  6192. if (!process.env.BABEL_TYPES_8_BREAKING) return sourced;
  6193. return function (node, key, val) {
  6194. const validator = node.source ? sourced : sourceless;
  6195. validator(node, key, val);
  6196. };
  6197. }()))
  6198. },
  6199. source: {
  6200. validate: (0, _utils$6.assertNodeType)("StringLiteral"),
  6201. optional: true
  6202. },
  6203. exportKind: (0, _utils$6.validateOptional)((0, _utils$6.assertOneOf)("type", "value"))
  6204. }
  6205. });
  6206. (0, _utils$6.default)("ExportSpecifier", {
  6207. visitor: ["local", "exported"],
  6208. aliases: ["ModuleSpecifier"],
  6209. fields: {
  6210. local: {
  6211. validate: (0, _utils$6.assertNodeType)("Identifier")
  6212. },
  6213. exported: {
  6214. validate: (0, _utils$6.assertNodeType)("Identifier", "StringLiteral")
  6215. }
  6216. }
  6217. });
  6218. (0, _utils$6.default)("ForOfStatement", {
  6219. visitor: ["left", "right", "body"],
  6220. builder: ["left", "right", "body", "await"],
  6221. aliases: ["Scopable", "Statement", "For", "BlockParent", "Loop", "ForXStatement"],
  6222. fields: {
  6223. left: {
  6224. validate: function () {
  6225. if (!process.env.BABEL_TYPES_8_BREAKING) {
  6226. return (0, _utils$6.assertNodeType)("VariableDeclaration", "LVal");
  6227. }
  6228. const declaration = (0, _utils$6.assertNodeType)("VariableDeclaration");
  6229. const lval = (0, _utils$6.assertNodeType)("Identifier", "MemberExpression", "ArrayPattern", "ObjectPattern");
  6230. return function (node, key, val) {
  6231. if ((0, _is$2.default)("VariableDeclaration", val)) {
  6232. declaration(node, key, val);
  6233. } else {
  6234. lval(node, key, val);
  6235. }
  6236. };
  6237. }()
  6238. },
  6239. right: {
  6240. validate: (0, _utils$6.assertNodeType)("Expression")
  6241. },
  6242. body: {
  6243. validate: (0, _utils$6.assertNodeType)("Statement")
  6244. },
  6245. await: {
  6246. default: false
  6247. }
  6248. }
  6249. });
  6250. (0, _utils$6.default)("ImportDeclaration", {
  6251. visitor: ["specifiers", "source"],
  6252. aliases: ["Statement", "Declaration", "ModuleDeclaration"],
  6253. fields: {
  6254. assertions: {
  6255. optional: true,
  6256. validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("ImportAttribute")))
  6257. },
  6258. specifiers: {
  6259. validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("ImportSpecifier", "ImportDefaultSpecifier", "ImportNamespaceSpecifier")))
  6260. },
  6261. source: {
  6262. validate: (0, _utils$6.assertNodeType)("StringLiteral")
  6263. },
  6264. importKind: {
  6265. validate: (0, _utils$6.assertOneOf)("type", "typeof", "value"),
  6266. optional: true
  6267. }
  6268. }
  6269. });
  6270. (0, _utils$6.default)("ImportDefaultSpecifier", {
  6271. visitor: ["local"],
  6272. aliases: ["ModuleSpecifier"],
  6273. fields: {
  6274. local: {
  6275. validate: (0, _utils$6.assertNodeType)("Identifier")
  6276. }
  6277. }
  6278. });
  6279. (0, _utils$6.default)("ImportNamespaceSpecifier", {
  6280. visitor: ["local"],
  6281. aliases: ["ModuleSpecifier"],
  6282. fields: {
  6283. local: {
  6284. validate: (0, _utils$6.assertNodeType)("Identifier")
  6285. }
  6286. }
  6287. });
  6288. (0, _utils$6.default)("ImportSpecifier", {
  6289. visitor: ["local", "imported"],
  6290. aliases: ["ModuleSpecifier"],
  6291. fields: {
  6292. local: {
  6293. validate: (0, _utils$6.assertNodeType)("Identifier")
  6294. },
  6295. imported: {
  6296. validate: (0, _utils$6.assertNodeType)("Identifier", "StringLiteral")
  6297. },
  6298. importKind: {
  6299. validate: (0, _utils$6.assertOneOf)("type", "typeof"),
  6300. optional: true
  6301. }
  6302. }
  6303. });
  6304. (0, _utils$6.default)("MetaProperty", {
  6305. visitor: ["meta", "property"],
  6306. aliases: ["Expression"],
  6307. fields: {
  6308. meta: {
  6309. validate: (0, _utils$6.chain)((0, _utils$6.assertNodeType)("Identifier"), Object.assign(function (node, key, val) {
  6310. if (!process.env.BABEL_TYPES_8_BREAKING) return;
  6311. let property;
  6312. switch (val.name) {
  6313. case "function":
  6314. property = "sent";
  6315. break;
  6316. case "new":
  6317. property = "target";
  6318. break;
  6319. case "import":
  6320. property = "meta";
  6321. break;
  6322. }
  6323. if (!(0, _is$2.default)("Identifier", node.property, {
  6324. name: property
  6325. })) {
  6326. throw new TypeError("Unrecognised MetaProperty");
  6327. }
  6328. }, {
  6329. oneOfNodeTypes: ["Identifier"]
  6330. }))
  6331. },
  6332. property: {
  6333. validate: (0, _utils$6.assertNodeType)("Identifier")
  6334. }
  6335. }
  6336. });
  6337. const classMethodOrPropertyCommon = {
  6338. abstract: {
  6339. validate: (0, _utils$6.assertValueType)("boolean"),
  6340. optional: true
  6341. },
  6342. accessibility: {
  6343. validate: (0, _utils$6.assertOneOf)("public", "private", "protected"),
  6344. optional: true
  6345. },
  6346. static: {
  6347. default: false
  6348. },
  6349. override: {
  6350. default: false
  6351. },
  6352. computed: {
  6353. default: false
  6354. },
  6355. optional: {
  6356. validate: (0, _utils$6.assertValueType)("boolean"),
  6357. optional: true
  6358. },
  6359. key: {
  6360. validate: (0, _utils$6.chain)(function () {
  6361. const normal = (0, _utils$6.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral");
  6362. const computed = (0, _utils$6.assertNodeType)("Expression");
  6363. return function (node, key, val) {
  6364. const validator = node.computed ? computed : normal;
  6365. validator(node, key, val);
  6366. };
  6367. }(), (0, _utils$6.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral", "Expression"))
  6368. }
  6369. };
  6370. core.classMethodOrPropertyCommon = classMethodOrPropertyCommon;
  6371. const classMethodOrDeclareMethodCommon = Object.assign({}, functionCommon, classMethodOrPropertyCommon, {
  6372. params: {
  6373. validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("Identifier", "Pattern", "RestElement", "TSParameterProperty")))
  6374. },
  6375. kind: {
  6376. validate: (0, _utils$6.assertOneOf)("get", "set", "method", "constructor"),
  6377. default: "method"
  6378. },
  6379. access: {
  6380. validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("string"), (0, _utils$6.assertOneOf)("public", "private", "protected")),
  6381. optional: true
  6382. },
  6383. decorators: {
  6384. validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("Decorator"))),
  6385. optional: true
  6386. }
  6387. });
  6388. core.classMethodOrDeclareMethodCommon = classMethodOrDeclareMethodCommon;
  6389. (0, _utils$6.default)("ClassMethod", {
  6390. aliases: ["Function", "Scopable", "BlockParent", "FunctionParent", "Method"],
  6391. builder: ["kind", "key", "params", "body", "computed", "static", "generator", "async"],
  6392. visitor: ["key", "params", "body", "decorators", "returnType", "typeParameters"],
  6393. fields: Object.assign({}, classMethodOrDeclareMethodCommon, functionTypeAnnotationCommon, {
  6394. body: {
  6395. validate: (0, _utils$6.assertNodeType)("BlockStatement")
  6396. }
  6397. })
  6398. });
  6399. (0, _utils$6.default)("ObjectPattern", {
  6400. visitor: ["properties", "typeAnnotation", "decorators"],
  6401. builder: ["properties"],
  6402. aliases: ["Pattern", "PatternLike", "LVal"],
  6403. fields: Object.assign({}, patternLikeCommon, {
  6404. properties: {
  6405. validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("RestElement", "ObjectProperty")))
  6406. }
  6407. })
  6408. });
  6409. (0, _utils$6.default)("SpreadElement", {
  6410. visitor: ["argument"],
  6411. aliases: ["UnaryLike"],
  6412. deprecatedAlias: "SpreadProperty",
  6413. fields: {
  6414. argument: {
  6415. validate: (0, _utils$6.assertNodeType)("Expression")
  6416. }
  6417. }
  6418. });
  6419. (0, _utils$6.default)("Super", {
  6420. aliases: ["Expression"]
  6421. });
  6422. (0, _utils$6.default)("TaggedTemplateExpression", {
  6423. visitor: ["tag", "quasi", "typeParameters"],
  6424. builder: ["tag", "quasi"],
  6425. aliases: ["Expression"],
  6426. fields: {
  6427. tag: {
  6428. validate: (0, _utils$6.assertNodeType)("Expression")
  6429. },
  6430. quasi: {
  6431. validate: (0, _utils$6.assertNodeType)("TemplateLiteral")
  6432. },
  6433. typeParameters: {
  6434. validate: (0, _utils$6.assertNodeType)("TypeParameterInstantiation", "TSTypeParameterInstantiation"),
  6435. optional: true
  6436. }
  6437. }
  6438. });
  6439. (0, _utils$6.default)("TemplateElement", {
  6440. builder: ["value", "tail"],
  6441. fields: {
  6442. value: {
  6443. validate: (0, _utils$6.assertShape)({
  6444. raw: {
  6445. validate: (0, _utils$6.assertValueType)("string")
  6446. },
  6447. cooked: {
  6448. validate: (0, _utils$6.assertValueType)("string"),
  6449. optional: true
  6450. }
  6451. })
  6452. },
  6453. tail: {
  6454. default: false
  6455. }
  6456. }
  6457. });
  6458. (0, _utils$6.default)("TemplateLiteral", {
  6459. visitor: ["quasis", "expressions"],
  6460. aliases: ["Expression", "Literal"],
  6461. fields: {
  6462. quasis: {
  6463. validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("TemplateElement")))
  6464. },
  6465. expressions: {
  6466. validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("Expression", "TSType")), function (node, key, val) {
  6467. if (node.quasis.length !== val.length + 1) {
  6468. 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}`);
  6469. }
  6470. })
  6471. }
  6472. }
  6473. });
  6474. (0, _utils$6.default)("YieldExpression", {
  6475. builder: ["argument", "delegate"],
  6476. visitor: ["argument"],
  6477. aliases: ["Expression", "Terminatorless"],
  6478. fields: {
  6479. delegate: {
  6480. validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("boolean"), Object.assign(function (node, key, val) {
  6481. if (!process.env.BABEL_TYPES_8_BREAKING) return;
  6482. if (val && !node.argument) {
  6483. throw new TypeError("Property delegate of YieldExpression cannot be true if there is no argument");
  6484. }
  6485. }, {
  6486. type: "boolean"
  6487. })),
  6488. default: false
  6489. },
  6490. argument: {
  6491. optional: true,
  6492. validate: (0, _utils$6.assertNodeType)("Expression")
  6493. }
  6494. }
  6495. });
  6496. (0, _utils$6.default)("AwaitExpression", {
  6497. builder: ["argument"],
  6498. visitor: ["argument"],
  6499. aliases: ["Expression", "Terminatorless"],
  6500. fields: {
  6501. argument: {
  6502. validate: (0, _utils$6.assertNodeType)("Expression")
  6503. }
  6504. }
  6505. });
  6506. (0, _utils$6.default)("Import", {
  6507. aliases: ["Expression"]
  6508. });
  6509. (0, _utils$6.default)("BigIntLiteral", {
  6510. builder: ["value"],
  6511. fields: {
  6512. value: {
  6513. validate: (0, _utils$6.assertValueType)("string")
  6514. }
  6515. },
  6516. aliases: ["Expression", "Pureish", "Literal", "Immutable"]
  6517. });
  6518. (0, _utils$6.default)("ExportNamespaceSpecifier", {
  6519. visitor: ["exported"],
  6520. aliases: ["ModuleSpecifier"],
  6521. fields: {
  6522. exported: {
  6523. validate: (0, _utils$6.assertNodeType)("Identifier")
  6524. }
  6525. }
  6526. });
  6527. (0, _utils$6.default)("OptionalMemberExpression", {
  6528. builder: ["object", "property", "computed", "optional"],
  6529. visitor: ["object", "property"],
  6530. aliases: ["Expression"],
  6531. fields: {
  6532. object: {
  6533. validate: (0, _utils$6.assertNodeType)("Expression")
  6534. },
  6535. property: {
  6536. validate: function () {
  6537. const normal = (0, _utils$6.assertNodeType)("Identifier");
  6538. const computed = (0, _utils$6.assertNodeType)("Expression");
  6539. const validator = function (node, key, val) {
  6540. const validator = node.computed ? computed : normal;
  6541. validator(node, key, val);
  6542. };
  6543. validator.oneOfNodeTypes = ["Expression", "Identifier"];
  6544. return validator;
  6545. }()
  6546. },
  6547. computed: {
  6548. default: false
  6549. },
  6550. optional: {
  6551. validate: !process.env.BABEL_TYPES_8_BREAKING ? (0, _utils$6.assertValueType)("boolean") : (0, _utils$6.chain)((0, _utils$6.assertValueType)("boolean"), (0, _utils$6.assertOptionalChainStart)())
  6552. }
  6553. }
  6554. });
  6555. (0, _utils$6.default)("OptionalCallExpression", {
  6556. visitor: ["callee", "arguments", "typeParameters", "typeArguments"],
  6557. builder: ["callee", "arguments", "optional"],
  6558. aliases: ["Expression"],
  6559. fields: {
  6560. callee: {
  6561. validate: (0, _utils$6.assertNodeType)("Expression")
  6562. },
  6563. arguments: {
  6564. validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("Expression", "SpreadElement", "JSXNamespacedName", "ArgumentPlaceholder")))
  6565. },
  6566. optional: {
  6567. validate: !process.env.BABEL_TYPES_8_BREAKING ? (0, _utils$6.assertValueType)("boolean") : (0, _utils$6.chain)((0, _utils$6.assertValueType)("boolean"), (0, _utils$6.assertOptionalChainStart)())
  6568. },
  6569. typeArguments: {
  6570. validate: (0, _utils$6.assertNodeType)("TypeParameterInstantiation"),
  6571. optional: true
  6572. },
  6573. typeParameters: {
  6574. validate: (0, _utils$6.assertNodeType)("TSTypeParameterInstantiation"),
  6575. optional: true
  6576. }
  6577. }
  6578. });
  6579. (0, _utils$6.default)("ClassProperty", {
  6580. visitor: ["key", "value", "typeAnnotation", "decorators"],
  6581. builder: ["key", "value", "typeAnnotation", "decorators", "computed", "static"],
  6582. aliases: ["Property"],
  6583. fields: Object.assign({}, classMethodOrPropertyCommon, {
  6584. value: {
  6585. validate: (0, _utils$6.assertNodeType)("Expression"),
  6586. optional: true
  6587. },
  6588. definite: {
  6589. validate: (0, _utils$6.assertValueType)("boolean"),
  6590. optional: true
  6591. },
  6592. typeAnnotation: {
  6593. validate: (0, _utils$6.assertNodeType)("TypeAnnotation", "TSTypeAnnotation", "Noop"),
  6594. optional: true
  6595. },
  6596. decorators: {
  6597. validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("Decorator"))),
  6598. optional: true
  6599. },
  6600. readonly: {
  6601. validate: (0, _utils$6.assertValueType)("boolean"),
  6602. optional: true
  6603. },
  6604. declare: {
  6605. validate: (0, _utils$6.assertValueType)("boolean"),
  6606. optional: true
  6607. },
  6608. variance: {
  6609. validate: (0, _utils$6.assertNodeType)("Variance"),
  6610. optional: true
  6611. }
  6612. })
  6613. });
  6614. (0, _utils$6.default)("ClassPrivateProperty", {
  6615. visitor: ["key", "value", "decorators", "typeAnnotation"],
  6616. builder: ["key", "value", "decorators", "static"],
  6617. aliases: ["Property", "Private"],
  6618. fields: {
  6619. key: {
  6620. validate: (0, _utils$6.assertNodeType)("PrivateName")
  6621. },
  6622. value: {
  6623. validate: (0, _utils$6.assertNodeType)("Expression"),
  6624. optional: true
  6625. },
  6626. typeAnnotation: {
  6627. validate: (0, _utils$6.assertNodeType)("TypeAnnotation", "TSTypeAnnotation", "Noop"),
  6628. optional: true
  6629. },
  6630. decorators: {
  6631. validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("Decorator"))),
  6632. optional: true
  6633. },
  6634. readonly: {
  6635. validate: (0, _utils$6.assertValueType)("boolean"),
  6636. optional: true
  6637. },
  6638. definite: {
  6639. validate: (0, _utils$6.assertValueType)("boolean"),
  6640. optional: true
  6641. },
  6642. variance: {
  6643. validate: (0, _utils$6.assertNodeType)("Variance"),
  6644. optional: true
  6645. }
  6646. }
  6647. });
  6648. (0, _utils$6.default)("ClassPrivateMethod", {
  6649. builder: ["kind", "key", "params", "body", "static"],
  6650. visitor: ["key", "params", "body", "decorators", "returnType", "typeParameters"],
  6651. aliases: ["Function", "Scopable", "BlockParent", "FunctionParent", "Method", "Private"],
  6652. fields: Object.assign({}, classMethodOrDeclareMethodCommon, functionTypeAnnotationCommon, {
  6653. key: {
  6654. validate: (0, _utils$6.assertNodeType)("PrivateName")
  6655. },
  6656. body: {
  6657. validate: (0, _utils$6.assertNodeType)("BlockStatement")
  6658. }
  6659. })
  6660. });
  6661. (0, _utils$6.default)("PrivateName", {
  6662. visitor: ["id"],
  6663. aliases: ["Private"],
  6664. fields: {
  6665. id: {
  6666. validate: (0, _utils$6.assertNodeType)("Identifier")
  6667. }
  6668. }
  6669. });
  6670. var _utils$5 = utils;
  6671. const defineInterfaceishType = (name, typeParameterType = "TypeParameterDeclaration") => {
  6672. (0, _utils$5.default)(name, {
  6673. builder: ["id", "typeParameters", "extends", "body"],
  6674. visitor: ["id", "typeParameters", "extends", "mixins", "implements", "body"],
  6675. aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
  6676. fields: {
  6677. id: (0, _utils$5.validateType)("Identifier"),
  6678. typeParameters: (0, _utils$5.validateOptionalType)(typeParameterType),
  6679. extends: (0, _utils$5.validateOptional)((0, _utils$5.arrayOfType)("InterfaceExtends")),
  6680. mixins: (0, _utils$5.validateOptional)((0, _utils$5.arrayOfType)("InterfaceExtends")),
  6681. implements: (0, _utils$5.validateOptional)((0, _utils$5.arrayOfType)("ClassImplements")),
  6682. body: (0, _utils$5.validateType)("ObjectTypeAnnotation")
  6683. }
  6684. });
  6685. };
  6686. (0, _utils$5.default)("AnyTypeAnnotation", {
  6687. aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
  6688. });
  6689. (0, _utils$5.default)("ArrayTypeAnnotation", {
  6690. visitor: ["elementType"],
  6691. aliases: ["Flow", "FlowType"],
  6692. fields: {
  6693. elementType: (0, _utils$5.validateType)("FlowType")
  6694. }
  6695. });
  6696. (0, _utils$5.default)("BooleanTypeAnnotation", {
  6697. aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
  6698. });
  6699. (0, _utils$5.default)("BooleanLiteralTypeAnnotation", {
  6700. builder: ["value"],
  6701. aliases: ["Flow", "FlowType"],
  6702. fields: {
  6703. value: (0, _utils$5.validate)((0, _utils$5.assertValueType)("boolean"))
  6704. }
  6705. });
  6706. (0, _utils$5.default)("NullLiteralTypeAnnotation", {
  6707. aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
  6708. });
  6709. (0, _utils$5.default)("ClassImplements", {
  6710. visitor: ["id", "typeParameters"],
  6711. aliases: ["Flow"],
  6712. fields: {
  6713. id: (0, _utils$5.validateType)("Identifier"),
  6714. typeParameters: (0, _utils$5.validateOptionalType)("TypeParameterInstantiation")
  6715. }
  6716. });
  6717. defineInterfaceishType("DeclareClass");
  6718. (0, _utils$5.default)("DeclareFunction", {
  6719. visitor: ["id"],
  6720. aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
  6721. fields: {
  6722. id: (0, _utils$5.validateType)("Identifier"),
  6723. predicate: (0, _utils$5.validateOptionalType)("DeclaredPredicate")
  6724. }
  6725. });
  6726. defineInterfaceishType("DeclareInterface");
  6727. (0, _utils$5.default)("DeclareModule", {
  6728. builder: ["id", "body", "kind"],
  6729. visitor: ["id", "body"],
  6730. aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
  6731. fields: {
  6732. id: (0, _utils$5.validateType)(["Identifier", "StringLiteral"]),
  6733. body: (0, _utils$5.validateType)("BlockStatement"),
  6734. kind: (0, _utils$5.validateOptional)((0, _utils$5.assertOneOf)("CommonJS", "ES"))
  6735. }
  6736. });
  6737. (0, _utils$5.default)("DeclareModuleExports", {
  6738. visitor: ["typeAnnotation"],
  6739. aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
  6740. fields: {
  6741. typeAnnotation: (0, _utils$5.validateType)("TypeAnnotation")
  6742. }
  6743. });
  6744. (0, _utils$5.default)("DeclareTypeAlias", {
  6745. visitor: ["id", "typeParameters", "right"],
  6746. aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
  6747. fields: {
  6748. id: (0, _utils$5.validateType)("Identifier"),
  6749. typeParameters: (0, _utils$5.validateOptionalType)("TypeParameterDeclaration"),
  6750. right: (0, _utils$5.validateType)("FlowType")
  6751. }
  6752. });
  6753. (0, _utils$5.default)("DeclareOpaqueType", {
  6754. visitor: ["id", "typeParameters", "supertype"],
  6755. aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
  6756. fields: {
  6757. id: (0, _utils$5.validateType)("Identifier"),
  6758. typeParameters: (0, _utils$5.validateOptionalType)("TypeParameterDeclaration"),
  6759. supertype: (0, _utils$5.validateOptionalType)("FlowType"),
  6760. impltype: (0, _utils$5.validateOptionalType)("FlowType")
  6761. }
  6762. });
  6763. (0, _utils$5.default)("DeclareVariable", {
  6764. visitor: ["id"],
  6765. aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
  6766. fields: {
  6767. id: (0, _utils$5.validateType)("Identifier")
  6768. }
  6769. });
  6770. (0, _utils$5.default)("DeclareExportDeclaration", {
  6771. visitor: ["declaration", "specifiers", "source"],
  6772. aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
  6773. fields: {
  6774. declaration: (0, _utils$5.validateOptionalType)("Flow"),
  6775. specifiers: (0, _utils$5.validateOptional)((0, _utils$5.arrayOfType)(["ExportSpecifier", "ExportNamespaceSpecifier"])),
  6776. source: (0, _utils$5.validateOptionalType)("StringLiteral"),
  6777. default: (0, _utils$5.validateOptional)((0, _utils$5.assertValueType)("boolean"))
  6778. }
  6779. });
  6780. (0, _utils$5.default)("DeclareExportAllDeclaration", {
  6781. visitor: ["source"],
  6782. aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
  6783. fields: {
  6784. source: (0, _utils$5.validateType)("StringLiteral"),
  6785. exportKind: (0, _utils$5.validateOptional)((0, _utils$5.assertOneOf)("type", "value"))
  6786. }
  6787. });
  6788. (0, _utils$5.default)("DeclaredPredicate", {
  6789. visitor: ["value"],
  6790. aliases: ["Flow", "FlowPredicate"],
  6791. fields: {
  6792. value: (0, _utils$5.validateType)("Flow")
  6793. }
  6794. });
  6795. (0, _utils$5.default)("ExistsTypeAnnotation", {
  6796. aliases: ["Flow", "FlowType"]
  6797. });
  6798. (0, _utils$5.default)("FunctionTypeAnnotation", {
  6799. visitor: ["typeParameters", "params", "rest", "returnType"],
  6800. aliases: ["Flow", "FlowType"],
  6801. fields: {
  6802. typeParameters: (0, _utils$5.validateOptionalType)("TypeParameterDeclaration"),
  6803. params: (0, _utils$5.validate)((0, _utils$5.arrayOfType)("FunctionTypeParam")),
  6804. rest: (0, _utils$5.validateOptionalType)("FunctionTypeParam"),
  6805. this: (0, _utils$5.validateOptionalType)("FunctionTypeParam"),
  6806. returnType: (0, _utils$5.validateType)("FlowType")
  6807. }
  6808. });
  6809. (0, _utils$5.default)("FunctionTypeParam", {
  6810. visitor: ["name", "typeAnnotation"],
  6811. aliases: ["Flow"],
  6812. fields: {
  6813. name: (0, _utils$5.validateOptionalType)("Identifier"),
  6814. typeAnnotation: (0, _utils$5.validateType)("FlowType"),
  6815. optional: (0, _utils$5.validateOptional)((0, _utils$5.assertValueType)("boolean"))
  6816. }
  6817. });
  6818. (0, _utils$5.default)("GenericTypeAnnotation", {
  6819. visitor: ["id", "typeParameters"],
  6820. aliases: ["Flow", "FlowType"],
  6821. fields: {
  6822. id: (0, _utils$5.validateType)(["Identifier", "QualifiedTypeIdentifier"]),
  6823. typeParameters: (0, _utils$5.validateOptionalType)("TypeParameterInstantiation")
  6824. }
  6825. });
  6826. (0, _utils$5.default)("InferredPredicate", {
  6827. aliases: ["Flow", "FlowPredicate"]
  6828. });
  6829. (0, _utils$5.default)("InterfaceExtends", {
  6830. visitor: ["id", "typeParameters"],
  6831. aliases: ["Flow"],
  6832. fields: {
  6833. id: (0, _utils$5.validateType)(["Identifier", "QualifiedTypeIdentifier"]),
  6834. typeParameters: (0, _utils$5.validateOptionalType)("TypeParameterInstantiation")
  6835. }
  6836. });
  6837. defineInterfaceishType("InterfaceDeclaration");
  6838. (0, _utils$5.default)("InterfaceTypeAnnotation", {
  6839. visitor: ["extends", "body"],
  6840. aliases: ["Flow", "FlowType"],
  6841. fields: {
  6842. extends: (0, _utils$5.validateOptional)((0, _utils$5.arrayOfType)("InterfaceExtends")),
  6843. body: (0, _utils$5.validateType)("ObjectTypeAnnotation")
  6844. }
  6845. });
  6846. (0, _utils$5.default)("IntersectionTypeAnnotation", {
  6847. visitor: ["types"],
  6848. aliases: ["Flow", "FlowType"],
  6849. fields: {
  6850. types: (0, _utils$5.validate)((0, _utils$5.arrayOfType)("FlowType"))
  6851. }
  6852. });
  6853. (0, _utils$5.default)("MixedTypeAnnotation", {
  6854. aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
  6855. });
  6856. (0, _utils$5.default)("EmptyTypeAnnotation", {
  6857. aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
  6858. });
  6859. (0, _utils$5.default)("NullableTypeAnnotation", {
  6860. visitor: ["typeAnnotation"],
  6861. aliases: ["Flow", "FlowType"],
  6862. fields: {
  6863. typeAnnotation: (0, _utils$5.validateType)("FlowType")
  6864. }
  6865. });
  6866. (0, _utils$5.default)("NumberLiteralTypeAnnotation", {
  6867. builder: ["value"],
  6868. aliases: ["Flow", "FlowType"],
  6869. fields: {
  6870. value: (0, _utils$5.validate)((0, _utils$5.assertValueType)("number"))
  6871. }
  6872. });
  6873. (0, _utils$5.default)("NumberTypeAnnotation", {
  6874. aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
  6875. });
  6876. (0, _utils$5.default)("ObjectTypeAnnotation", {
  6877. visitor: ["properties", "indexers", "callProperties", "internalSlots"],
  6878. aliases: ["Flow", "FlowType"],
  6879. builder: ["properties", "indexers", "callProperties", "internalSlots", "exact"],
  6880. fields: {
  6881. properties: (0, _utils$5.validate)((0, _utils$5.arrayOfType)(["ObjectTypeProperty", "ObjectTypeSpreadProperty"])),
  6882. indexers: (0, _utils$5.validateOptional)((0, _utils$5.arrayOfType)("ObjectTypeIndexer")),
  6883. callProperties: (0, _utils$5.validateOptional)((0, _utils$5.arrayOfType)("ObjectTypeCallProperty")),
  6884. internalSlots: (0, _utils$5.validateOptional)((0, _utils$5.arrayOfType)("ObjectTypeInternalSlot")),
  6885. exact: {
  6886. validate: (0, _utils$5.assertValueType)("boolean"),
  6887. default: false
  6888. },
  6889. inexact: (0, _utils$5.validateOptional)((0, _utils$5.assertValueType)("boolean"))
  6890. }
  6891. });
  6892. (0, _utils$5.default)("ObjectTypeInternalSlot", {
  6893. visitor: ["id", "value", "optional", "static", "method"],
  6894. aliases: ["Flow", "UserWhitespacable"],
  6895. fields: {
  6896. id: (0, _utils$5.validateType)("Identifier"),
  6897. value: (0, _utils$5.validateType)("FlowType"),
  6898. optional: (0, _utils$5.validate)((0, _utils$5.assertValueType)("boolean")),
  6899. static: (0, _utils$5.validate)((0, _utils$5.assertValueType)("boolean")),
  6900. method: (0, _utils$5.validate)((0, _utils$5.assertValueType)("boolean"))
  6901. }
  6902. });
  6903. (0, _utils$5.default)("ObjectTypeCallProperty", {
  6904. visitor: ["value"],
  6905. aliases: ["Flow", "UserWhitespacable"],
  6906. fields: {
  6907. value: (0, _utils$5.validateType)("FlowType"),
  6908. static: (0, _utils$5.validate)((0, _utils$5.assertValueType)("boolean"))
  6909. }
  6910. });
  6911. (0, _utils$5.default)("ObjectTypeIndexer", {
  6912. visitor: ["id", "key", "value", "variance"],
  6913. aliases: ["Flow", "UserWhitespacable"],
  6914. fields: {
  6915. id: (0, _utils$5.validateOptionalType)("Identifier"),
  6916. key: (0, _utils$5.validateType)("FlowType"),
  6917. value: (0, _utils$5.validateType)("FlowType"),
  6918. static: (0, _utils$5.validate)((0, _utils$5.assertValueType)("boolean")),
  6919. variance: (0, _utils$5.validateOptionalType)("Variance")
  6920. }
  6921. });
  6922. (0, _utils$5.default)("ObjectTypeProperty", {
  6923. visitor: ["key", "value", "variance"],
  6924. aliases: ["Flow", "UserWhitespacable"],
  6925. fields: {
  6926. key: (0, _utils$5.validateType)(["Identifier", "StringLiteral"]),
  6927. value: (0, _utils$5.validateType)("FlowType"),
  6928. kind: (0, _utils$5.validate)((0, _utils$5.assertOneOf)("init", "get", "set")),
  6929. static: (0, _utils$5.validate)((0, _utils$5.assertValueType)("boolean")),
  6930. proto: (0, _utils$5.validate)((0, _utils$5.assertValueType)("boolean")),
  6931. optional: (0, _utils$5.validate)((0, _utils$5.assertValueType)("boolean")),
  6932. variance: (0, _utils$5.validateOptionalType)("Variance"),
  6933. method: (0, _utils$5.validate)((0, _utils$5.assertValueType)("boolean"))
  6934. }
  6935. });
  6936. (0, _utils$5.default)("ObjectTypeSpreadProperty", {
  6937. visitor: ["argument"],
  6938. aliases: ["Flow", "UserWhitespacable"],
  6939. fields: {
  6940. argument: (0, _utils$5.validateType)("FlowType")
  6941. }
  6942. });
  6943. (0, _utils$5.default)("OpaqueType", {
  6944. visitor: ["id", "typeParameters", "supertype", "impltype"],
  6945. aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
  6946. fields: {
  6947. id: (0, _utils$5.validateType)("Identifier"),
  6948. typeParameters: (0, _utils$5.validateOptionalType)("TypeParameterDeclaration"),
  6949. supertype: (0, _utils$5.validateOptionalType)("FlowType"),
  6950. impltype: (0, _utils$5.validateType)("FlowType")
  6951. }
  6952. });
  6953. (0, _utils$5.default)("QualifiedTypeIdentifier", {
  6954. visitor: ["id", "qualification"],
  6955. aliases: ["Flow"],
  6956. fields: {
  6957. id: (0, _utils$5.validateType)("Identifier"),
  6958. qualification: (0, _utils$5.validateType)(["Identifier", "QualifiedTypeIdentifier"])
  6959. }
  6960. });
  6961. (0, _utils$5.default)("StringLiteralTypeAnnotation", {
  6962. builder: ["value"],
  6963. aliases: ["Flow", "FlowType"],
  6964. fields: {
  6965. value: (0, _utils$5.validate)((0, _utils$5.assertValueType)("string"))
  6966. }
  6967. });
  6968. (0, _utils$5.default)("StringTypeAnnotation", {
  6969. aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
  6970. });
  6971. (0, _utils$5.default)("SymbolTypeAnnotation", {
  6972. aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
  6973. });
  6974. (0, _utils$5.default)("ThisTypeAnnotation", {
  6975. aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
  6976. });
  6977. (0, _utils$5.default)("TupleTypeAnnotation", {
  6978. visitor: ["types"],
  6979. aliases: ["Flow", "FlowType"],
  6980. fields: {
  6981. types: (0, _utils$5.validate)((0, _utils$5.arrayOfType)("FlowType"))
  6982. }
  6983. });
  6984. (0, _utils$5.default)("TypeofTypeAnnotation", {
  6985. visitor: ["argument"],
  6986. aliases: ["Flow", "FlowType"],
  6987. fields: {
  6988. argument: (0, _utils$5.validateType)("FlowType")
  6989. }
  6990. });
  6991. (0, _utils$5.default)("TypeAlias", {
  6992. visitor: ["id", "typeParameters", "right"],
  6993. aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
  6994. fields: {
  6995. id: (0, _utils$5.validateType)("Identifier"),
  6996. typeParameters: (0, _utils$5.validateOptionalType)("TypeParameterDeclaration"),
  6997. right: (0, _utils$5.validateType)("FlowType")
  6998. }
  6999. });
  7000. (0, _utils$5.default)("TypeAnnotation", {
  7001. aliases: ["Flow"],
  7002. visitor: ["typeAnnotation"],
  7003. fields: {
  7004. typeAnnotation: (0, _utils$5.validateType)("FlowType")
  7005. }
  7006. });
  7007. (0, _utils$5.default)("TypeCastExpression", {
  7008. visitor: ["expression", "typeAnnotation"],
  7009. aliases: ["Flow", "ExpressionWrapper", "Expression"],
  7010. fields: {
  7011. expression: (0, _utils$5.validateType)("Expression"),
  7012. typeAnnotation: (0, _utils$5.validateType)("TypeAnnotation")
  7013. }
  7014. });
  7015. (0, _utils$5.default)("TypeParameter", {
  7016. aliases: ["Flow"],
  7017. visitor: ["bound", "default", "variance"],
  7018. fields: {
  7019. name: (0, _utils$5.validate)((0, _utils$5.assertValueType)("string")),
  7020. bound: (0, _utils$5.validateOptionalType)("TypeAnnotation"),
  7021. default: (0, _utils$5.validateOptionalType)("FlowType"),
  7022. variance: (0, _utils$5.validateOptionalType)("Variance")
  7023. }
  7024. });
  7025. (0, _utils$5.default)("TypeParameterDeclaration", {
  7026. aliases: ["Flow"],
  7027. visitor: ["params"],
  7028. fields: {
  7029. params: (0, _utils$5.validate)((0, _utils$5.arrayOfType)("TypeParameter"))
  7030. }
  7031. });
  7032. (0, _utils$5.default)("TypeParameterInstantiation", {
  7033. aliases: ["Flow"],
  7034. visitor: ["params"],
  7035. fields: {
  7036. params: (0, _utils$5.validate)((0, _utils$5.arrayOfType)("FlowType"))
  7037. }
  7038. });
  7039. (0, _utils$5.default)("UnionTypeAnnotation", {
  7040. visitor: ["types"],
  7041. aliases: ["Flow", "FlowType"],
  7042. fields: {
  7043. types: (0, _utils$5.validate)((0, _utils$5.arrayOfType)("FlowType"))
  7044. }
  7045. });
  7046. (0, _utils$5.default)("Variance", {
  7047. aliases: ["Flow"],
  7048. builder: ["kind"],
  7049. fields: {
  7050. kind: (0, _utils$5.validate)((0, _utils$5.assertOneOf)("minus", "plus"))
  7051. }
  7052. });
  7053. (0, _utils$5.default)("VoidTypeAnnotation", {
  7054. aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
  7055. });
  7056. (0, _utils$5.default)("EnumDeclaration", {
  7057. aliases: ["Statement", "Declaration"],
  7058. visitor: ["id", "body"],
  7059. fields: {
  7060. id: (0, _utils$5.validateType)("Identifier"),
  7061. body: (0, _utils$5.validateType)(["EnumBooleanBody", "EnumNumberBody", "EnumStringBody", "EnumSymbolBody"])
  7062. }
  7063. });
  7064. (0, _utils$5.default)("EnumBooleanBody", {
  7065. aliases: ["EnumBody"],
  7066. visitor: ["members"],
  7067. fields: {
  7068. explicitType: (0, _utils$5.validate)((0, _utils$5.assertValueType)("boolean")),
  7069. members: (0, _utils$5.validateArrayOfType)("EnumBooleanMember"),
  7070. hasUnknownMembers: (0, _utils$5.validate)((0, _utils$5.assertValueType)("boolean"))
  7071. }
  7072. });
  7073. (0, _utils$5.default)("EnumNumberBody", {
  7074. aliases: ["EnumBody"],
  7075. visitor: ["members"],
  7076. fields: {
  7077. explicitType: (0, _utils$5.validate)((0, _utils$5.assertValueType)("boolean")),
  7078. members: (0, _utils$5.validateArrayOfType)("EnumNumberMember"),
  7079. hasUnknownMembers: (0, _utils$5.validate)((0, _utils$5.assertValueType)("boolean"))
  7080. }
  7081. });
  7082. (0, _utils$5.default)("EnumStringBody", {
  7083. aliases: ["EnumBody"],
  7084. visitor: ["members"],
  7085. fields: {
  7086. explicitType: (0, _utils$5.validate)((0, _utils$5.assertValueType)("boolean")),
  7087. members: (0, _utils$5.validateArrayOfType)(["EnumStringMember", "EnumDefaultedMember"]),
  7088. hasUnknownMembers: (0, _utils$5.validate)((0, _utils$5.assertValueType)("boolean"))
  7089. }
  7090. });
  7091. (0, _utils$5.default)("EnumSymbolBody", {
  7092. aliases: ["EnumBody"],
  7093. visitor: ["members"],
  7094. fields: {
  7095. members: (0, _utils$5.validateArrayOfType)("EnumDefaultedMember"),
  7096. hasUnknownMembers: (0, _utils$5.validate)((0, _utils$5.assertValueType)("boolean"))
  7097. }
  7098. });
  7099. (0, _utils$5.default)("EnumBooleanMember", {
  7100. aliases: ["EnumMember"],
  7101. visitor: ["id"],
  7102. fields: {
  7103. id: (0, _utils$5.validateType)("Identifier"),
  7104. init: (0, _utils$5.validateType)("BooleanLiteral")
  7105. }
  7106. });
  7107. (0, _utils$5.default)("EnumNumberMember", {
  7108. aliases: ["EnumMember"],
  7109. visitor: ["id", "init"],
  7110. fields: {
  7111. id: (0, _utils$5.validateType)("Identifier"),
  7112. init: (0, _utils$5.validateType)("NumericLiteral")
  7113. }
  7114. });
  7115. (0, _utils$5.default)("EnumStringMember", {
  7116. aliases: ["EnumMember"],
  7117. visitor: ["id", "init"],
  7118. fields: {
  7119. id: (0, _utils$5.validateType)("Identifier"),
  7120. init: (0, _utils$5.validateType)("StringLiteral")
  7121. }
  7122. });
  7123. (0, _utils$5.default)("EnumDefaultedMember", {
  7124. aliases: ["EnumMember"],
  7125. visitor: ["id"],
  7126. fields: {
  7127. id: (0, _utils$5.validateType)("Identifier")
  7128. }
  7129. });
  7130. (0, _utils$5.default)("IndexedAccessType", {
  7131. visitor: ["objectType", "indexType"],
  7132. aliases: ["Flow", "FlowType"],
  7133. fields: {
  7134. objectType: (0, _utils$5.validateType)("FlowType"),
  7135. indexType: (0, _utils$5.validateType)("FlowType")
  7136. }
  7137. });
  7138. (0, _utils$5.default)("OptionalIndexedAccessType", {
  7139. visitor: ["objectType", "indexType"],
  7140. aliases: ["Flow", "FlowType"],
  7141. fields: {
  7142. objectType: (0, _utils$5.validateType)("FlowType"),
  7143. indexType: (0, _utils$5.validateType)("FlowType"),
  7144. optional: (0, _utils$5.validate)((0, _utils$5.assertValueType)("boolean"))
  7145. }
  7146. });
  7147. var _utils$4 = utils;
  7148. (0, _utils$4.default)("JSXAttribute", {
  7149. visitor: ["name", "value"],
  7150. aliases: ["JSX", "Immutable"],
  7151. fields: {
  7152. name: {
  7153. validate: (0, _utils$4.assertNodeType)("JSXIdentifier", "JSXNamespacedName")
  7154. },
  7155. value: {
  7156. optional: true,
  7157. validate: (0, _utils$4.assertNodeType)("JSXElement", "JSXFragment", "StringLiteral", "JSXExpressionContainer")
  7158. }
  7159. }
  7160. });
  7161. (0, _utils$4.default)("JSXClosingElement", {
  7162. visitor: ["name"],
  7163. aliases: ["JSX", "Immutable"],
  7164. fields: {
  7165. name: {
  7166. validate: (0, _utils$4.assertNodeType)("JSXIdentifier", "JSXMemberExpression", "JSXNamespacedName")
  7167. }
  7168. }
  7169. });
  7170. (0, _utils$4.default)("JSXElement", {
  7171. builder: ["openingElement", "closingElement", "children", "selfClosing"],
  7172. visitor: ["openingElement", "children", "closingElement"],
  7173. aliases: ["JSX", "Immutable", "Expression"],
  7174. fields: {
  7175. openingElement: {
  7176. validate: (0, _utils$4.assertNodeType)("JSXOpeningElement")
  7177. },
  7178. closingElement: {
  7179. optional: true,
  7180. validate: (0, _utils$4.assertNodeType)("JSXClosingElement")
  7181. },
  7182. children: {
  7183. validate: (0, _utils$4.chain)((0, _utils$4.assertValueType)("array"), (0, _utils$4.assertEach)((0, _utils$4.assertNodeType)("JSXText", "JSXExpressionContainer", "JSXSpreadChild", "JSXElement", "JSXFragment")))
  7184. },
  7185. selfClosing: {
  7186. validate: (0, _utils$4.assertValueType)("boolean"),
  7187. optional: true
  7188. }
  7189. }
  7190. });
  7191. (0, _utils$4.default)("JSXEmptyExpression", {
  7192. aliases: ["JSX"]
  7193. });
  7194. (0, _utils$4.default)("JSXExpressionContainer", {
  7195. visitor: ["expression"],
  7196. aliases: ["JSX", "Immutable"],
  7197. fields: {
  7198. expression: {
  7199. validate: (0, _utils$4.assertNodeType)("Expression", "JSXEmptyExpression")
  7200. }
  7201. }
  7202. });
  7203. (0, _utils$4.default)("JSXSpreadChild", {
  7204. visitor: ["expression"],
  7205. aliases: ["JSX", "Immutable"],
  7206. fields: {
  7207. expression: {
  7208. validate: (0, _utils$4.assertNodeType)("Expression")
  7209. }
  7210. }
  7211. });
  7212. (0, _utils$4.default)("JSXIdentifier", {
  7213. builder: ["name"],
  7214. aliases: ["JSX"],
  7215. fields: {
  7216. name: {
  7217. validate: (0, _utils$4.assertValueType)("string")
  7218. }
  7219. }
  7220. });
  7221. (0, _utils$4.default)("JSXMemberExpression", {
  7222. visitor: ["object", "property"],
  7223. aliases: ["JSX"],
  7224. fields: {
  7225. object: {
  7226. validate: (0, _utils$4.assertNodeType)("JSXMemberExpression", "JSXIdentifier")
  7227. },
  7228. property: {
  7229. validate: (0, _utils$4.assertNodeType)("JSXIdentifier")
  7230. }
  7231. }
  7232. });
  7233. (0, _utils$4.default)("JSXNamespacedName", {
  7234. visitor: ["namespace", "name"],
  7235. aliases: ["JSX"],
  7236. fields: {
  7237. namespace: {
  7238. validate: (0, _utils$4.assertNodeType)("JSXIdentifier")
  7239. },
  7240. name: {
  7241. validate: (0, _utils$4.assertNodeType)("JSXIdentifier")
  7242. }
  7243. }
  7244. });
  7245. (0, _utils$4.default)("JSXOpeningElement", {
  7246. builder: ["name", "attributes", "selfClosing"],
  7247. visitor: ["name", "attributes"],
  7248. aliases: ["JSX", "Immutable"],
  7249. fields: {
  7250. name: {
  7251. validate: (0, _utils$4.assertNodeType)("JSXIdentifier", "JSXMemberExpression", "JSXNamespacedName")
  7252. },
  7253. selfClosing: {
  7254. default: false
  7255. },
  7256. attributes: {
  7257. validate: (0, _utils$4.chain)((0, _utils$4.assertValueType)("array"), (0, _utils$4.assertEach)((0, _utils$4.assertNodeType)("JSXAttribute", "JSXSpreadAttribute")))
  7258. },
  7259. typeParameters: {
  7260. validate: (0, _utils$4.assertNodeType)("TypeParameterInstantiation", "TSTypeParameterInstantiation"),
  7261. optional: true
  7262. }
  7263. }
  7264. });
  7265. (0, _utils$4.default)("JSXSpreadAttribute", {
  7266. visitor: ["argument"],
  7267. aliases: ["JSX"],
  7268. fields: {
  7269. argument: {
  7270. validate: (0, _utils$4.assertNodeType)("Expression")
  7271. }
  7272. }
  7273. });
  7274. (0, _utils$4.default)("JSXText", {
  7275. aliases: ["JSX", "Immutable"],
  7276. builder: ["value"],
  7277. fields: {
  7278. value: {
  7279. validate: (0, _utils$4.assertValueType)("string")
  7280. }
  7281. }
  7282. });
  7283. (0, _utils$4.default)("JSXFragment", {
  7284. builder: ["openingFragment", "closingFragment", "children"],
  7285. visitor: ["openingFragment", "children", "closingFragment"],
  7286. aliases: ["JSX", "Immutable", "Expression"],
  7287. fields: {
  7288. openingFragment: {
  7289. validate: (0, _utils$4.assertNodeType)("JSXOpeningFragment")
  7290. },
  7291. closingFragment: {
  7292. validate: (0, _utils$4.assertNodeType)("JSXClosingFragment")
  7293. },
  7294. children: {
  7295. validate: (0, _utils$4.chain)((0, _utils$4.assertValueType)("array"), (0, _utils$4.assertEach)((0, _utils$4.assertNodeType)("JSXText", "JSXExpressionContainer", "JSXSpreadChild", "JSXElement", "JSXFragment")))
  7296. }
  7297. }
  7298. });
  7299. (0, _utils$4.default)("JSXOpeningFragment", {
  7300. aliases: ["JSX", "Immutable"]
  7301. });
  7302. (0, _utils$4.default)("JSXClosingFragment", {
  7303. aliases: ["JSX", "Immutable"]
  7304. });
  7305. var placeholders = {};
  7306. Object.defineProperty(placeholders, "__esModule", {
  7307. value: true
  7308. });
  7309. placeholders.PLACEHOLDERS_FLIPPED_ALIAS = placeholders.PLACEHOLDERS_ALIAS = placeholders.PLACEHOLDERS = void 0;
  7310. var _utils$3 = utils;
  7311. const PLACEHOLDERS = ["Identifier", "StringLiteral", "Expression", "Statement", "Declaration", "BlockStatement", "ClassBody", "Pattern"];
  7312. placeholders.PLACEHOLDERS = PLACEHOLDERS;
  7313. const PLACEHOLDERS_ALIAS = {
  7314. Declaration: ["Statement"],
  7315. Pattern: ["PatternLike", "LVal"]
  7316. };
  7317. placeholders.PLACEHOLDERS_ALIAS = PLACEHOLDERS_ALIAS;
  7318. for (const type of PLACEHOLDERS) {
  7319. const alias = _utils$3.ALIAS_KEYS[type];
  7320. if (alias != null && alias.length) PLACEHOLDERS_ALIAS[type] = alias;
  7321. }
  7322. const PLACEHOLDERS_FLIPPED_ALIAS = {};
  7323. placeholders.PLACEHOLDERS_FLIPPED_ALIAS = PLACEHOLDERS_FLIPPED_ALIAS;
  7324. Object.keys(PLACEHOLDERS_ALIAS).forEach(type => {
  7325. PLACEHOLDERS_ALIAS[type].forEach(alias => {
  7326. if (!Object.hasOwnProperty.call(PLACEHOLDERS_FLIPPED_ALIAS, alias)) {
  7327. PLACEHOLDERS_FLIPPED_ALIAS[alias] = [];
  7328. }
  7329. PLACEHOLDERS_FLIPPED_ALIAS[alias].push(type);
  7330. });
  7331. });
  7332. var _utils$2 = utils;
  7333. var _placeholders = placeholders;
  7334. {
  7335. (0, _utils$2.default)("Noop", {
  7336. visitor: []
  7337. });
  7338. }
  7339. (0, _utils$2.default)("Placeholder", {
  7340. visitor: [],
  7341. builder: ["expectedNode", "name"],
  7342. fields: {
  7343. name: {
  7344. validate: (0, _utils$2.assertNodeType)("Identifier")
  7345. },
  7346. expectedNode: {
  7347. validate: (0, _utils$2.assertOneOf)(..._placeholders.PLACEHOLDERS)
  7348. }
  7349. }
  7350. });
  7351. (0, _utils$2.default)("V8IntrinsicIdentifier", {
  7352. builder: ["name"],
  7353. fields: {
  7354. name: {
  7355. validate: (0, _utils$2.assertValueType)("string")
  7356. }
  7357. }
  7358. });
  7359. var _utils$1 = utils;
  7360. (0, _utils$1.default)("ArgumentPlaceholder", {});
  7361. (0, _utils$1.default)("BindExpression", {
  7362. visitor: ["object", "callee"],
  7363. aliases: ["Expression"],
  7364. fields: !process.env.BABEL_TYPES_8_BREAKING ? {
  7365. object: {
  7366. validate: Object.assign(() => {}, {
  7367. oneOfNodeTypes: ["Expression"]
  7368. })
  7369. },
  7370. callee: {
  7371. validate: Object.assign(() => {}, {
  7372. oneOfNodeTypes: ["Expression"]
  7373. })
  7374. }
  7375. } : {
  7376. object: {
  7377. validate: (0, _utils$1.assertNodeType)("Expression")
  7378. },
  7379. callee: {
  7380. validate: (0, _utils$1.assertNodeType)("Expression")
  7381. }
  7382. }
  7383. });
  7384. (0, _utils$1.default)("ImportAttribute", {
  7385. visitor: ["key", "value"],
  7386. fields: {
  7387. key: {
  7388. validate: (0, _utils$1.assertNodeType)("Identifier", "StringLiteral")
  7389. },
  7390. value: {
  7391. validate: (0, _utils$1.assertNodeType)("StringLiteral")
  7392. }
  7393. }
  7394. });
  7395. (0, _utils$1.default)("Decorator", {
  7396. visitor: ["expression"],
  7397. fields: {
  7398. expression: {
  7399. validate: (0, _utils$1.assertNodeType)("Expression")
  7400. }
  7401. }
  7402. });
  7403. (0, _utils$1.default)("DoExpression", {
  7404. visitor: ["body"],
  7405. builder: ["body", "async"],
  7406. aliases: ["Expression"],
  7407. fields: {
  7408. body: {
  7409. validate: (0, _utils$1.assertNodeType)("BlockStatement")
  7410. },
  7411. async: {
  7412. validate: (0, _utils$1.assertValueType)("boolean"),
  7413. default: false
  7414. }
  7415. }
  7416. });
  7417. (0, _utils$1.default)("ExportDefaultSpecifier", {
  7418. visitor: ["exported"],
  7419. aliases: ["ModuleSpecifier"],
  7420. fields: {
  7421. exported: {
  7422. validate: (0, _utils$1.assertNodeType)("Identifier")
  7423. }
  7424. }
  7425. });
  7426. (0, _utils$1.default)("RecordExpression", {
  7427. visitor: ["properties"],
  7428. aliases: ["Expression"],
  7429. fields: {
  7430. properties: {
  7431. validate: (0, _utils$1.chain)((0, _utils$1.assertValueType)("array"), (0, _utils$1.assertEach)((0, _utils$1.assertNodeType)("ObjectProperty", "SpreadElement")))
  7432. }
  7433. }
  7434. });
  7435. (0, _utils$1.default)("TupleExpression", {
  7436. fields: {
  7437. elements: {
  7438. validate: (0, _utils$1.chain)((0, _utils$1.assertValueType)("array"), (0, _utils$1.assertEach)((0, _utils$1.assertNodeType)("Expression", "SpreadElement"))),
  7439. default: []
  7440. }
  7441. },
  7442. visitor: ["elements"],
  7443. aliases: ["Expression"]
  7444. });
  7445. (0, _utils$1.default)("DecimalLiteral", {
  7446. builder: ["value"],
  7447. fields: {
  7448. value: {
  7449. validate: (0, _utils$1.assertValueType)("string")
  7450. }
  7451. },
  7452. aliases: ["Expression", "Pureish", "Literal", "Immutable"]
  7453. });
  7454. (0, _utils$1.default)("StaticBlock", {
  7455. visitor: ["body"],
  7456. fields: {
  7457. body: {
  7458. validate: (0, _utils$1.chain)((0, _utils$1.assertValueType)("array"), (0, _utils$1.assertEach)((0, _utils$1.assertNodeType)("Statement")))
  7459. }
  7460. },
  7461. aliases: ["Scopable", "BlockParent"]
  7462. });
  7463. (0, _utils$1.default)("ModuleExpression", {
  7464. visitor: ["body"],
  7465. fields: {
  7466. body: {
  7467. validate: (0, _utils$1.assertNodeType)("Program")
  7468. }
  7469. },
  7470. aliases: ["Expression"]
  7471. });
  7472. (0, _utils$1.default)("TopicReference", {
  7473. aliases: ["Expression"]
  7474. });
  7475. (0, _utils$1.default)("PipelineTopicExpression", {
  7476. builder: ["expression"],
  7477. visitor: ["expression"],
  7478. fields: {
  7479. expression: {
  7480. validate: (0, _utils$1.assertNodeType)("Expression")
  7481. }
  7482. },
  7483. aliases: ["Expression"]
  7484. });
  7485. (0, _utils$1.default)("PipelineBareFunction", {
  7486. builder: ["callee"],
  7487. visitor: ["callee"],
  7488. fields: {
  7489. callee: {
  7490. validate: (0, _utils$1.assertNodeType)("Expression")
  7491. }
  7492. },
  7493. aliases: ["Expression"]
  7494. });
  7495. (0, _utils$1.default)("PipelinePrimaryTopicReference", {
  7496. aliases: ["Expression"]
  7497. });
  7498. var _utils = utils;
  7499. var _core = core;
  7500. var _is$1 = is$1;
  7501. const bool = (0, _utils.assertValueType)("boolean");
  7502. const tSFunctionTypeAnnotationCommon = {
  7503. returnType: {
  7504. validate: (0, _utils.assertNodeType)("TSTypeAnnotation", "Noop"),
  7505. optional: true
  7506. },
  7507. typeParameters: {
  7508. validate: (0, _utils.assertNodeType)("TSTypeParameterDeclaration", "Noop"),
  7509. optional: true
  7510. }
  7511. };
  7512. (0, _utils.default)("TSParameterProperty", {
  7513. aliases: ["LVal"],
  7514. visitor: ["parameter"],
  7515. fields: {
  7516. accessibility: {
  7517. validate: (0, _utils.assertOneOf)("public", "private", "protected"),
  7518. optional: true
  7519. },
  7520. readonly: {
  7521. validate: (0, _utils.assertValueType)("boolean"),
  7522. optional: true
  7523. },
  7524. parameter: {
  7525. validate: (0, _utils.assertNodeType)("Identifier", "AssignmentPattern")
  7526. },
  7527. override: {
  7528. validate: (0, _utils.assertValueType)("boolean"),
  7529. optional: true
  7530. },
  7531. decorators: {
  7532. validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))),
  7533. optional: true
  7534. }
  7535. }
  7536. });
  7537. (0, _utils.default)("TSDeclareFunction", {
  7538. aliases: ["Statement", "Declaration"],
  7539. visitor: ["id", "typeParameters", "params", "returnType"],
  7540. fields: Object.assign({}, _core.functionDeclarationCommon, tSFunctionTypeAnnotationCommon)
  7541. });
  7542. (0, _utils.default)("TSDeclareMethod", {
  7543. visitor: ["decorators", "key", "typeParameters", "params", "returnType"],
  7544. fields: Object.assign({}, _core.classMethodOrDeclareMethodCommon, tSFunctionTypeAnnotationCommon)
  7545. });
  7546. (0, _utils.default)("TSQualifiedName", {
  7547. aliases: ["TSEntityName"],
  7548. visitor: ["left", "right"],
  7549. fields: {
  7550. left: (0, _utils.validateType)("TSEntityName"),
  7551. right: (0, _utils.validateType)("Identifier")
  7552. }
  7553. });
  7554. const signatureDeclarationCommon = {
  7555. typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterDeclaration"),
  7556. parameters: (0, _utils.validateArrayOfType)(["Identifier", "RestElement"]),
  7557. typeAnnotation: (0, _utils.validateOptionalType)("TSTypeAnnotation")
  7558. };
  7559. const callConstructSignatureDeclaration = {
  7560. aliases: ["TSTypeElement"],
  7561. visitor: ["typeParameters", "parameters", "typeAnnotation"],
  7562. fields: signatureDeclarationCommon
  7563. };
  7564. (0, _utils.default)("TSCallSignatureDeclaration", callConstructSignatureDeclaration);
  7565. (0, _utils.default)("TSConstructSignatureDeclaration", callConstructSignatureDeclaration);
  7566. const namedTypeElementCommon = {
  7567. key: (0, _utils.validateType)("Expression"),
  7568. computed: (0, _utils.validate)(bool),
  7569. optional: (0, _utils.validateOptional)(bool)
  7570. };
  7571. (0, _utils.default)("TSPropertySignature", {
  7572. aliases: ["TSTypeElement"],
  7573. visitor: ["key", "typeAnnotation", "initializer"],
  7574. fields: Object.assign({}, namedTypeElementCommon, {
  7575. readonly: (0, _utils.validateOptional)(bool),
  7576. typeAnnotation: (0, _utils.validateOptionalType)("TSTypeAnnotation"),
  7577. initializer: (0, _utils.validateOptionalType)("Expression"),
  7578. kind: {
  7579. validate: (0, _utils.assertOneOf)("get", "set")
  7580. }
  7581. })
  7582. });
  7583. (0, _utils.default)("TSMethodSignature", {
  7584. aliases: ["TSTypeElement"],
  7585. visitor: ["key", "typeParameters", "parameters", "typeAnnotation"],
  7586. fields: Object.assign({}, signatureDeclarationCommon, namedTypeElementCommon, {
  7587. kind: {
  7588. validate: (0, _utils.assertOneOf)("method", "get", "set")
  7589. }
  7590. })
  7591. });
  7592. (0, _utils.default)("TSIndexSignature", {
  7593. aliases: ["TSTypeElement"],
  7594. visitor: ["parameters", "typeAnnotation"],
  7595. fields: {
  7596. readonly: (0, _utils.validateOptional)(bool),
  7597. static: (0, _utils.validateOptional)(bool),
  7598. parameters: (0, _utils.validateArrayOfType)("Identifier"),
  7599. typeAnnotation: (0, _utils.validateOptionalType)("TSTypeAnnotation")
  7600. }
  7601. });
  7602. const tsKeywordTypes = ["TSAnyKeyword", "TSBooleanKeyword", "TSBigIntKeyword", "TSIntrinsicKeyword", "TSNeverKeyword", "TSNullKeyword", "TSNumberKeyword", "TSObjectKeyword", "TSStringKeyword", "TSSymbolKeyword", "TSUndefinedKeyword", "TSUnknownKeyword", "TSVoidKeyword"];
  7603. for (const type of tsKeywordTypes) {
  7604. (0, _utils.default)(type, {
  7605. aliases: ["TSType", "TSBaseType"],
  7606. visitor: [],
  7607. fields: {}
  7608. });
  7609. }
  7610. (0, _utils.default)("TSThisType", {
  7611. aliases: ["TSType", "TSBaseType"],
  7612. visitor: [],
  7613. fields: {}
  7614. });
  7615. const fnOrCtrBase = {
  7616. aliases: ["TSType"],
  7617. visitor: ["typeParameters", "parameters", "typeAnnotation"]
  7618. };
  7619. (0, _utils.default)("TSFunctionType", Object.assign({}, fnOrCtrBase, {
  7620. fields: signatureDeclarationCommon
  7621. }));
  7622. (0, _utils.default)("TSConstructorType", Object.assign({}, fnOrCtrBase, {
  7623. fields: Object.assign({}, signatureDeclarationCommon, {
  7624. abstract: (0, _utils.validateOptional)(bool)
  7625. })
  7626. }));
  7627. (0, _utils.default)("TSTypeReference", {
  7628. aliases: ["TSType"],
  7629. visitor: ["typeName", "typeParameters"],
  7630. fields: {
  7631. typeName: (0, _utils.validateType)("TSEntityName"),
  7632. typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterInstantiation")
  7633. }
  7634. });
  7635. (0, _utils.default)("TSTypePredicate", {
  7636. aliases: ["TSType"],
  7637. visitor: ["parameterName", "typeAnnotation"],
  7638. builder: ["parameterName", "typeAnnotation", "asserts"],
  7639. fields: {
  7640. parameterName: (0, _utils.validateType)(["Identifier", "TSThisType"]),
  7641. typeAnnotation: (0, _utils.validateOptionalType)("TSTypeAnnotation"),
  7642. asserts: (0, _utils.validateOptional)(bool)
  7643. }
  7644. });
  7645. (0, _utils.default)("TSTypeQuery", {
  7646. aliases: ["TSType"],
  7647. visitor: ["exprName"],
  7648. fields: {
  7649. exprName: (0, _utils.validateType)(["TSEntityName", "TSImportType"])
  7650. }
  7651. });
  7652. (0, _utils.default)("TSTypeLiteral", {
  7653. aliases: ["TSType"],
  7654. visitor: ["members"],
  7655. fields: {
  7656. members: (0, _utils.validateArrayOfType)("TSTypeElement")
  7657. }
  7658. });
  7659. (0, _utils.default)("TSArrayType", {
  7660. aliases: ["TSType"],
  7661. visitor: ["elementType"],
  7662. fields: {
  7663. elementType: (0, _utils.validateType)("TSType")
  7664. }
  7665. });
  7666. (0, _utils.default)("TSTupleType", {
  7667. aliases: ["TSType"],
  7668. visitor: ["elementTypes"],
  7669. fields: {
  7670. elementTypes: (0, _utils.validateArrayOfType)(["TSType", "TSNamedTupleMember"])
  7671. }
  7672. });
  7673. (0, _utils.default)("TSOptionalType", {
  7674. aliases: ["TSType"],
  7675. visitor: ["typeAnnotation"],
  7676. fields: {
  7677. typeAnnotation: (0, _utils.validateType)("TSType")
  7678. }
  7679. });
  7680. (0, _utils.default)("TSRestType", {
  7681. aliases: ["TSType"],
  7682. visitor: ["typeAnnotation"],
  7683. fields: {
  7684. typeAnnotation: (0, _utils.validateType)("TSType")
  7685. }
  7686. });
  7687. (0, _utils.default)("TSNamedTupleMember", {
  7688. visitor: ["label", "elementType"],
  7689. builder: ["label", "elementType", "optional"],
  7690. fields: {
  7691. label: (0, _utils.validateType)("Identifier"),
  7692. optional: {
  7693. validate: bool,
  7694. default: false
  7695. },
  7696. elementType: (0, _utils.validateType)("TSType")
  7697. }
  7698. });
  7699. const unionOrIntersection = {
  7700. aliases: ["TSType"],
  7701. visitor: ["types"],
  7702. fields: {
  7703. types: (0, _utils.validateArrayOfType)("TSType")
  7704. }
  7705. };
  7706. (0, _utils.default)("TSUnionType", unionOrIntersection);
  7707. (0, _utils.default)("TSIntersectionType", unionOrIntersection);
  7708. (0, _utils.default)("TSConditionalType", {
  7709. aliases: ["TSType"],
  7710. visitor: ["checkType", "extendsType", "trueType", "falseType"],
  7711. fields: {
  7712. checkType: (0, _utils.validateType)("TSType"),
  7713. extendsType: (0, _utils.validateType)("TSType"),
  7714. trueType: (0, _utils.validateType)("TSType"),
  7715. falseType: (0, _utils.validateType)("TSType")
  7716. }
  7717. });
  7718. (0, _utils.default)("TSInferType", {
  7719. aliases: ["TSType"],
  7720. visitor: ["typeParameter"],
  7721. fields: {
  7722. typeParameter: (0, _utils.validateType)("TSTypeParameter")
  7723. }
  7724. });
  7725. (0, _utils.default)("TSParenthesizedType", {
  7726. aliases: ["TSType"],
  7727. visitor: ["typeAnnotation"],
  7728. fields: {
  7729. typeAnnotation: (0, _utils.validateType)("TSType")
  7730. }
  7731. });
  7732. (0, _utils.default)("TSTypeOperator", {
  7733. aliases: ["TSType"],
  7734. visitor: ["typeAnnotation"],
  7735. fields: {
  7736. operator: (0, _utils.validate)((0, _utils.assertValueType)("string")),
  7737. typeAnnotation: (0, _utils.validateType)("TSType")
  7738. }
  7739. });
  7740. (0, _utils.default)("TSIndexedAccessType", {
  7741. aliases: ["TSType"],
  7742. visitor: ["objectType", "indexType"],
  7743. fields: {
  7744. objectType: (0, _utils.validateType)("TSType"),
  7745. indexType: (0, _utils.validateType)("TSType")
  7746. }
  7747. });
  7748. (0, _utils.default)("TSMappedType", {
  7749. aliases: ["TSType"],
  7750. visitor: ["typeParameter", "typeAnnotation", "nameType"],
  7751. fields: {
  7752. readonly: (0, _utils.validateOptional)(bool),
  7753. typeParameter: (0, _utils.validateType)("TSTypeParameter"),
  7754. optional: (0, _utils.validateOptional)(bool),
  7755. typeAnnotation: (0, _utils.validateOptionalType)("TSType"),
  7756. nameType: (0, _utils.validateOptionalType)("TSType")
  7757. }
  7758. });
  7759. (0, _utils.default)("TSLiteralType", {
  7760. aliases: ["TSType", "TSBaseType"],
  7761. visitor: ["literal"],
  7762. fields: {
  7763. literal: {
  7764. validate: function () {
  7765. const unaryExpression = (0, _utils.assertNodeType)("NumericLiteral", "BigIntLiteral");
  7766. const unaryOperator = (0, _utils.assertOneOf)("-");
  7767. const literal = (0, _utils.assertNodeType)("NumericLiteral", "StringLiteral", "BooleanLiteral", "BigIntLiteral");
  7768. function validator(parent, key, node) {
  7769. if ((0, _is$1.default)("UnaryExpression", node)) {
  7770. unaryOperator(node, "operator", node.operator);
  7771. unaryExpression(node, "argument", node.argument);
  7772. } else {
  7773. literal(parent, key, node);
  7774. }
  7775. }
  7776. validator.oneOfNodeTypes = ["NumericLiteral", "StringLiteral", "BooleanLiteral", "BigIntLiteral", "UnaryExpression"];
  7777. return validator;
  7778. }()
  7779. }
  7780. }
  7781. });
  7782. (0, _utils.default)("TSExpressionWithTypeArguments", {
  7783. aliases: ["TSType"],
  7784. visitor: ["expression", "typeParameters"],
  7785. fields: {
  7786. expression: (0, _utils.validateType)("TSEntityName"),
  7787. typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterInstantiation")
  7788. }
  7789. });
  7790. (0, _utils.default)("TSInterfaceDeclaration", {
  7791. aliases: ["Statement", "Declaration"],
  7792. visitor: ["id", "typeParameters", "extends", "body"],
  7793. fields: {
  7794. declare: (0, _utils.validateOptional)(bool),
  7795. id: (0, _utils.validateType)("Identifier"),
  7796. typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterDeclaration"),
  7797. extends: (0, _utils.validateOptional)((0, _utils.arrayOfType)("TSExpressionWithTypeArguments")),
  7798. body: (0, _utils.validateType)("TSInterfaceBody")
  7799. }
  7800. });
  7801. (0, _utils.default)("TSInterfaceBody", {
  7802. visitor: ["body"],
  7803. fields: {
  7804. body: (0, _utils.validateArrayOfType)("TSTypeElement")
  7805. }
  7806. });
  7807. (0, _utils.default)("TSTypeAliasDeclaration", {
  7808. aliases: ["Statement", "Declaration"],
  7809. visitor: ["id", "typeParameters", "typeAnnotation"],
  7810. fields: {
  7811. declare: (0, _utils.validateOptional)(bool),
  7812. id: (0, _utils.validateType)("Identifier"),
  7813. typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterDeclaration"),
  7814. typeAnnotation: (0, _utils.validateType)("TSType")
  7815. }
  7816. });
  7817. (0, _utils.default)("TSAsExpression", {
  7818. aliases: ["Expression"],
  7819. visitor: ["expression", "typeAnnotation"],
  7820. fields: {
  7821. expression: (0, _utils.validateType)("Expression"),
  7822. typeAnnotation: (0, _utils.validateType)("TSType")
  7823. }
  7824. });
  7825. (0, _utils.default)("TSTypeAssertion", {
  7826. aliases: ["Expression"],
  7827. visitor: ["typeAnnotation", "expression"],
  7828. fields: {
  7829. typeAnnotation: (0, _utils.validateType)("TSType"),
  7830. expression: (0, _utils.validateType)("Expression")
  7831. }
  7832. });
  7833. (0, _utils.default)("TSEnumDeclaration", {
  7834. aliases: ["Statement", "Declaration"],
  7835. visitor: ["id", "members"],
  7836. fields: {
  7837. declare: (0, _utils.validateOptional)(bool),
  7838. const: (0, _utils.validateOptional)(bool),
  7839. id: (0, _utils.validateType)("Identifier"),
  7840. members: (0, _utils.validateArrayOfType)("TSEnumMember"),
  7841. initializer: (0, _utils.validateOptionalType)("Expression")
  7842. }
  7843. });
  7844. (0, _utils.default)("TSEnumMember", {
  7845. visitor: ["id", "initializer"],
  7846. fields: {
  7847. id: (0, _utils.validateType)(["Identifier", "StringLiteral"]),
  7848. initializer: (0, _utils.validateOptionalType)("Expression")
  7849. }
  7850. });
  7851. (0, _utils.default)("TSModuleDeclaration", {
  7852. aliases: ["Statement", "Declaration"],
  7853. visitor: ["id", "body"],
  7854. fields: {
  7855. declare: (0, _utils.validateOptional)(bool),
  7856. global: (0, _utils.validateOptional)(bool),
  7857. id: (0, _utils.validateType)(["Identifier", "StringLiteral"]),
  7858. body: (0, _utils.validateType)(["TSModuleBlock", "TSModuleDeclaration"])
  7859. }
  7860. });
  7861. (0, _utils.default)("TSModuleBlock", {
  7862. aliases: ["Scopable", "Block", "BlockParent"],
  7863. visitor: ["body"],
  7864. fields: {
  7865. body: (0, _utils.validateArrayOfType)("Statement")
  7866. }
  7867. });
  7868. (0, _utils.default)("TSImportType", {
  7869. aliases: ["TSType"],
  7870. visitor: ["argument", "qualifier", "typeParameters"],
  7871. fields: {
  7872. argument: (0, _utils.validateType)("StringLiteral"),
  7873. qualifier: (0, _utils.validateOptionalType)("TSEntityName"),
  7874. typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterInstantiation")
  7875. }
  7876. });
  7877. (0, _utils.default)("TSImportEqualsDeclaration", {
  7878. aliases: ["Statement"],
  7879. visitor: ["id", "moduleReference"],
  7880. fields: {
  7881. isExport: (0, _utils.validate)(bool),
  7882. id: (0, _utils.validateType)("Identifier"),
  7883. moduleReference: (0, _utils.validateType)(["TSEntityName", "TSExternalModuleReference"]),
  7884. importKind: {
  7885. validate: (0, _utils.assertOneOf)("type", "value"),
  7886. optional: true
  7887. }
  7888. }
  7889. });
  7890. (0, _utils.default)("TSExternalModuleReference", {
  7891. visitor: ["expression"],
  7892. fields: {
  7893. expression: (0, _utils.validateType)("StringLiteral")
  7894. }
  7895. });
  7896. (0, _utils.default)("TSNonNullExpression", {
  7897. aliases: ["Expression"],
  7898. visitor: ["expression"],
  7899. fields: {
  7900. expression: (0, _utils.validateType)("Expression")
  7901. }
  7902. });
  7903. (0, _utils.default)("TSExportAssignment", {
  7904. aliases: ["Statement"],
  7905. visitor: ["expression"],
  7906. fields: {
  7907. expression: (0, _utils.validateType)("Expression")
  7908. }
  7909. });
  7910. (0, _utils.default)("TSNamespaceExportDeclaration", {
  7911. aliases: ["Statement"],
  7912. visitor: ["id"],
  7913. fields: {
  7914. id: (0, _utils.validateType)("Identifier")
  7915. }
  7916. });
  7917. (0, _utils.default)("TSTypeAnnotation", {
  7918. visitor: ["typeAnnotation"],
  7919. fields: {
  7920. typeAnnotation: {
  7921. validate: (0, _utils.assertNodeType)("TSType")
  7922. }
  7923. }
  7924. });
  7925. (0, _utils.default)("TSTypeParameterInstantiation", {
  7926. visitor: ["params"],
  7927. fields: {
  7928. params: {
  7929. validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("TSType")))
  7930. }
  7931. }
  7932. });
  7933. (0, _utils.default)("TSTypeParameterDeclaration", {
  7934. visitor: ["params"],
  7935. fields: {
  7936. params: {
  7937. validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("TSTypeParameter")))
  7938. }
  7939. }
  7940. });
  7941. (0, _utils.default)("TSTypeParameter", {
  7942. builder: ["constraint", "default", "name"],
  7943. visitor: ["constraint", "default"],
  7944. fields: {
  7945. name: {
  7946. validate: (0, _utils.assertValueType)("string")
  7947. },
  7948. constraint: {
  7949. validate: (0, _utils.assertNodeType)("TSType"),
  7950. optional: true
  7951. },
  7952. default: {
  7953. validate: (0, _utils.assertNodeType)("TSType"),
  7954. optional: true
  7955. }
  7956. }
  7957. });
  7958. (function (exports) {
  7959. Object.defineProperty(exports, "__esModule", {
  7960. value: true
  7961. });
  7962. Object.defineProperty(exports, "VISITOR_KEYS", {
  7963. enumerable: true,
  7964. get: function () {
  7965. return _utils.VISITOR_KEYS;
  7966. }
  7967. });
  7968. Object.defineProperty(exports, "ALIAS_KEYS", {
  7969. enumerable: true,
  7970. get: function () {
  7971. return _utils.ALIAS_KEYS;
  7972. }
  7973. });
  7974. Object.defineProperty(exports, "FLIPPED_ALIAS_KEYS", {
  7975. enumerable: true,
  7976. get: function () {
  7977. return _utils.FLIPPED_ALIAS_KEYS;
  7978. }
  7979. });
  7980. Object.defineProperty(exports, "NODE_FIELDS", {
  7981. enumerable: true,
  7982. get: function () {
  7983. return _utils.NODE_FIELDS;
  7984. }
  7985. });
  7986. Object.defineProperty(exports, "BUILDER_KEYS", {
  7987. enumerable: true,
  7988. get: function () {
  7989. return _utils.BUILDER_KEYS;
  7990. }
  7991. });
  7992. Object.defineProperty(exports, "DEPRECATED_KEYS", {
  7993. enumerable: true,
  7994. get: function () {
  7995. return _utils.DEPRECATED_KEYS;
  7996. }
  7997. });
  7998. Object.defineProperty(exports, "NODE_PARENT_VALIDATIONS", {
  7999. enumerable: true,
  8000. get: function () {
  8001. return _utils.NODE_PARENT_VALIDATIONS;
  8002. }
  8003. });
  8004. Object.defineProperty(exports, "PLACEHOLDERS", {
  8005. enumerable: true,
  8006. get: function () {
  8007. return _placeholders.PLACEHOLDERS;
  8008. }
  8009. });
  8010. Object.defineProperty(exports, "PLACEHOLDERS_ALIAS", {
  8011. enumerable: true,
  8012. get: function () {
  8013. return _placeholders.PLACEHOLDERS_ALIAS;
  8014. }
  8015. });
  8016. Object.defineProperty(exports, "PLACEHOLDERS_FLIPPED_ALIAS", {
  8017. enumerable: true,
  8018. get: function () {
  8019. return _placeholders.PLACEHOLDERS_FLIPPED_ALIAS;
  8020. }
  8021. });
  8022. exports.TYPES = void 0;
  8023. var _utils = utils;
  8024. var _placeholders = placeholders;
  8025. const TYPES = Object.keys(_utils.VISITOR_KEYS).concat(Object.keys(_utils.FLIPPED_ALIAS_KEYS)).concat(Object.keys(_utils.DEPRECATED_KEYS));
  8026. exports.TYPES = TYPES;
  8027. }(definitions));
  8028. Object.defineProperty(builder$1, "__esModule", {
  8029. value: true
  8030. });
  8031. builder$1.default = builder;
  8032. var _definitions$6 = definitions;
  8033. var _validate = validate$2;
  8034. function builder(type, ...args) {
  8035. const keys = _definitions$6.BUILDER_KEYS[type];
  8036. const countArgs = args.length;
  8037. if (countArgs > keys.length) {
  8038. throw new Error(`${type}: Too many arguments passed. Received ${countArgs} but can receive no more than ${keys.length}`);
  8039. }
  8040. const node = {
  8041. type
  8042. };
  8043. let i = 0;
  8044. keys.forEach(key => {
  8045. const field = _definitions$6.NODE_FIELDS[type][key];
  8046. let arg;
  8047. if (i < countArgs) arg = args[i];
  8048. if (arg === undefined) {
  8049. arg = Array.isArray(field.default) ? [] : field.default;
  8050. }
  8051. node[key] = arg;
  8052. i++;
  8053. });
  8054. for (const key of Object.keys(node)) {
  8055. (0, _validate.default)(node, key, node[key]);
  8056. }
  8057. return node;
  8058. }
  8059. Object.defineProperty(generated$3, "__esModule", {
  8060. value: true
  8061. });
  8062. generated$3.arrayExpression = arrayExpression;
  8063. generated$3.assignmentExpression = assignmentExpression;
  8064. generated$3.binaryExpression = binaryExpression;
  8065. generated$3.interpreterDirective = interpreterDirective;
  8066. generated$3.directive = directive;
  8067. generated$3.directiveLiteral = directiveLiteral;
  8068. generated$3.blockStatement = blockStatement;
  8069. generated$3.breakStatement = breakStatement;
  8070. generated$3.callExpression = callExpression;
  8071. generated$3.catchClause = catchClause;
  8072. generated$3.conditionalExpression = conditionalExpression;
  8073. generated$3.continueStatement = continueStatement;
  8074. generated$3.debuggerStatement = debuggerStatement;
  8075. generated$3.doWhileStatement = doWhileStatement;
  8076. generated$3.emptyStatement = emptyStatement;
  8077. generated$3.expressionStatement = expressionStatement;
  8078. generated$3.file = file;
  8079. generated$3.forInStatement = forInStatement;
  8080. generated$3.forStatement = forStatement;
  8081. generated$3.functionDeclaration = functionDeclaration;
  8082. generated$3.functionExpression = functionExpression;
  8083. generated$3.identifier = identifier;
  8084. generated$3.ifStatement = ifStatement;
  8085. generated$3.labeledStatement = labeledStatement;
  8086. generated$3.stringLiteral = stringLiteral;
  8087. generated$3.numericLiteral = numericLiteral;
  8088. generated$3.nullLiteral = nullLiteral;
  8089. generated$3.booleanLiteral = booleanLiteral;
  8090. generated$3.regExpLiteral = regExpLiteral;
  8091. generated$3.logicalExpression = logicalExpression;
  8092. generated$3.memberExpression = memberExpression;
  8093. generated$3.newExpression = newExpression;
  8094. generated$3.program = program;
  8095. generated$3.objectExpression = objectExpression;
  8096. generated$3.objectMethod = objectMethod;
  8097. generated$3.objectProperty = objectProperty;
  8098. generated$3.restElement = restElement;
  8099. generated$3.returnStatement = returnStatement;
  8100. generated$3.sequenceExpression = sequenceExpression;
  8101. generated$3.parenthesizedExpression = parenthesizedExpression;
  8102. generated$3.switchCase = switchCase;
  8103. generated$3.switchStatement = switchStatement;
  8104. generated$3.thisExpression = thisExpression;
  8105. generated$3.throwStatement = throwStatement;
  8106. generated$3.tryStatement = tryStatement;
  8107. generated$3.unaryExpression = unaryExpression;
  8108. generated$3.updateExpression = updateExpression;
  8109. generated$3.variableDeclaration = variableDeclaration;
  8110. generated$3.variableDeclarator = variableDeclarator;
  8111. generated$3.whileStatement = whileStatement;
  8112. generated$3.withStatement = withStatement;
  8113. generated$3.assignmentPattern = assignmentPattern;
  8114. generated$3.arrayPattern = arrayPattern;
  8115. generated$3.arrowFunctionExpression = arrowFunctionExpression;
  8116. generated$3.classBody = classBody;
  8117. generated$3.classExpression = classExpression;
  8118. generated$3.classDeclaration = classDeclaration;
  8119. generated$3.exportAllDeclaration = exportAllDeclaration;
  8120. generated$3.exportDefaultDeclaration = exportDefaultDeclaration;
  8121. generated$3.exportNamedDeclaration = exportNamedDeclaration;
  8122. generated$3.exportSpecifier = exportSpecifier;
  8123. generated$3.forOfStatement = forOfStatement;
  8124. generated$3.importDeclaration = importDeclaration;
  8125. generated$3.importDefaultSpecifier = importDefaultSpecifier;
  8126. generated$3.importNamespaceSpecifier = importNamespaceSpecifier;
  8127. generated$3.importSpecifier = importSpecifier;
  8128. generated$3.metaProperty = metaProperty;
  8129. generated$3.classMethod = classMethod;
  8130. generated$3.objectPattern = objectPattern;
  8131. generated$3.spreadElement = spreadElement;
  8132. generated$3.super = _super;
  8133. generated$3.taggedTemplateExpression = taggedTemplateExpression;
  8134. generated$3.templateElement = templateElement;
  8135. generated$3.templateLiteral = templateLiteral;
  8136. generated$3.yieldExpression = yieldExpression;
  8137. generated$3.awaitExpression = awaitExpression;
  8138. generated$3.import = _import;
  8139. generated$3.bigIntLiteral = bigIntLiteral;
  8140. generated$3.exportNamespaceSpecifier = exportNamespaceSpecifier;
  8141. generated$3.optionalMemberExpression = optionalMemberExpression;
  8142. generated$3.optionalCallExpression = optionalCallExpression;
  8143. generated$3.classProperty = classProperty;
  8144. generated$3.classPrivateProperty = classPrivateProperty;
  8145. generated$3.classPrivateMethod = classPrivateMethod;
  8146. generated$3.privateName = privateName;
  8147. generated$3.anyTypeAnnotation = anyTypeAnnotation;
  8148. generated$3.arrayTypeAnnotation = arrayTypeAnnotation;
  8149. generated$3.booleanTypeAnnotation = booleanTypeAnnotation;
  8150. generated$3.booleanLiteralTypeAnnotation = booleanLiteralTypeAnnotation;
  8151. generated$3.nullLiteralTypeAnnotation = nullLiteralTypeAnnotation;
  8152. generated$3.classImplements = classImplements;
  8153. generated$3.declareClass = declareClass;
  8154. generated$3.declareFunction = declareFunction;
  8155. generated$3.declareInterface = declareInterface;
  8156. generated$3.declareModule = declareModule;
  8157. generated$3.declareModuleExports = declareModuleExports;
  8158. generated$3.declareTypeAlias = declareTypeAlias;
  8159. generated$3.declareOpaqueType = declareOpaqueType;
  8160. generated$3.declareVariable = declareVariable;
  8161. generated$3.declareExportDeclaration = declareExportDeclaration;
  8162. generated$3.declareExportAllDeclaration = declareExportAllDeclaration;
  8163. generated$3.declaredPredicate = declaredPredicate;
  8164. generated$3.existsTypeAnnotation = existsTypeAnnotation;
  8165. generated$3.functionTypeAnnotation = functionTypeAnnotation;
  8166. generated$3.functionTypeParam = functionTypeParam;
  8167. generated$3.genericTypeAnnotation = genericTypeAnnotation;
  8168. generated$3.inferredPredicate = inferredPredicate;
  8169. generated$3.interfaceExtends = interfaceExtends;
  8170. generated$3.interfaceDeclaration = interfaceDeclaration;
  8171. generated$3.interfaceTypeAnnotation = interfaceTypeAnnotation;
  8172. generated$3.intersectionTypeAnnotation = intersectionTypeAnnotation;
  8173. generated$3.mixedTypeAnnotation = mixedTypeAnnotation;
  8174. generated$3.emptyTypeAnnotation = emptyTypeAnnotation;
  8175. generated$3.nullableTypeAnnotation = nullableTypeAnnotation;
  8176. generated$3.numberLiteralTypeAnnotation = numberLiteralTypeAnnotation;
  8177. generated$3.numberTypeAnnotation = numberTypeAnnotation;
  8178. generated$3.objectTypeAnnotation = objectTypeAnnotation;
  8179. generated$3.objectTypeInternalSlot = objectTypeInternalSlot;
  8180. generated$3.objectTypeCallProperty = objectTypeCallProperty;
  8181. generated$3.objectTypeIndexer = objectTypeIndexer;
  8182. generated$3.objectTypeProperty = objectTypeProperty;
  8183. generated$3.objectTypeSpreadProperty = objectTypeSpreadProperty;
  8184. generated$3.opaqueType = opaqueType;
  8185. generated$3.qualifiedTypeIdentifier = qualifiedTypeIdentifier;
  8186. generated$3.stringLiteralTypeAnnotation = stringLiteralTypeAnnotation;
  8187. generated$3.stringTypeAnnotation = stringTypeAnnotation;
  8188. generated$3.symbolTypeAnnotation = symbolTypeAnnotation;
  8189. generated$3.thisTypeAnnotation = thisTypeAnnotation;
  8190. generated$3.tupleTypeAnnotation = tupleTypeAnnotation;
  8191. generated$3.typeofTypeAnnotation = typeofTypeAnnotation;
  8192. generated$3.typeAlias = typeAlias;
  8193. generated$3.typeAnnotation = typeAnnotation;
  8194. generated$3.typeCastExpression = typeCastExpression;
  8195. generated$3.typeParameter = typeParameter;
  8196. generated$3.typeParameterDeclaration = typeParameterDeclaration;
  8197. generated$3.typeParameterInstantiation = typeParameterInstantiation;
  8198. generated$3.unionTypeAnnotation = unionTypeAnnotation;
  8199. generated$3.variance = variance;
  8200. generated$3.voidTypeAnnotation = voidTypeAnnotation;
  8201. generated$3.enumDeclaration = enumDeclaration;
  8202. generated$3.enumBooleanBody = enumBooleanBody;
  8203. generated$3.enumNumberBody = enumNumberBody;
  8204. generated$3.enumStringBody = enumStringBody;
  8205. generated$3.enumSymbolBody = enumSymbolBody;
  8206. generated$3.enumBooleanMember = enumBooleanMember;
  8207. generated$3.enumNumberMember = enumNumberMember;
  8208. generated$3.enumStringMember = enumStringMember;
  8209. generated$3.enumDefaultedMember = enumDefaultedMember;
  8210. generated$3.indexedAccessType = indexedAccessType;
  8211. generated$3.optionalIndexedAccessType = optionalIndexedAccessType;
  8212. generated$3.jSXAttribute = generated$3.jsxAttribute = jsxAttribute;
  8213. generated$3.jSXClosingElement = generated$3.jsxClosingElement = jsxClosingElement;
  8214. generated$3.jSXElement = generated$3.jsxElement = jsxElement;
  8215. generated$3.jSXEmptyExpression = generated$3.jsxEmptyExpression = jsxEmptyExpression;
  8216. generated$3.jSXExpressionContainer = generated$3.jsxExpressionContainer = jsxExpressionContainer;
  8217. generated$3.jSXSpreadChild = generated$3.jsxSpreadChild = jsxSpreadChild;
  8218. generated$3.jSXIdentifier = generated$3.jsxIdentifier = jsxIdentifier;
  8219. generated$3.jSXMemberExpression = generated$3.jsxMemberExpression = jsxMemberExpression;
  8220. generated$3.jSXNamespacedName = generated$3.jsxNamespacedName = jsxNamespacedName;
  8221. generated$3.jSXOpeningElement = generated$3.jsxOpeningElement = jsxOpeningElement;
  8222. generated$3.jSXSpreadAttribute = generated$3.jsxSpreadAttribute = jsxSpreadAttribute;
  8223. generated$3.jSXText = generated$3.jsxText = jsxText;
  8224. generated$3.jSXFragment = generated$3.jsxFragment = jsxFragment;
  8225. generated$3.jSXOpeningFragment = generated$3.jsxOpeningFragment = jsxOpeningFragment;
  8226. generated$3.jSXClosingFragment = generated$3.jsxClosingFragment = jsxClosingFragment;
  8227. generated$3.noop = noop;
  8228. generated$3.placeholder = placeholder;
  8229. generated$3.v8IntrinsicIdentifier = v8IntrinsicIdentifier;
  8230. generated$3.argumentPlaceholder = argumentPlaceholder;
  8231. generated$3.bindExpression = bindExpression;
  8232. generated$3.importAttribute = importAttribute;
  8233. generated$3.decorator = decorator;
  8234. generated$3.doExpression = doExpression;
  8235. generated$3.exportDefaultSpecifier = exportDefaultSpecifier;
  8236. generated$3.recordExpression = recordExpression;
  8237. generated$3.tupleExpression = tupleExpression;
  8238. generated$3.decimalLiteral = decimalLiteral;
  8239. generated$3.staticBlock = staticBlock;
  8240. generated$3.moduleExpression = moduleExpression;
  8241. generated$3.topicReference = topicReference;
  8242. generated$3.pipelineTopicExpression = pipelineTopicExpression;
  8243. generated$3.pipelineBareFunction = pipelineBareFunction;
  8244. generated$3.pipelinePrimaryTopicReference = pipelinePrimaryTopicReference;
  8245. generated$3.tSParameterProperty = generated$3.tsParameterProperty = tsParameterProperty;
  8246. generated$3.tSDeclareFunction = generated$3.tsDeclareFunction = tsDeclareFunction;
  8247. generated$3.tSDeclareMethod = generated$3.tsDeclareMethod = tsDeclareMethod;
  8248. generated$3.tSQualifiedName = generated$3.tsQualifiedName = tsQualifiedName;
  8249. generated$3.tSCallSignatureDeclaration = generated$3.tsCallSignatureDeclaration = tsCallSignatureDeclaration;
  8250. generated$3.tSConstructSignatureDeclaration = generated$3.tsConstructSignatureDeclaration = tsConstructSignatureDeclaration;
  8251. generated$3.tSPropertySignature = generated$3.tsPropertySignature = tsPropertySignature;
  8252. generated$3.tSMethodSignature = generated$3.tsMethodSignature = tsMethodSignature;
  8253. generated$3.tSIndexSignature = generated$3.tsIndexSignature = tsIndexSignature;
  8254. generated$3.tSAnyKeyword = generated$3.tsAnyKeyword = tsAnyKeyword;
  8255. generated$3.tSBooleanKeyword = generated$3.tsBooleanKeyword = tsBooleanKeyword;
  8256. generated$3.tSBigIntKeyword = generated$3.tsBigIntKeyword = tsBigIntKeyword;
  8257. generated$3.tSIntrinsicKeyword = generated$3.tsIntrinsicKeyword = tsIntrinsicKeyword;
  8258. generated$3.tSNeverKeyword = generated$3.tsNeverKeyword = tsNeverKeyword;
  8259. generated$3.tSNullKeyword = generated$3.tsNullKeyword = tsNullKeyword;
  8260. generated$3.tSNumberKeyword = generated$3.tsNumberKeyword = tsNumberKeyword;
  8261. generated$3.tSObjectKeyword = generated$3.tsObjectKeyword = tsObjectKeyword;
  8262. generated$3.tSStringKeyword = generated$3.tsStringKeyword = tsStringKeyword;
  8263. generated$3.tSSymbolKeyword = generated$3.tsSymbolKeyword = tsSymbolKeyword;
  8264. generated$3.tSUndefinedKeyword = generated$3.tsUndefinedKeyword = tsUndefinedKeyword;
  8265. generated$3.tSUnknownKeyword = generated$3.tsUnknownKeyword = tsUnknownKeyword;
  8266. generated$3.tSVoidKeyword = generated$3.tsVoidKeyword = tsVoidKeyword;
  8267. generated$3.tSThisType = generated$3.tsThisType = tsThisType;
  8268. generated$3.tSFunctionType = generated$3.tsFunctionType = tsFunctionType;
  8269. generated$3.tSConstructorType = generated$3.tsConstructorType = tsConstructorType;
  8270. generated$3.tSTypeReference = generated$3.tsTypeReference = tsTypeReference;
  8271. generated$3.tSTypePredicate = generated$3.tsTypePredicate = tsTypePredicate;
  8272. generated$3.tSTypeQuery = generated$3.tsTypeQuery = tsTypeQuery;
  8273. generated$3.tSTypeLiteral = generated$3.tsTypeLiteral = tsTypeLiteral;
  8274. generated$3.tSArrayType = generated$3.tsArrayType = tsArrayType;
  8275. generated$3.tSTupleType = generated$3.tsTupleType = tsTupleType;
  8276. generated$3.tSOptionalType = generated$3.tsOptionalType = tsOptionalType;
  8277. generated$3.tSRestType = generated$3.tsRestType = tsRestType;
  8278. generated$3.tSNamedTupleMember = generated$3.tsNamedTupleMember = tsNamedTupleMember;
  8279. generated$3.tSUnionType = generated$3.tsUnionType = tsUnionType;
  8280. generated$3.tSIntersectionType = generated$3.tsIntersectionType = tsIntersectionType;
  8281. generated$3.tSConditionalType = generated$3.tsConditionalType = tsConditionalType;
  8282. generated$3.tSInferType = generated$3.tsInferType = tsInferType;
  8283. generated$3.tSParenthesizedType = generated$3.tsParenthesizedType = tsParenthesizedType;
  8284. generated$3.tSTypeOperator = generated$3.tsTypeOperator = tsTypeOperator;
  8285. generated$3.tSIndexedAccessType = generated$3.tsIndexedAccessType = tsIndexedAccessType;
  8286. generated$3.tSMappedType = generated$3.tsMappedType = tsMappedType;
  8287. generated$3.tSLiteralType = generated$3.tsLiteralType = tsLiteralType;
  8288. generated$3.tSExpressionWithTypeArguments = generated$3.tsExpressionWithTypeArguments = tsExpressionWithTypeArguments;
  8289. generated$3.tSInterfaceDeclaration = generated$3.tsInterfaceDeclaration = tsInterfaceDeclaration;
  8290. generated$3.tSInterfaceBody = generated$3.tsInterfaceBody = tsInterfaceBody;
  8291. generated$3.tSTypeAliasDeclaration = generated$3.tsTypeAliasDeclaration = tsTypeAliasDeclaration;
  8292. generated$3.tSAsExpression = generated$3.tsAsExpression = tsAsExpression;
  8293. generated$3.tSTypeAssertion = generated$3.tsTypeAssertion = tsTypeAssertion;
  8294. generated$3.tSEnumDeclaration = generated$3.tsEnumDeclaration = tsEnumDeclaration;
  8295. generated$3.tSEnumMember = generated$3.tsEnumMember = tsEnumMember;
  8296. generated$3.tSModuleDeclaration = generated$3.tsModuleDeclaration = tsModuleDeclaration;
  8297. generated$3.tSModuleBlock = generated$3.tsModuleBlock = tsModuleBlock;
  8298. generated$3.tSImportType = generated$3.tsImportType = tsImportType;
  8299. generated$3.tSImportEqualsDeclaration = generated$3.tsImportEqualsDeclaration = tsImportEqualsDeclaration;
  8300. generated$3.tSExternalModuleReference = generated$3.tsExternalModuleReference = tsExternalModuleReference;
  8301. generated$3.tSNonNullExpression = generated$3.tsNonNullExpression = tsNonNullExpression;
  8302. generated$3.tSExportAssignment = generated$3.tsExportAssignment = tsExportAssignment;
  8303. generated$3.tSNamespaceExportDeclaration = generated$3.tsNamespaceExportDeclaration = tsNamespaceExportDeclaration;
  8304. generated$3.tSTypeAnnotation = generated$3.tsTypeAnnotation = tsTypeAnnotation;
  8305. generated$3.tSTypeParameterInstantiation = generated$3.tsTypeParameterInstantiation = tsTypeParameterInstantiation;
  8306. generated$3.tSTypeParameterDeclaration = generated$3.tsTypeParameterDeclaration = tsTypeParameterDeclaration;
  8307. generated$3.tSTypeParameter = generated$3.tsTypeParameter = tsTypeParameter;
  8308. generated$3.numberLiteral = NumberLiteral;
  8309. generated$3.regexLiteral = RegexLiteral;
  8310. generated$3.restProperty = RestProperty;
  8311. generated$3.spreadProperty = SpreadProperty;
  8312. var _builder = builder$1;
  8313. function arrayExpression(elements) {
  8314. return (0, _builder.default)("ArrayExpression", ...arguments);
  8315. }
  8316. function assignmentExpression(operator, left, right) {
  8317. return (0, _builder.default)("AssignmentExpression", ...arguments);
  8318. }
  8319. function binaryExpression(operator, left, right) {
  8320. return (0, _builder.default)("BinaryExpression", ...arguments);
  8321. }
  8322. function interpreterDirective(value) {
  8323. return (0, _builder.default)("InterpreterDirective", ...arguments);
  8324. }
  8325. function directive(value) {
  8326. return (0, _builder.default)("Directive", ...arguments);
  8327. }
  8328. function directiveLiteral(value) {
  8329. return (0, _builder.default)("DirectiveLiteral", ...arguments);
  8330. }
  8331. function blockStatement(body, directives) {
  8332. return (0, _builder.default)("BlockStatement", ...arguments);
  8333. }
  8334. function breakStatement(label) {
  8335. return (0, _builder.default)("BreakStatement", ...arguments);
  8336. }
  8337. function callExpression(callee, _arguments) {
  8338. return (0, _builder.default)("CallExpression", ...arguments);
  8339. }
  8340. function catchClause(param, body) {
  8341. return (0, _builder.default)("CatchClause", ...arguments);
  8342. }
  8343. function conditionalExpression(test, consequent, alternate) {
  8344. return (0, _builder.default)("ConditionalExpression", ...arguments);
  8345. }
  8346. function continueStatement(label) {
  8347. return (0, _builder.default)("ContinueStatement", ...arguments);
  8348. }
  8349. function debuggerStatement() {
  8350. return (0, _builder.default)("DebuggerStatement", ...arguments);
  8351. }
  8352. function doWhileStatement(test, body) {
  8353. return (0, _builder.default)("DoWhileStatement", ...arguments);
  8354. }
  8355. function emptyStatement() {
  8356. return (0, _builder.default)("EmptyStatement", ...arguments);
  8357. }
  8358. function expressionStatement(expression) {
  8359. return (0, _builder.default)("ExpressionStatement", ...arguments);
  8360. }
  8361. function file(program, comments, tokens) {
  8362. return (0, _builder.default)("File", ...arguments);
  8363. }
  8364. function forInStatement(left, right, body) {
  8365. return (0, _builder.default)("ForInStatement", ...arguments);
  8366. }
  8367. function forStatement(init, test, update, body) {
  8368. return (0, _builder.default)("ForStatement", ...arguments);
  8369. }
  8370. function functionDeclaration(id, params, body, generator, async) {
  8371. return (0, _builder.default)("FunctionDeclaration", ...arguments);
  8372. }
  8373. function functionExpression(id, params, body, generator, async) {
  8374. return (0, _builder.default)("FunctionExpression", ...arguments);
  8375. }
  8376. function identifier(name) {
  8377. return (0, _builder.default)("Identifier", ...arguments);
  8378. }
  8379. function ifStatement(test, consequent, alternate) {
  8380. return (0, _builder.default)("IfStatement", ...arguments);
  8381. }
  8382. function labeledStatement(label, body) {
  8383. return (0, _builder.default)("LabeledStatement", ...arguments);
  8384. }
  8385. function stringLiteral(value) {
  8386. return (0, _builder.default)("StringLiteral", ...arguments);
  8387. }
  8388. function numericLiteral(value) {
  8389. return (0, _builder.default)("NumericLiteral", ...arguments);
  8390. }
  8391. function nullLiteral() {
  8392. return (0, _builder.default)("NullLiteral", ...arguments);
  8393. }
  8394. function booleanLiteral(value) {
  8395. return (0, _builder.default)("BooleanLiteral", ...arguments);
  8396. }
  8397. function regExpLiteral(pattern, flags) {
  8398. return (0, _builder.default)("RegExpLiteral", ...arguments);
  8399. }
  8400. function logicalExpression(operator, left, right) {
  8401. return (0, _builder.default)("LogicalExpression", ...arguments);
  8402. }
  8403. function memberExpression(object, property, computed, optional) {
  8404. return (0, _builder.default)("MemberExpression", ...arguments);
  8405. }
  8406. function newExpression(callee, _arguments) {
  8407. return (0, _builder.default)("NewExpression", ...arguments);
  8408. }
  8409. function program(body, directives, sourceType, interpreter) {
  8410. return (0, _builder.default)("Program", ...arguments);
  8411. }
  8412. function objectExpression(properties) {
  8413. return (0, _builder.default)("ObjectExpression", ...arguments);
  8414. }
  8415. function objectMethod(kind, key, params, body, computed, generator, async) {
  8416. return (0, _builder.default)("ObjectMethod", ...arguments);
  8417. }
  8418. function objectProperty(key, value, computed, shorthand, decorators) {
  8419. return (0, _builder.default)("ObjectProperty", ...arguments);
  8420. }
  8421. function restElement(argument) {
  8422. return (0, _builder.default)("RestElement", ...arguments);
  8423. }
  8424. function returnStatement(argument) {
  8425. return (0, _builder.default)("ReturnStatement", ...arguments);
  8426. }
  8427. function sequenceExpression(expressions) {
  8428. return (0, _builder.default)("SequenceExpression", ...arguments);
  8429. }
  8430. function parenthesizedExpression(expression) {
  8431. return (0, _builder.default)("ParenthesizedExpression", ...arguments);
  8432. }
  8433. function switchCase(test, consequent) {
  8434. return (0, _builder.default)("SwitchCase", ...arguments);
  8435. }
  8436. function switchStatement(discriminant, cases) {
  8437. return (0, _builder.default)("SwitchStatement", ...arguments);
  8438. }
  8439. function thisExpression() {
  8440. return (0, _builder.default)("ThisExpression", ...arguments);
  8441. }
  8442. function throwStatement(argument) {
  8443. return (0, _builder.default)("ThrowStatement", ...arguments);
  8444. }
  8445. function tryStatement(block, handler, finalizer) {
  8446. return (0, _builder.default)("TryStatement", ...arguments);
  8447. }
  8448. function unaryExpression(operator, argument, prefix) {
  8449. return (0, _builder.default)("UnaryExpression", ...arguments);
  8450. }
  8451. function updateExpression(operator, argument, prefix) {
  8452. return (0, _builder.default)("UpdateExpression", ...arguments);
  8453. }
  8454. function variableDeclaration(kind, declarations) {
  8455. return (0, _builder.default)("VariableDeclaration", ...arguments);
  8456. }
  8457. function variableDeclarator(id, init) {
  8458. return (0, _builder.default)("VariableDeclarator", ...arguments);
  8459. }
  8460. function whileStatement(test, body) {
  8461. return (0, _builder.default)("WhileStatement", ...arguments);
  8462. }
  8463. function withStatement(object, body) {
  8464. return (0, _builder.default)("WithStatement", ...arguments);
  8465. }
  8466. function assignmentPattern(left, right) {
  8467. return (0, _builder.default)("AssignmentPattern", ...arguments);
  8468. }
  8469. function arrayPattern(elements) {
  8470. return (0, _builder.default)("ArrayPattern", ...arguments);
  8471. }
  8472. function arrowFunctionExpression(params, body, async) {
  8473. return (0, _builder.default)("ArrowFunctionExpression", ...arguments);
  8474. }
  8475. function classBody(body) {
  8476. return (0, _builder.default)("ClassBody", ...arguments);
  8477. }
  8478. function classExpression(id, superClass, body, decorators) {
  8479. return (0, _builder.default)("ClassExpression", ...arguments);
  8480. }
  8481. function classDeclaration(id, superClass, body, decorators) {
  8482. return (0, _builder.default)("ClassDeclaration", ...arguments);
  8483. }
  8484. function exportAllDeclaration(source) {
  8485. return (0, _builder.default)("ExportAllDeclaration", ...arguments);
  8486. }
  8487. function exportDefaultDeclaration(declaration) {
  8488. return (0, _builder.default)("ExportDefaultDeclaration", ...arguments);
  8489. }
  8490. function exportNamedDeclaration(declaration, specifiers, source) {
  8491. return (0, _builder.default)("ExportNamedDeclaration", ...arguments);
  8492. }
  8493. function exportSpecifier(local, exported) {
  8494. return (0, _builder.default)("ExportSpecifier", ...arguments);
  8495. }
  8496. function forOfStatement(left, right, body, _await) {
  8497. return (0, _builder.default)("ForOfStatement", ...arguments);
  8498. }
  8499. function importDeclaration(specifiers, source) {
  8500. return (0, _builder.default)("ImportDeclaration", ...arguments);
  8501. }
  8502. function importDefaultSpecifier(local) {
  8503. return (0, _builder.default)("ImportDefaultSpecifier", ...arguments);
  8504. }
  8505. function importNamespaceSpecifier(local) {
  8506. return (0, _builder.default)("ImportNamespaceSpecifier", ...arguments);
  8507. }
  8508. function importSpecifier(local, imported) {
  8509. return (0, _builder.default)("ImportSpecifier", ...arguments);
  8510. }
  8511. function metaProperty(meta, property) {
  8512. return (0, _builder.default)("MetaProperty", ...arguments);
  8513. }
  8514. function classMethod(kind, key, params, body, computed, _static, generator, async) {
  8515. return (0, _builder.default)("ClassMethod", ...arguments);
  8516. }
  8517. function objectPattern(properties) {
  8518. return (0, _builder.default)("ObjectPattern", ...arguments);
  8519. }
  8520. function spreadElement(argument) {
  8521. return (0, _builder.default)("SpreadElement", ...arguments);
  8522. }
  8523. function _super() {
  8524. return (0, _builder.default)("Super", ...arguments);
  8525. }
  8526. function taggedTemplateExpression(tag, quasi) {
  8527. return (0, _builder.default)("TaggedTemplateExpression", ...arguments);
  8528. }
  8529. function templateElement(value, tail) {
  8530. return (0, _builder.default)("TemplateElement", ...arguments);
  8531. }
  8532. function templateLiteral(quasis, expressions) {
  8533. return (0, _builder.default)("TemplateLiteral", ...arguments);
  8534. }
  8535. function yieldExpression(argument, delegate) {
  8536. return (0, _builder.default)("YieldExpression", ...arguments);
  8537. }
  8538. function awaitExpression(argument) {
  8539. return (0, _builder.default)("AwaitExpression", ...arguments);
  8540. }
  8541. function _import() {
  8542. return (0, _builder.default)("Import", ...arguments);
  8543. }
  8544. function bigIntLiteral(value) {
  8545. return (0, _builder.default)("BigIntLiteral", ...arguments);
  8546. }
  8547. function exportNamespaceSpecifier(exported) {
  8548. return (0, _builder.default)("ExportNamespaceSpecifier", ...arguments);
  8549. }
  8550. function optionalMemberExpression(object, property, computed, optional) {
  8551. return (0, _builder.default)("OptionalMemberExpression", ...arguments);
  8552. }
  8553. function optionalCallExpression(callee, _arguments, optional) {
  8554. return (0, _builder.default)("OptionalCallExpression", ...arguments);
  8555. }
  8556. function classProperty(key, value, typeAnnotation, decorators, computed, _static) {
  8557. return (0, _builder.default)("ClassProperty", ...arguments);
  8558. }
  8559. function classPrivateProperty(key, value, decorators, _static) {
  8560. return (0, _builder.default)("ClassPrivateProperty", ...arguments);
  8561. }
  8562. function classPrivateMethod(kind, key, params, body, _static) {
  8563. return (0, _builder.default)("ClassPrivateMethod", ...arguments);
  8564. }
  8565. function privateName(id) {
  8566. return (0, _builder.default)("PrivateName", ...arguments);
  8567. }
  8568. function anyTypeAnnotation() {
  8569. return (0, _builder.default)("AnyTypeAnnotation", ...arguments);
  8570. }
  8571. function arrayTypeAnnotation(elementType) {
  8572. return (0, _builder.default)("ArrayTypeAnnotation", ...arguments);
  8573. }
  8574. function booleanTypeAnnotation() {
  8575. return (0, _builder.default)("BooleanTypeAnnotation", ...arguments);
  8576. }
  8577. function booleanLiteralTypeAnnotation(value) {
  8578. return (0, _builder.default)("BooleanLiteralTypeAnnotation", ...arguments);
  8579. }
  8580. function nullLiteralTypeAnnotation() {
  8581. return (0, _builder.default)("NullLiteralTypeAnnotation", ...arguments);
  8582. }
  8583. function classImplements(id, typeParameters) {
  8584. return (0, _builder.default)("ClassImplements", ...arguments);
  8585. }
  8586. function declareClass(id, typeParameters, _extends, body) {
  8587. return (0, _builder.default)("DeclareClass", ...arguments);
  8588. }
  8589. function declareFunction(id) {
  8590. return (0, _builder.default)("DeclareFunction", ...arguments);
  8591. }
  8592. function declareInterface(id, typeParameters, _extends, body) {
  8593. return (0, _builder.default)("DeclareInterface", ...arguments);
  8594. }
  8595. function declareModule(id, body, kind) {
  8596. return (0, _builder.default)("DeclareModule", ...arguments);
  8597. }
  8598. function declareModuleExports(typeAnnotation) {
  8599. return (0, _builder.default)("DeclareModuleExports", ...arguments);
  8600. }
  8601. function declareTypeAlias(id, typeParameters, right) {
  8602. return (0, _builder.default)("DeclareTypeAlias", ...arguments);
  8603. }
  8604. function declareOpaqueType(id, typeParameters, supertype) {
  8605. return (0, _builder.default)("DeclareOpaqueType", ...arguments);
  8606. }
  8607. function declareVariable(id) {
  8608. return (0, _builder.default)("DeclareVariable", ...arguments);
  8609. }
  8610. function declareExportDeclaration(declaration, specifiers, source) {
  8611. return (0, _builder.default)("DeclareExportDeclaration", ...arguments);
  8612. }
  8613. function declareExportAllDeclaration(source) {
  8614. return (0, _builder.default)("DeclareExportAllDeclaration", ...arguments);
  8615. }
  8616. function declaredPredicate(value) {
  8617. return (0, _builder.default)("DeclaredPredicate", ...arguments);
  8618. }
  8619. function existsTypeAnnotation() {
  8620. return (0, _builder.default)("ExistsTypeAnnotation", ...arguments);
  8621. }
  8622. function functionTypeAnnotation(typeParameters, params, rest, returnType) {
  8623. return (0, _builder.default)("FunctionTypeAnnotation", ...arguments);
  8624. }
  8625. function functionTypeParam(name, typeAnnotation) {
  8626. return (0, _builder.default)("FunctionTypeParam", ...arguments);
  8627. }
  8628. function genericTypeAnnotation(id, typeParameters) {
  8629. return (0, _builder.default)("GenericTypeAnnotation", ...arguments);
  8630. }
  8631. function inferredPredicate() {
  8632. return (0, _builder.default)("InferredPredicate", ...arguments);
  8633. }
  8634. function interfaceExtends(id, typeParameters) {
  8635. return (0, _builder.default)("InterfaceExtends", ...arguments);
  8636. }
  8637. function interfaceDeclaration(id, typeParameters, _extends, body) {
  8638. return (0, _builder.default)("InterfaceDeclaration", ...arguments);
  8639. }
  8640. function interfaceTypeAnnotation(_extends, body) {
  8641. return (0, _builder.default)("InterfaceTypeAnnotation", ...arguments);
  8642. }
  8643. function intersectionTypeAnnotation(types) {
  8644. return (0, _builder.default)("IntersectionTypeAnnotation", ...arguments);
  8645. }
  8646. function mixedTypeAnnotation() {
  8647. return (0, _builder.default)("MixedTypeAnnotation", ...arguments);
  8648. }
  8649. function emptyTypeAnnotation() {
  8650. return (0, _builder.default)("EmptyTypeAnnotation", ...arguments);
  8651. }
  8652. function nullableTypeAnnotation(typeAnnotation) {
  8653. return (0, _builder.default)("NullableTypeAnnotation", ...arguments);
  8654. }
  8655. function numberLiteralTypeAnnotation(value) {
  8656. return (0, _builder.default)("NumberLiteralTypeAnnotation", ...arguments);
  8657. }
  8658. function numberTypeAnnotation() {
  8659. return (0, _builder.default)("NumberTypeAnnotation", ...arguments);
  8660. }
  8661. function objectTypeAnnotation(properties, indexers, callProperties, internalSlots, exact) {
  8662. return (0, _builder.default)("ObjectTypeAnnotation", ...arguments);
  8663. }
  8664. function objectTypeInternalSlot(id, value, optional, _static, method) {
  8665. return (0, _builder.default)("ObjectTypeInternalSlot", ...arguments);
  8666. }
  8667. function objectTypeCallProperty(value) {
  8668. return (0, _builder.default)("ObjectTypeCallProperty", ...arguments);
  8669. }
  8670. function objectTypeIndexer(id, key, value, variance) {
  8671. return (0, _builder.default)("ObjectTypeIndexer", ...arguments);
  8672. }
  8673. function objectTypeProperty(key, value, variance) {
  8674. return (0, _builder.default)("ObjectTypeProperty", ...arguments);
  8675. }
  8676. function objectTypeSpreadProperty(argument) {
  8677. return (0, _builder.default)("ObjectTypeSpreadProperty", ...arguments);
  8678. }
  8679. function opaqueType(id, typeParameters, supertype, impltype) {
  8680. return (0, _builder.default)("OpaqueType", ...arguments);
  8681. }
  8682. function qualifiedTypeIdentifier(id, qualification) {
  8683. return (0, _builder.default)("QualifiedTypeIdentifier", ...arguments);
  8684. }
  8685. function stringLiteralTypeAnnotation(value) {
  8686. return (0, _builder.default)("StringLiteralTypeAnnotation", ...arguments);
  8687. }
  8688. function stringTypeAnnotation() {
  8689. return (0, _builder.default)("StringTypeAnnotation", ...arguments);
  8690. }
  8691. function symbolTypeAnnotation() {
  8692. return (0, _builder.default)("SymbolTypeAnnotation", ...arguments);
  8693. }
  8694. function thisTypeAnnotation() {
  8695. return (0, _builder.default)("ThisTypeAnnotation", ...arguments);
  8696. }
  8697. function tupleTypeAnnotation(types) {
  8698. return (0, _builder.default)("TupleTypeAnnotation", ...arguments);
  8699. }
  8700. function typeofTypeAnnotation(argument) {
  8701. return (0, _builder.default)("TypeofTypeAnnotation", ...arguments);
  8702. }
  8703. function typeAlias(id, typeParameters, right) {
  8704. return (0, _builder.default)("TypeAlias", ...arguments);
  8705. }
  8706. function typeAnnotation(typeAnnotation) {
  8707. return (0, _builder.default)("TypeAnnotation", ...arguments);
  8708. }
  8709. function typeCastExpression(expression, typeAnnotation) {
  8710. return (0, _builder.default)("TypeCastExpression", ...arguments);
  8711. }
  8712. function typeParameter(bound, _default, variance) {
  8713. return (0, _builder.default)("TypeParameter", ...arguments);
  8714. }
  8715. function typeParameterDeclaration(params) {
  8716. return (0, _builder.default)("TypeParameterDeclaration", ...arguments);
  8717. }
  8718. function typeParameterInstantiation(params) {
  8719. return (0, _builder.default)("TypeParameterInstantiation", ...arguments);
  8720. }
  8721. function unionTypeAnnotation(types) {
  8722. return (0, _builder.default)("UnionTypeAnnotation", ...arguments);
  8723. }
  8724. function variance(kind) {
  8725. return (0, _builder.default)("Variance", ...arguments);
  8726. }
  8727. function voidTypeAnnotation() {
  8728. return (0, _builder.default)("VoidTypeAnnotation", ...arguments);
  8729. }
  8730. function enumDeclaration(id, body) {
  8731. return (0, _builder.default)("EnumDeclaration", ...arguments);
  8732. }
  8733. function enumBooleanBody(members) {
  8734. return (0, _builder.default)("EnumBooleanBody", ...arguments);
  8735. }
  8736. function enumNumberBody(members) {
  8737. return (0, _builder.default)("EnumNumberBody", ...arguments);
  8738. }
  8739. function enumStringBody(members) {
  8740. return (0, _builder.default)("EnumStringBody", ...arguments);
  8741. }
  8742. function enumSymbolBody(members) {
  8743. return (0, _builder.default)("EnumSymbolBody", ...arguments);
  8744. }
  8745. function enumBooleanMember(id) {
  8746. return (0, _builder.default)("EnumBooleanMember", ...arguments);
  8747. }
  8748. function enumNumberMember(id, init) {
  8749. return (0, _builder.default)("EnumNumberMember", ...arguments);
  8750. }
  8751. function enumStringMember(id, init) {
  8752. return (0, _builder.default)("EnumStringMember", ...arguments);
  8753. }
  8754. function enumDefaultedMember(id) {
  8755. return (0, _builder.default)("EnumDefaultedMember", ...arguments);
  8756. }
  8757. function indexedAccessType(objectType, indexType) {
  8758. return (0, _builder.default)("IndexedAccessType", ...arguments);
  8759. }
  8760. function optionalIndexedAccessType(objectType, indexType) {
  8761. return (0, _builder.default)("OptionalIndexedAccessType", ...arguments);
  8762. }
  8763. function jsxAttribute(name, value) {
  8764. return (0, _builder.default)("JSXAttribute", ...arguments);
  8765. }
  8766. function jsxClosingElement(name) {
  8767. return (0, _builder.default)("JSXClosingElement", ...arguments);
  8768. }
  8769. function jsxElement(openingElement, closingElement, children, selfClosing) {
  8770. return (0, _builder.default)("JSXElement", ...arguments);
  8771. }
  8772. function jsxEmptyExpression() {
  8773. return (0, _builder.default)("JSXEmptyExpression", ...arguments);
  8774. }
  8775. function jsxExpressionContainer(expression) {
  8776. return (0, _builder.default)("JSXExpressionContainer", ...arguments);
  8777. }
  8778. function jsxSpreadChild(expression) {
  8779. return (0, _builder.default)("JSXSpreadChild", ...arguments);
  8780. }
  8781. function jsxIdentifier(name) {
  8782. return (0, _builder.default)("JSXIdentifier", ...arguments);
  8783. }
  8784. function jsxMemberExpression(object, property) {
  8785. return (0, _builder.default)("JSXMemberExpression", ...arguments);
  8786. }
  8787. function jsxNamespacedName(namespace, name) {
  8788. return (0, _builder.default)("JSXNamespacedName", ...arguments);
  8789. }
  8790. function jsxOpeningElement(name, attributes, selfClosing) {
  8791. return (0, _builder.default)("JSXOpeningElement", ...arguments);
  8792. }
  8793. function jsxSpreadAttribute(argument) {
  8794. return (0, _builder.default)("JSXSpreadAttribute", ...arguments);
  8795. }
  8796. function jsxText(value) {
  8797. return (0, _builder.default)("JSXText", ...arguments);
  8798. }
  8799. function jsxFragment(openingFragment, closingFragment, children) {
  8800. return (0, _builder.default)("JSXFragment", ...arguments);
  8801. }
  8802. function jsxOpeningFragment() {
  8803. return (0, _builder.default)("JSXOpeningFragment", ...arguments);
  8804. }
  8805. function jsxClosingFragment() {
  8806. return (0, _builder.default)("JSXClosingFragment", ...arguments);
  8807. }
  8808. function noop() {
  8809. return (0, _builder.default)("Noop", ...arguments);
  8810. }
  8811. function placeholder(expectedNode, name) {
  8812. return (0, _builder.default)("Placeholder", ...arguments);
  8813. }
  8814. function v8IntrinsicIdentifier(name) {
  8815. return (0, _builder.default)("V8IntrinsicIdentifier", ...arguments);
  8816. }
  8817. function argumentPlaceholder() {
  8818. return (0, _builder.default)("ArgumentPlaceholder", ...arguments);
  8819. }
  8820. function bindExpression(object, callee) {
  8821. return (0, _builder.default)("BindExpression", ...arguments);
  8822. }
  8823. function importAttribute(key, value) {
  8824. return (0, _builder.default)("ImportAttribute", ...arguments);
  8825. }
  8826. function decorator(expression) {
  8827. return (0, _builder.default)("Decorator", ...arguments);
  8828. }
  8829. function doExpression(body, async) {
  8830. return (0, _builder.default)("DoExpression", ...arguments);
  8831. }
  8832. function exportDefaultSpecifier(exported) {
  8833. return (0, _builder.default)("ExportDefaultSpecifier", ...arguments);
  8834. }
  8835. function recordExpression(properties) {
  8836. return (0, _builder.default)("RecordExpression", ...arguments);
  8837. }
  8838. function tupleExpression(elements) {
  8839. return (0, _builder.default)("TupleExpression", ...arguments);
  8840. }
  8841. function decimalLiteral(value) {
  8842. return (0, _builder.default)("DecimalLiteral", ...arguments);
  8843. }
  8844. function staticBlock(body) {
  8845. return (0, _builder.default)("StaticBlock", ...arguments);
  8846. }
  8847. function moduleExpression(body) {
  8848. return (0, _builder.default)("ModuleExpression", ...arguments);
  8849. }
  8850. function topicReference() {
  8851. return (0, _builder.default)("TopicReference", ...arguments);
  8852. }
  8853. function pipelineTopicExpression(expression) {
  8854. return (0, _builder.default)("PipelineTopicExpression", ...arguments);
  8855. }
  8856. function pipelineBareFunction(callee) {
  8857. return (0, _builder.default)("PipelineBareFunction", ...arguments);
  8858. }
  8859. function pipelinePrimaryTopicReference() {
  8860. return (0, _builder.default)("PipelinePrimaryTopicReference", ...arguments);
  8861. }
  8862. function tsParameterProperty(parameter) {
  8863. return (0, _builder.default)("TSParameterProperty", ...arguments);
  8864. }
  8865. function tsDeclareFunction(id, typeParameters, params, returnType) {
  8866. return (0, _builder.default)("TSDeclareFunction", ...arguments);
  8867. }
  8868. function tsDeclareMethod(decorators, key, typeParameters, params, returnType) {
  8869. return (0, _builder.default)("TSDeclareMethod", ...arguments);
  8870. }
  8871. function tsQualifiedName(left, right) {
  8872. return (0, _builder.default)("TSQualifiedName", ...arguments);
  8873. }
  8874. function tsCallSignatureDeclaration(typeParameters, parameters, typeAnnotation) {
  8875. return (0, _builder.default)("TSCallSignatureDeclaration", ...arguments);
  8876. }
  8877. function tsConstructSignatureDeclaration(typeParameters, parameters, typeAnnotation) {
  8878. return (0, _builder.default)("TSConstructSignatureDeclaration", ...arguments);
  8879. }
  8880. function tsPropertySignature(key, typeAnnotation, initializer) {
  8881. return (0, _builder.default)("TSPropertySignature", ...arguments);
  8882. }
  8883. function tsMethodSignature(key, typeParameters, parameters, typeAnnotation) {
  8884. return (0, _builder.default)("TSMethodSignature", ...arguments);
  8885. }
  8886. function tsIndexSignature(parameters, typeAnnotation) {
  8887. return (0, _builder.default)("TSIndexSignature", ...arguments);
  8888. }
  8889. function tsAnyKeyword() {
  8890. return (0, _builder.default)("TSAnyKeyword", ...arguments);
  8891. }
  8892. function tsBooleanKeyword() {
  8893. return (0, _builder.default)("TSBooleanKeyword", ...arguments);
  8894. }
  8895. function tsBigIntKeyword() {
  8896. return (0, _builder.default)("TSBigIntKeyword", ...arguments);
  8897. }
  8898. function tsIntrinsicKeyword() {
  8899. return (0, _builder.default)("TSIntrinsicKeyword", ...arguments);
  8900. }
  8901. function tsNeverKeyword() {
  8902. return (0, _builder.default)("TSNeverKeyword", ...arguments);
  8903. }
  8904. function tsNullKeyword() {
  8905. return (0, _builder.default)("TSNullKeyword", ...arguments);
  8906. }
  8907. function tsNumberKeyword() {
  8908. return (0, _builder.default)("TSNumberKeyword", ...arguments);
  8909. }
  8910. function tsObjectKeyword() {
  8911. return (0, _builder.default)("TSObjectKeyword", ...arguments);
  8912. }
  8913. function tsStringKeyword() {
  8914. return (0, _builder.default)("TSStringKeyword", ...arguments);
  8915. }
  8916. function tsSymbolKeyword() {
  8917. return (0, _builder.default)("TSSymbolKeyword", ...arguments);
  8918. }
  8919. function tsUndefinedKeyword() {
  8920. return (0, _builder.default)("TSUndefinedKeyword", ...arguments);
  8921. }
  8922. function tsUnknownKeyword() {
  8923. return (0, _builder.default)("TSUnknownKeyword", ...arguments);
  8924. }
  8925. function tsVoidKeyword() {
  8926. return (0, _builder.default)("TSVoidKeyword", ...arguments);
  8927. }
  8928. function tsThisType() {
  8929. return (0, _builder.default)("TSThisType", ...arguments);
  8930. }
  8931. function tsFunctionType(typeParameters, parameters, typeAnnotation) {
  8932. return (0, _builder.default)("TSFunctionType", ...arguments);
  8933. }
  8934. function tsConstructorType(typeParameters, parameters, typeAnnotation) {
  8935. return (0, _builder.default)("TSConstructorType", ...arguments);
  8936. }
  8937. function tsTypeReference(typeName, typeParameters) {
  8938. return (0, _builder.default)("TSTypeReference", ...arguments);
  8939. }
  8940. function tsTypePredicate(parameterName, typeAnnotation, asserts) {
  8941. return (0, _builder.default)("TSTypePredicate", ...arguments);
  8942. }
  8943. function tsTypeQuery(exprName) {
  8944. return (0, _builder.default)("TSTypeQuery", ...arguments);
  8945. }
  8946. function tsTypeLiteral(members) {
  8947. return (0, _builder.default)("TSTypeLiteral", ...arguments);
  8948. }
  8949. function tsArrayType(elementType) {
  8950. return (0, _builder.default)("TSArrayType", ...arguments);
  8951. }
  8952. function tsTupleType(elementTypes) {
  8953. return (0, _builder.default)("TSTupleType", ...arguments);
  8954. }
  8955. function tsOptionalType(typeAnnotation) {
  8956. return (0, _builder.default)("TSOptionalType", ...arguments);
  8957. }
  8958. function tsRestType(typeAnnotation) {
  8959. return (0, _builder.default)("TSRestType", ...arguments);
  8960. }
  8961. function tsNamedTupleMember(label, elementType, optional) {
  8962. return (0, _builder.default)("TSNamedTupleMember", ...arguments);
  8963. }
  8964. function tsUnionType(types) {
  8965. return (0, _builder.default)("TSUnionType", ...arguments);
  8966. }
  8967. function tsIntersectionType(types) {
  8968. return (0, _builder.default)("TSIntersectionType", ...arguments);
  8969. }
  8970. function tsConditionalType(checkType, extendsType, trueType, falseType) {
  8971. return (0, _builder.default)("TSConditionalType", ...arguments);
  8972. }
  8973. function tsInferType(typeParameter) {
  8974. return (0, _builder.default)("TSInferType", ...arguments);
  8975. }
  8976. function tsParenthesizedType(typeAnnotation) {
  8977. return (0, _builder.default)("TSParenthesizedType", ...arguments);
  8978. }
  8979. function tsTypeOperator(typeAnnotation) {
  8980. return (0, _builder.default)("TSTypeOperator", ...arguments);
  8981. }
  8982. function tsIndexedAccessType(objectType, indexType) {
  8983. return (0, _builder.default)("TSIndexedAccessType", ...arguments);
  8984. }
  8985. function tsMappedType(typeParameter, typeAnnotation, nameType) {
  8986. return (0, _builder.default)("TSMappedType", ...arguments);
  8987. }
  8988. function tsLiteralType(literal) {
  8989. return (0, _builder.default)("TSLiteralType", ...arguments);
  8990. }
  8991. function tsExpressionWithTypeArguments(expression, typeParameters) {
  8992. return (0, _builder.default)("TSExpressionWithTypeArguments", ...arguments);
  8993. }
  8994. function tsInterfaceDeclaration(id, typeParameters, _extends, body) {
  8995. return (0, _builder.default)("TSInterfaceDeclaration", ...arguments);
  8996. }
  8997. function tsInterfaceBody(body) {
  8998. return (0, _builder.default)("TSInterfaceBody", ...arguments);
  8999. }
  9000. function tsTypeAliasDeclaration(id, typeParameters, typeAnnotation) {
  9001. return (0, _builder.default)("TSTypeAliasDeclaration", ...arguments);
  9002. }
  9003. function tsAsExpression(expression, typeAnnotation) {
  9004. return (0, _builder.default)("TSAsExpression", ...arguments);
  9005. }
  9006. function tsTypeAssertion(typeAnnotation, expression) {
  9007. return (0, _builder.default)("TSTypeAssertion", ...arguments);
  9008. }
  9009. function tsEnumDeclaration(id, members) {
  9010. return (0, _builder.default)("TSEnumDeclaration", ...arguments);
  9011. }
  9012. function tsEnumMember(id, initializer) {
  9013. return (0, _builder.default)("TSEnumMember", ...arguments);
  9014. }
  9015. function tsModuleDeclaration(id, body) {
  9016. return (0, _builder.default)("TSModuleDeclaration", ...arguments);
  9017. }
  9018. function tsModuleBlock(body) {
  9019. return (0, _builder.default)("TSModuleBlock", ...arguments);
  9020. }
  9021. function tsImportType(argument, qualifier, typeParameters) {
  9022. return (0, _builder.default)("TSImportType", ...arguments);
  9023. }
  9024. function tsImportEqualsDeclaration(id, moduleReference) {
  9025. return (0, _builder.default)("TSImportEqualsDeclaration", ...arguments);
  9026. }
  9027. function tsExternalModuleReference(expression) {
  9028. return (0, _builder.default)("TSExternalModuleReference", ...arguments);
  9029. }
  9030. function tsNonNullExpression(expression) {
  9031. return (0, _builder.default)("TSNonNullExpression", ...arguments);
  9032. }
  9033. function tsExportAssignment(expression) {
  9034. return (0, _builder.default)("TSExportAssignment", ...arguments);
  9035. }
  9036. function tsNamespaceExportDeclaration(id) {
  9037. return (0, _builder.default)("TSNamespaceExportDeclaration", ...arguments);
  9038. }
  9039. function tsTypeAnnotation(typeAnnotation) {
  9040. return (0, _builder.default)("TSTypeAnnotation", ...arguments);
  9041. }
  9042. function tsTypeParameterInstantiation(params) {
  9043. return (0, _builder.default)("TSTypeParameterInstantiation", ...arguments);
  9044. }
  9045. function tsTypeParameterDeclaration(params) {
  9046. return (0, _builder.default)("TSTypeParameterDeclaration", ...arguments);
  9047. }
  9048. function tsTypeParameter(constraint, _default, name) {
  9049. return (0, _builder.default)("TSTypeParameter", ...arguments);
  9050. }
  9051. function NumberLiteral(...args) {
  9052. console.trace("The node type NumberLiteral has been renamed to NumericLiteral");
  9053. return (0, _builder.default)("NumberLiteral", ...args);
  9054. }
  9055. function RegexLiteral(...args) {
  9056. console.trace("The node type RegexLiteral has been renamed to RegExpLiteral");
  9057. return (0, _builder.default)("RegexLiteral", ...args);
  9058. }
  9059. function RestProperty(...args) {
  9060. console.trace("The node type RestProperty has been renamed to RestElement");
  9061. return (0, _builder.default)("RestProperty", ...args);
  9062. }
  9063. function SpreadProperty(...args) {
  9064. console.trace("The node type SpreadProperty has been renamed to SpreadElement");
  9065. return (0, _builder.default)("SpreadProperty", ...args);
  9066. }
  9067. Object.defineProperty(cleanJSXElementLiteralChild$1, "__esModule", {
  9068. value: true
  9069. });
  9070. cleanJSXElementLiteralChild$1.default = cleanJSXElementLiteralChild;
  9071. var _generated$n = generated$3;
  9072. function cleanJSXElementLiteralChild(child, args) {
  9073. const lines = child.value.split(/\r\n|\n|\r/);
  9074. let lastNonEmptyLine = 0;
  9075. for (let i = 0; i < lines.length; i++) {
  9076. if (lines[i].match(/[^ \t]/)) {
  9077. lastNonEmptyLine = i;
  9078. }
  9079. }
  9080. let str = "";
  9081. for (let i = 0; i < lines.length; i++) {
  9082. const line = lines[i];
  9083. const isFirstLine = i === 0;
  9084. const isLastLine = i === lines.length - 1;
  9085. const isLastNonEmptyLine = i === lastNonEmptyLine;
  9086. let trimmedLine = line.replace(/\t/g, " ");
  9087. if (!isFirstLine) {
  9088. trimmedLine = trimmedLine.replace(/^[ ]+/, "");
  9089. }
  9090. if (!isLastLine) {
  9091. trimmedLine = trimmedLine.replace(/[ ]+$/, "");
  9092. }
  9093. if (trimmedLine) {
  9094. if (!isLastNonEmptyLine) {
  9095. trimmedLine += " ";
  9096. }
  9097. str += trimmedLine;
  9098. }
  9099. }
  9100. if (str) args.push((0, _generated$n.stringLiteral)(str));
  9101. }
  9102. Object.defineProperty(buildChildren$1, "__esModule", {
  9103. value: true
  9104. });
  9105. buildChildren$1.default = buildChildren;
  9106. var _generated$m = generated$4;
  9107. var _cleanJSXElementLiteralChild = cleanJSXElementLiteralChild$1;
  9108. function buildChildren(node) {
  9109. const elements = [];
  9110. for (let i = 0; i < node.children.length; i++) {
  9111. let child = node.children[i];
  9112. if ((0, _generated$m.isJSXText)(child)) {
  9113. (0, _cleanJSXElementLiteralChild.default)(child, elements);
  9114. continue;
  9115. }
  9116. if ((0, _generated$m.isJSXExpressionContainer)(child)) child = child.expression;
  9117. if ((0, _generated$m.isJSXEmptyExpression)(child)) continue;
  9118. elements.push(child);
  9119. }
  9120. return elements;
  9121. }
  9122. var assertNode$1 = {};
  9123. var isNode$1 = {};
  9124. Object.defineProperty(isNode$1, "__esModule", {
  9125. value: true
  9126. });
  9127. isNode$1.default = isNode;
  9128. var _definitions$5 = definitions;
  9129. function isNode(node) {
  9130. return !!(node && _definitions$5.VISITOR_KEYS[node.type]);
  9131. }
  9132. Object.defineProperty(assertNode$1, "__esModule", {
  9133. value: true
  9134. });
  9135. assertNode$1.default = assertNode;
  9136. var _isNode = isNode$1;
  9137. function assertNode(node) {
  9138. if (!(0, _isNode.default)(node)) {
  9139. var _node$type;
  9140. const type = (_node$type = node == null ? void 0 : node.type) != null ? _node$type : JSON.stringify(node);
  9141. throw new TypeError(`Not a valid node of type "${type}"`);
  9142. }
  9143. }
  9144. var generated$2 = {};
  9145. Object.defineProperty(generated$2, "__esModule", {
  9146. value: true
  9147. });
  9148. generated$2.assertArrayExpression = assertArrayExpression;
  9149. generated$2.assertAssignmentExpression = assertAssignmentExpression;
  9150. generated$2.assertBinaryExpression = assertBinaryExpression;
  9151. generated$2.assertInterpreterDirective = assertInterpreterDirective;
  9152. generated$2.assertDirective = assertDirective;
  9153. generated$2.assertDirectiveLiteral = assertDirectiveLiteral;
  9154. generated$2.assertBlockStatement = assertBlockStatement;
  9155. generated$2.assertBreakStatement = assertBreakStatement;
  9156. generated$2.assertCallExpression = assertCallExpression;
  9157. generated$2.assertCatchClause = assertCatchClause;
  9158. generated$2.assertConditionalExpression = assertConditionalExpression;
  9159. generated$2.assertContinueStatement = assertContinueStatement;
  9160. generated$2.assertDebuggerStatement = assertDebuggerStatement;
  9161. generated$2.assertDoWhileStatement = assertDoWhileStatement;
  9162. generated$2.assertEmptyStatement = assertEmptyStatement;
  9163. generated$2.assertExpressionStatement = assertExpressionStatement;
  9164. generated$2.assertFile = assertFile;
  9165. generated$2.assertForInStatement = assertForInStatement;
  9166. generated$2.assertForStatement = assertForStatement;
  9167. generated$2.assertFunctionDeclaration = assertFunctionDeclaration;
  9168. generated$2.assertFunctionExpression = assertFunctionExpression;
  9169. generated$2.assertIdentifier = assertIdentifier;
  9170. generated$2.assertIfStatement = assertIfStatement;
  9171. generated$2.assertLabeledStatement = assertLabeledStatement;
  9172. generated$2.assertStringLiteral = assertStringLiteral;
  9173. generated$2.assertNumericLiteral = assertNumericLiteral;
  9174. generated$2.assertNullLiteral = assertNullLiteral;
  9175. generated$2.assertBooleanLiteral = assertBooleanLiteral;
  9176. generated$2.assertRegExpLiteral = assertRegExpLiteral;
  9177. generated$2.assertLogicalExpression = assertLogicalExpression;
  9178. generated$2.assertMemberExpression = assertMemberExpression;
  9179. generated$2.assertNewExpression = assertNewExpression;
  9180. generated$2.assertProgram = assertProgram;
  9181. generated$2.assertObjectExpression = assertObjectExpression;
  9182. generated$2.assertObjectMethod = assertObjectMethod;
  9183. generated$2.assertObjectProperty = assertObjectProperty;
  9184. generated$2.assertRestElement = assertRestElement;
  9185. generated$2.assertReturnStatement = assertReturnStatement;
  9186. generated$2.assertSequenceExpression = assertSequenceExpression;
  9187. generated$2.assertParenthesizedExpression = assertParenthesizedExpression;
  9188. generated$2.assertSwitchCase = assertSwitchCase;
  9189. generated$2.assertSwitchStatement = assertSwitchStatement;
  9190. generated$2.assertThisExpression = assertThisExpression;
  9191. generated$2.assertThrowStatement = assertThrowStatement;
  9192. generated$2.assertTryStatement = assertTryStatement;
  9193. generated$2.assertUnaryExpression = assertUnaryExpression;
  9194. generated$2.assertUpdateExpression = assertUpdateExpression;
  9195. generated$2.assertVariableDeclaration = assertVariableDeclaration;
  9196. generated$2.assertVariableDeclarator = assertVariableDeclarator;
  9197. generated$2.assertWhileStatement = assertWhileStatement;
  9198. generated$2.assertWithStatement = assertWithStatement;
  9199. generated$2.assertAssignmentPattern = assertAssignmentPattern;
  9200. generated$2.assertArrayPattern = assertArrayPattern;
  9201. generated$2.assertArrowFunctionExpression = assertArrowFunctionExpression;
  9202. generated$2.assertClassBody = assertClassBody;
  9203. generated$2.assertClassExpression = assertClassExpression;
  9204. generated$2.assertClassDeclaration = assertClassDeclaration;
  9205. generated$2.assertExportAllDeclaration = assertExportAllDeclaration;
  9206. generated$2.assertExportDefaultDeclaration = assertExportDefaultDeclaration;
  9207. generated$2.assertExportNamedDeclaration = assertExportNamedDeclaration;
  9208. generated$2.assertExportSpecifier = assertExportSpecifier;
  9209. generated$2.assertForOfStatement = assertForOfStatement;
  9210. generated$2.assertImportDeclaration = assertImportDeclaration;
  9211. generated$2.assertImportDefaultSpecifier = assertImportDefaultSpecifier;
  9212. generated$2.assertImportNamespaceSpecifier = assertImportNamespaceSpecifier;
  9213. generated$2.assertImportSpecifier = assertImportSpecifier;
  9214. generated$2.assertMetaProperty = assertMetaProperty;
  9215. generated$2.assertClassMethod = assertClassMethod;
  9216. generated$2.assertObjectPattern = assertObjectPattern;
  9217. generated$2.assertSpreadElement = assertSpreadElement;
  9218. generated$2.assertSuper = assertSuper;
  9219. generated$2.assertTaggedTemplateExpression = assertTaggedTemplateExpression;
  9220. generated$2.assertTemplateElement = assertTemplateElement;
  9221. generated$2.assertTemplateLiteral = assertTemplateLiteral;
  9222. generated$2.assertYieldExpression = assertYieldExpression;
  9223. generated$2.assertAwaitExpression = assertAwaitExpression;
  9224. generated$2.assertImport = assertImport;
  9225. generated$2.assertBigIntLiteral = assertBigIntLiteral;
  9226. generated$2.assertExportNamespaceSpecifier = assertExportNamespaceSpecifier;
  9227. generated$2.assertOptionalMemberExpression = assertOptionalMemberExpression;
  9228. generated$2.assertOptionalCallExpression = assertOptionalCallExpression;
  9229. generated$2.assertClassProperty = assertClassProperty;
  9230. generated$2.assertClassPrivateProperty = assertClassPrivateProperty;
  9231. generated$2.assertClassPrivateMethod = assertClassPrivateMethod;
  9232. generated$2.assertPrivateName = assertPrivateName;
  9233. generated$2.assertAnyTypeAnnotation = assertAnyTypeAnnotation;
  9234. generated$2.assertArrayTypeAnnotation = assertArrayTypeAnnotation;
  9235. generated$2.assertBooleanTypeAnnotation = assertBooleanTypeAnnotation;
  9236. generated$2.assertBooleanLiteralTypeAnnotation = assertBooleanLiteralTypeAnnotation;
  9237. generated$2.assertNullLiteralTypeAnnotation = assertNullLiteralTypeAnnotation;
  9238. generated$2.assertClassImplements = assertClassImplements;
  9239. generated$2.assertDeclareClass = assertDeclareClass;
  9240. generated$2.assertDeclareFunction = assertDeclareFunction;
  9241. generated$2.assertDeclareInterface = assertDeclareInterface;
  9242. generated$2.assertDeclareModule = assertDeclareModule;
  9243. generated$2.assertDeclareModuleExports = assertDeclareModuleExports;
  9244. generated$2.assertDeclareTypeAlias = assertDeclareTypeAlias;
  9245. generated$2.assertDeclareOpaqueType = assertDeclareOpaqueType;
  9246. generated$2.assertDeclareVariable = assertDeclareVariable;
  9247. generated$2.assertDeclareExportDeclaration = assertDeclareExportDeclaration;
  9248. generated$2.assertDeclareExportAllDeclaration = assertDeclareExportAllDeclaration;
  9249. generated$2.assertDeclaredPredicate = assertDeclaredPredicate;
  9250. generated$2.assertExistsTypeAnnotation = assertExistsTypeAnnotation;
  9251. generated$2.assertFunctionTypeAnnotation = assertFunctionTypeAnnotation;
  9252. generated$2.assertFunctionTypeParam = assertFunctionTypeParam;
  9253. generated$2.assertGenericTypeAnnotation = assertGenericTypeAnnotation;
  9254. generated$2.assertInferredPredicate = assertInferredPredicate;
  9255. generated$2.assertInterfaceExtends = assertInterfaceExtends;
  9256. generated$2.assertInterfaceDeclaration = assertInterfaceDeclaration;
  9257. generated$2.assertInterfaceTypeAnnotation = assertInterfaceTypeAnnotation;
  9258. generated$2.assertIntersectionTypeAnnotation = assertIntersectionTypeAnnotation;
  9259. generated$2.assertMixedTypeAnnotation = assertMixedTypeAnnotation;
  9260. generated$2.assertEmptyTypeAnnotation = assertEmptyTypeAnnotation;
  9261. generated$2.assertNullableTypeAnnotation = assertNullableTypeAnnotation;
  9262. generated$2.assertNumberLiteralTypeAnnotation = assertNumberLiteralTypeAnnotation;
  9263. generated$2.assertNumberTypeAnnotation = assertNumberTypeAnnotation;
  9264. generated$2.assertObjectTypeAnnotation = assertObjectTypeAnnotation;
  9265. generated$2.assertObjectTypeInternalSlot = assertObjectTypeInternalSlot;
  9266. generated$2.assertObjectTypeCallProperty = assertObjectTypeCallProperty;
  9267. generated$2.assertObjectTypeIndexer = assertObjectTypeIndexer;
  9268. generated$2.assertObjectTypeProperty = assertObjectTypeProperty;
  9269. generated$2.assertObjectTypeSpreadProperty = assertObjectTypeSpreadProperty;
  9270. generated$2.assertOpaqueType = assertOpaqueType;
  9271. generated$2.assertQualifiedTypeIdentifier = assertQualifiedTypeIdentifier;
  9272. generated$2.assertStringLiteralTypeAnnotation = assertStringLiteralTypeAnnotation;
  9273. generated$2.assertStringTypeAnnotation = assertStringTypeAnnotation;
  9274. generated$2.assertSymbolTypeAnnotation = assertSymbolTypeAnnotation;
  9275. generated$2.assertThisTypeAnnotation = assertThisTypeAnnotation;
  9276. generated$2.assertTupleTypeAnnotation = assertTupleTypeAnnotation;
  9277. generated$2.assertTypeofTypeAnnotation = assertTypeofTypeAnnotation;
  9278. generated$2.assertTypeAlias = assertTypeAlias;
  9279. generated$2.assertTypeAnnotation = assertTypeAnnotation;
  9280. generated$2.assertTypeCastExpression = assertTypeCastExpression;
  9281. generated$2.assertTypeParameter = assertTypeParameter;
  9282. generated$2.assertTypeParameterDeclaration = assertTypeParameterDeclaration;
  9283. generated$2.assertTypeParameterInstantiation = assertTypeParameterInstantiation;
  9284. generated$2.assertUnionTypeAnnotation = assertUnionTypeAnnotation;
  9285. generated$2.assertVariance = assertVariance;
  9286. generated$2.assertVoidTypeAnnotation = assertVoidTypeAnnotation;
  9287. generated$2.assertEnumDeclaration = assertEnumDeclaration;
  9288. generated$2.assertEnumBooleanBody = assertEnumBooleanBody;
  9289. generated$2.assertEnumNumberBody = assertEnumNumberBody;
  9290. generated$2.assertEnumStringBody = assertEnumStringBody;
  9291. generated$2.assertEnumSymbolBody = assertEnumSymbolBody;
  9292. generated$2.assertEnumBooleanMember = assertEnumBooleanMember;
  9293. generated$2.assertEnumNumberMember = assertEnumNumberMember;
  9294. generated$2.assertEnumStringMember = assertEnumStringMember;
  9295. generated$2.assertEnumDefaultedMember = assertEnumDefaultedMember;
  9296. generated$2.assertIndexedAccessType = assertIndexedAccessType;
  9297. generated$2.assertOptionalIndexedAccessType = assertOptionalIndexedAccessType;
  9298. generated$2.assertJSXAttribute = assertJSXAttribute;
  9299. generated$2.assertJSXClosingElement = assertJSXClosingElement;
  9300. generated$2.assertJSXElement = assertJSXElement;
  9301. generated$2.assertJSXEmptyExpression = assertJSXEmptyExpression;
  9302. generated$2.assertJSXExpressionContainer = assertJSXExpressionContainer;
  9303. generated$2.assertJSXSpreadChild = assertJSXSpreadChild;
  9304. generated$2.assertJSXIdentifier = assertJSXIdentifier;
  9305. generated$2.assertJSXMemberExpression = assertJSXMemberExpression;
  9306. generated$2.assertJSXNamespacedName = assertJSXNamespacedName;
  9307. generated$2.assertJSXOpeningElement = assertJSXOpeningElement;
  9308. generated$2.assertJSXSpreadAttribute = assertJSXSpreadAttribute;
  9309. generated$2.assertJSXText = assertJSXText;
  9310. generated$2.assertJSXFragment = assertJSXFragment;
  9311. generated$2.assertJSXOpeningFragment = assertJSXOpeningFragment;
  9312. generated$2.assertJSXClosingFragment = assertJSXClosingFragment;
  9313. generated$2.assertNoop = assertNoop;
  9314. generated$2.assertPlaceholder = assertPlaceholder;
  9315. generated$2.assertV8IntrinsicIdentifier = assertV8IntrinsicIdentifier;
  9316. generated$2.assertArgumentPlaceholder = assertArgumentPlaceholder;
  9317. generated$2.assertBindExpression = assertBindExpression;
  9318. generated$2.assertImportAttribute = assertImportAttribute;
  9319. generated$2.assertDecorator = assertDecorator;
  9320. generated$2.assertDoExpression = assertDoExpression;
  9321. generated$2.assertExportDefaultSpecifier = assertExportDefaultSpecifier;
  9322. generated$2.assertRecordExpression = assertRecordExpression;
  9323. generated$2.assertTupleExpression = assertTupleExpression;
  9324. generated$2.assertDecimalLiteral = assertDecimalLiteral;
  9325. generated$2.assertStaticBlock = assertStaticBlock;
  9326. generated$2.assertModuleExpression = assertModuleExpression;
  9327. generated$2.assertTopicReference = assertTopicReference;
  9328. generated$2.assertPipelineTopicExpression = assertPipelineTopicExpression;
  9329. generated$2.assertPipelineBareFunction = assertPipelineBareFunction;
  9330. generated$2.assertPipelinePrimaryTopicReference = assertPipelinePrimaryTopicReference;
  9331. generated$2.assertTSParameterProperty = assertTSParameterProperty;
  9332. generated$2.assertTSDeclareFunction = assertTSDeclareFunction;
  9333. generated$2.assertTSDeclareMethod = assertTSDeclareMethod;
  9334. generated$2.assertTSQualifiedName = assertTSQualifiedName;
  9335. generated$2.assertTSCallSignatureDeclaration = assertTSCallSignatureDeclaration;
  9336. generated$2.assertTSConstructSignatureDeclaration = assertTSConstructSignatureDeclaration;
  9337. generated$2.assertTSPropertySignature = assertTSPropertySignature;
  9338. generated$2.assertTSMethodSignature = assertTSMethodSignature;
  9339. generated$2.assertTSIndexSignature = assertTSIndexSignature;
  9340. generated$2.assertTSAnyKeyword = assertTSAnyKeyword;
  9341. generated$2.assertTSBooleanKeyword = assertTSBooleanKeyword;
  9342. generated$2.assertTSBigIntKeyword = assertTSBigIntKeyword;
  9343. generated$2.assertTSIntrinsicKeyword = assertTSIntrinsicKeyword;
  9344. generated$2.assertTSNeverKeyword = assertTSNeverKeyword;
  9345. generated$2.assertTSNullKeyword = assertTSNullKeyword;
  9346. generated$2.assertTSNumberKeyword = assertTSNumberKeyword;
  9347. generated$2.assertTSObjectKeyword = assertTSObjectKeyword;
  9348. generated$2.assertTSStringKeyword = assertTSStringKeyword;
  9349. generated$2.assertTSSymbolKeyword = assertTSSymbolKeyword;
  9350. generated$2.assertTSUndefinedKeyword = assertTSUndefinedKeyword;
  9351. generated$2.assertTSUnknownKeyword = assertTSUnknownKeyword;
  9352. generated$2.assertTSVoidKeyword = assertTSVoidKeyword;
  9353. generated$2.assertTSThisType = assertTSThisType;
  9354. generated$2.assertTSFunctionType = assertTSFunctionType;
  9355. generated$2.assertTSConstructorType = assertTSConstructorType;
  9356. generated$2.assertTSTypeReference = assertTSTypeReference;
  9357. generated$2.assertTSTypePredicate = assertTSTypePredicate;
  9358. generated$2.assertTSTypeQuery = assertTSTypeQuery;
  9359. generated$2.assertTSTypeLiteral = assertTSTypeLiteral;
  9360. generated$2.assertTSArrayType = assertTSArrayType;
  9361. generated$2.assertTSTupleType = assertTSTupleType;
  9362. generated$2.assertTSOptionalType = assertTSOptionalType;
  9363. generated$2.assertTSRestType = assertTSRestType;
  9364. generated$2.assertTSNamedTupleMember = assertTSNamedTupleMember;
  9365. generated$2.assertTSUnionType = assertTSUnionType;
  9366. generated$2.assertTSIntersectionType = assertTSIntersectionType;
  9367. generated$2.assertTSConditionalType = assertTSConditionalType;
  9368. generated$2.assertTSInferType = assertTSInferType;
  9369. generated$2.assertTSParenthesizedType = assertTSParenthesizedType;
  9370. generated$2.assertTSTypeOperator = assertTSTypeOperator;
  9371. generated$2.assertTSIndexedAccessType = assertTSIndexedAccessType;
  9372. generated$2.assertTSMappedType = assertTSMappedType;
  9373. generated$2.assertTSLiteralType = assertTSLiteralType;
  9374. generated$2.assertTSExpressionWithTypeArguments = assertTSExpressionWithTypeArguments;
  9375. generated$2.assertTSInterfaceDeclaration = assertTSInterfaceDeclaration;
  9376. generated$2.assertTSInterfaceBody = assertTSInterfaceBody;
  9377. generated$2.assertTSTypeAliasDeclaration = assertTSTypeAliasDeclaration;
  9378. generated$2.assertTSAsExpression = assertTSAsExpression;
  9379. generated$2.assertTSTypeAssertion = assertTSTypeAssertion;
  9380. generated$2.assertTSEnumDeclaration = assertTSEnumDeclaration;
  9381. generated$2.assertTSEnumMember = assertTSEnumMember;
  9382. generated$2.assertTSModuleDeclaration = assertTSModuleDeclaration;
  9383. generated$2.assertTSModuleBlock = assertTSModuleBlock;
  9384. generated$2.assertTSImportType = assertTSImportType;
  9385. generated$2.assertTSImportEqualsDeclaration = assertTSImportEqualsDeclaration;
  9386. generated$2.assertTSExternalModuleReference = assertTSExternalModuleReference;
  9387. generated$2.assertTSNonNullExpression = assertTSNonNullExpression;
  9388. generated$2.assertTSExportAssignment = assertTSExportAssignment;
  9389. generated$2.assertTSNamespaceExportDeclaration = assertTSNamespaceExportDeclaration;
  9390. generated$2.assertTSTypeAnnotation = assertTSTypeAnnotation;
  9391. generated$2.assertTSTypeParameterInstantiation = assertTSTypeParameterInstantiation;
  9392. generated$2.assertTSTypeParameterDeclaration = assertTSTypeParameterDeclaration;
  9393. generated$2.assertTSTypeParameter = assertTSTypeParameter;
  9394. generated$2.assertExpression = assertExpression;
  9395. generated$2.assertBinary = assertBinary;
  9396. generated$2.assertScopable = assertScopable;
  9397. generated$2.assertBlockParent = assertBlockParent;
  9398. generated$2.assertBlock = assertBlock;
  9399. generated$2.assertStatement = assertStatement;
  9400. generated$2.assertTerminatorless = assertTerminatorless;
  9401. generated$2.assertCompletionStatement = assertCompletionStatement;
  9402. generated$2.assertConditional = assertConditional;
  9403. generated$2.assertLoop = assertLoop;
  9404. generated$2.assertWhile = assertWhile;
  9405. generated$2.assertExpressionWrapper = assertExpressionWrapper;
  9406. generated$2.assertFor = assertFor;
  9407. generated$2.assertForXStatement = assertForXStatement;
  9408. generated$2.assertFunction = assertFunction;
  9409. generated$2.assertFunctionParent = assertFunctionParent;
  9410. generated$2.assertPureish = assertPureish;
  9411. generated$2.assertDeclaration = assertDeclaration;
  9412. generated$2.assertPatternLike = assertPatternLike;
  9413. generated$2.assertLVal = assertLVal;
  9414. generated$2.assertTSEntityName = assertTSEntityName;
  9415. generated$2.assertLiteral = assertLiteral;
  9416. generated$2.assertImmutable = assertImmutable;
  9417. generated$2.assertUserWhitespacable = assertUserWhitespacable;
  9418. generated$2.assertMethod = assertMethod;
  9419. generated$2.assertObjectMember = assertObjectMember;
  9420. generated$2.assertProperty = assertProperty;
  9421. generated$2.assertUnaryLike = assertUnaryLike;
  9422. generated$2.assertPattern = assertPattern;
  9423. generated$2.assertClass = assertClass;
  9424. generated$2.assertModuleDeclaration = assertModuleDeclaration;
  9425. generated$2.assertExportDeclaration = assertExportDeclaration;
  9426. generated$2.assertModuleSpecifier = assertModuleSpecifier;
  9427. generated$2.assertPrivate = assertPrivate;
  9428. generated$2.assertFlow = assertFlow;
  9429. generated$2.assertFlowType = assertFlowType;
  9430. generated$2.assertFlowBaseAnnotation = assertFlowBaseAnnotation;
  9431. generated$2.assertFlowDeclaration = assertFlowDeclaration;
  9432. generated$2.assertFlowPredicate = assertFlowPredicate;
  9433. generated$2.assertEnumBody = assertEnumBody;
  9434. generated$2.assertEnumMember = assertEnumMember;
  9435. generated$2.assertJSX = assertJSX;
  9436. generated$2.assertTSTypeElement = assertTSTypeElement;
  9437. generated$2.assertTSType = assertTSType;
  9438. generated$2.assertTSBaseType = assertTSBaseType;
  9439. generated$2.assertNumberLiteral = assertNumberLiteral;
  9440. generated$2.assertRegexLiteral = assertRegexLiteral;
  9441. generated$2.assertRestProperty = assertRestProperty;
  9442. generated$2.assertSpreadProperty = assertSpreadProperty;
  9443. var _is = is$1;
  9444. function assert$1(type, node, opts) {
  9445. if (!(0, _is.default)(type, node, opts)) {
  9446. throw new Error(`Expected type "${type}" with option ${JSON.stringify(opts)}, ` + `but instead got "${node.type}".`);
  9447. }
  9448. }
  9449. function assertArrayExpression(node, opts) {
  9450. assert$1("ArrayExpression", node, opts);
  9451. }
  9452. function assertAssignmentExpression(node, opts) {
  9453. assert$1("AssignmentExpression", node, opts);
  9454. }
  9455. function assertBinaryExpression(node, opts) {
  9456. assert$1("BinaryExpression", node, opts);
  9457. }
  9458. function assertInterpreterDirective(node, opts) {
  9459. assert$1("InterpreterDirective", node, opts);
  9460. }
  9461. function assertDirective(node, opts) {
  9462. assert$1("Directive", node, opts);
  9463. }
  9464. function assertDirectiveLiteral(node, opts) {
  9465. assert$1("DirectiveLiteral", node, opts);
  9466. }
  9467. function assertBlockStatement(node, opts) {
  9468. assert$1("BlockStatement", node, opts);
  9469. }
  9470. function assertBreakStatement(node, opts) {
  9471. assert$1("BreakStatement", node, opts);
  9472. }
  9473. function assertCallExpression(node, opts) {
  9474. assert$1("CallExpression", node, opts);
  9475. }
  9476. function assertCatchClause(node, opts) {
  9477. assert$1("CatchClause", node, opts);
  9478. }
  9479. function assertConditionalExpression(node, opts) {
  9480. assert$1("ConditionalExpression", node, opts);
  9481. }
  9482. function assertContinueStatement(node, opts) {
  9483. assert$1("ContinueStatement", node, opts);
  9484. }
  9485. function assertDebuggerStatement(node, opts) {
  9486. assert$1("DebuggerStatement", node, opts);
  9487. }
  9488. function assertDoWhileStatement(node, opts) {
  9489. assert$1("DoWhileStatement", node, opts);
  9490. }
  9491. function assertEmptyStatement(node, opts) {
  9492. assert$1("EmptyStatement", node, opts);
  9493. }
  9494. function assertExpressionStatement(node, opts) {
  9495. assert$1("ExpressionStatement", node, opts);
  9496. }
  9497. function assertFile(node, opts) {
  9498. assert$1("File", node, opts);
  9499. }
  9500. function assertForInStatement(node, opts) {
  9501. assert$1("ForInStatement", node, opts);
  9502. }
  9503. function assertForStatement(node, opts) {
  9504. assert$1("ForStatement", node, opts);
  9505. }
  9506. function assertFunctionDeclaration(node, opts) {
  9507. assert$1("FunctionDeclaration", node, opts);
  9508. }
  9509. function assertFunctionExpression(node, opts) {
  9510. assert$1("FunctionExpression", node, opts);
  9511. }
  9512. function assertIdentifier(node, opts) {
  9513. assert$1("Identifier", node, opts);
  9514. }
  9515. function assertIfStatement(node, opts) {
  9516. assert$1("IfStatement", node, opts);
  9517. }
  9518. function assertLabeledStatement(node, opts) {
  9519. assert$1("LabeledStatement", node, opts);
  9520. }
  9521. function assertStringLiteral(node, opts) {
  9522. assert$1("StringLiteral", node, opts);
  9523. }
  9524. function assertNumericLiteral(node, opts) {
  9525. assert$1("NumericLiteral", node, opts);
  9526. }
  9527. function assertNullLiteral(node, opts) {
  9528. assert$1("NullLiteral", node, opts);
  9529. }
  9530. function assertBooleanLiteral(node, opts) {
  9531. assert$1("BooleanLiteral", node, opts);
  9532. }
  9533. function assertRegExpLiteral(node, opts) {
  9534. assert$1("RegExpLiteral", node, opts);
  9535. }
  9536. function assertLogicalExpression(node, opts) {
  9537. assert$1("LogicalExpression", node, opts);
  9538. }
  9539. function assertMemberExpression(node, opts) {
  9540. assert$1("MemberExpression", node, opts);
  9541. }
  9542. function assertNewExpression(node, opts) {
  9543. assert$1("NewExpression", node, opts);
  9544. }
  9545. function assertProgram(node, opts) {
  9546. assert$1("Program", node, opts);
  9547. }
  9548. function assertObjectExpression(node, opts) {
  9549. assert$1("ObjectExpression", node, opts);
  9550. }
  9551. function assertObjectMethod(node, opts) {
  9552. assert$1("ObjectMethod", node, opts);
  9553. }
  9554. function assertObjectProperty(node, opts) {
  9555. assert$1("ObjectProperty", node, opts);
  9556. }
  9557. function assertRestElement(node, opts) {
  9558. assert$1("RestElement", node, opts);
  9559. }
  9560. function assertReturnStatement(node, opts) {
  9561. assert$1("ReturnStatement", node, opts);
  9562. }
  9563. function assertSequenceExpression(node, opts) {
  9564. assert$1("SequenceExpression", node, opts);
  9565. }
  9566. function assertParenthesizedExpression(node, opts) {
  9567. assert$1("ParenthesizedExpression", node, opts);
  9568. }
  9569. function assertSwitchCase(node, opts) {
  9570. assert$1("SwitchCase", node, opts);
  9571. }
  9572. function assertSwitchStatement(node, opts) {
  9573. assert$1("SwitchStatement", node, opts);
  9574. }
  9575. function assertThisExpression(node, opts) {
  9576. assert$1("ThisExpression", node, opts);
  9577. }
  9578. function assertThrowStatement(node, opts) {
  9579. assert$1("ThrowStatement", node, opts);
  9580. }
  9581. function assertTryStatement(node, opts) {
  9582. assert$1("TryStatement", node, opts);
  9583. }
  9584. function assertUnaryExpression(node, opts) {
  9585. assert$1("UnaryExpression", node, opts);
  9586. }
  9587. function assertUpdateExpression(node, opts) {
  9588. assert$1("UpdateExpression", node, opts);
  9589. }
  9590. function assertVariableDeclaration(node, opts) {
  9591. assert$1("VariableDeclaration", node, opts);
  9592. }
  9593. function assertVariableDeclarator(node, opts) {
  9594. assert$1("VariableDeclarator", node, opts);
  9595. }
  9596. function assertWhileStatement(node, opts) {
  9597. assert$1("WhileStatement", node, opts);
  9598. }
  9599. function assertWithStatement(node, opts) {
  9600. assert$1("WithStatement", node, opts);
  9601. }
  9602. function assertAssignmentPattern(node, opts) {
  9603. assert$1("AssignmentPattern", node, opts);
  9604. }
  9605. function assertArrayPattern(node, opts) {
  9606. assert$1("ArrayPattern", node, opts);
  9607. }
  9608. function assertArrowFunctionExpression(node, opts) {
  9609. assert$1("ArrowFunctionExpression", node, opts);
  9610. }
  9611. function assertClassBody(node, opts) {
  9612. assert$1("ClassBody", node, opts);
  9613. }
  9614. function assertClassExpression(node, opts) {
  9615. assert$1("ClassExpression", node, opts);
  9616. }
  9617. function assertClassDeclaration(node, opts) {
  9618. assert$1("ClassDeclaration", node, opts);
  9619. }
  9620. function assertExportAllDeclaration(node, opts) {
  9621. assert$1("ExportAllDeclaration", node, opts);
  9622. }
  9623. function assertExportDefaultDeclaration(node, opts) {
  9624. assert$1("ExportDefaultDeclaration", node, opts);
  9625. }
  9626. function assertExportNamedDeclaration(node, opts) {
  9627. assert$1("ExportNamedDeclaration", node, opts);
  9628. }
  9629. function assertExportSpecifier(node, opts) {
  9630. assert$1("ExportSpecifier", node, opts);
  9631. }
  9632. function assertForOfStatement(node, opts) {
  9633. assert$1("ForOfStatement", node, opts);
  9634. }
  9635. function assertImportDeclaration(node, opts) {
  9636. assert$1("ImportDeclaration", node, opts);
  9637. }
  9638. function assertImportDefaultSpecifier(node, opts) {
  9639. assert$1("ImportDefaultSpecifier", node, opts);
  9640. }
  9641. function assertImportNamespaceSpecifier(node, opts) {
  9642. assert$1("ImportNamespaceSpecifier", node, opts);
  9643. }
  9644. function assertImportSpecifier(node, opts) {
  9645. assert$1("ImportSpecifier", node, opts);
  9646. }
  9647. function assertMetaProperty(node, opts) {
  9648. assert$1("MetaProperty", node, opts);
  9649. }
  9650. function assertClassMethod(node, opts) {
  9651. assert$1("ClassMethod", node, opts);
  9652. }
  9653. function assertObjectPattern(node, opts) {
  9654. assert$1("ObjectPattern", node, opts);
  9655. }
  9656. function assertSpreadElement(node, opts) {
  9657. assert$1("SpreadElement", node, opts);
  9658. }
  9659. function assertSuper(node, opts) {
  9660. assert$1("Super", node, opts);
  9661. }
  9662. function assertTaggedTemplateExpression(node, opts) {
  9663. assert$1("TaggedTemplateExpression", node, opts);
  9664. }
  9665. function assertTemplateElement(node, opts) {
  9666. assert$1("TemplateElement", node, opts);
  9667. }
  9668. function assertTemplateLiteral(node, opts) {
  9669. assert$1("TemplateLiteral", node, opts);
  9670. }
  9671. function assertYieldExpression(node, opts) {
  9672. assert$1("YieldExpression", node, opts);
  9673. }
  9674. function assertAwaitExpression(node, opts) {
  9675. assert$1("AwaitExpression", node, opts);
  9676. }
  9677. function assertImport(node, opts) {
  9678. assert$1("Import", node, opts);
  9679. }
  9680. function assertBigIntLiteral(node, opts) {
  9681. assert$1("BigIntLiteral", node, opts);
  9682. }
  9683. function assertExportNamespaceSpecifier(node, opts) {
  9684. assert$1("ExportNamespaceSpecifier", node, opts);
  9685. }
  9686. function assertOptionalMemberExpression(node, opts) {
  9687. assert$1("OptionalMemberExpression", node, opts);
  9688. }
  9689. function assertOptionalCallExpression(node, opts) {
  9690. assert$1("OptionalCallExpression", node, opts);
  9691. }
  9692. function assertClassProperty(node, opts) {
  9693. assert$1("ClassProperty", node, opts);
  9694. }
  9695. function assertClassPrivateProperty(node, opts) {
  9696. assert$1("ClassPrivateProperty", node, opts);
  9697. }
  9698. function assertClassPrivateMethod(node, opts) {
  9699. assert$1("ClassPrivateMethod", node, opts);
  9700. }
  9701. function assertPrivateName(node, opts) {
  9702. assert$1("PrivateName", node, opts);
  9703. }
  9704. function assertAnyTypeAnnotation(node, opts) {
  9705. assert$1("AnyTypeAnnotation", node, opts);
  9706. }
  9707. function assertArrayTypeAnnotation(node, opts) {
  9708. assert$1("ArrayTypeAnnotation", node, opts);
  9709. }
  9710. function assertBooleanTypeAnnotation(node, opts) {
  9711. assert$1("BooleanTypeAnnotation", node, opts);
  9712. }
  9713. function assertBooleanLiteralTypeAnnotation(node, opts) {
  9714. assert$1("BooleanLiteralTypeAnnotation", node, opts);
  9715. }
  9716. function assertNullLiteralTypeAnnotation(node, opts) {
  9717. assert$1("NullLiteralTypeAnnotation", node, opts);
  9718. }
  9719. function assertClassImplements(node, opts) {
  9720. assert$1("ClassImplements", node, opts);
  9721. }
  9722. function assertDeclareClass(node, opts) {
  9723. assert$1("DeclareClass", node, opts);
  9724. }
  9725. function assertDeclareFunction(node, opts) {
  9726. assert$1("DeclareFunction", node, opts);
  9727. }
  9728. function assertDeclareInterface(node, opts) {
  9729. assert$1("DeclareInterface", node, opts);
  9730. }
  9731. function assertDeclareModule(node, opts) {
  9732. assert$1("DeclareModule", node, opts);
  9733. }
  9734. function assertDeclareModuleExports(node, opts) {
  9735. assert$1("DeclareModuleExports", node, opts);
  9736. }
  9737. function assertDeclareTypeAlias(node, opts) {
  9738. assert$1("DeclareTypeAlias", node, opts);
  9739. }
  9740. function assertDeclareOpaqueType(node, opts) {
  9741. assert$1("DeclareOpaqueType", node, opts);
  9742. }
  9743. function assertDeclareVariable(node, opts) {
  9744. assert$1("DeclareVariable", node, opts);
  9745. }
  9746. function assertDeclareExportDeclaration(node, opts) {
  9747. assert$1("DeclareExportDeclaration", node, opts);
  9748. }
  9749. function assertDeclareExportAllDeclaration(node, opts) {
  9750. assert$1("DeclareExportAllDeclaration", node, opts);
  9751. }
  9752. function assertDeclaredPredicate(node, opts) {
  9753. assert$1("DeclaredPredicate", node, opts);
  9754. }
  9755. function assertExistsTypeAnnotation(node, opts) {
  9756. assert$1("ExistsTypeAnnotation", node, opts);
  9757. }
  9758. function assertFunctionTypeAnnotation(node, opts) {
  9759. assert$1("FunctionTypeAnnotation", node, opts);
  9760. }
  9761. function assertFunctionTypeParam(node, opts) {
  9762. assert$1("FunctionTypeParam", node, opts);
  9763. }
  9764. function assertGenericTypeAnnotation(node, opts) {
  9765. assert$1("GenericTypeAnnotation", node, opts);
  9766. }
  9767. function assertInferredPredicate(node, opts) {
  9768. assert$1("InferredPredicate", node, opts);
  9769. }
  9770. function assertInterfaceExtends(node, opts) {
  9771. assert$1("InterfaceExtends", node, opts);
  9772. }
  9773. function assertInterfaceDeclaration(node, opts) {
  9774. assert$1("InterfaceDeclaration", node, opts);
  9775. }
  9776. function assertInterfaceTypeAnnotation(node, opts) {
  9777. assert$1("InterfaceTypeAnnotation", node, opts);
  9778. }
  9779. function assertIntersectionTypeAnnotation(node, opts) {
  9780. assert$1("IntersectionTypeAnnotation", node, opts);
  9781. }
  9782. function assertMixedTypeAnnotation(node, opts) {
  9783. assert$1("MixedTypeAnnotation", node, opts);
  9784. }
  9785. function assertEmptyTypeAnnotation(node, opts) {
  9786. assert$1("EmptyTypeAnnotation", node, opts);
  9787. }
  9788. function assertNullableTypeAnnotation(node, opts) {
  9789. assert$1("NullableTypeAnnotation", node, opts);
  9790. }
  9791. function assertNumberLiteralTypeAnnotation(node, opts) {
  9792. assert$1("NumberLiteralTypeAnnotation", node, opts);
  9793. }
  9794. function assertNumberTypeAnnotation(node, opts) {
  9795. assert$1("NumberTypeAnnotation", node, opts);
  9796. }
  9797. function assertObjectTypeAnnotation(node, opts) {
  9798. assert$1("ObjectTypeAnnotation", node, opts);
  9799. }
  9800. function assertObjectTypeInternalSlot(node, opts) {
  9801. assert$1("ObjectTypeInternalSlot", node, opts);
  9802. }
  9803. function assertObjectTypeCallProperty(node, opts) {
  9804. assert$1("ObjectTypeCallProperty", node, opts);
  9805. }
  9806. function assertObjectTypeIndexer(node, opts) {
  9807. assert$1("ObjectTypeIndexer", node, opts);
  9808. }
  9809. function assertObjectTypeProperty(node, opts) {
  9810. assert$1("ObjectTypeProperty", node, opts);
  9811. }
  9812. function assertObjectTypeSpreadProperty(node, opts) {
  9813. assert$1("ObjectTypeSpreadProperty", node, opts);
  9814. }
  9815. function assertOpaqueType(node, opts) {
  9816. assert$1("OpaqueType", node, opts);
  9817. }
  9818. function assertQualifiedTypeIdentifier(node, opts) {
  9819. assert$1("QualifiedTypeIdentifier", node, opts);
  9820. }
  9821. function assertStringLiteralTypeAnnotation(node, opts) {
  9822. assert$1("StringLiteralTypeAnnotation", node, opts);
  9823. }
  9824. function assertStringTypeAnnotation(node, opts) {
  9825. assert$1("StringTypeAnnotation", node, opts);
  9826. }
  9827. function assertSymbolTypeAnnotation(node, opts) {
  9828. assert$1("SymbolTypeAnnotation", node, opts);
  9829. }
  9830. function assertThisTypeAnnotation(node, opts) {
  9831. assert$1("ThisTypeAnnotation", node, opts);
  9832. }
  9833. function assertTupleTypeAnnotation(node, opts) {
  9834. assert$1("TupleTypeAnnotation", node, opts);
  9835. }
  9836. function assertTypeofTypeAnnotation(node, opts) {
  9837. assert$1("TypeofTypeAnnotation", node, opts);
  9838. }
  9839. function assertTypeAlias(node, opts) {
  9840. assert$1("TypeAlias", node, opts);
  9841. }
  9842. function assertTypeAnnotation(node, opts) {
  9843. assert$1("TypeAnnotation", node, opts);
  9844. }
  9845. function assertTypeCastExpression(node, opts) {
  9846. assert$1("TypeCastExpression", node, opts);
  9847. }
  9848. function assertTypeParameter(node, opts) {
  9849. assert$1("TypeParameter", node, opts);
  9850. }
  9851. function assertTypeParameterDeclaration(node, opts) {
  9852. assert$1("TypeParameterDeclaration", node, opts);
  9853. }
  9854. function assertTypeParameterInstantiation(node, opts) {
  9855. assert$1("TypeParameterInstantiation", node, opts);
  9856. }
  9857. function assertUnionTypeAnnotation(node, opts) {
  9858. assert$1("UnionTypeAnnotation", node, opts);
  9859. }
  9860. function assertVariance(node, opts) {
  9861. assert$1("Variance", node, opts);
  9862. }
  9863. function assertVoidTypeAnnotation(node, opts) {
  9864. assert$1("VoidTypeAnnotation", node, opts);
  9865. }
  9866. function assertEnumDeclaration(node, opts) {
  9867. assert$1("EnumDeclaration", node, opts);
  9868. }
  9869. function assertEnumBooleanBody(node, opts) {
  9870. assert$1("EnumBooleanBody", node, opts);
  9871. }
  9872. function assertEnumNumberBody(node, opts) {
  9873. assert$1("EnumNumberBody", node, opts);
  9874. }
  9875. function assertEnumStringBody(node, opts) {
  9876. assert$1("EnumStringBody", node, opts);
  9877. }
  9878. function assertEnumSymbolBody(node, opts) {
  9879. assert$1("EnumSymbolBody", node, opts);
  9880. }
  9881. function assertEnumBooleanMember(node, opts) {
  9882. assert$1("EnumBooleanMember", node, opts);
  9883. }
  9884. function assertEnumNumberMember(node, opts) {
  9885. assert$1("EnumNumberMember", node, opts);
  9886. }
  9887. function assertEnumStringMember(node, opts) {
  9888. assert$1("EnumStringMember", node, opts);
  9889. }
  9890. function assertEnumDefaultedMember(node, opts) {
  9891. assert$1("EnumDefaultedMember", node, opts);
  9892. }
  9893. function assertIndexedAccessType(node, opts) {
  9894. assert$1("IndexedAccessType", node, opts);
  9895. }
  9896. function assertOptionalIndexedAccessType(node, opts) {
  9897. assert$1("OptionalIndexedAccessType", node, opts);
  9898. }
  9899. function assertJSXAttribute(node, opts) {
  9900. assert$1("JSXAttribute", node, opts);
  9901. }
  9902. function assertJSXClosingElement(node, opts) {
  9903. assert$1("JSXClosingElement", node, opts);
  9904. }
  9905. function assertJSXElement(node, opts) {
  9906. assert$1("JSXElement", node, opts);
  9907. }
  9908. function assertJSXEmptyExpression(node, opts) {
  9909. assert$1("JSXEmptyExpression", node, opts);
  9910. }
  9911. function assertJSXExpressionContainer(node, opts) {
  9912. assert$1("JSXExpressionContainer", node, opts);
  9913. }
  9914. function assertJSXSpreadChild(node, opts) {
  9915. assert$1("JSXSpreadChild", node, opts);
  9916. }
  9917. function assertJSXIdentifier(node, opts) {
  9918. assert$1("JSXIdentifier", node, opts);
  9919. }
  9920. function assertJSXMemberExpression(node, opts) {
  9921. assert$1("JSXMemberExpression", node, opts);
  9922. }
  9923. function assertJSXNamespacedName(node, opts) {
  9924. assert$1("JSXNamespacedName", node, opts);
  9925. }
  9926. function assertJSXOpeningElement(node, opts) {
  9927. assert$1("JSXOpeningElement", node, opts);
  9928. }
  9929. function assertJSXSpreadAttribute(node, opts) {
  9930. assert$1("JSXSpreadAttribute", node, opts);
  9931. }
  9932. function assertJSXText(node, opts) {
  9933. assert$1("JSXText", node, opts);
  9934. }
  9935. function assertJSXFragment(node, opts) {
  9936. assert$1("JSXFragment", node, opts);
  9937. }
  9938. function assertJSXOpeningFragment(node, opts) {
  9939. assert$1("JSXOpeningFragment", node, opts);
  9940. }
  9941. function assertJSXClosingFragment(node, opts) {
  9942. assert$1("JSXClosingFragment", node, opts);
  9943. }
  9944. function assertNoop(node, opts) {
  9945. assert$1("Noop", node, opts);
  9946. }
  9947. function assertPlaceholder(node, opts) {
  9948. assert$1("Placeholder", node, opts);
  9949. }
  9950. function assertV8IntrinsicIdentifier(node, opts) {
  9951. assert$1("V8IntrinsicIdentifier", node, opts);
  9952. }
  9953. function assertArgumentPlaceholder(node, opts) {
  9954. assert$1("ArgumentPlaceholder", node, opts);
  9955. }
  9956. function assertBindExpression(node, opts) {
  9957. assert$1("BindExpression", node, opts);
  9958. }
  9959. function assertImportAttribute(node, opts) {
  9960. assert$1("ImportAttribute", node, opts);
  9961. }
  9962. function assertDecorator(node, opts) {
  9963. assert$1("Decorator", node, opts);
  9964. }
  9965. function assertDoExpression(node, opts) {
  9966. assert$1("DoExpression", node, opts);
  9967. }
  9968. function assertExportDefaultSpecifier(node, opts) {
  9969. assert$1("ExportDefaultSpecifier", node, opts);
  9970. }
  9971. function assertRecordExpression(node, opts) {
  9972. assert$1("RecordExpression", node, opts);
  9973. }
  9974. function assertTupleExpression(node, opts) {
  9975. assert$1("TupleExpression", node, opts);
  9976. }
  9977. function assertDecimalLiteral(node, opts) {
  9978. assert$1("DecimalLiteral", node, opts);
  9979. }
  9980. function assertStaticBlock(node, opts) {
  9981. assert$1("StaticBlock", node, opts);
  9982. }
  9983. function assertModuleExpression(node, opts) {
  9984. assert$1("ModuleExpression", node, opts);
  9985. }
  9986. function assertTopicReference(node, opts) {
  9987. assert$1("TopicReference", node, opts);
  9988. }
  9989. function assertPipelineTopicExpression(node, opts) {
  9990. assert$1("PipelineTopicExpression", node, opts);
  9991. }
  9992. function assertPipelineBareFunction(node, opts) {
  9993. assert$1("PipelineBareFunction", node, opts);
  9994. }
  9995. function assertPipelinePrimaryTopicReference(node, opts) {
  9996. assert$1("PipelinePrimaryTopicReference", node, opts);
  9997. }
  9998. function assertTSParameterProperty(node, opts) {
  9999. assert$1("TSParameterProperty", node, opts);
  10000. }
  10001. function assertTSDeclareFunction(node, opts) {
  10002. assert$1("TSDeclareFunction", node, opts);
  10003. }
  10004. function assertTSDeclareMethod(node, opts) {
  10005. assert$1("TSDeclareMethod", node, opts);
  10006. }
  10007. function assertTSQualifiedName(node, opts) {
  10008. assert$1("TSQualifiedName", node, opts);
  10009. }
  10010. function assertTSCallSignatureDeclaration(node, opts) {
  10011. assert$1("TSCallSignatureDeclaration", node, opts);
  10012. }
  10013. function assertTSConstructSignatureDeclaration(node, opts) {
  10014. assert$1("TSConstructSignatureDeclaration", node, opts);
  10015. }
  10016. function assertTSPropertySignature(node, opts) {
  10017. assert$1("TSPropertySignature", node, opts);
  10018. }
  10019. function assertTSMethodSignature(node, opts) {
  10020. assert$1("TSMethodSignature", node, opts);
  10021. }
  10022. function assertTSIndexSignature(node, opts) {
  10023. assert$1("TSIndexSignature", node, opts);
  10024. }
  10025. function assertTSAnyKeyword(node, opts) {
  10026. assert$1("TSAnyKeyword", node, opts);
  10027. }
  10028. function assertTSBooleanKeyword(node, opts) {
  10029. assert$1("TSBooleanKeyword", node, opts);
  10030. }
  10031. function assertTSBigIntKeyword(node, opts) {
  10032. assert$1("TSBigIntKeyword", node, opts);
  10033. }
  10034. function assertTSIntrinsicKeyword(node, opts) {
  10035. assert$1("TSIntrinsicKeyword", node, opts);
  10036. }
  10037. function assertTSNeverKeyword(node, opts) {
  10038. assert$1("TSNeverKeyword", node, opts);
  10039. }
  10040. function assertTSNullKeyword(node, opts) {
  10041. assert$1("TSNullKeyword", node, opts);
  10042. }
  10043. function assertTSNumberKeyword(node, opts) {
  10044. assert$1("TSNumberKeyword", node, opts);
  10045. }
  10046. function assertTSObjectKeyword(node, opts) {
  10047. assert$1("TSObjectKeyword", node, opts);
  10048. }
  10049. function assertTSStringKeyword(node, opts) {
  10050. assert$1("TSStringKeyword", node, opts);
  10051. }
  10052. function assertTSSymbolKeyword(node, opts) {
  10053. assert$1("TSSymbolKeyword", node, opts);
  10054. }
  10055. function assertTSUndefinedKeyword(node, opts) {
  10056. assert$1("TSUndefinedKeyword", node, opts);
  10057. }
  10058. function assertTSUnknownKeyword(node, opts) {
  10059. assert$1("TSUnknownKeyword", node, opts);
  10060. }
  10061. function assertTSVoidKeyword(node, opts) {
  10062. assert$1("TSVoidKeyword", node, opts);
  10063. }
  10064. function assertTSThisType(node, opts) {
  10065. assert$1("TSThisType", node, opts);
  10066. }
  10067. function assertTSFunctionType(node, opts) {
  10068. assert$1("TSFunctionType", node, opts);
  10069. }
  10070. function assertTSConstructorType(node, opts) {
  10071. assert$1("TSConstructorType", node, opts);
  10072. }
  10073. function assertTSTypeReference(node, opts) {
  10074. assert$1("TSTypeReference", node, opts);
  10075. }
  10076. function assertTSTypePredicate(node, opts) {
  10077. assert$1("TSTypePredicate", node, opts);
  10078. }
  10079. function assertTSTypeQuery(node, opts) {
  10080. assert$1("TSTypeQuery", node, opts);
  10081. }
  10082. function assertTSTypeLiteral(node, opts) {
  10083. assert$1("TSTypeLiteral", node, opts);
  10084. }
  10085. function assertTSArrayType(node, opts) {
  10086. assert$1("TSArrayType", node, opts);
  10087. }
  10088. function assertTSTupleType(node, opts) {
  10089. assert$1("TSTupleType", node, opts);
  10090. }
  10091. function assertTSOptionalType(node, opts) {
  10092. assert$1("TSOptionalType", node, opts);
  10093. }
  10094. function assertTSRestType(node, opts) {
  10095. assert$1("TSRestType", node, opts);
  10096. }
  10097. function assertTSNamedTupleMember(node, opts) {
  10098. assert$1("TSNamedTupleMember", node, opts);
  10099. }
  10100. function assertTSUnionType(node, opts) {
  10101. assert$1("TSUnionType", node, opts);
  10102. }
  10103. function assertTSIntersectionType(node, opts) {
  10104. assert$1("TSIntersectionType", node, opts);
  10105. }
  10106. function assertTSConditionalType(node, opts) {
  10107. assert$1("TSConditionalType", node, opts);
  10108. }
  10109. function assertTSInferType(node, opts) {
  10110. assert$1("TSInferType", node, opts);
  10111. }
  10112. function assertTSParenthesizedType(node, opts) {
  10113. assert$1("TSParenthesizedType", node, opts);
  10114. }
  10115. function assertTSTypeOperator(node, opts) {
  10116. assert$1("TSTypeOperator", node, opts);
  10117. }
  10118. function assertTSIndexedAccessType(node, opts) {
  10119. assert$1("TSIndexedAccessType", node, opts);
  10120. }
  10121. function assertTSMappedType(node, opts) {
  10122. assert$1("TSMappedType", node, opts);
  10123. }
  10124. function assertTSLiteralType(node, opts) {
  10125. assert$1("TSLiteralType", node, opts);
  10126. }
  10127. function assertTSExpressionWithTypeArguments(node, opts) {
  10128. assert$1("TSExpressionWithTypeArguments", node, opts);
  10129. }
  10130. function assertTSInterfaceDeclaration(node, opts) {
  10131. assert$1("TSInterfaceDeclaration", node, opts);
  10132. }
  10133. function assertTSInterfaceBody(node, opts) {
  10134. assert$1("TSInterfaceBody", node, opts);
  10135. }
  10136. function assertTSTypeAliasDeclaration(node, opts) {
  10137. assert$1("TSTypeAliasDeclaration", node, opts);
  10138. }
  10139. function assertTSAsExpression(node, opts) {
  10140. assert$1("TSAsExpression", node, opts);
  10141. }
  10142. function assertTSTypeAssertion(node, opts) {
  10143. assert$1("TSTypeAssertion", node, opts);
  10144. }
  10145. function assertTSEnumDeclaration(node, opts) {
  10146. assert$1("TSEnumDeclaration", node, opts);
  10147. }
  10148. function assertTSEnumMember(node, opts) {
  10149. assert$1("TSEnumMember", node, opts);
  10150. }
  10151. function assertTSModuleDeclaration(node, opts) {
  10152. assert$1("TSModuleDeclaration", node, opts);
  10153. }
  10154. function assertTSModuleBlock(node, opts) {
  10155. assert$1("TSModuleBlock", node, opts);
  10156. }
  10157. function assertTSImportType(node, opts) {
  10158. assert$1("TSImportType", node, opts);
  10159. }
  10160. function assertTSImportEqualsDeclaration(node, opts) {
  10161. assert$1("TSImportEqualsDeclaration", node, opts);
  10162. }
  10163. function assertTSExternalModuleReference(node, opts) {
  10164. assert$1("TSExternalModuleReference", node, opts);
  10165. }
  10166. function assertTSNonNullExpression(node, opts) {
  10167. assert$1("TSNonNullExpression", node, opts);
  10168. }
  10169. function assertTSExportAssignment(node, opts) {
  10170. assert$1("TSExportAssignment", node, opts);
  10171. }
  10172. function assertTSNamespaceExportDeclaration(node, opts) {
  10173. assert$1("TSNamespaceExportDeclaration", node, opts);
  10174. }
  10175. function assertTSTypeAnnotation(node, opts) {
  10176. assert$1("TSTypeAnnotation", node, opts);
  10177. }
  10178. function assertTSTypeParameterInstantiation(node, opts) {
  10179. assert$1("TSTypeParameterInstantiation", node, opts);
  10180. }
  10181. function assertTSTypeParameterDeclaration(node, opts) {
  10182. assert$1("TSTypeParameterDeclaration", node, opts);
  10183. }
  10184. function assertTSTypeParameter(node, opts) {
  10185. assert$1("TSTypeParameter", node, opts);
  10186. }
  10187. function assertExpression(node, opts) {
  10188. assert$1("Expression", node, opts);
  10189. }
  10190. function assertBinary(node, opts) {
  10191. assert$1("Binary", node, opts);
  10192. }
  10193. function assertScopable(node, opts) {
  10194. assert$1("Scopable", node, opts);
  10195. }
  10196. function assertBlockParent(node, opts) {
  10197. assert$1("BlockParent", node, opts);
  10198. }
  10199. function assertBlock(node, opts) {
  10200. assert$1("Block", node, opts);
  10201. }
  10202. function assertStatement(node, opts) {
  10203. assert$1("Statement", node, opts);
  10204. }
  10205. function assertTerminatorless(node, opts) {
  10206. assert$1("Terminatorless", node, opts);
  10207. }
  10208. function assertCompletionStatement(node, opts) {
  10209. assert$1("CompletionStatement", node, opts);
  10210. }
  10211. function assertConditional(node, opts) {
  10212. assert$1("Conditional", node, opts);
  10213. }
  10214. function assertLoop(node, opts) {
  10215. assert$1("Loop", node, opts);
  10216. }
  10217. function assertWhile(node, opts) {
  10218. assert$1("While", node, opts);
  10219. }
  10220. function assertExpressionWrapper(node, opts) {
  10221. assert$1("ExpressionWrapper", node, opts);
  10222. }
  10223. function assertFor(node, opts) {
  10224. assert$1("For", node, opts);
  10225. }
  10226. function assertForXStatement(node, opts) {
  10227. assert$1("ForXStatement", node, opts);
  10228. }
  10229. function assertFunction(node, opts) {
  10230. assert$1("Function", node, opts);
  10231. }
  10232. function assertFunctionParent(node, opts) {
  10233. assert$1("FunctionParent", node, opts);
  10234. }
  10235. function assertPureish(node, opts) {
  10236. assert$1("Pureish", node, opts);
  10237. }
  10238. function assertDeclaration(node, opts) {
  10239. assert$1("Declaration", node, opts);
  10240. }
  10241. function assertPatternLike(node, opts) {
  10242. assert$1("PatternLike", node, opts);
  10243. }
  10244. function assertLVal(node, opts) {
  10245. assert$1("LVal", node, opts);
  10246. }
  10247. function assertTSEntityName(node, opts) {
  10248. assert$1("TSEntityName", node, opts);
  10249. }
  10250. function assertLiteral(node, opts) {
  10251. assert$1("Literal", node, opts);
  10252. }
  10253. function assertImmutable(node, opts) {
  10254. assert$1("Immutable", node, opts);
  10255. }
  10256. function assertUserWhitespacable(node, opts) {
  10257. assert$1("UserWhitespacable", node, opts);
  10258. }
  10259. function assertMethod(node, opts) {
  10260. assert$1("Method", node, opts);
  10261. }
  10262. function assertObjectMember(node, opts) {
  10263. assert$1("ObjectMember", node, opts);
  10264. }
  10265. function assertProperty(node, opts) {
  10266. assert$1("Property", node, opts);
  10267. }
  10268. function assertUnaryLike(node, opts) {
  10269. assert$1("UnaryLike", node, opts);
  10270. }
  10271. function assertPattern(node, opts) {
  10272. assert$1("Pattern", node, opts);
  10273. }
  10274. function assertClass(node, opts) {
  10275. assert$1("Class", node, opts);
  10276. }
  10277. function assertModuleDeclaration(node, opts) {
  10278. assert$1("ModuleDeclaration", node, opts);
  10279. }
  10280. function assertExportDeclaration(node, opts) {
  10281. assert$1("ExportDeclaration", node, opts);
  10282. }
  10283. function assertModuleSpecifier(node, opts) {
  10284. assert$1("ModuleSpecifier", node, opts);
  10285. }
  10286. function assertPrivate(node, opts) {
  10287. assert$1("Private", node, opts);
  10288. }
  10289. function assertFlow(node, opts) {
  10290. assert$1("Flow", node, opts);
  10291. }
  10292. function assertFlowType(node, opts) {
  10293. assert$1("FlowType", node, opts);
  10294. }
  10295. function assertFlowBaseAnnotation(node, opts) {
  10296. assert$1("FlowBaseAnnotation", node, opts);
  10297. }
  10298. function assertFlowDeclaration(node, opts) {
  10299. assert$1("FlowDeclaration", node, opts);
  10300. }
  10301. function assertFlowPredicate(node, opts) {
  10302. assert$1("FlowPredicate", node, opts);
  10303. }
  10304. function assertEnumBody(node, opts) {
  10305. assert$1("EnumBody", node, opts);
  10306. }
  10307. function assertEnumMember(node, opts) {
  10308. assert$1("EnumMember", node, opts);
  10309. }
  10310. function assertJSX(node, opts) {
  10311. assert$1("JSX", node, opts);
  10312. }
  10313. function assertTSTypeElement(node, opts) {
  10314. assert$1("TSTypeElement", node, opts);
  10315. }
  10316. function assertTSType(node, opts) {
  10317. assert$1("TSType", node, opts);
  10318. }
  10319. function assertTSBaseType(node, opts) {
  10320. assert$1("TSBaseType", node, opts);
  10321. }
  10322. function assertNumberLiteral(node, opts) {
  10323. console.trace("The node type NumberLiteral has been renamed to NumericLiteral");
  10324. assert$1("NumberLiteral", node, opts);
  10325. }
  10326. function assertRegexLiteral(node, opts) {
  10327. console.trace("The node type RegexLiteral has been renamed to RegExpLiteral");
  10328. assert$1("RegexLiteral", node, opts);
  10329. }
  10330. function assertRestProperty(node, opts) {
  10331. console.trace("The node type RestProperty has been renamed to RestElement");
  10332. assert$1("RestProperty", node, opts);
  10333. }
  10334. function assertSpreadProperty(node, opts) {
  10335. console.trace("The node type SpreadProperty has been renamed to SpreadElement");
  10336. assert$1("SpreadProperty", node, opts);
  10337. }
  10338. var createTypeAnnotationBasedOnTypeof$1 = {};
  10339. Object.defineProperty(createTypeAnnotationBasedOnTypeof$1, "__esModule", {
  10340. value: true
  10341. });
  10342. createTypeAnnotationBasedOnTypeof$1.default = createTypeAnnotationBasedOnTypeof;
  10343. var _generated$l = generated$3;
  10344. function createTypeAnnotationBasedOnTypeof(type) {
  10345. if (type === "string") {
  10346. return (0, _generated$l.stringTypeAnnotation)();
  10347. } else if (type === "number") {
  10348. return (0, _generated$l.numberTypeAnnotation)();
  10349. } else if (type === "undefined") {
  10350. return (0, _generated$l.voidTypeAnnotation)();
  10351. } else if (type === "boolean") {
  10352. return (0, _generated$l.booleanTypeAnnotation)();
  10353. } else if (type === "function") {
  10354. return (0, _generated$l.genericTypeAnnotation)((0, _generated$l.identifier)("Function"));
  10355. } else if (type === "object") {
  10356. return (0, _generated$l.genericTypeAnnotation)((0, _generated$l.identifier)("Object"));
  10357. } else if (type === "symbol") {
  10358. return (0, _generated$l.genericTypeAnnotation)((0, _generated$l.identifier)("Symbol"));
  10359. } else if (type === "bigint") {
  10360. return (0, _generated$l.anyTypeAnnotation)();
  10361. } else {
  10362. throw new Error("Invalid typeof value: " + type);
  10363. }
  10364. }
  10365. var createFlowUnionType$1 = {};
  10366. var removeTypeDuplicates$3 = {};
  10367. Object.defineProperty(removeTypeDuplicates$3, "__esModule", {
  10368. value: true
  10369. });
  10370. removeTypeDuplicates$3.default = removeTypeDuplicates$2;
  10371. var _generated$k = generated$4;
  10372. function getQualifiedName(node) {
  10373. return (0, _generated$k.isIdentifier)(node) ? node.name : `${node.id.name}.${getQualifiedName(node.qualification)}`;
  10374. }
  10375. function removeTypeDuplicates$2(nodes) {
  10376. const generics = {};
  10377. const bases = {};
  10378. const typeGroups = [];
  10379. const types = [];
  10380. for (let i = 0; i < nodes.length; i++) {
  10381. const node = nodes[i];
  10382. if (!node) continue;
  10383. if (types.indexOf(node) >= 0) {
  10384. continue;
  10385. }
  10386. if ((0, _generated$k.isAnyTypeAnnotation)(node)) {
  10387. return [node];
  10388. }
  10389. if ((0, _generated$k.isFlowBaseAnnotation)(node)) {
  10390. bases[node.type] = node;
  10391. continue;
  10392. }
  10393. if ((0, _generated$k.isUnionTypeAnnotation)(node)) {
  10394. if (typeGroups.indexOf(node.types) < 0) {
  10395. nodes = nodes.concat(node.types);
  10396. typeGroups.push(node.types);
  10397. }
  10398. continue;
  10399. }
  10400. if ((0, _generated$k.isGenericTypeAnnotation)(node)) {
  10401. const name = getQualifiedName(node.id);
  10402. if (generics[name]) {
  10403. let existing = generics[name];
  10404. if (existing.typeParameters) {
  10405. if (node.typeParameters) {
  10406. existing.typeParameters.params = removeTypeDuplicates$2(existing.typeParameters.params.concat(node.typeParameters.params));
  10407. }
  10408. } else {
  10409. existing = node.typeParameters;
  10410. }
  10411. } else {
  10412. generics[name] = node;
  10413. }
  10414. continue;
  10415. }
  10416. types.push(node);
  10417. }
  10418. for (const type of Object.keys(bases)) {
  10419. types.push(bases[type]);
  10420. }
  10421. for (const name of Object.keys(generics)) {
  10422. types.push(generics[name]);
  10423. }
  10424. return types;
  10425. }
  10426. Object.defineProperty(createFlowUnionType$1, "__esModule", {
  10427. value: true
  10428. });
  10429. createFlowUnionType$1.default = createFlowUnionType;
  10430. var _generated$j = generated$3;
  10431. var _removeTypeDuplicates$1 = removeTypeDuplicates$3;
  10432. function createFlowUnionType(types) {
  10433. const flattened = (0, _removeTypeDuplicates$1.default)(types);
  10434. if (flattened.length === 1) {
  10435. return flattened[0];
  10436. } else {
  10437. return (0, _generated$j.unionTypeAnnotation)(flattened);
  10438. }
  10439. }
  10440. var createTSUnionType$1 = {};
  10441. var removeTypeDuplicates$1 = {};
  10442. Object.defineProperty(removeTypeDuplicates$1, "__esModule", {
  10443. value: true
  10444. });
  10445. removeTypeDuplicates$1.default = removeTypeDuplicates;
  10446. var _generated$i = generated$4;
  10447. function removeTypeDuplicates(nodes) {
  10448. const generics = {};
  10449. const bases = {};
  10450. const typeGroups = [];
  10451. const types = [];
  10452. for (let i = 0; i < nodes.length; i++) {
  10453. const node = nodes[i];
  10454. if (!node) continue;
  10455. if (types.indexOf(node) >= 0) {
  10456. continue;
  10457. }
  10458. if ((0, _generated$i.isTSAnyKeyword)(node)) {
  10459. return [node];
  10460. }
  10461. if ((0, _generated$i.isTSBaseType)(node)) {
  10462. bases[node.type] = node;
  10463. continue;
  10464. }
  10465. if ((0, _generated$i.isTSUnionType)(node)) {
  10466. if (typeGroups.indexOf(node.types) < 0) {
  10467. nodes = nodes.concat(node.types);
  10468. typeGroups.push(node.types);
  10469. }
  10470. continue;
  10471. }
  10472. types.push(node);
  10473. }
  10474. for (const type of Object.keys(bases)) {
  10475. types.push(bases[type]);
  10476. }
  10477. for (const name of Object.keys(generics)) {
  10478. types.push(generics[name]);
  10479. }
  10480. return types;
  10481. }
  10482. Object.defineProperty(createTSUnionType$1, "__esModule", {
  10483. value: true
  10484. });
  10485. createTSUnionType$1.default = createTSUnionType;
  10486. var _generated$h = generated$3;
  10487. var _removeTypeDuplicates = removeTypeDuplicates$1;
  10488. function createTSUnionType(typeAnnotations) {
  10489. const types = typeAnnotations.map(type => type.typeAnnotation);
  10490. const flattened = (0, _removeTypeDuplicates.default)(types);
  10491. if (flattened.length === 1) {
  10492. return flattened[0];
  10493. } else {
  10494. return (0, _generated$h.tsUnionType)(flattened);
  10495. }
  10496. }
  10497. var uppercase = {};
  10498. (function (exports) {
  10499. Object.defineProperty(exports, "__esModule", {
  10500. value: true
  10501. });
  10502. Object.defineProperty(exports, "ArrayExpression", {
  10503. enumerable: true,
  10504. get: function () {
  10505. return _index.arrayExpression;
  10506. }
  10507. });
  10508. Object.defineProperty(exports, "AssignmentExpression", {
  10509. enumerable: true,
  10510. get: function () {
  10511. return _index.assignmentExpression;
  10512. }
  10513. });
  10514. Object.defineProperty(exports, "BinaryExpression", {
  10515. enumerable: true,
  10516. get: function () {
  10517. return _index.binaryExpression;
  10518. }
  10519. });
  10520. Object.defineProperty(exports, "InterpreterDirective", {
  10521. enumerable: true,
  10522. get: function () {
  10523. return _index.interpreterDirective;
  10524. }
  10525. });
  10526. Object.defineProperty(exports, "Directive", {
  10527. enumerable: true,
  10528. get: function () {
  10529. return _index.directive;
  10530. }
  10531. });
  10532. Object.defineProperty(exports, "DirectiveLiteral", {
  10533. enumerable: true,
  10534. get: function () {
  10535. return _index.directiveLiteral;
  10536. }
  10537. });
  10538. Object.defineProperty(exports, "BlockStatement", {
  10539. enumerable: true,
  10540. get: function () {
  10541. return _index.blockStatement;
  10542. }
  10543. });
  10544. Object.defineProperty(exports, "BreakStatement", {
  10545. enumerable: true,
  10546. get: function () {
  10547. return _index.breakStatement;
  10548. }
  10549. });
  10550. Object.defineProperty(exports, "CallExpression", {
  10551. enumerable: true,
  10552. get: function () {
  10553. return _index.callExpression;
  10554. }
  10555. });
  10556. Object.defineProperty(exports, "CatchClause", {
  10557. enumerable: true,
  10558. get: function () {
  10559. return _index.catchClause;
  10560. }
  10561. });
  10562. Object.defineProperty(exports, "ConditionalExpression", {
  10563. enumerable: true,
  10564. get: function () {
  10565. return _index.conditionalExpression;
  10566. }
  10567. });
  10568. Object.defineProperty(exports, "ContinueStatement", {
  10569. enumerable: true,
  10570. get: function () {
  10571. return _index.continueStatement;
  10572. }
  10573. });
  10574. Object.defineProperty(exports, "DebuggerStatement", {
  10575. enumerable: true,
  10576. get: function () {
  10577. return _index.debuggerStatement;
  10578. }
  10579. });
  10580. Object.defineProperty(exports, "DoWhileStatement", {
  10581. enumerable: true,
  10582. get: function () {
  10583. return _index.doWhileStatement;
  10584. }
  10585. });
  10586. Object.defineProperty(exports, "EmptyStatement", {
  10587. enumerable: true,
  10588. get: function () {
  10589. return _index.emptyStatement;
  10590. }
  10591. });
  10592. Object.defineProperty(exports, "ExpressionStatement", {
  10593. enumerable: true,
  10594. get: function () {
  10595. return _index.expressionStatement;
  10596. }
  10597. });
  10598. Object.defineProperty(exports, "File", {
  10599. enumerable: true,
  10600. get: function () {
  10601. return _index.file;
  10602. }
  10603. });
  10604. Object.defineProperty(exports, "ForInStatement", {
  10605. enumerable: true,
  10606. get: function () {
  10607. return _index.forInStatement;
  10608. }
  10609. });
  10610. Object.defineProperty(exports, "ForStatement", {
  10611. enumerable: true,
  10612. get: function () {
  10613. return _index.forStatement;
  10614. }
  10615. });
  10616. Object.defineProperty(exports, "FunctionDeclaration", {
  10617. enumerable: true,
  10618. get: function () {
  10619. return _index.functionDeclaration;
  10620. }
  10621. });
  10622. Object.defineProperty(exports, "FunctionExpression", {
  10623. enumerable: true,
  10624. get: function () {
  10625. return _index.functionExpression;
  10626. }
  10627. });
  10628. Object.defineProperty(exports, "Identifier", {
  10629. enumerable: true,
  10630. get: function () {
  10631. return _index.identifier;
  10632. }
  10633. });
  10634. Object.defineProperty(exports, "IfStatement", {
  10635. enumerable: true,
  10636. get: function () {
  10637. return _index.ifStatement;
  10638. }
  10639. });
  10640. Object.defineProperty(exports, "LabeledStatement", {
  10641. enumerable: true,
  10642. get: function () {
  10643. return _index.labeledStatement;
  10644. }
  10645. });
  10646. Object.defineProperty(exports, "StringLiteral", {
  10647. enumerable: true,
  10648. get: function () {
  10649. return _index.stringLiteral;
  10650. }
  10651. });
  10652. Object.defineProperty(exports, "NumericLiteral", {
  10653. enumerable: true,
  10654. get: function () {
  10655. return _index.numericLiteral;
  10656. }
  10657. });
  10658. Object.defineProperty(exports, "NullLiteral", {
  10659. enumerable: true,
  10660. get: function () {
  10661. return _index.nullLiteral;
  10662. }
  10663. });
  10664. Object.defineProperty(exports, "BooleanLiteral", {
  10665. enumerable: true,
  10666. get: function () {
  10667. return _index.booleanLiteral;
  10668. }
  10669. });
  10670. Object.defineProperty(exports, "RegExpLiteral", {
  10671. enumerable: true,
  10672. get: function () {
  10673. return _index.regExpLiteral;
  10674. }
  10675. });
  10676. Object.defineProperty(exports, "LogicalExpression", {
  10677. enumerable: true,
  10678. get: function () {
  10679. return _index.logicalExpression;
  10680. }
  10681. });
  10682. Object.defineProperty(exports, "MemberExpression", {
  10683. enumerable: true,
  10684. get: function () {
  10685. return _index.memberExpression;
  10686. }
  10687. });
  10688. Object.defineProperty(exports, "NewExpression", {
  10689. enumerable: true,
  10690. get: function () {
  10691. return _index.newExpression;
  10692. }
  10693. });
  10694. Object.defineProperty(exports, "Program", {
  10695. enumerable: true,
  10696. get: function () {
  10697. return _index.program;
  10698. }
  10699. });
  10700. Object.defineProperty(exports, "ObjectExpression", {
  10701. enumerable: true,
  10702. get: function () {
  10703. return _index.objectExpression;
  10704. }
  10705. });
  10706. Object.defineProperty(exports, "ObjectMethod", {
  10707. enumerable: true,
  10708. get: function () {
  10709. return _index.objectMethod;
  10710. }
  10711. });
  10712. Object.defineProperty(exports, "ObjectProperty", {
  10713. enumerable: true,
  10714. get: function () {
  10715. return _index.objectProperty;
  10716. }
  10717. });
  10718. Object.defineProperty(exports, "RestElement", {
  10719. enumerable: true,
  10720. get: function () {
  10721. return _index.restElement;
  10722. }
  10723. });
  10724. Object.defineProperty(exports, "ReturnStatement", {
  10725. enumerable: true,
  10726. get: function () {
  10727. return _index.returnStatement;
  10728. }
  10729. });
  10730. Object.defineProperty(exports, "SequenceExpression", {
  10731. enumerable: true,
  10732. get: function () {
  10733. return _index.sequenceExpression;
  10734. }
  10735. });
  10736. Object.defineProperty(exports, "ParenthesizedExpression", {
  10737. enumerable: true,
  10738. get: function () {
  10739. return _index.parenthesizedExpression;
  10740. }
  10741. });
  10742. Object.defineProperty(exports, "SwitchCase", {
  10743. enumerable: true,
  10744. get: function () {
  10745. return _index.switchCase;
  10746. }
  10747. });
  10748. Object.defineProperty(exports, "SwitchStatement", {
  10749. enumerable: true,
  10750. get: function () {
  10751. return _index.switchStatement;
  10752. }
  10753. });
  10754. Object.defineProperty(exports, "ThisExpression", {
  10755. enumerable: true,
  10756. get: function () {
  10757. return _index.thisExpression;
  10758. }
  10759. });
  10760. Object.defineProperty(exports, "ThrowStatement", {
  10761. enumerable: true,
  10762. get: function () {
  10763. return _index.throwStatement;
  10764. }
  10765. });
  10766. Object.defineProperty(exports, "TryStatement", {
  10767. enumerable: true,
  10768. get: function () {
  10769. return _index.tryStatement;
  10770. }
  10771. });
  10772. Object.defineProperty(exports, "UnaryExpression", {
  10773. enumerable: true,
  10774. get: function () {
  10775. return _index.unaryExpression;
  10776. }
  10777. });
  10778. Object.defineProperty(exports, "UpdateExpression", {
  10779. enumerable: true,
  10780. get: function () {
  10781. return _index.updateExpression;
  10782. }
  10783. });
  10784. Object.defineProperty(exports, "VariableDeclaration", {
  10785. enumerable: true,
  10786. get: function () {
  10787. return _index.variableDeclaration;
  10788. }
  10789. });
  10790. Object.defineProperty(exports, "VariableDeclarator", {
  10791. enumerable: true,
  10792. get: function () {
  10793. return _index.variableDeclarator;
  10794. }
  10795. });
  10796. Object.defineProperty(exports, "WhileStatement", {
  10797. enumerable: true,
  10798. get: function () {
  10799. return _index.whileStatement;
  10800. }
  10801. });
  10802. Object.defineProperty(exports, "WithStatement", {
  10803. enumerable: true,
  10804. get: function () {
  10805. return _index.withStatement;
  10806. }
  10807. });
  10808. Object.defineProperty(exports, "AssignmentPattern", {
  10809. enumerable: true,
  10810. get: function () {
  10811. return _index.assignmentPattern;
  10812. }
  10813. });
  10814. Object.defineProperty(exports, "ArrayPattern", {
  10815. enumerable: true,
  10816. get: function () {
  10817. return _index.arrayPattern;
  10818. }
  10819. });
  10820. Object.defineProperty(exports, "ArrowFunctionExpression", {
  10821. enumerable: true,
  10822. get: function () {
  10823. return _index.arrowFunctionExpression;
  10824. }
  10825. });
  10826. Object.defineProperty(exports, "ClassBody", {
  10827. enumerable: true,
  10828. get: function () {
  10829. return _index.classBody;
  10830. }
  10831. });
  10832. Object.defineProperty(exports, "ClassExpression", {
  10833. enumerable: true,
  10834. get: function () {
  10835. return _index.classExpression;
  10836. }
  10837. });
  10838. Object.defineProperty(exports, "ClassDeclaration", {
  10839. enumerable: true,
  10840. get: function () {
  10841. return _index.classDeclaration;
  10842. }
  10843. });
  10844. Object.defineProperty(exports, "ExportAllDeclaration", {
  10845. enumerable: true,
  10846. get: function () {
  10847. return _index.exportAllDeclaration;
  10848. }
  10849. });
  10850. Object.defineProperty(exports, "ExportDefaultDeclaration", {
  10851. enumerable: true,
  10852. get: function () {
  10853. return _index.exportDefaultDeclaration;
  10854. }
  10855. });
  10856. Object.defineProperty(exports, "ExportNamedDeclaration", {
  10857. enumerable: true,
  10858. get: function () {
  10859. return _index.exportNamedDeclaration;
  10860. }
  10861. });
  10862. Object.defineProperty(exports, "ExportSpecifier", {
  10863. enumerable: true,
  10864. get: function () {
  10865. return _index.exportSpecifier;
  10866. }
  10867. });
  10868. Object.defineProperty(exports, "ForOfStatement", {
  10869. enumerable: true,
  10870. get: function () {
  10871. return _index.forOfStatement;
  10872. }
  10873. });
  10874. Object.defineProperty(exports, "ImportDeclaration", {
  10875. enumerable: true,
  10876. get: function () {
  10877. return _index.importDeclaration;
  10878. }
  10879. });
  10880. Object.defineProperty(exports, "ImportDefaultSpecifier", {
  10881. enumerable: true,
  10882. get: function () {
  10883. return _index.importDefaultSpecifier;
  10884. }
  10885. });
  10886. Object.defineProperty(exports, "ImportNamespaceSpecifier", {
  10887. enumerable: true,
  10888. get: function () {
  10889. return _index.importNamespaceSpecifier;
  10890. }
  10891. });
  10892. Object.defineProperty(exports, "ImportSpecifier", {
  10893. enumerable: true,
  10894. get: function () {
  10895. return _index.importSpecifier;
  10896. }
  10897. });
  10898. Object.defineProperty(exports, "MetaProperty", {
  10899. enumerable: true,
  10900. get: function () {
  10901. return _index.metaProperty;
  10902. }
  10903. });
  10904. Object.defineProperty(exports, "ClassMethod", {
  10905. enumerable: true,
  10906. get: function () {
  10907. return _index.classMethod;
  10908. }
  10909. });
  10910. Object.defineProperty(exports, "ObjectPattern", {
  10911. enumerable: true,
  10912. get: function () {
  10913. return _index.objectPattern;
  10914. }
  10915. });
  10916. Object.defineProperty(exports, "SpreadElement", {
  10917. enumerable: true,
  10918. get: function () {
  10919. return _index.spreadElement;
  10920. }
  10921. });
  10922. Object.defineProperty(exports, "Super", {
  10923. enumerable: true,
  10924. get: function () {
  10925. return _index.super;
  10926. }
  10927. });
  10928. Object.defineProperty(exports, "TaggedTemplateExpression", {
  10929. enumerable: true,
  10930. get: function () {
  10931. return _index.taggedTemplateExpression;
  10932. }
  10933. });
  10934. Object.defineProperty(exports, "TemplateElement", {
  10935. enumerable: true,
  10936. get: function () {
  10937. return _index.templateElement;
  10938. }
  10939. });
  10940. Object.defineProperty(exports, "TemplateLiteral", {
  10941. enumerable: true,
  10942. get: function () {
  10943. return _index.templateLiteral;
  10944. }
  10945. });
  10946. Object.defineProperty(exports, "YieldExpression", {
  10947. enumerable: true,
  10948. get: function () {
  10949. return _index.yieldExpression;
  10950. }
  10951. });
  10952. Object.defineProperty(exports, "AwaitExpression", {
  10953. enumerable: true,
  10954. get: function () {
  10955. return _index.awaitExpression;
  10956. }
  10957. });
  10958. Object.defineProperty(exports, "Import", {
  10959. enumerable: true,
  10960. get: function () {
  10961. return _index.import;
  10962. }
  10963. });
  10964. Object.defineProperty(exports, "BigIntLiteral", {
  10965. enumerable: true,
  10966. get: function () {
  10967. return _index.bigIntLiteral;
  10968. }
  10969. });
  10970. Object.defineProperty(exports, "ExportNamespaceSpecifier", {
  10971. enumerable: true,
  10972. get: function () {
  10973. return _index.exportNamespaceSpecifier;
  10974. }
  10975. });
  10976. Object.defineProperty(exports, "OptionalMemberExpression", {
  10977. enumerable: true,
  10978. get: function () {
  10979. return _index.optionalMemberExpression;
  10980. }
  10981. });
  10982. Object.defineProperty(exports, "OptionalCallExpression", {
  10983. enumerable: true,
  10984. get: function () {
  10985. return _index.optionalCallExpression;
  10986. }
  10987. });
  10988. Object.defineProperty(exports, "ClassProperty", {
  10989. enumerable: true,
  10990. get: function () {
  10991. return _index.classProperty;
  10992. }
  10993. });
  10994. Object.defineProperty(exports, "ClassPrivateProperty", {
  10995. enumerable: true,
  10996. get: function () {
  10997. return _index.classPrivateProperty;
  10998. }
  10999. });
  11000. Object.defineProperty(exports, "ClassPrivateMethod", {
  11001. enumerable: true,
  11002. get: function () {
  11003. return _index.classPrivateMethod;
  11004. }
  11005. });
  11006. Object.defineProperty(exports, "PrivateName", {
  11007. enumerable: true,
  11008. get: function () {
  11009. return _index.privateName;
  11010. }
  11011. });
  11012. Object.defineProperty(exports, "AnyTypeAnnotation", {
  11013. enumerable: true,
  11014. get: function () {
  11015. return _index.anyTypeAnnotation;
  11016. }
  11017. });
  11018. Object.defineProperty(exports, "ArrayTypeAnnotation", {
  11019. enumerable: true,
  11020. get: function () {
  11021. return _index.arrayTypeAnnotation;
  11022. }
  11023. });
  11024. Object.defineProperty(exports, "BooleanTypeAnnotation", {
  11025. enumerable: true,
  11026. get: function () {
  11027. return _index.booleanTypeAnnotation;
  11028. }
  11029. });
  11030. Object.defineProperty(exports, "BooleanLiteralTypeAnnotation", {
  11031. enumerable: true,
  11032. get: function () {
  11033. return _index.booleanLiteralTypeAnnotation;
  11034. }
  11035. });
  11036. Object.defineProperty(exports, "NullLiteralTypeAnnotation", {
  11037. enumerable: true,
  11038. get: function () {
  11039. return _index.nullLiteralTypeAnnotation;
  11040. }
  11041. });
  11042. Object.defineProperty(exports, "ClassImplements", {
  11043. enumerable: true,
  11044. get: function () {
  11045. return _index.classImplements;
  11046. }
  11047. });
  11048. Object.defineProperty(exports, "DeclareClass", {
  11049. enumerable: true,
  11050. get: function () {
  11051. return _index.declareClass;
  11052. }
  11053. });
  11054. Object.defineProperty(exports, "DeclareFunction", {
  11055. enumerable: true,
  11056. get: function () {
  11057. return _index.declareFunction;
  11058. }
  11059. });
  11060. Object.defineProperty(exports, "DeclareInterface", {
  11061. enumerable: true,
  11062. get: function () {
  11063. return _index.declareInterface;
  11064. }
  11065. });
  11066. Object.defineProperty(exports, "DeclareModule", {
  11067. enumerable: true,
  11068. get: function () {
  11069. return _index.declareModule;
  11070. }
  11071. });
  11072. Object.defineProperty(exports, "DeclareModuleExports", {
  11073. enumerable: true,
  11074. get: function () {
  11075. return _index.declareModuleExports;
  11076. }
  11077. });
  11078. Object.defineProperty(exports, "DeclareTypeAlias", {
  11079. enumerable: true,
  11080. get: function () {
  11081. return _index.declareTypeAlias;
  11082. }
  11083. });
  11084. Object.defineProperty(exports, "DeclareOpaqueType", {
  11085. enumerable: true,
  11086. get: function () {
  11087. return _index.declareOpaqueType;
  11088. }
  11089. });
  11090. Object.defineProperty(exports, "DeclareVariable", {
  11091. enumerable: true,
  11092. get: function () {
  11093. return _index.declareVariable;
  11094. }
  11095. });
  11096. Object.defineProperty(exports, "DeclareExportDeclaration", {
  11097. enumerable: true,
  11098. get: function () {
  11099. return _index.declareExportDeclaration;
  11100. }
  11101. });
  11102. Object.defineProperty(exports, "DeclareExportAllDeclaration", {
  11103. enumerable: true,
  11104. get: function () {
  11105. return _index.declareExportAllDeclaration;
  11106. }
  11107. });
  11108. Object.defineProperty(exports, "DeclaredPredicate", {
  11109. enumerable: true,
  11110. get: function () {
  11111. return _index.declaredPredicate;
  11112. }
  11113. });
  11114. Object.defineProperty(exports, "ExistsTypeAnnotation", {
  11115. enumerable: true,
  11116. get: function () {
  11117. return _index.existsTypeAnnotation;
  11118. }
  11119. });
  11120. Object.defineProperty(exports, "FunctionTypeAnnotation", {
  11121. enumerable: true,
  11122. get: function () {
  11123. return _index.functionTypeAnnotation;
  11124. }
  11125. });
  11126. Object.defineProperty(exports, "FunctionTypeParam", {
  11127. enumerable: true,
  11128. get: function () {
  11129. return _index.functionTypeParam;
  11130. }
  11131. });
  11132. Object.defineProperty(exports, "GenericTypeAnnotation", {
  11133. enumerable: true,
  11134. get: function () {
  11135. return _index.genericTypeAnnotation;
  11136. }
  11137. });
  11138. Object.defineProperty(exports, "InferredPredicate", {
  11139. enumerable: true,
  11140. get: function () {
  11141. return _index.inferredPredicate;
  11142. }
  11143. });
  11144. Object.defineProperty(exports, "InterfaceExtends", {
  11145. enumerable: true,
  11146. get: function () {
  11147. return _index.interfaceExtends;
  11148. }
  11149. });
  11150. Object.defineProperty(exports, "InterfaceDeclaration", {
  11151. enumerable: true,
  11152. get: function () {
  11153. return _index.interfaceDeclaration;
  11154. }
  11155. });
  11156. Object.defineProperty(exports, "InterfaceTypeAnnotation", {
  11157. enumerable: true,
  11158. get: function () {
  11159. return _index.interfaceTypeAnnotation;
  11160. }
  11161. });
  11162. Object.defineProperty(exports, "IntersectionTypeAnnotation", {
  11163. enumerable: true,
  11164. get: function () {
  11165. return _index.intersectionTypeAnnotation;
  11166. }
  11167. });
  11168. Object.defineProperty(exports, "MixedTypeAnnotation", {
  11169. enumerable: true,
  11170. get: function () {
  11171. return _index.mixedTypeAnnotation;
  11172. }
  11173. });
  11174. Object.defineProperty(exports, "EmptyTypeAnnotation", {
  11175. enumerable: true,
  11176. get: function () {
  11177. return _index.emptyTypeAnnotation;
  11178. }
  11179. });
  11180. Object.defineProperty(exports, "NullableTypeAnnotation", {
  11181. enumerable: true,
  11182. get: function () {
  11183. return _index.nullableTypeAnnotation;
  11184. }
  11185. });
  11186. Object.defineProperty(exports, "NumberLiteralTypeAnnotation", {
  11187. enumerable: true,
  11188. get: function () {
  11189. return _index.numberLiteralTypeAnnotation;
  11190. }
  11191. });
  11192. Object.defineProperty(exports, "NumberTypeAnnotation", {
  11193. enumerable: true,
  11194. get: function () {
  11195. return _index.numberTypeAnnotation;
  11196. }
  11197. });
  11198. Object.defineProperty(exports, "ObjectTypeAnnotation", {
  11199. enumerable: true,
  11200. get: function () {
  11201. return _index.objectTypeAnnotation;
  11202. }
  11203. });
  11204. Object.defineProperty(exports, "ObjectTypeInternalSlot", {
  11205. enumerable: true,
  11206. get: function () {
  11207. return _index.objectTypeInternalSlot;
  11208. }
  11209. });
  11210. Object.defineProperty(exports, "ObjectTypeCallProperty", {
  11211. enumerable: true,
  11212. get: function () {
  11213. return _index.objectTypeCallProperty;
  11214. }
  11215. });
  11216. Object.defineProperty(exports, "ObjectTypeIndexer", {
  11217. enumerable: true,
  11218. get: function () {
  11219. return _index.objectTypeIndexer;
  11220. }
  11221. });
  11222. Object.defineProperty(exports, "ObjectTypeProperty", {
  11223. enumerable: true,
  11224. get: function () {
  11225. return _index.objectTypeProperty;
  11226. }
  11227. });
  11228. Object.defineProperty(exports, "ObjectTypeSpreadProperty", {
  11229. enumerable: true,
  11230. get: function () {
  11231. return _index.objectTypeSpreadProperty;
  11232. }
  11233. });
  11234. Object.defineProperty(exports, "OpaqueType", {
  11235. enumerable: true,
  11236. get: function () {
  11237. return _index.opaqueType;
  11238. }
  11239. });
  11240. Object.defineProperty(exports, "QualifiedTypeIdentifier", {
  11241. enumerable: true,
  11242. get: function () {
  11243. return _index.qualifiedTypeIdentifier;
  11244. }
  11245. });
  11246. Object.defineProperty(exports, "StringLiteralTypeAnnotation", {
  11247. enumerable: true,
  11248. get: function () {
  11249. return _index.stringLiteralTypeAnnotation;
  11250. }
  11251. });
  11252. Object.defineProperty(exports, "StringTypeAnnotation", {
  11253. enumerable: true,
  11254. get: function () {
  11255. return _index.stringTypeAnnotation;
  11256. }
  11257. });
  11258. Object.defineProperty(exports, "SymbolTypeAnnotation", {
  11259. enumerable: true,
  11260. get: function () {
  11261. return _index.symbolTypeAnnotation;
  11262. }
  11263. });
  11264. Object.defineProperty(exports, "ThisTypeAnnotation", {
  11265. enumerable: true,
  11266. get: function () {
  11267. return _index.thisTypeAnnotation;
  11268. }
  11269. });
  11270. Object.defineProperty(exports, "TupleTypeAnnotation", {
  11271. enumerable: true,
  11272. get: function () {
  11273. return _index.tupleTypeAnnotation;
  11274. }
  11275. });
  11276. Object.defineProperty(exports, "TypeofTypeAnnotation", {
  11277. enumerable: true,
  11278. get: function () {
  11279. return _index.typeofTypeAnnotation;
  11280. }
  11281. });
  11282. Object.defineProperty(exports, "TypeAlias", {
  11283. enumerable: true,
  11284. get: function () {
  11285. return _index.typeAlias;
  11286. }
  11287. });
  11288. Object.defineProperty(exports, "TypeAnnotation", {
  11289. enumerable: true,
  11290. get: function () {
  11291. return _index.typeAnnotation;
  11292. }
  11293. });
  11294. Object.defineProperty(exports, "TypeCastExpression", {
  11295. enumerable: true,
  11296. get: function () {
  11297. return _index.typeCastExpression;
  11298. }
  11299. });
  11300. Object.defineProperty(exports, "TypeParameter", {
  11301. enumerable: true,
  11302. get: function () {
  11303. return _index.typeParameter;
  11304. }
  11305. });
  11306. Object.defineProperty(exports, "TypeParameterDeclaration", {
  11307. enumerable: true,
  11308. get: function () {
  11309. return _index.typeParameterDeclaration;
  11310. }
  11311. });
  11312. Object.defineProperty(exports, "TypeParameterInstantiation", {
  11313. enumerable: true,
  11314. get: function () {
  11315. return _index.typeParameterInstantiation;
  11316. }
  11317. });
  11318. Object.defineProperty(exports, "UnionTypeAnnotation", {
  11319. enumerable: true,
  11320. get: function () {
  11321. return _index.unionTypeAnnotation;
  11322. }
  11323. });
  11324. Object.defineProperty(exports, "Variance", {
  11325. enumerable: true,
  11326. get: function () {
  11327. return _index.variance;
  11328. }
  11329. });
  11330. Object.defineProperty(exports, "VoidTypeAnnotation", {
  11331. enumerable: true,
  11332. get: function () {
  11333. return _index.voidTypeAnnotation;
  11334. }
  11335. });
  11336. Object.defineProperty(exports, "EnumDeclaration", {
  11337. enumerable: true,
  11338. get: function () {
  11339. return _index.enumDeclaration;
  11340. }
  11341. });
  11342. Object.defineProperty(exports, "EnumBooleanBody", {
  11343. enumerable: true,
  11344. get: function () {
  11345. return _index.enumBooleanBody;
  11346. }
  11347. });
  11348. Object.defineProperty(exports, "EnumNumberBody", {
  11349. enumerable: true,
  11350. get: function () {
  11351. return _index.enumNumberBody;
  11352. }
  11353. });
  11354. Object.defineProperty(exports, "EnumStringBody", {
  11355. enumerable: true,
  11356. get: function () {
  11357. return _index.enumStringBody;
  11358. }
  11359. });
  11360. Object.defineProperty(exports, "EnumSymbolBody", {
  11361. enumerable: true,
  11362. get: function () {
  11363. return _index.enumSymbolBody;
  11364. }
  11365. });
  11366. Object.defineProperty(exports, "EnumBooleanMember", {
  11367. enumerable: true,
  11368. get: function () {
  11369. return _index.enumBooleanMember;
  11370. }
  11371. });
  11372. Object.defineProperty(exports, "EnumNumberMember", {
  11373. enumerable: true,
  11374. get: function () {
  11375. return _index.enumNumberMember;
  11376. }
  11377. });
  11378. Object.defineProperty(exports, "EnumStringMember", {
  11379. enumerable: true,
  11380. get: function () {
  11381. return _index.enumStringMember;
  11382. }
  11383. });
  11384. Object.defineProperty(exports, "EnumDefaultedMember", {
  11385. enumerable: true,
  11386. get: function () {
  11387. return _index.enumDefaultedMember;
  11388. }
  11389. });
  11390. Object.defineProperty(exports, "IndexedAccessType", {
  11391. enumerable: true,
  11392. get: function () {
  11393. return _index.indexedAccessType;
  11394. }
  11395. });
  11396. Object.defineProperty(exports, "OptionalIndexedAccessType", {
  11397. enumerable: true,
  11398. get: function () {
  11399. return _index.optionalIndexedAccessType;
  11400. }
  11401. });
  11402. Object.defineProperty(exports, "JSXAttribute", {
  11403. enumerable: true,
  11404. get: function () {
  11405. return _index.jsxAttribute;
  11406. }
  11407. });
  11408. Object.defineProperty(exports, "JSXClosingElement", {
  11409. enumerable: true,
  11410. get: function () {
  11411. return _index.jsxClosingElement;
  11412. }
  11413. });
  11414. Object.defineProperty(exports, "JSXElement", {
  11415. enumerable: true,
  11416. get: function () {
  11417. return _index.jsxElement;
  11418. }
  11419. });
  11420. Object.defineProperty(exports, "JSXEmptyExpression", {
  11421. enumerable: true,
  11422. get: function () {
  11423. return _index.jsxEmptyExpression;
  11424. }
  11425. });
  11426. Object.defineProperty(exports, "JSXExpressionContainer", {
  11427. enumerable: true,
  11428. get: function () {
  11429. return _index.jsxExpressionContainer;
  11430. }
  11431. });
  11432. Object.defineProperty(exports, "JSXSpreadChild", {
  11433. enumerable: true,
  11434. get: function () {
  11435. return _index.jsxSpreadChild;
  11436. }
  11437. });
  11438. Object.defineProperty(exports, "JSXIdentifier", {
  11439. enumerable: true,
  11440. get: function () {
  11441. return _index.jsxIdentifier;
  11442. }
  11443. });
  11444. Object.defineProperty(exports, "JSXMemberExpression", {
  11445. enumerable: true,
  11446. get: function () {
  11447. return _index.jsxMemberExpression;
  11448. }
  11449. });
  11450. Object.defineProperty(exports, "JSXNamespacedName", {
  11451. enumerable: true,
  11452. get: function () {
  11453. return _index.jsxNamespacedName;
  11454. }
  11455. });
  11456. Object.defineProperty(exports, "JSXOpeningElement", {
  11457. enumerable: true,
  11458. get: function () {
  11459. return _index.jsxOpeningElement;
  11460. }
  11461. });
  11462. Object.defineProperty(exports, "JSXSpreadAttribute", {
  11463. enumerable: true,
  11464. get: function () {
  11465. return _index.jsxSpreadAttribute;
  11466. }
  11467. });
  11468. Object.defineProperty(exports, "JSXText", {
  11469. enumerable: true,
  11470. get: function () {
  11471. return _index.jsxText;
  11472. }
  11473. });
  11474. Object.defineProperty(exports, "JSXFragment", {
  11475. enumerable: true,
  11476. get: function () {
  11477. return _index.jsxFragment;
  11478. }
  11479. });
  11480. Object.defineProperty(exports, "JSXOpeningFragment", {
  11481. enumerable: true,
  11482. get: function () {
  11483. return _index.jsxOpeningFragment;
  11484. }
  11485. });
  11486. Object.defineProperty(exports, "JSXClosingFragment", {
  11487. enumerable: true,
  11488. get: function () {
  11489. return _index.jsxClosingFragment;
  11490. }
  11491. });
  11492. Object.defineProperty(exports, "Noop", {
  11493. enumerable: true,
  11494. get: function () {
  11495. return _index.noop;
  11496. }
  11497. });
  11498. Object.defineProperty(exports, "Placeholder", {
  11499. enumerable: true,
  11500. get: function () {
  11501. return _index.placeholder;
  11502. }
  11503. });
  11504. Object.defineProperty(exports, "V8IntrinsicIdentifier", {
  11505. enumerable: true,
  11506. get: function () {
  11507. return _index.v8IntrinsicIdentifier;
  11508. }
  11509. });
  11510. Object.defineProperty(exports, "ArgumentPlaceholder", {
  11511. enumerable: true,
  11512. get: function () {
  11513. return _index.argumentPlaceholder;
  11514. }
  11515. });
  11516. Object.defineProperty(exports, "BindExpression", {
  11517. enumerable: true,
  11518. get: function () {
  11519. return _index.bindExpression;
  11520. }
  11521. });
  11522. Object.defineProperty(exports, "ImportAttribute", {
  11523. enumerable: true,
  11524. get: function () {
  11525. return _index.importAttribute;
  11526. }
  11527. });
  11528. Object.defineProperty(exports, "Decorator", {
  11529. enumerable: true,
  11530. get: function () {
  11531. return _index.decorator;
  11532. }
  11533. });
  11534. Object.defineProperty(exports, "DoExpression", {
  11535. enumerable: true,
  11536. get: function () {
  11537. return _index.doExpression;
  11538. }
  11539. });
  11540. Object.defineProperty(exports, "ExportDefaultSpecifier", {
  11541. enumerable: true,
  11542. get: function () {
  11543. return _index.exportDefaultSpecifier;
  11544. }
  11545. });
  11546. Object.defineProperty(exports, "RecordExpression", {
  11547. enumerable: true,
  11548. get: function () {
  11549. return _index.recordExpression;
  11550. }
  11551. });
  11552. Object.defineProperty(exports, "TupleExpression", {
  11553. enumerable: true,
  11554. get: function () {
  11555. return _index.tupleExpression;
  11556. }
  11557. });
  11558. Object.defineProperty(exports, "DecimalLiteral", {
  11559. enumerable: true,
  11560. get: function () {
  11561. return _index.decimalLiteral;
  11562. }
  11563. });
  11564. Object.defineProperty(exports, "StaticBlock", {
  11565. enumerable: true,
  11566. get: function () {
  11567. return _index.staticBlock;
  11568. }
  11569. });
  11570. Object.defineProperty(exports, "ModuleExpression", {
  11571. enumerable: true,
  11572. get: function () {
  11573. return _index.moduleExpression;
  11574. }
  11575. });
  11576. Object.defineProperty(exports, "TopicReference", {
  11577. enumerable: true,
  11578. get: function () {
  11579. return _index.topicReference;
  11580. }
  11581. });
  11582. Object.defineProperty(exports, "PipelineTopicExpression", {
  11583. enumerable: true,
  11584. get: function () {
  11585. return _index.pipelineTopicExpression;
  11586. }
  11587. });
  11588. Object.defineProperty(exports, "PipelineBareFunction", {
  11589. enumerable: true,
  11590. get: function () {
  11591. return _index.pipelineBareFunction;
  11592. }
  11593. });
  11594. Object.defineProperty(exports, "PipelinePrimaryTopicReference", {
  11595. enumerable: true,
  11596. get: function () {
  11597. return _index.pipelinePrimaryTopicReference;
  11598. }
  11599. });
  11600. Object.defineProperty(exports, "TSParameterProperty", {
  11601. enumerable: true,
  11602. get: function () {
  11603. return _index.tsParameterProperty;
  11604. }
  11605. });
  11606. Object.defineProperty(exports, "TSDeclareFunction", {
  11607. enumerable: true,
  11608. get: function () {
  11609. return _index.tsDeclareFunction;
  11610. }
  11611. });
  11612. Object.defineProperty(exports, "TSDeclareMethod", {
  11613. enumerable: true,
  11614. get: function () {
  11615. return _index.tsDeclareMethod;
  11616. }
  11617. });
  11618. Object.defineProperty(exports, "TSQualifiedName", {
  11619. enumerable: true,
  11620. get: function () {
  11621. return _index.tsQualifiedName;
  11622. }
  11623. });
  11624. Object.defineProperty(exports, "TSCallSignatureDeclaration", {
  11625. enumerable: true,
  11626. get: function () {
  11627. return _index.tsCallSignatureDeclaration;
  11628. }
  11629. });
  11630. Object.defineProperty(exports, "TSConstructSignatureDeclaration", {
  11631. enumerable: true,
  11632. get: function () {
  11633. return _index.tsConstructSignatureDeclaration;
  11634. }
  11635. });
  11636. Object.defineProperty(exports, "TSPropertySignature", {
  11637. enumerable: true,
  11638. get: function () {
  11639. return _index.tsPropertySignature;
  11640. }
  11641. });
  11642. Object.defineProperty(exports, "TSMethodSignature", {
  11643. enumerable: true,
  11644. get: function () {
  11645. return _index.tsMethodSignature;
  11646. }
  11647. });
  11648. Object.defineProperty(exports, "TSIndexSignature", {
  11649. enumerable: true,
  11650. get: function () {
  11651. return _index.tsIndexSignature;
  11652. }
  11653. });
  11654. Object.defineProperty(exports, "TSAnyKeyword", {
  11655. enumerable: true,
  11656. get: function () {
  11657. return _index.tsAnyKeyword;
  11658. }
  11659. });
  11660. Object.defineProperty(exports, "TSBooleanKeyword", {
  11661. enumerable: true,
  11662. get: function () {
  11663. return _index.tsBooleanKeyword;
  11664. }
  11665. });
  11666. Object.defineProperty(exports, "TSBigIntKeyword", {
  11667. enumerable: true,
  11668. get: function () {
  11669. return _index.tsBigIntKeyword;
  11670. }
  11671. });
  11672. Object.defineProperty(exports, "TSIntrinsicKeyword", {
  11673. enumerable: true,
  11674. get: function () {
  11675. return _index.tsIntrinsicKeyword;
  11676. }
  11677. });
  11678. Object.defineProperty(exports, "TSNeverKeyword", {
  11679. enumerable: true,
  11680. get: function () {
  11681. return _index.tsNeverKeyword;
  11682. }
  11683. });
  11684. Object.defineProperty(exports, "TSNullKeyword", {
  11685. enumerable: true,
  11686. get: function () {
  11687. return _index.tsNullKeyword;
  11688. }
  11689. });
  11690. Object.defineProperty(exports, "TSNumberKeyword", {
  11691. enumerable: true,
  11692. get: function () {
  11693. return _index.tsNumberKeyword;
  11694. }
  11695. });
  11696. Object.defineProperty(exports, "TSObjectKeyword", {
  11697. enumerable: true,
  11698. get: function () {
  11699. return _index.tsObjectKeyword;
  11700. }
  11701. });
  11702. Object.defineProperty(exports, "TSStringKeyword", {
  11703. enumerable: true,
  11704. get: function () {
  11705. return _index.tsStringKeyword;
  11706. }
  11707. });
  11708. Object.defineProperty(exports, "TSSymbolKeyword", {
  11709. enumerable: true,
  11710. get: function () {
  11711. return _index.tsSymbolKeyword;
  11712. }
  11713. });
  11714. Object.defineProperty(exports, "TSUndefinedKeyword", {
  11715. enumerable: true,
  11716. get: function () {
  11717. return _index.tsUndefinedKeyword;
  11718. }
  11719. });
  11720. Object.defineProperty(exports, "TSUnknownKeyword", {
  11721. enumerable: true,
  11722. get: function () {
  11723. return _index.tsUnknownKeyword;
  11724. }
  11725. });
  11726. Object.defineProperty(exports, "TSVoidKeyword", {
  11727. enumerable: true,
  11728. get: function () {
  11729. return _index.tsVoidKeyword;
  11730. }
  11731. });
  11732. Object.defineProperty(exports, "TSThisType", {
  11733. enumerable: true,
  11734. get: function () {
  11735. return _index.tsThisType;
  11736. }
  11737. });
  11738. Object.defineProperty(exports, "TSFunctionType", {
  11739. enumerable: true,
  11740. get: function () {
  11741. return _index.tsFunctionType;
  11742. }
  11743. });
  11744. Object.defineProperty(exports, "TSConstructorType", {
  11745. enumerable: true,
  11746. get: function () {
  11747. return _index.tsConstructorType;
  11748. }
  11749. });
  11750. Object.defineProperty(exports, "TSTypeReference", {
  11751. enumerable: true,
  11752. get: function () {
  11753. return _index.tsTypeReference;
  11754. }
  11755. });
  11756. Object.defineProperty(exports, "TSTypePredicate", {
  11757. enumerable: true,
  11758. get: function () {
  11759. return _index.tsTypePredicate;
  11760. }
  11761. });
  11762. Object.defineProperty(exports, "TSTypeQuery", {
  11763. enumerable: true,
  11764. get: function () {
  11765. return _index.tsTypeQuery;
  11766. }
  11767. });
  11768. Object.defineProperty(exports, "TSTypeLiteral", {
  11769. enumerable: true,
  11770. get: function () {
  11771. return _index.tsTypeLiteral;
  11772. }
  11773. });
  11774. Object.defineProperty(exports, "TSArrayType", {
  11775. enumerable: true,
  11776. get: function () {
  11777. return _index.tsArrayType;
  11778. }
  11779. });
  11780. Object.defineProperty(exports, "TSTupleType", {
  11781. enumerable: true,
  11782. get: function () {
  11783. return _index.tsTupleType;
  11784. }
  11785. });
  11786. Object.defineProperty(exports, "TSOptionalType", {
  11787. enumerable: true,
  11788. get: function () {
  11789. return _index.tsOptionalType;
  11790. }
  11791. });
  11792. Object.defineProperty(exports, "TSRestType", {
  11793. enumerable: true,
  11794. get: function () {
  11795. return _index.tsRestType;
  11796. }
  11797. });
  11798. Object.defineProperty(exports, "TSNamedTupleMember", {
  11799. enumerable: true,
  11800. get: function () {
  11801. return _index.tsNamedTupleMember;
  11802. }
  11803. });
  11804. Object.defineProperty(exports, "TSUnionType", {
  11805. enumerable: true,
  11806. get: function () {
  11807. return _index.tsUnionType;
  11808. }
  11809. });
  11810. Object.defineProperty(exports, "TSIntersectionType", {
  11811. enumerable: true,
  11812. get: function () {
  11813. return _index.tsIntersectionType;
  11814. }
  11815. });
  11816. Object.defineProperty(exports, "TSConditionalType", {
  11817. enumerable: true,
  11818. get: function () {
  11819. return _index.tsConditionalType;
  11820. }
  11821. });
  11822. Object.defineProperty(exports, "TSInferType", {
  11823. enumerable: true,
  11824. get: function () {
  11825. return _index.tsInferType;
  11826. }
  11827. });
  11828. Object.defineProperty(exports, "TSParenthesizedType", {
  11829. enumerable: true,
  11830. get: function () {
  11831. return _index.tsParenthesizedType;
  11832. }
  11833. });
  11834. Object.defineProperty(exports, "TSTypeOperator", {
  11835. enumerable: true,
  11836. get: function () {
  11837. return _index.tsTypeOperator;
  11838. }
  11839. });
  11840. Object.defineProperty(exports, "TSIndexedAccessType", {
  11841. enumerable: true,
  11842. get: function () {
  11843. return _index.tsIndexedAccessType;
  11844. }
  11845. });
  11846. Object.defineProperty(exports, "TSMappedType", {
  11847. enumerable: true,
  11848. get: function () {
  11849. return _index.tsMappedType;
  11850. }
  11851. });
  11852. Object.defineProperty(exports, "TSLiteralType", {
  11853. enumerable: true,
  11854. get: function () {
  11855. return _index.tsLiteralType;
  11856. }
  11857. });
  11858. Object.defineProperty(exports, "TSExpressionWithTypeArguments", {
  11859. enumerable: true,
  11860. get: function () {
  11861. return _index.tsExpressionWithTypeArguments;
  11862. }
  11863. });
  11864. Object.defineProperty(exports, "TSInterfaceDeclaration", {
  11865. enumerable: true,
  11866. get: function () {
  11867. return _index.tsInterfaceDeclaration;
  11868. }
  11869. });
  11870. Object.defineProperty(exports, "TSInterfaceBody", {
  11871. enumerable: true,
  11872. get: function () {
  11873. return _index.tsInterfaceBody;
  11874. }
  11875. });
  11876. Object.defineProperty(exports, "TSTypeAliasDeclaration", {
  11877. enumerable: true,
  11878. get: function () {
  11879. return _index.tsTypeAliasDeclaration;
  11880. }
  11881. });
  11882. Object.defineProperty(exports, "TSAsExpression", {
  11883. enumerable: true,
  11884. get: function () {
  11885. return _index.tsAsExpression;
  11886. }
  11887. });
  11888. Object.defineProperty(exports, "TSTypeAssertion", {
  11889. enumerable: true,
  11890. get: function () {
  11891. return _index.tsTypeAssertion;
  11892. }
  11893. });
  11894. Object.defineProperty(exports, "TSEnumDeclaration", {
  11895. enumerable: true,
  11896. get: function () {
  11897. return _index.tsEnumDeclaration;
  11898. }
  11899. });
  11900. Object.defineProperty(exports, "TSEnumMember", {
  11901. enumerable: true,
  11902. get: function () {
  11903. return _index.tsEnumMember;
  11904. }
  11905. });
  11906. Object.defineProperty(exports, "TSModuleDeclaration", {
  11907. enumerable: true,
  11908. get: function () {
  11909. return _index.tsModuleDeclaration;
  11910. }
  11911. });
  11912. Object.defineProperty(exports, "TSModuleBlock", {
  11913. enumerable: true,
  11914. get: function () {
  11915. return _index.tsModuleBlock;
  11916. }
  11917. });
  11918. Object.defineProperty(exports, "TSImportType", {
  11919. enumerable: true,
  11920. get: function () {
  11921. return _index.tsImportType;
  11922. }
  11923. });
  11924. Object.defineProperty(exports, "TSImportEqualsDeclaration", {
  11925. enumerable: true,
  11926. get: function () {
  11927. return _index.tsImportEqualsDeclaration;
  11928. }
  11929. });
  11930. Object.defineProperty(exports, "TSExternalModuleReference", {
  11931. enumerable: true,
  11932. get: function () {
  11933. return _index.tsExternalModuleReference;
  11934. }
  11935. });
  11936. Object.defineProperty(exports, "TSNonNullExpression", {
  11937. enumerable: true,
  11938. get: function () {
  11939. return _index.tsNonNullExpression;
  11940. }
  11941. });
  11942. Object.defineProperty(exports, "TSExportAssignment", {
  11943. enumerable: true,
  11944. get: function () {
  11945. return _index.tsExportAssignment;
  11946. }
  11947. });
  11948. Object.defineProperty(exports, "TSNamespaceExportDeclaration", {
  11949. enumerable: true,
  11950. get: function () {
  11951. return _index.tsNamespaceExportDeclaration;
  11952. }
  11953. });
  11954. Object.defineProperty(exports, "TSTypeAnnotation", {
  11955. enumerable: true,
  11956. get: function () {
  11957. return _index.tsTypeAnnotation;
  11958. }
  11959. });
  11960. Object.defineProperty(exports, "TSTypeParameterInstantiation", {
  11961. enumerable: true,
  11962. get: function () {
  11963. return _index.tsTypeParameterInstantiation;
  11964. }
  11965. });
  11966. Object.defineProperty(exports, "TSTypeParameterDeclaration", {
  11967. enumerable: true,
  11968. get: function () {
  11969. return _index.tsTypeParameterDeclaration;
  11970. }
  11971. });
  11972. Object.defineProperty(exports, "TSTypeParameter", {
  11973. enumerable: true,
  11974. get: function () {
  11975. return _index.tsTypeParameter;
  11976. }
  11977. });
  11978. Object.defineProperty(exports, "NumberLiteral", {
  11979. enumerable: true,
  11980. get: function () {
  11981. return _index.numberLiteral;
  11982. }
  11983. });
  11984. Object.defineProperty(exports, "RegexLiteral", {
  11985. enumerable: true,
  11986. get: function () {
  11987. return _index.regexLiteral;
  11988. }
  11989. });
  11990. Object.defineProperty(exports, "RestProperty", {
  11991. enumerable: true,
  11992. get: function () {
  11993. return _index.restProperty;
  11994. }
  11995. });
  11996. Object.defineProperty(exports, "SpreadProperty", {
  11997. enumerable: true,
  11998. get: function () {
  11999. return _index.spreadProperty;
  12000. }
  12001. });
  12002. var _index = generated$3;
  12003. }(uppercase));
  12004. var cloneNode$1 = {};
  12005. Object.defineProperty(cloneNode$1, "__esModule", {
  12006. value: true
  12007. });
  12008. cloneNode$1.default = cloneNode;
  12009. var _definitions$4 = definitions;
  12010. var _generated$g = generated$4;
  12011. const has = Function.call.bind(Object.prototype.hasOwnProperty);
  12012. function cloneIfNode(obj, deep, withoutLoc) {
  12013. if (obj && typeof obj.type === "string") {
  12014. return cloneNode(obj, deep, withoutLoc);
  12015. }
  12016. return obj;
  12017. }
  12018. function cloneIfNodeOrArray(obj, deep, withoutLoc) {
  12019. if (Array.isArray(obj)) {
  12020. return obj.map(node => cloneIfNode(node, deep, withoutLoc));
  12021. }
  12022. return cloneIfNode(obj, deep, withoutLoc);
  12023. }
  12024. function cloneNode(node, deep = true, withoutLoc = false) {
  12025. if (!node) return node;
  12026. const {
  12027. type
  12028. } = node;
  12029. const newNode = {
  12030. type: node.type
  12031. };
  12032. if ((0, _generated$g.isIdentifier)(node)) {
  12033. newNode.name = node.name;
  12034. if (has(node, "optional") && typeof node.optional === "boolean") {
  12035. newNode.optional = node.optional;
  12036. }
  12037. if (has(node, "typeAnnotation")) {
  12038. newNode.typeAnnotation = deep ? cloneIfNodeOrArray(node.typeAnnotation, true, withoutLoc) : node.typeAnnotation;
  12039. }
  12040. } else if (!has(_definitions$4.NODE_FIELDS, type)) {
  12041. throw new Error(`Unknown node type: "${type}"`);
  12042. } else {
  12043. for (const field of Object.keys(_definitions$4.NODE_FIELDS[type])) {
  12044. if (has(node, field)) {
  12045. if (deep) {
  12046. newNode[field] = (0, _generated$g.isFile)(node) && field === "comments" ? maybeCloneComments(node.comments, deep, withoutLoc) : cloneIfNodeOrArray(node[field], true, withoutLoc);
  12047. } else {
  12048. newNode[field] = node[field];
  12049. }
  12050. }
  12051. }
  12052. }
  12053. if (has(node, "loc")) {
  12054. if (withoutLoc) {
  12055. newNode.loc = null;
  12056. } else {
  12057. newNode.loc = node.loc;
  12058. }
  12059. }
  12060. if (has(node, "leadingComments")) {
  12061. newNode.leadingComments = maybeCloneComments(node.leadingComments, deep, withoutLoc);
  12062. }
  12063. if (has(node, "innerComments")) {
  12064. newNode.innerComments = maybeCloneComments(node.innerComments, deep, withoutLoc);
  12065. }
  12066. if (has(node, "trailingComments")) {
  12067. newNode.trailingComments = maybeCloneComments(node.trailingComments, deep, withoutLoc);
  12068. }
  12069. if (has(node, "extra")) {
  12070. newNode.extra = Object.assign({}, node.extra);
  12071. }
  12072. return newNode;
  12073. }
  12074. function maybeCloneComments(comments, deep, withoutLoc) {
  12075. if (!comments || !deep) {
  12076. return comments;
  12077. }
  12078. return comments.map(({
  12079. type,
  12080. value,
  12081. loc
  12082. }) => {
  12083. if (withoutLoc) {
  12084. return {
  12085. type,
  12086. value,
  12087. loc: null
  12088. };
  12089. }
  12090. return {
  12091. type,
  12092. value,
  12093. loc
  12094. };
  12095. });
  12096. }
  12097. var clone$1 = {};
  12098. Object.defineProperty(clone$1, "__esModule", {
  12099. value: true
  12100. });
  12101. clone$1.default = clone;
  12102. var _cloneNode$5 = cloneNode$1;
  12103. function clone(node) {
  12104. return (0, _cloneNode$5.default)(node, false);
  12105. }
  12106. var cloneDeep$1 = {};
  12107. Object.defineProperty(cloneDeep$1, "__esModule", {
  12108. value: true
  12109. });
  12110. cloneDeep$1.default = cloneDeep;
  12111. var _cloneNode$4 = cloneNode$1;
  12112. function cloneDeep(node) {
  12113. return (0, _cloneNode$4.default)(node);
  12114. }
  12115. var cloneDeepWithoutLoc$1 = {};
  12116. Object.defineProperty(cloneDeepWithoutLoc$1, "__esModule", {
  12117. value: true
  12118. });
  12119. cloneDeepWithoutLoc$1.default = cloneDeepWithoutLoc;
  12120. var _cloneNode$3 = cloneNode$1;
  12121. function cloneDeepWithoutLoc(node) {
  12122. return (0, _cloneNode$3.default)(node, true, true);
  12123. }
  12124. var cloneWithoutLoc$1 = {};
  12125. Object.defineProperty(cloneWithoutLoc$1, "__esModule", {
  12126. value: true
  12127. });
  12128. cloneWithoutLoc$1.default = cloneWithoutLoc;
  12129. var _cloneNode$2 = cloneNode$1;
  12130. function cloneWithoutLoc(node) {
  12131. return (0, _cloneNode$2.default)(node, false, true);
  12132. }
  12133. var addComment$1 = {};
  12134. var addComments$1 = {};
  12135. Object.defineProperty(addComments$1, "__esModule", {
  12136. value: true
  12137. });
  12138. addComments$1.default = addComments;
  12139. function addComments(node, type, comments) {
  12140. if (!comments || !node) return node;
  12141. const key = `${type}Comments`;
  12142. if (node[key]) {
  12143. if (type === "leading") {
  12144. node[key] = comments.concat(node[key]);
  12145. } else {
  12146. node[key] = node[key].concat(comments);
  12147. }
  12148. } else {
  12149. node[key] = comments;
  12150. }
  12151. return node;
  12152. }
  12153. Object.defineProperty(addComment$1, "__esModule", {
  12154. value: true
  12155. });
  12156. addComment$1.default = addComment;
  12157. var _addComments = addComments$1;
  12158. function addComment(node, type, content, line) {
  12159. return (0, _addComments.default)(node, type, [{
  12160. type: line ? "CommentLine" : "CommentBlock",
  12161. value: content
  12162. }]);
  12163. }
  12164. var inheritInnerComments$1 = {};
  12165. var inherit$1 = {};
  12166. Object.defineProperty(inherit$1, "__esModule", {
  12167. value: true
  12168. });
  12169. inherit$1.default = inherit;
  12170. function inherit(key, child, parent) {
  12171. if (child && parent) {
  12172. child[key] = Array.from(new Set([].concat(child[key], parent[key]).filter(Boolean)));
  12173. }
  12174. }
  12175. Object.defineProperty(inheritInnerComments$1, "__esModule", {
  12176. value: true
  12177. });
  12178. inheritInnerComments$1.default = inheritInnerComments;
  12179. var _inherit$2 = inherit$1;
  12180. function inheritInnerComments(child, parent) {
  12181. (0, _inherit$2.default)("innerComments", child, parent);
  12182. }
  12183. var inheritLeadingComments$1 = {};
  12184. Object.defineProperty(inheritLeadingComments$1, "__esModule", {
  12185. value: true
  12186. });
  12187. inheritLeadingComments$1.default = inheritLeadingComments;
  12188. var _inherit$1 = inherit$1;
  12189. function inheritLeadingComments(child, parent) {
  12190. (0, _inherit$1.default)("leadingComments", child, parent);
  12191. }
  12192. var inheritsComments$1 = {};
  12193. var inheritTrailingComments$1 = {};
  12194. Object.defineProperty(inheritTrailingComments$1, "__esModule", {
  12195. value: true
  12196. });
  12197. inheritTrailingComments$1.default = inheritTrailingComments;
  12198. var _inherit = inherit$1;
  12199. function inheritTrailingComments(child, parent) {
  12200. (0, _inherit.default)("trailingComments", child, parent);
  12201. }
  12202. Object.defineProperty(inheritsComments$1, "__esModule", {
  12203. value: true
  12204. });
  12205. inheritsComments$1.default = inheritsComments;
  12206. var _inheritTrailingComments = inheritTrailingComments$1;
  12207. var _inheritLeadingComments = inheritLeadingComments$1;
  12208. var _inheritInnerComments = inheritInnerComments$1;
  12209. function inheritsComments(child, parent) {
  12210. (0, _inheritTrailingComments.default)(child, parent);
  12211. (0, _inheritLeadingComments.default)(child, parent);
  12212. (0, _inheritInnerComments.default)(child, parent);
  12213. return child;
  12214. }
  12215. var removeComments$1 = {};
  12216. Object.defineProperty(removeComments$1, "__esModule", {
  12217. value: true
  12218. });
  12219. removeComments$1.default = removeComments;
  12220. var _constants$4 = constants;
  12221. function removeComments(node) {
  12222. _constants$4.COMMENT_KEYS.forEach(key => {
  12223. node[key] = null;
  12224. });
  12225. return node;
  12226. }
  12227. var generated$1 = {};
  12228. Object.defineProperty(generated$1, "__esModule", {
  12229. value: true
  12230. });
  12231. 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;
  12232. var _definitions$3 = definitions;
  12233. const EXPRESSION_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Expression"];
  12234. generated$1.EXPRESSION_TYPES = EXPRESSION_TYPES;
  12235. const BINARY_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Binary"];
  12236. generated$1.BINARY_TYPES = BINARY_TYPES;
  12237. const SCOPABLE_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Scopable"];
  12238. generated$1.SCOPABLE_TYPES = SCOPABLE_TYPES;
  12239. const BLOCKPARENT_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["BlockParent"];
  12240. generated$1.BLOCKPARENT_TYPES = BLOCKPARENT_TYPES;
  12241. const BLOCK_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Block"];
  12242. generated$1.BLOCK_TYPES = BLOCK_TYPES;
  12243. const STATEMENT_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Statement"];
  12244. generated$1.STATEMENT_TYPES = STATEMENT_TYPES;
  12245. const TERMINATORLESS_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Terminatorless"];
  12246. generated$1.TERMINATORLESS_TYPES = TERMINATORLESS_TYPES;
  12247. const COMPLETIONSTATEMENT_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["CompletionStatement"];
  12248. generated$1.COMPLETIONSTATEMENT_TYPES = COMPLETIONSTATEMENT_TYPES;
  12249. const CONDITIONAL_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Conditional"];
  12250. generated$1.CONDITIONAL_TYPES = CONDITIONAL_TYPES;
  12251. const LOOP_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Loop"];
  12252. generated$1.LOOP_TYPES = LOOP_TYPES;
  12253. const WHILE_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["While"];
  12254. generated$1.WHILE_TYPES = WHILE_TYPES;
  12255. const EXPRESSIONWRAPPER_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["ExpressionWrapper"];
  12256. generated$1.EXPRESSIONWRAPPER_TYPES = EXPRESSIONWRAPPER_TYPES;
  12257. const FOR_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["For"];
  12258. generated$1.FOR_TYPES = FOR_TYPES;
  12259. const FORXSTATEMENT_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["ForXStatement"];
  12260. generated$1.FORXSTATEMENT_TYPES = FORXSTATEMENT_TYPES;
  12261. const FUNCTION_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Function"];
  12262. generated$1.FUNCTION_TYPES = FUNCTION_TYPES;
  12263. const FUNCTIONPARENT_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["FunctionParent"];
  12264. generated$1.FUNCTIONPARENT_TYPES = FUNCTIONPARENT_TYPES;
  12265. const PUREISH_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Pureish"];
  12266. generated$1.PUREISH_TYPES = PUREISH_TYPES;
  12267. const DECLARATION_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Declaration"];
  12268. generated$1.DECLARATION_TYPES = DECLARATION_TYPES;
  12269. const PATTERNLIKE_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["PatternLike"];
  12270. generated$1.PATTERNLIKE_TYPES = PATTERNLIKE_TYPES;
  12271. const LVAL_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["LVal"];
  12272. generated$1.LVAL_TYPES = LVAL_TYPES;
  12273. const TSENTITYNAME_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["TSEntityName"];
  12274. generated$1.TSENTITYNAME_TYPES = TSENTITYNAME_TYPES;
  12275. const LITERAL_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Literal"];
  12276. generated$1.LITERAL_TYPES = LITERAL_TYPES;
  12277. const IMMUTABLE_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Immutable"];
  12278. generated$1.IMMUTABLE_TYPES = IMMUTABLE_TYPES;
  12279. const USERWHITESPACABLE_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["UserWhitespacable"];
  12280. generated$1.USERWHITESPACABLE_TYPES = USERWHITESPACABLE_TYPES;
  12281. const METHOD_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Method"];
  12282. generated$1.METHOD_TYPES = METHOD_TYPES;
  12283. const OBJECTMEMBER_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["ObjectMember"];
  12284. generated$1.OBJECTMEMBER_TYPES = OBJECTMEMBER_TYPES;
  12285. const PROPERTY_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Property"];
  12286. generated$1.PROPERTY_TYPES = PROPERTY_TYPES;
  12287. const UNARYLIKE_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["UnaryLike"];
  12288. generated$1.UNARYLIKE_TYPES = UNARYLIKE_TYPES;
  12289. const PATTERN_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Pattern"];
  12290. generated$1.PATTERN_TYPES = PATTERN_TYPES;
  12291. const CLASS_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Class"];
  12292. generated$1.CLASS_TYPES = CLASS_TYPES;
  12293. const MODULEDECLARATION_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["ModuleDeclaration"];
  12294. generated$1.MODULEDECLARATION_TYPES = MODULEDECLARATION_TYPES;
  12295. const EXPORTDECLARATION_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["ExportDeclaration"];
  12296. generated$1.EXPORTDECLARATION_TYPES = EXPORTDECLARATION_TYPES;
  12297. const MODULESPECIFIER_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["ModuleSpecifier"];
  12298. generated$1.MODULESPECIFIER_TYPES = MODULESPECIFIER_TYPES;
  12299. const PRIVATE_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Private"];
  12300. generated$1.PRIVATE_TYPES = PRIVATE_TYPES;
  12301. const FLOW_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Flow"];
  12302. generated$1.FLOW_TYPES = FLOW_TYPES;
  12303. const FLOWTYPE_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["FlowType"];
  12304. generated$1.FLOWTYPE_TYPES = FLOWTYPE_TYPES;
  12305. const FLOWBASEANNOTATION_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["FlowBaseAnnotation"];
  12306. generated$1.FLOWBASEANNOTATION_TYPES = FLOWBASEANNOTATION_TYPES;
  12307. const FLOWDECLARATION_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["FlowDeclaration"];
  12308. generated$1.FLOWDECLARATION_TYPES = FLOWDECLARATION_TYPES;
  12309. const FLOWPREDICATE_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["FlowPredicate"];
  12310. generated$1.FLOWPREDICATE_TYPES = FLOWPREDICATE_TYPES;
  12311. const ENUMBODY_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["EnumBody"];
  12312. generated$1.ENUMBODY_TYPES = ENUMBODY_TYPES;
  12313. const ENUMMEMBER_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["EnumMember"];
  12314. generated$1.ENUMMEMBER_TYPES = ENUMMEMBER_TYPES;
  12315. const JSX_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["JSX"];
  12316. generated$1.JSX_TYPES = JSX_TYPES;
  12317. const TSTYPEELEMENT_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["TSTypeElement"];
  12318. generated$1.TSTYPEELEMENT_TYPES = TSTYPEELEMENT_TYPES;
  12319. const TSTYPE_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["TSType"];
  12320. generated$1.TSTYPE_TYPES = TSTYPE_TYPES;
  12321. const TSBASETYPE_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["TSBaseType"];
  12322. generated$1.TSBASETYPE_TYPES = TSBASETYPE_TYPES;
  12323. var ensureBlock$1 = {};
  12324. var toBlock$1 = {};
  12325. Object.defineProperty(toBlock$1, "__esModule", {
  12326. value: true
  12327. });
  12328. toBlock$1.default = toBlock;
  12329. var _generated$f = generated$4;
  12330. var _generated2$3 = generated$3;
  12331. function toBlock(node, parent) {
  12332. if ((0, _generated$f.isBlockStatement)(node)) {
  12333. return node;
  12334. }
  12335. let blockNodes = [];
  12336. if ((0, _generated$f.isEmptyStatement)(node)) {
  12337. blockNodes = [];
  12338. } else {
  12339. if (!(0, _generated$f.isStatement)(node)) {
  12340. if ((0, _generated$f.isFunction)(parent)) {
  12341. node = (0, _generated2$3.returnStatement)(node);
  12342. } else {
  12343. node = (0, _generated2$3.expressionStatement)(node);
  12344. }
  12345. }
  12346. blockNodes = [node];
  12347. }
  12348. return (0, _generated2$3.blockStatement)(blockNodes);
  12349. }
  12350. Object.defineProperty(ensureBlock$1, "__esModule", {
  12351. value: true
  12352. });
  12353. ensureBlock$1.default = ensureBlock;
  12354. var _toBlock = toBlock$1;
  12355. function ensureBlock(node, key = "body") {
  12356. return node[key] = (0, _toBlock.default)(node[key], node);
  12357. }
  12358. var toBindingIdentifierName$1 = {};
  12359. var toIdentifier$1 = {};
  12360. Object.defineProperty(toIdentifier$1, "__esModule", {
  12361. value: true
  12362. });
  12363. toIdentifier$1.default = toIdentifier;
  12364. var _isValidIdentifier$2 = isValidIdentifier$1;
  12365. var _helperValidatorIdentifier = lib;
  12366. function toIdentifier(input) {
  12367. input = input + "";
  12368. let name = "";
  12369. for (const c of input) {
  12370. name += (0, _helperValidatorIdentifier.isIdentifierChar)(c.codePointAt(0)) ? c : "-";
  12371. }
  12372. name = name.replace(/^[-0-9]+/, "");
  12373. name = name.replace(/[-\s]+(.)?/g, function (match, c) {
  12374. return c ? c.toUpperCase() : "";
  12375. });
  12376. if (!(0, _isValidIdentifier$2.default)(name)) {
  12377. name = `_${name}`;
  12378. }
  12379. return name || "_";
  12380. }
  12381. Object.defineProperty(toBindingIdentifierName$1, "__esModule", {
  12382. value: true
  12383. });
  12384. toBindingIdentifierName$1.default = toBindingIdentifierName;
  12385. var _toIdentifier = toIdentifier$1;
  12386. function toBindingIdentifierName(name) {
  12387. name = (0, _toIdentifier.default)(name);
  12388. if (name === "eval" || name === "arguments") name = "_" + name;
  12389. return name;
  12390. }
  12391. var toComputedKey$1 = {};
  12392. Object.defineProperty(toComputedKey$1, "__esModule", {
  12393. value: true
  12394. });
  12395. toComputedKey$1.default = toComputedKey;
  12396. var _generated$e = generated$4;
  12397. var _generated2$2 = generated$3;
  12398. function toComputedKey(node, key = node.key || node.property) {
  12399. if (!node.computed && (0, _generated$e.isIdentifier)(key)) key = (0, _generated2$2.stringLiteral)(key.name);
  12400. return key;
  12401. }
  12402. var toExpression$1 = {};
  12403. Object.defineProperty(toExpression$1, "__esModule", {
  12404. value: true
  12405. });
  12406. toExpression$1.default = void 0;
  12407. var _generated$d = generated$4;
  12408. var _default$3 = toExpression;
  12409. toExpression$1.default = _default$3;
  12410. function toExpression(node) {
  12411. if ((0, _generated$d.isExpressionStatement)(node)) {
  12412. node = node.expression;
  12413. }
  12414. if ((0, _generated$d.isExpression)(node)) {
  12415. return node;
  12416. }
  12417. if ((0, _generated$d.isClass)(node)) {
  12418. node.type = "ClassExpression";
  12419. } else if ((0, _generated$d.isFunction)(node)) {
  12420. node.type = "FunctionExpression";
  12421. }
  12422. if (!(0, _generated$d.isExpression)(node)) {
  12423. throw new Error(`cannot turn ${node.type} to an expression`);
  12424. }
  12425. return node;
  12426. }
  12427. var toKeyAlias$1 = {};
  12428. var removePropertiesDeep$1 = {};
  12429. var traverseFast$1 = {};
  12430. Object.defineProperty(traverseFast$1, "__esModule", {
  12431. value: true
  12432. });
  12433. traverseFast$1.default = traverseFast;
  12434. var _definitions$2 = definitions;
  12435. function traverseFast(node, enter, opts) {
  12436. if (!node) return;
  12437. const keys = _definitions$2.VISITOR_KEYS[node.type];
  12438. if (!keys) return;
  12439. opts = opts || {};
  12440. enter(node, opts);
  12441. for (const key of keys) {
  12442. const subNode = node[key];
  12443. if (Array.isArray(subNode)) {
  12444. for (const node of subNode) {
  12445. traverseFast(node, enter, opts);
  12446. }
  12447. } else {
  12448. traverseFast(subNode, enter, opts);
  12449. }
  12450. }
  12451. }
  12452. var removeProperties$1 = {};
  12453. Object.defineProperty(removeProperties$1, "__esModule", {
  12454. value: true
  12455. });
  12456. removeProperties$1.default = removeProperties;
  12457. var _constants$3 = constants;
  12458. const CLEAR_KEYS = ["tokens", "start", "end", "loc", "raw", "rawValue"];
  12459. const CLEAR_KEYS_PLUS_COMMENTS = _constants$3.COMMENT_KEYS.concat(["comments"]).concat(CLEAR_KEYS);
  12460. function removeProperties(node, opts = {}) {
  12461. const map = opts.preserveComments ? CLEAR_KEYS : CLEAR_KEYS_PLUS_COMMENTS;
  12462. for (const key of map) {
  12463. if (node[key] != null) node[key] = undefined;
  12464. }
  12465. for (const key of Object.keys(node)) {
  12466. if (key[0] === "_" && node[key] != null) node[key] = undefined;
  12467. }
  12468. const symbols = Object.getOwnPropertySymbols(node);
  12469. for (const sym of symbols) {
  12470. node[sym] = null;
  12471. }
  12472. }
  12473. Object.defineProperty(removePropertiesDeep$1, "__esModule", {
  12474. value: true
  12475. });
  12476. removePropertiesDeep$1.default = removePropertiesDeep;
  12477. var _traverseFast = traverseFast$1;
  12478. var _removeProperties = removeProperties$1;
  12479. function removePropertiesDeep(tree, opts) {
  12480. (0, _traverseFast.default)(tree, _removeProperties.default, opts);
  12481. return tree;
  12482. }
  12483. Object.defineProperty(toKeyAlias$1, "__esModule", {
  12484. value: true
  12485. });
  12486. toKeyAlias$1.default = toKeyAlias;
  12487. var _generated$c = generated$4;
  12488. var _cloneNode$1 = cloneNode$1;
  12489. var _removePropertiesDeep = removePropertiesDeep$1;
  12490. function toKeyAlias(node, key = node.key) {
  12491. let alias;
  12492. if (node.kind === "method") {
  12493. return toKeyAlias.increment() + "";
  12494. } else if ((0, _generated$c.isIdentifier)(key)) {
  12495. alias = key.name;
  12496. } else if ((0, _generated$c.isStringLiteral)(key)) {
  12497. alias = JSON.stringify(key.value);
  12498. } else {
  12499. alias = JSON.stringify((0, _removePropertiesDeep.default)((0, _cloneNode$1.default)(key)));
  12500. }
  12501. if (node.computed) {
  12502. alias = `[${alias}]`;
  12503. }
  12504. if (node.static) {
  12505. alias = `static:${alias}`;
  12506. }
  12507. return alias;
  12508. }
  12509. toKeyAlias.uid = 0;
  12510. toKeyAlias.increment = function () {
  12511. if (toKeyAlias.uid >= Number.MAX_SAFE_INTEGER) {
  12512. return toKeyAlias.uid = 0;
  12513. } else {
  12514. return toKeyAlias.uid++;
  12515. }
  12516. };
  12517. var toSequenceExpression$1 = {};
  12518. var gatherSequenceExpressions$1 = {};
  12519. var getBindingIdentifiers$1 = {};
  12520. Object.defineProperty(getBindingIdentifiers$1, "__esModule", {
  12521. value: true
  12522. });
  12523. getBindingIdentifiers$1.default = getBindingIdentifiers;
  12524. var _generated$b = generated$4;
  12525. function getBindingIdentifiers(node, duplicates, outerOnly) {
  12526. let search = [].concat(node);
  12527. const ids = Object.create(null);
  12528. while (search.length) {
  12529. const id = search.shift();
  12530. if (!id) continue;
  12531. const keys = getBindingIdentifiers.keys[id.type];
  12532. if ((0, _generated$b.isIdentifier)(id)) {
  12533. if (duplicates) {
  12534. const _ids = ids[id.name] = ids[id.name] || [];
  12535. _ids.push(id);
  12536. } else {
  12537. ids[id.name] = id;
  12538. }
  12539. continue;
  12540. }
  12541. if ((0, _generated$b.isExportDeclaration)(id) && !(0, _generated$b.isExportAllDeclaration)(id)) {
  12542. if ((0, _generated$b.isDeclaration)(id.declaration)) {
  12543. search.push(id.declaration);
  12544. }
  12545. continue;
  12546. }
  12547. if (outerOnly) {
  12548. if ((0, _generated$b.isFunctionDeclaration)(id)) {
  12549. search.push(id.id);
  12550. continue;
  12551. }
  12552. if ((0, _generated$b.isFunctionExpression)(id)) {
  12553. continue;
  12554. }
  12555. }
  12556. if (keys) {
  12557. for (let i = 0; i < keys.length; i++) {
  12558. const key = keys[i];
  12559. if (id[key]) {
  12560. search = search.concat(id[key]);
  12561. }
  12562. }
  12563. }
  12564. }
  12565. return ids;
  12566. }
  12567. getBindingIdentifiers.keys = {
  12568. DeclareClass: ["id"],
  12569. DeclareFunction: ["id"],
  12570. DeclareModule: ["id"],
  12571. DeclareVariable: ["id"],
  12572. DeclareInterface: ["id"],
  12573. DeclareTypeAlias: ["id"],
  12574. DeclareOpaqueType: ["id"],
  12575. InterfaceDeclaration: ["id"],
  12576. TypeAlias: ["id"],
  12577. OpaqueType: ["id"],
  12578. CatchClause: ["param"],
  12579. LabeledStatement: ["label"],
  12580. UnaryExpression: ["argument"],
  12581. AssignmentExpression: ["left"],
  12582. ImportSpecifier: ["local"],
  12583. ImportNamespaceSpecifier: ["local"],
  12584. ImportDefaultSpecifier: ["local"],
  12585. ImportDeclaration: ["specifiers"],
  12586. ExportSpecifier: ["exported"],
  12587. ExportNamespaceSpecifier: ["exported"],
  12588. ExportDefaultSpecifier: ["exported"],
  12589. FunctionDeclaration: ["id", "params"],
  12590. FunctionExpression: ["id", "params"],
  12591. ArrowFunctionExpression: ["params"],
  12592. ObjectMethod: ["params"],
  12593. ClassMethod: ["params"],
  12594. ForInStatement: ["left"],
  12595. ForOfStatement: ["left"],
  12596. ClassDeclaration: ["id"],
  12597. ClassExpression: ["id"],
  12598. RestElement: ["argument"],
  12599. UpdateExpression: ["argument"],
  12600. ObjectProperty: ["value"],
  12601. AssignmentPattern: ["left"],
  12602. ArrayPattern: ["elements"],
  12603. ObjectPattern: ["properties"],
  12604. VariableDeclaration: ["declarations"],
  12605. VariableDeclarator: ["id"]
  12606. };
  12607. Object.defineProperty(gatherSequenceExpressions$1, "__esModule", {
  12608. value: true
  12609. });
  12610. gatherSequenceExpressions$1.default = gatherSequenceExpressions;
  12611. var _getBindingIdentifiers$2 = getBindingIdentifiers$1;
  12612. var _generated$a = generated$4;
  12613. var _generated2$1 = generated$3;
  12614. var _cloneNode = cloneNode$1;
  12615. function gatherSequenceExpressions(nodes, scope, declars) {
  12616. const exprs = [];
  12617. let ensureLastUndefined = true;
  12618. for (const node of nodes) {
  12619. if (!(0, _generated$a.isEmptyStatement)(node)) {
  12620. ensureLastUndefined = false;
  12621. }
  12622. if ((0, _generated$a.isExpression)(node)) {
  12623. exprs.push(node);
  12624. } else if ((0, _generated$a.isExpressionStatement)(node)) {
  12625. exprs.push(node.expression);
  12626. } else if ((0, _generated$a.isVariableDeclaration)(node)) {
  12627. if (node.kind !== "var") return;
  12628. for (const declar of node.declarations) {
  12629. const bindings = (0, _getBindingIdentifiers$2.default)(declar);
  12630. for (const key of Object.keys(bindings)) {
  12631. declars.push({
  12632. kind: node.kind,
  12633. id: (0, _cloneNode.default)(bindings[key])
  12634. });
  12635. }
  12636. if (declar.init) {
  12637. exprs.push((0, _generated2$1.assignmentExpression)("=", declar.id, declar.init));
  12638. }
  12639. }
  12640. ensureLastUndefined = true;
  12641. } else if ((0, _generated$a.isIfStatement)(node)) {
  12642. const consequent = node.consequent ? gatherSequenceExpressions([node.consequent], scope, declars) : scope.buildUndefinedNode();
  12643. const alternate = node.alternate ? gatherSequenceExpressions([node.alternate], scope, declars) : scope.buildUndefinedNode();
  12644. if (!consequent || !alternate) return;
  12645. exprs.push((0, _generated2$1.conditionalExpression)(node.test, consequent, alternate));
  12646. } else if ((0, _generated$a.isBlockStatement)(node)) {
  12647. const body = gatherSequenceExpressions(node.body, scope, declars);
  12648. if (!body) return;
  12649. exprs.push(body);
  12650. } else if ((0, _generated$a.isEmptyStatement)(node)) {
  12651. if (nodes.indexOf(node) === 0) {
  12652. ensureLastUndefined = true;
  12653. }
  12654. } else {
  12655. return;
  12656. }
  12657. }
  12658. if (ensureLastUndefined) {
  12659. exprs.push(scope.buildUndefinedNode());
  12660. }
  12661. if (exprs.length === 1) {
  12662. return exprs[0];
  12663. } else {
  12664. return (0, _generated2$1.sequenceExpression)(exprs);
  12665. }
  12666. }
  12667. Object.defineProperty(toSequenceExpression$1, "__esModule", {
  12668. value: true
  12669. });
  12670. toSequenceExpression$1.default = toSequenceExpression;
  12671. var _gatherSequenceExpressions = gatherSequenceExpressions$1;
  12672. function toSequenceExpression(nodes, scope) {
  12673. if (!(nodes != null && nodes.length)) return;
  12674. const declars = [];
  12675. const result = (0, _gatherSequenceExpressions.default)(nodes, scope, declars);
  12676. if (!result) return;
  12677. for (const declar of declars) {
  12678. scope.push(declar);
  12679. }
  12680. return result;
  12681. }
  12682. var toStatement$1 = {};
  12683. Object.defineProperty(toStatement$1, "__esModule", {
  12684. value: true
  12685. });
  12686. toStatement$1.default = void 0;
  12687. var _generated$9 = generated$4;
  12688. var _generated2 = generated$3;
  12689. var _default$2 = toStatement;
  12690. toStatement$1.default = _default$2;
  12691. function toStatement(node, ignore) {
  12692. if ((0, _generated$9.isStatement)(node)) {
  12693. return node;
  12694. }
  12695. let mustHaveId = false;
  12696. let newType;
  12697. if ((0, _generated$9.isClass)(node)) {
  12698. mustHaveId = true;
  12699. newType = "ClassDeclaration";
  12700. } else if ((0, _generated$9.isFunction)(node)) {
  12701. mustHaveId = true;
  12702. newType = "FunctionDeclaration";
  12703. } else if ((0, _generated$9.isAssignmentExpression)(node)) {
  12704. return (0, _generated2.expressionStatement)(node);
  12705. }
  12706. if (mustHaveId && !node.id) {
  12707. newType = false;
  12708. }
  12709. if (!newType) {
  12710. if (ignore) {
  12711. return false;
  12712. } else {
  12713. throw new Error(`cannot turn ${node.type} to a statement`);
  12714. }
  12715. }
  12716. node.type = newType;
  12717. return node;
  12718. }
  12719. var valueToNode$1 = {};
  12720. Object.defineProperty(valueToNode$1, "__esModule", {
  12721. value: true
  12722. });
  12723. valueToNode$1.default = void 0;
  12724. var _isValidIdentifier$1 = isValidIdentifier$1;
  12725. var _generated$8 = generated$3;
  12726. var _default$1 = valueToNode;
  12727. valueToNode$1.default = _default$1;
  12728. const objectToString = Function.call.bind(Object.prototype.toString);
  12729. function isRegExp(value) {
  12730. return objectToString(value) === "[object RegExp]";
  12731. }
  12732. function isPlainObject(value) {
  12733. if (typeof value !== "object" || value === null || Object.prototype.toString.call(value) !== "[object Object]") {
  12734. return false;
  12735. }
  12736. const proto = Object.getPrototypeOf(value);
  12737. return proto === null || Object.getPrototypeOf(proto) === null;
  12738. }
  12739. function valueToNode(value) {
  12740. if (value === undefined) {
  12741. return (0, _generated$8.identifier)("undefined");
  12742. }
  12743. if (value === true || value === false) {
  12744. return (0, _generated$8.booleanLiteral)(value);
  12745. }
  12746. if (value === null) {
  12747. return (0, _generated$8.nullLiteral)();
  12748. }
  12749. if (typeof value === "string") {
  12750. return (0, _generated$8.stringLiteral)(value);
  12751. }
  12752. if (typeof value === "number") {
  12753. let result;
  12754. if (Number.isFinite(value)) {
  12755. result = (0, _generated$8.numericLiteral)(Math.abs(value));
  12756. } else {
  12757. let numerator;
  12758. if (Number.isNaN(value)) {
  12759. numerator = (0, _generated$8.numericLiteral)(0);
  12760. } else {
  12761. numerator = (0, _generated$8.numericLiteral)(1);
  12762. }
  12763. result = (0, _generated$8.binaryExpression)("/", numerator, (0, _generated$8.numericLiteral)(0));
  12764. }
  12765. if (value < 0 || Object.is(value, -0)) {
  12766. result = (0, _generated$8.unaryExpression)("-", result);
  12767. }
  12768. return result;
  12769. }
  12770. if (isRegExp(value)) {
  12771. const pattern = value.source;
  12772. const flags = value.toString().match(/\/([a-z]+|)$/)[1];
  12773. return (0, _generated$8.regExpLiteral)(pattern, flags);
  12774. }
  12775. if (Array.isArray(value)) {
  12776. return (0, _generated$8.arrayExpression)(value.map(valueToNode));
  12777. }
  12778. if (isPlainObject(value)) {
  12779. const props = [];
  12780. for (const key of Object.keys(value)) {
  12781. let nodeKey;
  12782. if ((0, _isValidIdentifier$1.default)(key)) {
  12783. nodeKey = (0, _generated$8.identifier)(key);
  12784. } else {
  12785. nodeKey = (0, _generated$8.stringLiteral)(key);
  12786. }
  12787. props.push((0, _generated$8.objectProperty)(nodeKey, valueToNode(value[key])));
  12788. }
  12789. return (0, _generated$8.objectExpression)(props);
  12790. }
  12791. throw new Error("don't know how to turn this value into a node");
  12792. }
  12793. var appendToMemberExpression$1 = {};
  12794. Object.defineProperty(appendToMemberExpression$1, "__esModule", {
  12795. value: true
  12796. });
  12797. appendToMemberExpression$1.default = appendToMemberExpression;
  12798. var _generated$7 = generated$3;
  12799. function appendToMemberExpression(member, append, computed = false) {
  12800. member.object = (0, _generated$7.memberExpression)(member.object, member.property, member.computed);
  12801. member.property = append;
  12802. member.computed = !!computed;
  12803. return member;
  12804. }
  12805. var inherits$1 = {};
  12806. Object.defineProperty(inherits$1, "__esModule", {
  12807. value: true
  12808. });
  12809. inherits$1.default = inherits;
  12810. var _constants$2 = constants;
  12811. var _inheritsComments = inheritsComments$1;
  12812. function inherits(child, parent) {
  12813. if (!child || !parent) return child;
  12814. for (const key of _constants$2.INHERIT_KEYS.optional) {
  12815. if (child[key] == null) {
  12816. child[key] = parent[key];
  12817. }
  12818. }
  12819. for (const key of Object.keys(parent)) {
  12820. if (key[0] === "_" && key !== "__clone") child[key] = parent[key];
  12821. }
  12822. for (const key of _constants$2.INHERIT_KEYS.force) {
  12823. child[key] = parent[key];
  12824. }
  12825. (0, _inheritsComments.default)(child, parent);
  12826. return child;
  12827. }
  12828. var prependToMemberExpression$1 = {};
  12829. Object.defineProperty(prependToMemberExpression$1, "__esModule", {
  12830. value: true
  12831. });
  12832. prependToMemberExpression$1.default = prependToMemberExpression;
  12833. var _generated$6 = generated$3;
  12834. function prependToMemberExpression(member, prepend) {
  12835. member.object = (0, _generated$6.memberExpression)(prepend, member.object);
  12836. return member;
  12837. }
  12838. var getOuterBindingIdentifiers$1 = {};
  12839. Object.defineProperty(getOuterBindingIdentifiers$1, "__esModule", {
  12840. value: true
  12841. });
  12842. getOuterBindingIdentifiers$1.default = void 0;
  12843. var _getBindingIdentifiers$1 = getBindingIdentifiers$1;
  12844. var _default = getOuterBindingIdentifiers;
  12845. getOuterBindingIdentifiers$1.default = _default;
  12846. function getOuterBindingIdentifiers(node, duplicates) {
  12847. return (0, _getBindingIdentifiers$1.default)(node, duplicates, true);
  12848. }
  12849. var traverse$1 = {};
  12850. Object.defineProperty(traverse$1, "__esModule", {
  12851. value: true
  12852. });
  12853. traverse$1.default = traverse;
  12854. var _definitions$1 = definitions;
  12855. function traverse(node, handlers, state) {
  12856. if (typeof handlers === "function") {
  12857. handlers = {
  12858. enter: handlers
  12859. };
  12860. }
  12861. const {
  12862. enter,
  12863. exit
  12864. } = handlers;
  12865. traverseSimpleImpl(node, enter, exit, state, []);
  12866. }
  12867. function traverseSimpleImpl(node, enter, exit, state, ancestors) {
  12868. const keys = _definitions$1.VISITOR_KEYS[node.type];
  12869. if (!keys) return;
  12870. if (enter) enter(node, ancestors, state);
  12871. for (const key of keys) {
  12872. const subNode = node[key];
  12873. if (Array.isArray(subNode)) {
  12874. for (let i = 0; i < subNode.length; i++) {
  12875. const child = subNode[i];
  12876. if (!child) continue;
  12877. ancestors.push({
  12878. node,
  12879. key,
  12880. index: i
  12881. });
  12882. traverseSimpleImpl(child, enter, exit, state, ancestors);
  12883. ancestors.pop();
  12884. }
  12885. } else if (subNode) {
  12886. ancestors.push({
  12887. node,
  12888. key
  12889. });
  12890. traverseSimpleImpl(subNode, enter, exit, state, ancestors);
  12891. ancestors.pop();
  12892. }
  12893. }
  12894. if (exit) exit(node, ancestors, state);
  12895. }
  12896. var isBinding$1 = {};
  12897. Object.defineProperty(isBinding$1, "__esModule", {
  12898. value: true
  12899. });
  12900. isBinding$1.default = isBinding;
  12901. var _getBindingIdentifiers = getBindingIdentifiers$1;
  12902. function isBinding(node, parent, grandparent) {
  12903. if (grandparent && node.type === "Identifier" && parent.type === "ObjectProperty" && grandparent.type === "ObjectExpression") {
  12904. return false;
  12905. }
  12906. const keys = _getBindingIdentifiers.default.keys[parent.type];
  12907. if (keys) {
  12908. for (let i = 0; i < keys.length; i++) {
  12909. const key = keys[i];
  12910. const val = parent[key];
  12911. if (Array.isArray(val)) {
  12912. if (val.indexOf(node) >= 0) return true;
  12913. } else {
  12914. if (val === node) return true;
  12915. }
  12916. }
  12917. }
  12918. return false;
  12919. }
  12920. var isBlockScoped$1 = {};
  12921. var isLet$1 = {};
  12922. Object.defineProperty(isLet$1, "__esModule", {
  12923. value: true
  12924. });
  12925. isLet$1.default = isLet;
  12926. var _generated$5 = generated$4;
  12927. var _constants$1 = constants;
  12928. function isLet(node) {
  12929. return (0, _generated$5.isVariableDeclaration)(node) && (node.kind !== "var" || node[_constants$1.BLOCK_SCOPED_SYMBOL]);
  12930. }
  12931. Object.defineProperty(isBlockScoped$1, "__esModule", {
  12932. value: true
  12933. });
  12934. isBlockScoped$1.default = isBlockScoped;
  12935. var _generated$4 = generated$4;
  12936. var _isLet = isLet$1;
  12937. function isBlockScoped(node) {
  12938. return (0, _generated$4.isFunctionDeclaration)(node) || (0, _generated$4.isClassDeclaration)(node) || (0, _isLet.default)(node);
  12939. }
  12940. var isImmutable$1 = {};
  12941. Object.defineProperty(isImmutable$1, "__esModule", {
  12942. value: true
  12943. });
  12944. isImmutable$1.default = isImmutable;
  12945. var _isType = isType$1;
  12946. var _generated$3 = generated$4;
  12947. function isImmutable(node) {
  12948. if ((0, _isType.default)(node.type, "Immutable")) return true;
  12949. if ((0, _generated$3.isIdentifier)(node)) {
  12950. if (node.name === "undefined") {
  12951. return true;
  12952. } else {
  12953. return false;
  12954. }
  12955. }
  12956. return false;
  12957. }
  12958. var isNodesEquivalent$1 = {};
  12959. Object.defineProperty(isNodesEquivalent$1, "__esModule", {
  12960. value: true
  12961. });
  12962. isNodesEquivalent$1.default = isNodesEquivalent;
  12963. var _definitions = definitions;
  12964. function isNodesEquivalent(a, b) {
  12965. if (typeof a !== "object" || typeof b !== "object" || a == null || b == null) {
  12966. return a === b;
  12967. }
  12968. if (a.type !== b.type) {
  12969. return false;
  12970. }
  12971. const fields = Object.keys(_definitions.NODE_FIELDS[a.type] || a.type);
  12972. const visitorKeys = _definitions.VISITOR_KEYS[a.type];
  12973. for (const field of fields) {
  12974. if (typeof a[field] !== typeof b[field]) {
  12975. return false;
  12976. }
  12977. if (a[field] == null && b[field] == null) {
  12978. continue;
  12979. } else if (a[field] == null || b[field] == null) {
  12980. return false;
  12981. }
  12982. if (Array.isArray(a[field])) {
  12983. if (!Array.isArray(b[field])) {
  12984. return false;
  12985. }
  12986. if (a[field].length !== b[field].length) {
  12987. return false;
  12988. }
  12989. for (let i = 0; i < a[field].length; i++) {
  12990. if (!isNodesEquivalent(a[field][i], b[field][i])) {
  12991. return false;
  12992. }
  12993. }
  12994. continue;
  12995. }
  12996. if (typeof a[field] === "object" && !(visitorKeys != null && visitorKeys.includes(field))) {
  12997. for (const key of Object.keys(a[field])) {
  12998. if (a[field][key] !== b[field][key]) {
  12999. return false;
  13000. }
  13001. }
  13002. continue;
  13003. }
  13004. if (!isNodesEquivalent(a[field], b[field])) {
  13005. return false;
  13006. }
  13007. }
  13008. return true;
  13009. }
  13010. var isReferenced$1 = {};
  13011. Object.defineProperty(isReferenced$1, "__esModule", {
  13012. value: true
  13013. });
  13014. isReferenced$1.default = isReferenced;
  13015. function isReferenced(node, parent, grandparent) {
  13016. switch (parent.type) {
  13017. case "MemberExpression":
  13018. case "JSXMemberExpression":
  13019. case "OptionalMemberExpression":
  13020. if (parent.property === node) {
  13021. return !!parent.computed;
  13022. }
  13023. return parent.object === node;
  13024. case "VariableDeclarator":
  13025. return parent.init === node;
  13026. case "ArrowFunctionExpression":
  13027. return parent.body === node;
  13028. case "PrivateName":
  13029. return false;
  13030. case "ClassMethod":
  13031. case "ClassPrivateMethod":
  13032. case "ObjectMethod":
  13033. if (parent.params.includes(node)) {
  13034. return false;
  13035. }
  13036. case "ObjectProperty":
  13037. case "ClassProperty":
  13038. case "ClassPrivateProperty":
  13039. if (parent.key === node) {
  13040. return !!parent.computed;
  13041. }
  13042. if (parent.value === node) {
  13043. return !grandparent || grandparent.type !== "ObjectPattern";
  13044. }
  13045. return true;
  13046. case "ClassDeclaration":
  13047. case "ClassExpression":
  13048. return parent.superClass === node;
  13049. case "AssignmentExpression":
  13050. return parent.right === node;
  13051. case "AssignmentPattern":
  13052. return parent.right === node;
  13053. case "LabeledStatement":
  13054. return false;
  13055. case "CatchClause":
  13056. return false;
  13057. case "RestElement":
  13058. return false;
  13059. case "BreakStatement":
  13060. case "ContinueStatement":
  13061. return false;
  13062. case "FunctionDeclaration":
  13063. case "FunctionExpression":
  13064. return false;
  13065. case "ExportNamespaceSpecifier":
  13066. case "ExportDefaultSpecifier":
  13067. return false;
  13068. case "ExportSpecifier":
  13069. if (grandparent != null && grandparent.source) {
  13070. return false;
  13071. }
  13072. return parent.local === node;
  13073. case "ImportDefaultSpecifier":
  13074. case "ImportNamespaceSpecifier":
  13075. case "ImportSpecifier":
  13076. return false;
  13077. case "JSXAttribute":
  13078. return false;
  13079. case "ObjectPattern":
  13080. case "ArrayPattern":
  13081. return false;
  13082. case "MetaProperty":
  13083. return false;
  13084. case "ObjectTypeProperty":
  13085. return parent.key !== node;
  13086. case "TSEnumMember":
  13087. return parent.id !== node;
  13088. case "TSPropertySignature":
  13089. if (parent.key === node) {
  13090. return !!parent.computed;
  13091. }
  13092. return true;
  13093. }
  13094. return true;
  13095. }
  13096. var isScope$1 = {};
  13097. Object.defineProperty(isScope$1, "__esModule", {
  13098. value: true
  13099. });
  13100. isScope$1.default = isScope;
  13101. var _generated$2 = generated$4;
  13102. function isScope(node, parent) {
  13103. if ((0, _generated$2.isBlockStatement)(node) && ((0, _generated$2.isFunction)(parent) || (0, _generated$2.isCatchClause)(parent))) {
  13104. return false;
  13105. }
  13106. if ((0, _generated$2.isPattern)(node) && ((0, _generated$2.isFunction)(parent) || (0, _generated$2.isCatchClause)(parent))) {
  13107. return true;
  13108. }
  13109. return (0, _generated$2.isScopable)(node);
  13110. }
  13111. var isSpecifierDefault$1 = {};
  13112. Object.defineProperty(isSpecifierDefault$1, "__esModule", {
  13113. value: true
  13114. });
  13115. isSpecifierDefault$1.default = isSpecifierDefault;
  13116. var _generated$1 = generated$4;
  13117. function isSpecifierDefault(specifier) {
  13118. return (0, _generated$1.isImportDefaultSpecifier)(specifier) || (0, _generated$1.isIdentifier)(specifier.imported || specifier.exported, {
  13119. name: "default"
  13120. });
  13121. }
  13122. var isValidES3Identifier$1 = {};
  13123. Object.defineProperty(isValidES3Identifier$1, "__esModule", {
  13124. value: true
  13125. });
  13126. isValidES3Identifier$1.default = isValidES3Identifier;
  13127. var _isValidIdentifier = isValidIdentifier$1;
  13128. const RESERVED_WORDS_ES3_ONLY = new Set(["abstract", "boolean", "byte", "char", "double", "enum", "final", "float", "goto", "implements", "int", "interface", "long", "native", "package", "private", "protected", "public", "short", "static", "synchronized", "throws", "transient", "volatile"]);
  13129. function isValidES3Identifier(name) {
  13130. return (0, _isValidIdentifier.default)(name) && !RESERVED_WORDS_ES3_ONLY.has(name);
  13131. }
  13132. var isVar$1 = {};
  13133. Object.defineProperty(isVar$1, "__esModule", {
  13134. value: true
  13135. });
  13136. isVar$1.default = isVar;
  13137. var _generated = generated$4;
  13138. var _constants = constants;
  13139. function isVar(node) {
  13140. return (0, _generated.isVariableDeclaration)(node, {
  13141. kind: "var"
  13142. }) && !node[_constants.BLOCK_SCOPED_SYMBOL];
  13143. }
  13144. var generated = {
  13145. __proto__: null
  13146. };
  13147. var require$$65 = /*@__PURE__*/build.getAugmentedNamespace(generated);
  13148. (function (exports) {
  13149. Object.defineProperty(exports, "__esModule", {
  13150. value: true
  13151. });
  13152. var _exportNames = {
  13153. react: true,
  13154. assertNode: true,
  13155. createTypeAnnotationBasedOnTypeof: true,
  13156. createUnionTypeAnnotation: true,
  13157. createFlowUnionType: true,
  13158. createTSUnionType: true,
  13159. cloneNode: true,
  13160. clone: true,
  13161. cloneDeep: true,
  13162. cloneDeepWithoutLoc: true,
  13163. cloneWithoutLoc: true,
  13164. addComment: true,
  13165. addComments: true,
  13166. inheritInnerComments: true,
  13167. inheritLeadingComments: true,
  13168. inheritsComments: true,
  13169. inheritTrailingComments: true,
  13170. removeComments: true,
  13171. ensureBlock: true,
  13172. toBindingIdentifierName: true,
  13173. toBlock: true,
  13174. toComputedKey: true,
  13175. toExpression: true,
  13176. toIdentifier: true,
  13177. toKeyAlias: true,
  13178. toSequenceExpression: true,
  13179. toStatement: true,
  13180. valueToNode: true,
  13181. appendToMemberExpression: true,
  13182. inherits: true,
  13183. prependToMemberExpression: true,
  13184. removeProperties: true,
  13185. removePropertiesDeep: true,
  13186. removeTypeDuplicates: true,
  13187. getBindingIdentifiers: true,
  13188. getOuterBindingIdentifiers: true,
  13189. traverse: true,
  13190. traverseFast: true,
  13191. shallowEqual: true,
  13192. is: true,
  13193. isBinding: true,
  13194. isBlockScoped: true,
  13195. isImmutable: true,
  13196. isLet: true,
  13197. isNode: true,
  13198. isNodesEquivalent: true,
  13199. isPlaceholderType: true,
  13200. isReferenced: true,
  13201. isScope: true,
  13202. isSpecifierDefault: true,
  13203. isType: true,
  13204. isValidES3Identifier: true,
  13205. isValidIdentifier: true,
  13206. isVar: true,
  13207. matchesPattern: true,
  13208. validate: true,
  13209. buildMatchMemberExpression: true
  13210. };
  13211. Object.defineProperty(exports, "assertNode", {
  13212. enumerable: true,
  13213. get: function () {
  13214. return _assertNode.default;
  13215. }
  13216. });
  13217. Object.defineProperty(exports, "createTypeAnnotationBasedOnTypeof", {
  13218. enumerable: true,
  13219. get: function () {
  13220. return _createTypeAnnotationBasedOnTypeof.default;
  13221. }
  13222. });
  13223. Object.defineProperty(exports, "createUnionTypeAnnotation", {
  13224. enumerable: true,
  13225. get: function () {
  13226. return _createFlowUnionType.default;
  13227. }
  13228. });
  13229. Object.defineProperty(exports, "createFlowUnionType", {
  13230. enumerable: true,
  13231. get: function () {
  13232. return _createFlowUnionType.default;
  13233. }
  13234. });
  13235. Object.defineProperty(exports, "createTSUnionType", {
  13236. enumerable: true,
  13237. get: function () {
  13238. return _createTSUnionType.default;
  13239. }
  13240. });
  13241. Object.defineProperty(exports, "cloneNode", {
  13242. enumerable: true,
  13243. get: function () {
  13244. return _cloneNode.default;
  13245. }
  13246. });
  13247. Object.defineProperty(exports, "clone", {
  13248. enumerable: true,
  13249. get: function () {
  13250. return _clone.default;
  13251. }
  13252. });
  13253. Object.defineProperty(exports, "cloneDeep", {
  13254. enumerable: true,
  13255. get: function () {
  13256. return _cloneDeep.default;
  13257. }
  13258. });
  13259. Object.defineProperty(exports, "cloneDeepWithoutLoc", {
  13260. enumerable: true,
  13261. get: function () {
  13262. return _cloneDeepWithoutLoc.default;
  13263. }
  13264. });
  13265. Object.defineProperty(exports, "cloneWithoutLoc", {
  13266. enumerable: true,
  13267. get: function () {
  13268. return _cloneWithoutLoc.default;
  13269. }
  13270. });
  13271. Object.defineProperty(exports, "addComment", {
  13272. enumerable: true,
  13273. get: function () {
  13274. return _addComment.default;
  13275. }
  13276. });
  13277. Object.defineProperty(exports, "addComments", {
  13278. enumerable: true,
  13279. get: function () {
  13280. return _addComments.default;
  13281. }
  13282. });
  13283. Object.defineProperty(exports, "inheritInnerComments", {
  13284. enumerable: true,
  13285. get: function () {
  13286. return _inheritInnerComments.default;
  13287. }
  13288. });
  13289. Object.defineProperty(exports, "inheritLeadingComments", {
  13290. enumerable: true,
  13291. get: function () {
  13292. return _inheritLeadingComments.default;
  13293. }
  13294. });
  13295. Object.defineProperty(exports, "inheritsComments", {
  13296. enumerable: true,
  13297. get: function () {
  13298. return _inheritsComments.default;
  13299. }
  13300. });
  13301. Object.defineProperty(exports, "inheritTrailingComments", {
  13302. enumerable: true,
  13303. get: function () {
  13304. return _inheritTrailingComments.default;
  13305. }
  13306. });
  13307. Object.defineProperty(exports, "removeComments", {
  13308. enumerable: true,
  13309. get: function () {
  13310. return _removeComments.default;
  13311. }
  13312. });
  13313. Object.defineProperty(exports, "ensureBlock", {
  13314. enumerable: true,
  13315. get: function () {
  13316. return _ensureBlock.default;
  13317. }
  13318. });
  13319. Object.defineProperty(exports, "toBindingIdentifierName", {
  13320. enumerable: true,
  13321. get: function () {
  13322. return _toBindingIdentifierName.default;
  13323. }
  13324. });
  13325. Object.defineProperty(exports, "toBlock", {
  13326. enumerable: true,
  13327. get: function () {
  13328. return _toBlock.default;
  13329. }
  13330. });
  13331. Object.defineProperty(exports, "toComputedKey", {
  13332. enumerable: true,
  13333. get: function () {
  13334. return _toComputedKey.default;
  13335. }
  13336. });
  13337. Object.defineProperty(exports, "toExpression", {
  13338. enumerable: true,
  13339. get: function () {
  13340. return _toExpression.default;
  13341. }
  13342. });
  13343. Object.defineProperty(exports, "toIdentifier", {
  13344. enumerable: true,
  13345. get: function () {
  13346. return _toIdentifier.default;
  13347. }
  13348. });
  13349. Object.defineProperty(exports, "toKeyAlias", {
  13350. enumerable: true,
  13351. get: function () {
  13352. return _toKeyAlias.default;
  13353. }
  13354. });
  13355. Object.defineProperty(exports, "toSequenceExpression", {
  13356. enumerable: true,
  13357. get: function () {
  13358. return _toSequenceExpression.default;
  13359. }
  13360. });
  13361. Object.defineProperty(exports, "toStatement", {
  13362. enumerable: true,
  13363. get: function () {
  13364. return _toStatement.default;
  13365. }
  13366. });
  13367. Object.defineProperty(exports, "valueToNode", {
  13368. enumerable: true,
  13369. get: function () {
  13370. return _valueToNode.default;
  13371. }
  13372. });
  13373. Object.defineProperty(exports, "appendToMemberExpression", {
  13374. enumerable: true,
  13375. get: function () {
  13376. return _appendToMemberExpression.default;
  13377. }
  13378. });
  13379. Object.defineProperty(exports, "inherits", {
  13380. enumerable: true,
  13381. get: function () {
  13382. return _inherits.default;
  13383. }
  13384. });
  13385. Object.defineProperty(exports, "prependToMemberExpression", {
  13386. enumerable: true,
  13387. get: function () {
  13388. return _prependToMemberExpression.default;
  13389. }
  13390. });
  13391. Object.defineProperty(exports, "removeProperties", {
  13392. enumerable: true,
  13393. get: function () {
  13394. return _removeProperties.default;
  13395. }
  13396. });
  13397. Object.defineProperty(exports, "removePropertiesDeep", {
  13398. enumerable: true,
  13399. get: function () {
  13400. return _removePropertiesDeep.default;
  13401. }
  13402. });
  13403. Object.defineProperty(exports, "removeTypeDuplicates", {
  13404. enumerable: true,
  13405. get: function () {
  13406. return _removeTypeDuplicates.default;
  13407. }
  13408. });
  13409. Object.defineProperty(exports, "getBindingIdentifiers", {
  13410. enumerable: true,
  13411. get: function () {
  13412. return _getBindingIdentifiers.default;
  13413. }
  13414. });
  13415. Object.defineProperty(exports, "getOuterBindingIdentifiers", {
  13416. enumerable: true,
  13417. get: function () {
  13418. return _getOuterBindingIdentifiers.default;
  13419. }
  13420. });
  13421. Object.defineProperty(exports, "traverse", {
  13422. enumerable: true,
  13423. get: function () {
  13424. return _traverse.default;
  13425. }
  13426. });
  13427. Object.defineProperty(exports, "traverseFast", {
  13428. enumerable: true,
  13429. get: function () {
  13430. return _traverseFast.default;
  13431. }
  13432. });
  13433. Object.defineProperty(exports, "shallowEqual", {
  13434. enumerable: true,
  13435. get: function () {
  13436. return _shallowEqual.default;
  13437. }
  13438. });
  13439. Object.defineProperty(exports, "is", {
  13440. enumerable: true,
  13441. get: function () {
  13442. return _is.default;
  13443. }
  13444. });
  13445. Object.defineProperty(exports, "isBinding", {
  13446. enumerable: true,
  13447. get: function () {
  13448. return _isBinding.default;
  13449. }
  13450. });
  13451. Object.defineProperty(exports, "isBlockScoped", {
  13452. enumerable: true,
  13453. get: function () {
  13454. return _isBlockScoped.default;
  13455. }
  13456. });
  13457. Object.defineProperty(exports, "isImmutable", {
  13458. enumerable: true,
  13459. get: function () {
  13460. return _isImmutable.default;
  13461. }
  13462. });
  13463. Object.defineProperty(exports, "isLet", {
  13464. enumerable: true,
  13465. get: function () {
  13466. return _isLet.default;
  13467. }
  13468. });
  13469. Object.defineProperty(exports, "isNode", {
  13470. enumerable: true,
  13471. get: function () {
  13472. return _isNode.default;
  13473. }
  13474. });
  13475. Object.defineProperty(exports, "isNodesEquivalent", {
  13476. enumerable: true,
  13477. get: function () {
  13478. return _isNodesEquivalent.default;
  13479. }
  13480. });
  13481. Object.defineProperty(exports, "isPlaceholderType", {
  13482. enumerable: true,
  13483. get: function () {
  13484. return _isPlaceholderType.default;
  13485. }
  13486. });
  13487. Object.defineProperty(exports, "isReferenced", {
  13488. enumerable: true,
  13489. get: function () {
  13490. return _isReferenced.default;
  13491. }
  13492. });
  13493. Object.defineProperty(exports, "isScope", {
  13494. enumerable: true,
  13495. get: function () {
  13496. return _isScope.default;
  13497. }
  13498. });
  13499. Object.defineProperty(exports, "isSpecifierDefault", {
  13500. enumerable: true,
  13501. get: function () {
  13502. return _isSpecifierDefault.default;
  13503. }
  13504. });
  13505. Object.defineProperty(exports, "isType", {
  13506. enumerable: true,
  13507. get: function () {
  13508. return _isType.default;
  13509. }
  13510. });
  13511. Object.defineProperty(exports, "isValidES3Identifier", {
  13512. enumerable: true,
  13513. get: function () {
  13514. return _isValidES3Identifier.default;
  13515. }
  13516. });
  13517. Object.defineProperty(exports, "isValidIdentifier", {
  13518. enumerable: true,
  13519. get: function () {
  13520. return _isValidIdentifier.default;
  13521. }
  13522. });
  13523. Object.defineProperty(exports, "isVar", {
  13524. enumerable: true,
  13525. get: function () {
  13526. return _isVar.default;
  13527. }
  13528. });
  13529. Object.defineProperty(exports, "matchesPattern", {
  13530. enumerable: true,
  13531. get: function () {
  13532. return _matchesPattern.default;
  13533. }
  13534. });
  13535. Object.defineProperty(exports, "validate", {
  13536. enumerable: true,
  13537. get: function () {
  13538. return _validate.default;
  13539. }
  13540. });
  13541. Object.defineProperty(exports, "buildMatchMemberExpression", {
  13542. enumerable: true,
  13543. get: function () {
  13544. return _buildMatchMemberExpression.default;
  13545. }
  13546. });
  13547. exports.react = void 0;
  13548. var _isReactComponent = isReactComponent$1;
  13549. var _isCompatTag = isCompatTag$1;
  13550. var _buildChildren = buildChildren$1;
  13551. var _assertNode = assertNode$1;
  13552. var _generated = generated$2;
  13553. Object.keys(_generated).forEach(function (key) {
  13554. if (key === "default" || key === "__esModule") return;
  13555. if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
  13556. if (key in exports && exports[key] === _generated[key]) return;
  13557. Object.defineProperty(exports, key, {
  13558. enumerable: true,
  13559. get: function () {
  13560. return _generated[key];
  13561. }
  13562. });
  13563. });
  13564. var _createTypeAnnotationBasedOnTypeof = createTypeAnnotationBasedOnTypeof$1;
  13565. var _createFlowUnionType = createFlowUnionType$1;
  13566. var _createTSUnionType = createTSUnionType$1;
  13567. var _generated2 = generated$3;
  13568. Object.keys(_generated2).forEach(function (key) {
  13569. if (key === "default" || key === "__esModule") return;
  13570. if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
  13571. if (key in exports && exports[key] === _generated2[key]) return;
  13572. Object.defineProperty(exports, key, {
  13573. enumerable: true,
  13574. get: function () {
  13575. return _generated2[key];
  13576. }
  13577. });
  13578. });
  13579. var _uppercase = uppercase;
  13580. Object.keys(_uppercase).forEach(function (key) {
  13581. if (key === "default" || key === "__esModule") return;
  13582. if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
  13583. if (key in exports && exports[key] === _uppercase[key]) return;
  13584. Object.defineProperty(exports, key, {
  13585. enumerable: true,
  13586. get: function () {
  13587. return _uppercase[key];
  13588. }
  13589. });
  13590. });
  13591. var _cloneNode = cloneNode$1;
  13592. var _clone = clone$1;
  13593. var _cloneDeep = cloneDeep$1;
  13594. var _cloneDeepWithoutLoc = cloneDeepWithoutLoc$1;
  13595. var _cloneWithoutLoc = cloneWithoutLoc$1;
  13596. var _addComment = addComment$1;
  13597. var _addComments = addComments$1;
  13598. var _inheritInnerComments = inheritInnerComments$1;
  13599. var _inheritLeadingComments = inheritLeadingComments$1;
  13600. var _inheritsComments = inheritsComments$1;
  13601. var _inheritTrailingComments = inheritTrailingComments$1;
  13602. var _removeComments = removeComments$1;
  13603. var _generated3 = generated$1;
  13604. Object.keys(_generated3).forEach(function (key) {
  13605. if (key === "default" || key === "__esModule") return;
  13606. if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
  13607. if (key in exports && exports[key] === _generated3[key]) return;
  13608. Object.defineProperty(exports, key, {
  13609. enumerable: true,
  13610. get: function () {
  13611. return _generated3[key];
  13612. }
  13613. });
  13614. });
  13615. var _constants = constants;
  13616. Object.keys(_constants).forEach(function (key) {
  13617. if (key === "default" || key === "__esModule") return;
  13618. if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
  13619. if (key in exports && exports[key] === _constants[key]) return;
  13620. Object.defineProperty(exports, key, {
  13621. enumerable: true,
  13622. get: function () {
  13623. return _constants[key];
  13624. }
  13625. });
  13626. });
  13627. var _ensureBlock = ensureBlock$1;
  13628. var _toBindingIdentifierName = toBindingIdentifierName$1;
  13629. var _toBlock = toBlock$1;
  13630. var _toComputedKey = toComputedKey$1;
  13631. var _toExpression = toExpression$1;
  13632. var _toIdentifier = toIdentifier$1;
  13633. var _toKeyAlias = toKeyAlias$1;
  13634. var _toSequenceExpression = toSequenceExpression$1;
  13635. var _toStatement = toStatement$1;
  13636. var _valueToNode = valueToNode$1;
  13637. var _definitions = definitions;
  13638. Object.keys(_definitions).forEach(function (key) {
  13639. if (key === "default" || key === "__esModule") return;
  13640. if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
  13641. if (key in exports && exports[key] === _definitions[key]) return;
  13642. Object.defineProperty(exports, key, {
  13643. enumerable: true,
  13644. get: function () {
  13645. return _definitions[key];
  13646. }
  13647. });
  13648. });
  13649. var _appendToMemberExpression = appendToMemberExpression$1;
  13650. var _inherits = inherits$1;
  13651. var _prependToMemberExpression = prependToMemberExpression$1;
  13652. var _removeProperties = removeProperties$1;
  13653. var _removePropertiesDeep = removePropertiesDeep$1;
  13654. var _removeTypeDuplicates = removeTypeDuplicates$3;
  13655. var _getBindingIdentifiers = getBindingIdentifiers$1;
  13656. var _getOuterBindingIdentifiers = getOuterBindingIdentifiers$1;
  13657. var _traverse = traverse$1;
  13658. Object.keys(_traverse).forEach(function (key) {
  13659. if (key === "default" || key === "__esModule") return;
  13660. if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
  13661. if (key in exports && exports[key] === _traverse[key]) return;
  13662. Object.defineProperty(exports, key, {
  13663. enumerable: true,
  13664. get: function () {
  13665. return _traverse[key];
  13666. }
  13667. });
  13668. });
  13669. var _traverseFast = traverseFast$1;
  13670. var _shallowEqual = shallowEqual$1;
  13671. var _is = is$1;
  13672. var _isBinding = isBinding$1;
  13673. var _isBlockScoped = isBlockScoped$1;
  13674. var _isImmutable = isImmutable$1;
  13675. var _isLet = isLet$1;
  13676. var _isNode = isNode$1;
  13677. var _isNodesEquivalent = isNodesEquivalent$1;
  13678. var _isPlaceholderType = isPlaceholderType$1;
  13679. var _isReferenced = isReferenced$1;
  13680. var _isScope = isScope$1;
  13681. var _isSpecifierDefault = isSpecifierDefault$1;
  13682. var _isType = isType$1;
  13683. var _isValidES3Identifier = isValidES3Identifier$1;
  13684. var _isValidIdentifier = isValidIdentifier$1;
  13685. var _isVar = isVar$1;
  13686. var _matchesPattern = matchesPattern$1;
  13687. var _validate = validate$2;
  13688. var _buildMatchMemberExpression = buildMatchMemberExpression$1;
  13689. var _generated4 = generated$4;
  13690. Object.keys(_generated4).forEach(function (key) {
  13691. if (key === "default" || key === "__esModule") return;
  13692. if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
  13693. if (key in exports && exports[key] === _generated4[key]) return;
  13694. Object.defineProperty(exports, key, {
  13695. enumerable: true,
  13696. get: function () {
  13697. return _generated4[key];
  13698. }
  13699. });
  13700. });
  13701. var _generated5 = require$$65;
  13702. Object.keys(_generated5).forEach(function (key) {
  13703. if (key === "default" || key === "__esModule") return;
  13704. if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
  13705. if (key in exports && exports[key] === _generated5[key]) return;
  13706. Object.defineProperty(exports, key, {
  13707. enumerable: true,
  13708. get: function () {
  13709. return _generated5[key];
  13710. }
  13711. });
  13712. });
  13713. const react = {
  13714. isReactComponent: _isReactComponent.default,
  13715. isCompatTag: _isCompatTag.default,
  13716. buildChildren: _buildChildren.default
  13717. };
  13718. exports.react = react;
  13719. }(lib$1));
  13720. function defaultOnError(error) {
  13721. throw error;
  13722. }
  13723. function defaultOnWarn(msg) {
  13724. (process.env.NODE_ENV !== 'production') && console.warn(`[Vue warn] ${msg.message}`);
  13725. }
  13726. function createCompilerError(code, loc, messages, additionalMessage) {
  13727. const msg = (process.env.NODE_ENV !== 'production') || !true
  13728. ? (messages || errorMessages)[code] + (additionalMessage || ``)
  13729. : code;
  13730. const error = new SyntaxError(String(msg));
  13731. error.code = code;
  13732. error.loc = loc;
  13733. return error;
  13734. }
  13735. const errorMessages = {
  13736. // parse errors
  13737. [0 /* ABRUPT_CLOSING_OF_EMPTY_COMMENT */]: 'Illegal comment.',
  13738. [1 /* CDATA_IN_HTML_CONTENT */]: 'CDATA section is allowed only in XML context.',
  13739. [2 /* DUPLICATE_ATTRIBUTE */]: 'Duplicate attribute.',
  13740. [3 /* END_TAG_WITH_ATTRIBUTES */]: 'End tag cannot have attributes.',
  13741. [4 /* END_TAG_WITH_TRAILING_SOLIDUS */]: "Illegal '/' in tags.",
  13742. [5 /* EOF_BEFORE_TAG_NAME */]: 'Unexpected EOF in tag.',
  13743. [6 /* EOF_IN_CDATA */]: 'Unexpected EOF in CDATA section.',
  13744. [7 /* EOF_IN_COMMENT */]: 'Unexpected EOF in comment.',
  13745. [8 /* EOF_IN_SCRIPT_HTML_COMMENT_LIKE_TEXT */]: 'Unexpected EOF in script.',
  13746. [9 /* EOF_IN_TAG */]: 'Unexpected EOF in tag.',
  13747. [10 /* INCORRECTLY_CLOSED_COMMENT */]: 'Incorrectly closed comment.',
  13748. [11 /* INCORRECTLY_OPENED_COMMENT */]: 'Incorrectly opened comment.',
  13749. [12 /* INVALID_FIRST_CHARACTER_OF_TAG_NAME */]: "Illegal tag name. Use '&lt;' to print '<'.",
  13750. [13 /* MISSING_ATTRIBUTE_VALUE */]: 'Attribute value was expected.',
  13751. [14 /* MISSING_END_TAG_NAME */]: 'End tag name was expected.',
  13752. [15 /* MISSING_WHITESPACE_BETWEEN_ATTRIBUTES */]: 'Whitespace was expected.',
  13753. [16 /* NESTED_COMMENT */]: "Unexpected '<!--' in comment.",
  13754. [17 /* UNEXPECTED_CHARACTER_IN_ATTRIBUTE_NAME */]: 'Attribute name cannot contain U+0022 ("), U+0027 (\'), and U+003C (<).',
  13755. [18 /* UNEXPECTED_CHARACTER_IN_UNQUOTED_ATTRIBUTE_VALUE */]: 'Unquoted attribute value cannot contain U+0022 ("), U+0027 (\'), U+003C (<), U+003D (=), and U+0060 (`).',
  13756. [19 /* UNEXPECTED_EQUALS_SIGN_BEFORE_ATTRIBUTE_NAME */]: "Attribute name cannot start with '='.",
  13757. [21 /* UNEXPECTED_QUESTION_MARK_INSTEAD_OF_TAG_NAME */]: "'<?' is allowed only in XML context.",
  13758. [20 /* UNEXPECTED_NULL_CHARACTER */]: `Unexpected null cahracter.`,
  13759. [22 /* UNEXPECTED_SOLIDUS_IN_TAG */]: "Illegal '/' in tags.",
  13760. // Vue-specific parse errors
  13761. [23 /* X_INVALID_END_TAG */]: 'Invalid end tag.',
  13762. [24 /* X_MISSING_END_TAG */]: 'Element is missing end tag.',
  13763. [25 /* X_MISSING_INTERPOLATION_END */]: 'Interpolation end sign was not found.',
  13764. [26 /* X_MISSING_DYNAMIC_DIRECTIVE_ARGUMENT_END */]: 'End bracket for dynamic directive argument was not found. ' +
  13765. 'Note that dynamic directive argument cannot contain spaces.',
  13766. // transform errors
  13767. [27 /* X_V_IF_NO_EXPRESSION */]: `v-if/v-else-if is missing expression.`,
  13768. [28 /* X_V_IF_SAME_KEY */]: `v-if/else branches must use unique keys.`,
  13769. [29 /* X_V_ELSE_NO_ADJACENT_IF */]: `v-else/v-else-if has no adjacent v-if.`,
  13770. [30 /* X_V_FOR_NO_EXPRESSION */]: `v-for is missing expression.`,
  13771. [31 /* X_V_FOR_MALFORMED_EXPRESSION */]: `v-for has invalid expression.`,
  13772. [32 /* X_V_FOR_TEMPLATE_KEY_PLACEMENT */]: `<template v-for> key should be placed on the <template> tag.`,
  13773. [33 /* X_V_BIND_NO_EXPRESSION */]: `v-bind is missing expression.`,
  13774. [34 /* X_V_ON_NO_EXPRESSION */]: `v-on is missing expression.`,
  13775. [35 /* X_V_SLOT_UNEXPECTED_DIRECTIVE_ON_SLOT_OUTLET */]: `Unexpected custom directive on <slot> outlet.`,
  13776. [36 /* X_V_SLOT_MIXED_SLOT_USAGE */]: `Mixed v-slot usage on both the component and nested <template>.` +
  13777. `When there are multiple named slots, all slots should use <template> ` +
  13778. `syntax to avoid scope ambiguity.`,
  13779. [37 /* X_V_SLOT_DUPLICATE_SLOT_NAMES */]: `Duplicate slot names found. `,
  13780. [38 /* X_V_SLOT_EXTRANEOUS_DEFAULT_SLOT_CHILDREN */]: `Extraneous children found when component already has explicitly named ` +
  13781. `default slot. These children will be ignored.`,
  13782. [39 /* X_V_SLOT_MISPLACED */]: `v-slot can only be used on components or <template> tags.`,
  13783. [40 /* X_V_MODEL_NO_EXPRESSION */]: `v-model is missing expression.`,
  13784. [41 /* X_V_MODEL_MALFORMED_EXPRESSION */]: `v-model value must be a valid JavaScript member expression.`,
  13785. [42 /* X_V_MODEL_ON_SCOPE_VARIABLE */]: `v-model cannot be used on v-for or v-slot scope variables because they are not writable.`,
  13786. [43 /* X_INVALID_EXPRESSION */]: `Error parsing JavaScript expression: `,
  13787. [44 /* X_KEEP_ALIVE_INVALID_CHILDREN */]: `<KeepAlive> expects exactly one child component.`,
  13788. // generic errors
  13789. [45 /* X_PREFIX_ID_NOT_SUPPORTED */]: `"prefixIdentifiers" option is not supported in this build of compiler.`,
  13790. [46 /* X_MODULE_MODE_NOT_SUPPORTED */]: `ES module mode is not supported in this build of compiler.`,
  13791. [47 /* X_CACHE_HANDLER_NOT_SUPPORTED */]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`,
  13792. [48 /* X_SCOPE_ID_NOT_SUPPORTED */]: `"scopeId" option is only supported in module mode.`,
  13793. // just to fullfill types
  13794. [49 /* __EXTEND_POINT__ */]: ``
  13795. };
  13796. const FRAGMENT = Symbol((process.env.NODE_ENV !== 'production') ? `Fragment` : ``);
  13797. const TELEPORT = Symbol((process.env.NODE_ENV !== 'production') ? `Teleport` : ``);
  13798. const SUSPENSE = Symbol((process.env.NODE_ENV !== 'production') ? `Suspense` : ``);
  13799. const KEEP_ALIVE = Symbol((process.env.NODE_ENV !== 'production') ? `KeepAlive` : ``);
  13800. const BASE_TRANSITION = Symbol((process.env.NODE_ENV !== 'production') ? `BaseTransition` : ``);
  13801. const OPEN_BLOCK = Symbol((process.env.NODE_ENV !== 'production') ? `openBlock` : ``);
  13802. const CREATE_BLOCK = Symbol((process.env.NODE_ENV !== 'production') ? `createBlock` : ``);
  13803. const CREATE_ELEMENT_BLOCK = Symbol((process.env.NODE_ENV !== 'production') ? `createElementBlock` : ``);
  13804. const CREATE_VNODE = Symbol((process.env.NODE_ENV !== 'production') ? `createVNode` : ``);
  13805. const CREATE_ELEMENT_VNODE = Symbol((process.env.NODE_ENV !== 'production') ? `createElementVNode` : ``);
  13806. const CREATE_COMMENT = Symbol((process.env.NODE_ENV !== 'production') ? `createCommentVNode` : ``);
  13807. const CREATE_TEXT = Symbol((process.env.NODE_ENV !== 'production') ? `createTextVNode` : ``);
  13808. const CREATE_STATIC = Symbol((process.env.NODE_ENV !== 'production') ? `createStaticVNode` : ``);
  13809. const RESOLVE_COMPONENT = Symbol((process.env.NODE_ENV !== 'production') ? `resolveComponent` : ``);
  13810. const RESOLVE_DYNAMIC_COMPONENT = Symbol((process.env.NODE_ENV !== 'production') ? `resolveDynamicComponent` : ``);
  13811. const RESOLVE_DIRECTIVE = Symbol((process.env.NODE_ENV !== 'production') ? `resolveDirective` : ``);
  13812. const RESOLVE_FILTER = Symbol((process.env.NODE_ENV !== 'production') ? `resolveFilter` : ``);
  13813. const WITH_DIRECTIVES = Symbol((process.env.NODE_ENV !== 'production') ? `withDirectives` : ``);
  13814. const RENDER_LIST = Symbol((process.env.NODE_ENV !== 'production') ? `renderList` : ``);
  13815. const RENDER_SLOT = Symbol((process.env.NODE_ENV !== 'production') ? `renderSlot` : ``);
  13816. const CREATE_SLOTS = Symbol((process.env.NODE_ENV !== 'production') ? `createSlots` : ``);
  13817. const TO_DISPLAY_STRING = Symbol((process.env.NODE_ENV !== 'production') ? `toDisplayString` : ``);
  13818. const MERGE_PROPS = Symbol((process.env.NODE_ENV !== 'production') ? `mergeProps` : ``);
  13819. const NORMALIZE_CLASS = Symbol((process.env.NODE_ENV !== 'production') ? `normalizeClass` : ``);
  13820. const NORMALIZE_STYLE = Symbol((process.env.NODE_ENV !== 'production') ? `normalizeStyle` : ``);
  13821. const NORMALIZE_PROPS = Symbol((process.env.NODE_ENV !== 'production') ? `normalizeProps` : ``);
  13822. const GUARD_REACTIVE_PROPS = Symbol((process.env.NODE_ENV !== 'production') ? `guardReactiveProps` : ``);
  13823. const TO_HANDLERS = Symbol((process.env.NODE_ENV !== 'production') ? `toHandlers` : ``);
  13824. const CAMELIZE = Symbol((process.env.NODE_ENV !== 'production') ? `camelize` : ``);
  13825. const CAPITALIZE = Symbol((process.env.NODE_ENV !== 'production') ? `capitalize` : ``);
  13826. const TO_HANDLER_KEY = Symbol((process.env.NODE_ENV !== 'production') ? `toHandlerKey` : ``);
  13827. const SET_BLOCK_TRACKING = Symbol((process.env.NODE_ENV !== 'production') ? `setBlockTracking` : ``);
  13828. const PUSH_SCOPE_ID = Symbol((process.env.NODE_ENV !== 'production') ? `pushScopeId` : ``);
  13829. const POP_SCOPE_ID = Symbol((process.env.NODE_ENV !== 'production') ? `popScopeId` : ``);
  13830. const WITH_SCOPE_ID = Symbol((process.env.NODE_ENV !== 'production') ? `withScopeId` : ``);
  13831. const WITH_CTX = Symbol((process.env.NODE_ENV !== 'production') ? `withCtx` : ``);
  13832. const UNREF = Symbol((process.env.NODE_ENV !== 'production') ? `unref` : ``);
  13833. const IS_REF = Symbol((process.env.NODE_ENV !== 'production') ? `isRef` : ``);
  13834. const WITH_MEMO = Symbol((process.env.NODE_ENV !== 'production') ? `withMemo` : ``);
  13835. const IS_MEMO_SAME = Symbol((process.env.NODE_ENV !== 'production') ? `isMemoSame` : ``);
  13836. // Name mapping for runtime helpers that need to be imported from 'vue' in
  13837. // generated code. Make sure these are correctly exported in the runtime!
  13838. // Using `any` here because TS doesn't allow symbols as index type.
  13839. const helperNameMap = {
  13840. [FRAGMENT]: `Fragment`,
  13841. [TELEPORT]: `Teleport`,
  13842. [SUSPENSE]: `Suspense`,
  13843. [KEEP_ALIVE]: `KeepAlive`,
  13844. [BASE_TRANSITION]: `BaseTransition`,
  13845. [OPEN_BLOCK]: `openBlock`,
  13846. [CREATE_BLOCK]: `createBlock`,
  13847. [CREATE_ELEMENT_BLOCK]: `createElementBlock`,
  13848. [CREATE_VNODE]: `createVNode`,
  13849. [CREATE_ELEMENT_VNODE]: `createElementVNode`,
  13850. [CREATE_COMMENT]: `createCommentVNode`,
  13851. [CREATE_TEXT]: `createTextVNode`,
  13852. [CREATE_STATIC]: `createStaticVNode`,
  13853. [RESOLVE_COMPONENT]: `resolveComponent`,
  13854. [RESOLVE_DYNAMIC_COMPONENT]: `resolveDynamicComponent`,
  13855. [RESOLVE_DIRECTIVE]: `resolveDirective`,
  13856. [RESOLVE_FILTER]: `resolveFilter`,
  13857. [WITH_DIRECTIVES]: `withDirectives`,
  13858. [RENDER_LIST]: `renderList`,
  13859. [RENDER_SLOT]: `renderSlot`,
  13860. [CREATE_SLOTS]: `createSlots`,
  13861. [TO_DISPLAY_STRING]: `toDisplayString`,
  13862. [MERGE_PROPS]: `mergeProps`,
  13863. [NORMALIZE_CLASS]: `normalizeClass`,
  13864. [NORMALIZE_STYLE]: `normalizeStyle`,
  13865. [NORMALIZE_PROPS]: `normalizeProps`,
  13866. [GUARD_REACTIVE_PROPS]: `guardReactiveProps`,
  13867. [TO_HANDLERS]: `toHandlers`,
  13868. [CAMELIZE]: `camelize`,
  13869. [CAPITALIZE]: `capitalize`,
  13870. [TO_HANDLER_KEY]: `toHandlerKey`,
  13871. [SET_BLOCK_TRACKING]: `setBlockTracking`,
  13872. [PUSH_SCOPE_ID]: `pushScopeId`,
  13873. [POP_SCOPE_ID]: `popScopeId`,
  13874. [WITH_SCOPE_ID]: `withScopeId`,
  13875. [WITH_CTX]: `withCtx`,
  13876. [UNREF]: `unref`,
  13877. [IS_REF]: `isRef`,
  13878. [WITH_MEMO]: `withMemo`,
  13879. [IS_MEMO_SAME]: `isMemoSame`
  13880. };
  13881. function registerRuntimeHelpers(helpers) {
  13882. Object.getOwnPropertySymbols(helpers).forEach(s => {
  13883. helperNameMap[s] = helpers[s];
  13884. });
  13885. }
  13886. // AST Utilities ---------------------------------------------------------------
  13887. // Some expressions, e.g. sequence and conditional expressions, are never
  13888. // associated with template nodes, so their source locations are just a stub.
  13889. // Container types like CompoundExpression also don't need a real location.
  13890. const locStub = {
  13891. source: '',
  13892. start: { line: 1, column: 1, offset: 0 },
  13893. end: { line: 1, column: 1, offset: 0 }
  13894. };
  13895. function createRoot(children, loc = locStub) {
  13896. return {
  13897. type: 0 /* ROOT */,
  13898. children,
  13899. helpers: [],
  13900. components: [],
  13901. directives: [],
  13902. hoists: [],
  13903. imports: [],
  13904. cached: 0,
  13905. temps: 0,
  13906. codegenNode: undefined,
  13907. loc
  13908. };
  13909. }
  13910. function createVNodeCall(context, tag, props, children, patchFlag, dynamicProps, directives, isBlock = false, disableTracking = false, isComponent = false, loc = locStub) {
  13911. if (context) {
  13912. if (isBlock) {
  13913. context.helper(OPEN_BLOCK);
  13914. context.helper(getVNodeBlockHelper(context.inSSR, isComponent));
  13915. }
  13916. else {
  13917. context.helper(getVNodeHelper(context.inSSR, isComponent));
  13918. }
  13919. if (directives) {
  13920. context.helper(WITH_DIRECTIVES);
  13921. }
  13922. }
  13923. return {
  13924. type: 13 /* VNODE_CALL */,
  13925. tag,
  13926. props,
  13927. children,
  13928. patchFlag,
  13929. dynamicProps,
  13930. directives,
  13931. isBlock,
  13932. disableTracking,
  13933. isComponent,
  13934. loc
  13935. };
  13936. }
  13937. function createArrayExpression(elements, loc = locStub) {
  13938. return {
  13939. type: 17 /* JS_ARRAY_EXPRESSION */,
  13940. loc,
  13941. elements
  13942. };
  13943. }
  13944. function createObjectExpression(properties, loc = locStub) {
  13945. return {
  13946. type: 15 /* JS_OBJECT_EXPRESSION */,
  13947. loc,
  13948. properties
  13949. };
  13950. }
  13951. function createObjectProperty(key, value) {
  13952. return {
  13953. type: 16 /* JS_PROPERTY */,
  13954. loc: locStub,
  13955. key: isString(key) ? createSimpleExpression(key, true) : key,
  13956. value
  13957. };
  13958. }
  13959. function createSimpleExpression(content, isStatic = false, loc = locStub, constType = 0 /* NOT_CONSTANT */) {
  13960. return {
  13961. type: 4 /* SIMPLE_EXPRESSION */,
  13962. loc,
  13963. content,
  13964. isStatic,
  13965. constType: isStatic ? 3 /* CAN_STRINGIFY */ : constType
  13966. };
  13967. }
  13968. function createInterpolation(content, loc) {
  13969. return {
  13970. type: 5 /* INTERPOLATION */,
  13971. loc,
  13972. content: isString(content)
  13973. ? createSimpleExpression(content, false, loc)
  13974. : content
  13975. };
  13976. }
  13977. function createCompoundExpression(children, loc = locStub) {
  13978. return {
  13979. type: 8 /* COMPOUND_EXPRESSION */,
  13980. loc,
  13981. children
  13982. };
  13983. }
  13984. function createCallExpression(callee, args = [], loc = locStub) {
  13985. return {
  13986. type: 14 /* JS_CALL_EXPRESSION */,
  13987. loc,
  13988. callee,
  13989. arguments: args
  13990. };
  13991. }
  13992. function createFunctionExpression(params, returns = undefined, newline = false, isSlot = false, loc = locStub) {
  13993. return {
  13994. type: 18 /* JS_FUNCTION_EXPRESSION */,
  13995. params,
  13996. returns,
  13997. newline,
  13998. isSlot,
  13999. loc
  14000. };
  14001. }
  14002. function createConditionalExpression(test, consequent, alternate, newline = true) {
  14003. return {
  14004. type: 19 /* JS_CONDITIONAL_EXPRESSION */,
  14005. test,
  14006. consequent,
  14007. alternate,
  14008. newline,
  14009. loc: locStub
  14010. };
  14011. }
  14012. function createCacheExpression(index, value, isVNode = false) {
  14013. return {
  14014. type: 20 /* JS_CACHE_EXPRESSION */,
  14015. index,
  14016. value,
  14017. isVNode,
  14018. loc: locStub
  14019. };
  14020. }
  14021. function createBlockStatement(body) {
  14022. return {
  14023. type: 21 /* JS_BLOCK_STATEMENT */,
  14024. body,
  14025. loc: locStub
  14026. };
  14027. }
  14028. function createTemplateLiteral(elements) {
  14029. return {
  14030. type: 22 /* JS_TEMPLATE_LITERAL */,
  14031. elements,
  14032. loc: locStub
  14033. };
  14034. }
  14035. function createIfStatement(test, consequent, alternate) {
  14036. return {
  14037. type: 23 /* JS_IF_STATEMENT */,
  14038. test,
  14039. consequent,
  14040. alternate,
  14041. loc: locStub
  14042. };
  14043. }
  14044. function createAssignmentExpression(left, right) {
  14045. return {
  14046. type: 24 /* JS_ASSIGNMENT_EXPRESSION */,
  14047. left,
  14048. right,
  14049. loc: locStub
  14050. };
  14051. }
  14052. function createSequenceExpression(expressions) {
  14053. return {
  14054. type: 25 /* JS_SEQUENCE_EXPRESSION */,
  14055. expressions,
  14056. loc: locStub
  14057. };
  14058. }
  14059. function createReturnStatement(returns) {
  14060. return {
  14061. type: 26 /* JS_RETURN_STATEMENT */,
  14062. returns,
  14063. loc: locStub
  14064. };
  14065. }
  14066. const isStaticExp = (p) => p.type === 4 /* SIMPLE_EXPRESSION */ && p.isStatic;
  14067. const isBuiltInType = (tag, expected) => tag === expected || tag === hyphenate(expected);
  14068. function isCoreComponent(tag) {
  14069. if (isBuiltInType(tag, 'Teleport')) {
  14070. return TELEPORT;
  14071. }
  14072. else if (isBuiltInType(tag, 'Suspense')) {
  14073. return SUSPENSE;
  14074. }
  14075. else if (isBuiltInType(tag, 'KeepAlive')) {
  14076. return KEEP_ALIVE;
  14077. }
  14078. else if (isBuiltInType(tag, 'BaseTransition')) {
  14079. return BASE_TRANSITION;
  14080. }
  14081. }
  14082. const nonIdentifierRE = /^\d|[^\$\w]/;
  14083. const isSimpleIdentifier = (name) => !nonIdentifierRE.test(name);
  14084. const validFirstIdentCharRE = /[A-Za-z_$\xA0-\uFFFF]/;
  14085. const validIdentCharRE = /[\.\?\w$\xA0-\uFFFF]/;
  14086. const whitespaceRE = /\s+[.[]\s*|\s*[.[]\s+/g;
  14087. /**
  14088. * Simple lexer to check if an expression is a member expression. This is
  14089. * lax and only checks validity at the root level (i.e. does not validate exps
  14090. * inside square brackets), but it's ok since these are only used on template
  14091. * expressions and false positives are invalid expressions in the first place.
  14092. */
  14093. const isMemberExpression = (path) => {
  14094. // remove whitespaces around . or [ first
  14095. path = path.trim().replace(whitespaceRE, s => s.trim());
  14096. let state = 0 /* inMemberExp */;
  14097. let stateStack = [];
  14098. let currentOpenBracketCount = 0;
  14099. let currentOpenParensCount = 0;
  14100. let currentStringType = null;
  14101. for (let i = 0; i < path.length; i++) {
  14102. const char = path.charAt(i);
  14103. switch (state) {
  14104. case 0 /* inMemberExp */:
  14105. if (char === '[') {
  14106. stateStack.push(state);
  14107. state = 1 /* inBrackets */;
  14108. currentOpenBracketCount++;
  14109. }
  14110. else if (char === '(') {
  14111. stateStack.push(state);
  14112. state = 2 /* inParens */;
  14113. currentOpenParensCount++;
  14114. }
  14115. else if (!(i === 0 ? validFirstIdentCharRE : validIdentCharRE).test(char)) {
  14116. return false;
  14117. }
  14118. break;
  14119. case 1 /* inBrackets */:
  14120. if (char === `'` || char === `"` || char === '`') {
  14121. stateStack.push(state);
  14122. state = 3 /* inString */;
  14123. currentStringType = char;
  14124. }
  14125. else if (char === `[`) {
  14126. currentOpenBracketCount++;
  14127. }
  14128. else if (char === `]`) {
  14129. if (!--currentOpenBracketCount) {
  14130. state = stateStack.pop();
  14131. }
  14132. }
  14133. break;
  14134. case 2 /* inParens */:
  14135. if (char === `'` || char === `"` || char === '`') {
  14136. stateStack.push(state);
  14137. state = 3 /* inString */;
  14138. currentStringType = char;
  14139. }
  14140. else if (char === `(`) {
  14141. currentOpenParensCount++;
  14142. }
  14143. else if (char === `)`) {
  14144. // if the exp ends as a call then it should not be considered valid
  14145. if (i === path.length - 1) {
  14146. return false;
  14147. }
  14148. if (!--currentOpenParensCount) {
  14149. state = stateStack.pop();
  14150. }
  14151. }
  14152. break;
  14153. case 3 /* inString */:
  14154. if (char === currentStringType) {
  14155. state = stateStack.pop();
  14156. currentStringType = null;
  14157. }
  14158. break;
  14159. }
  14160. }
  14161. return !currentOpenBracketCount && !currentOpenParensCount;
  14162. };
  14163. function getInnerRange(loc, offset, length) {
  14164. const source = loc.source.substr(offset, length);
  14165. const newLoc = {
  14166. source,
  14167. start: advancePositionWithClone(loc.start, loc.source, offset),
  14168. end: loc.end
  14169. };
  14170. if (length != null) {
  14171. newLoc.end = advancePositionWithClone(loc.start, loc.source, offset + length);
  14172. }
  14173. return newLoc;
  14174. }
  14175. function advancePositionWithClone(pos, source, numberOfCharacters = source.length) {
  14176. return advancePositionWithMutation(extend({}, pos), source, numberOfCharacters);
  14177. }
  14178. // advance by mutation without cloning (for performance reasons), since this
  14179. // gets called a lot in the parser
  14180. function advancePositionWithMutation(pos, source, numberOfCharacters = source.length) {
  14181. let linesCount = 0;
  14182. let lastNewLinePos = -1;
  14183. for (let i = 0; i < numberOfCharacters; i++) {
  14184. if (source.charCodeAt(i) === 10 /* newline char code */) {
  14185. linesCount++;
  14186. lastNewLinePos = i;
  14187. }
  14188. }
  14189. pos.offset += numberOfCharacters;
  14190. pos.line += linesCount;
  14191. pos.column =
  14192. lastNewLinePos === -1
  14193. ? pos.column + numberOfCharacters
  14194. : numberOfCharacters - lastNewLinePos;
  14195. return pos;
  14196. }
  14197. function assert(condition, msg) {
  14198. /* istanbul ignore if */
  14199. if (!condition) {
  14200. throw new Error(msg || `unexpected compiler condition`);
  14201. }
  14202. }
  14203. function findDir(node, name, allowEmpty = false) {
  14204. for (let i = 0; i < node.props.length; i++) {
  14205. const p = node.props[i];
  14206. if (p.type === 7 /* DIRECTIVE */ &&
  14207. (allowEmpty || p.exp) &&
  14208. (isString(name) ? p.name === name : name.test(p.name))) {
  14209. return p;
  14210. }
  14211. }
  14212. }
  14213. function findProp(node, name, dynamicOnly = false, allowEmpty = false) {
  14214. for (let i = 0; i < node.props.length; i++) {
  14215. const p = node.props[i];
  14216. if (p.type === 6 /* ATTRIBUTE */) {
  14217. if (dynamicOnly)
  14218. continue;
  14219. if (p.name === name && (p.value || allowEmpty)) {
  14220. return p;
  14221. }
  14222. }
  14223. else if (p.name === 'bind' &&
  14224. (p.exp || allowEmpty) &&
  14225. isBindKey(p.arg, name)) {
  14226. return p;
  14227. }
  14228. }
  14229. }
  14230. function isBindKey(arg, name) {
  14231. return !!(arg && isStaticExp(arg) && arg.content === name);
  14232. }
  14233. function hasDynamicKeyVBind(node) {
  14234. return node.props.some(p => p.type === 7 /* DIRECTIVE */ &&
  14235. p.name === 'bind' &&
  14236. (!p.arg || // v-bind="obj"
  14237. p.arg.type !== 4 /* SIMPLE_EXPRESSION */ || // v-bind:[_ctx.foo]
  14238. !p.arg.isStatic) // v-bind:[foo]
  14239. );
  14240. }
  14241. function isText(node) {
  14242. return node.type === 5 /* INTERPOLATION */ || node.type === 2 /* TEXT */;
  14243. }
  14244. function isVSlot(p) {
  14245. return p.type === 7 /* DIRECTIVE */ && p.name === 'slot';
  14246. }
  14247. function isTemplateNode(node) {
  14248. return (node.type === 1 /* ELEMENT */ && node.tagType === 3 /* TEMPLATE */);
  14249. }
  14250. function isSlotOutlet(node) {
  14251. return node.type === 1 /* ELEMENT */ && node.tagType === 2 /* SLOT */;
  14252. }
  14253. function getVNodeHelper(ssr, isComponent) {
  14254. return ssr || isComponent ? CREATE_VNODE : CREATE_ELEMENT_VNODE;
  14255. }
  14256. function getVNodeBlockHelper(ssr, isComponent) {
  14257. return ssr || isComponent ? CREATE_BLOCK : CREATE_ELEMENT_BLOCK;
  14258. }
  14259. const propsHelperSet = new Set([NORMALIZE_PROPS, GUARD_REACTIVE_PROPS]);
  14260. function getUnnormalizedProps(props, callPath = []) {
  14261. if (props &&
  14262. !isString(props) &&
  14263. props.type === 14 /* JS_CALL_EXPRESSION */) {
  14264. const callee = props.callee;
  14265. if (!isString(callee) && propsHelperSet.has(callee)) {
  14266. return getUnnormalizedProps(props.arguments[0], callPath.concat(props));
  14267. }
  14268. }
  14269. return [props, callPath];
  14270. }
  14271. function injectProp(node, prop, context) {
  14272. let propsWithInjection;
  14273. const originalProps = node.type === 13 /* VNODE_CALL */ ? node.props : node.arguments[2];
  14274. /**
  14275. * 1. mergeProps(...)
  14276. * 2. toHandlers(...)
  14277. * 3. normalizeProps(...)
  14278. * 4. normalizeProps(guardReactiveProps(...))
  14279. *
  14280. * we need to get the real props before normalization
  14281. */
  14282. let props = originalProps;
  14283. let callPath = [];
  14284. let parentCall;
  14285. if (props &&
  14286. !isString(props) &&
  14287. props.type === 14 /* JS_CALL_EXPRESSION */) {
  14288. const ret = getUnnormalizedProps(props);
  14289. props = ret[0];
  14290. callPath = ret[1];
  14291. parentCall = callPath[callPath.length - 1];
  14292. }
  14293. if (props == null || isString(props)) {
  14294. propsWithInjection = createObjectExpression([prop]);
  14295. }
  14296. else if (props.type === 14 /* JS_CALL_EXPRESSION */) {
  14297. // merged props... add ours
  14298. // only inject key to object literal if it's the first argument so that
  14299. // if doesn't override user provided keys
  14300. const first = props.arguments[0];
  14301. if (!isString(first) && first.type === 15 /* JS_OBJECT_EXPRESSION */) {
  14302. first.properties.unshift(prop);
  14303. }
  14304. else {
  14305. if (props.callee === TO_HANDLERS) {
  14306. // #2366
  14307. propsWithInjection = createCallExpression(context.helper(MERGE_PROPS), [
  14308. createObjectExpression([prop]),
  14309. props
  14310. ]);
  14311. }
  14312. else {
  14313. props.arguments.unshift(createObjectExpression([prop]));
  14314. }
  14315. }
  14316. !propsWithInjection && (propsWithInjection = props);
  14317. }
  14318. else if (props.type === 15 /* JS_OBJECT_EXPRESSION */) {
  14319. let alreadyExists = false;
  14320. // check existing key to avoid overriding user provided keys
  14321. if (prop.key.type === 4 /* SIMPLE_EXPRESSION */) {
  14322. const propKeyName = prop.key.content;
  14323. alreadyExists = props.properties.some(p => p.key.type === 4 /* SIMPLE_EXPRESSION */ &&
  14324. p.key.content === propKeyName);
  14325. }
  14326. if (!alreadyExists) {
  14327. props.properties.unshift(prop);
  14328. }
  14329. propsWithInjection = props;
  14330. }
  14331. else {
  14332. // single v-bind with expression, return a merged replacement
  14333. propsWithInjection = createCallExpression(context.helper(MERGE_PROPS), [
  14334. createObjectExpression([prop]),
  14335. props
  14336. ]);
  14337. // in the case of nested helper call, e.g. `normalizeProps(guardReactiveProps(props))`,
  14338. // it will be rewritten as `normalizeProps(mergeProps({ key: 0 }, props))`,
  14339. // the `guardReactiveProps` will no longer be needed
  14340. if (parentCall && parentCall.callee === GUARD_REACTIVE_PROPS) {
  14341. parentCall = callPath[callPath.length - 2];
  14342. }
  14343. }
  14344. if (node.type === 13 /* VNODE_CALL */) {
  14345. if (parentCall) {
  14346. parentCall.arguments[0] = propsWithInjection;
  14347. }
  14348. else {
  14349. node.props = propsWithInjection;
  14350. }
  14351. }
  14352. else {
  14353. if (parentCall) {
  14354. parentCall.arguments[0] = propsWithInjection;
  14355. }
  14356. else {
  14357. node.arguments[2] = propsWithInjection;
  14358. }
  14359. }
  14360. }
  14361. function toValidAssetId(name, type) {
  14362. // see issue#4422, we need adding identifier on validAssetId if variable `name` has specific character
  14363. return `_${type}_${name.replace(/[^\w]/g, (searchValue, replaceValue) => {
  14364. return searchValue === '-' ? '_' : name.charCodeAt(replaceValue).toString();
  14365. })}`;
  14366. }
  14367. // Check if a node contains expressions that reference current context scope ids
  14368. function hasScopeRef(node, ids) {
  14369. if (!node || Object.keys(ids).length === 0) {
  14370. return false;
  14371. }
  14372. switch (node.type) {
  14373. case 1 /* ELEMENT */:
  14374. for (let i = 0; i < node.props.length; i++) {
  14375. const p = node.props[i];
  14376. if (p.type === 7 /* DIRECTIVE */ &&
  14377. (hasScopeRef(p.arg, ids) || hasScopeRef(p.exp, ids))) {
  14378. return true;
  14379. }
  14380. }
  14381. return node.children.some(c => hasScopeRef(c, ids));
  14382. case 11 /* FOR */:
  14383. if (hasScopeRef(node.source, ids)) {
  14384. return true;
  14385. }
  14386. return node.children.some(c => hasScopeRef(c, ids));
  14387. case 9 /* IF */:
  14388. return node.branches.some(b => hasScopeRef(b, ids));
  14389. case 10 /* IF_BRANCH */:
  14390. if (hasScopeRef(node.condition, ids)) {
  14391. return true;
  14392. }
  14393. return node.children.some(c => hasScopeRef(c, ids));
  14394. case 4 /* SIMPLE_EXPRESSION */:
  14395. return (!node.isStatic &&
  14396. isSimpleIdentifier(node.content) &&
  14397. !!ids[node.content]);
  14398. case 8 /* COMPOUND_EXPRESSION */:
  14399. return node.children.some(c => isObject(c) && hasScopeRef(c, ids));
  14400. case 5 /* INTERPOLATION */:
  14401. case 12 /* TEXT_CALL */:
  14402. return hasScopeRef(node.content, ids);
  14403. case 2 /* TEXT */:
  14404. case 3 /* COMMENT */:
  14405. return false;
  14406. default:
  14407. if ((process.env.NODE_ENV !== 'production')) ;
  14408. return false;
  14409. }
  14410. }
  14411. function getMemoedVNodeCall(node) {
  14412. if (node.type === 14 /* JS_CALL_EXPRESSION */ && node.callee === WITH_MEMO) {
  14413. return node.arguments[1].returns;
  14414. }
  14415. else {
  14416. return node;
  14417. }
  14418. }
  14419. function makeBlock(node, { helper, removeHelper, inSSR }) {
  14420. if (!node.isBlock) {
  14421. node.isBlock = true;
  14422. removeHelper(getVNodeHelper(inSSR, node.isComponent));
  14423. helper(OPEN_BLOCK);
  14424. helper(getVNodeBlockHelper(inSSR, node.isComponent));
  14425. }
  14426. }
  14427. const deprecationData = {
  14428. ["COMPILER_IS_ON_ELEMENT" /* COMPILER_IS_ON_ELEMENT */]: {
  14429. message: `Platform-native elements with "is" prop will no longer be ` +
  14430. `treated as components in Vue 3 unless the "is" value is explicitly ` +
  14431. `prefixed with "vue:".`,
  14432. link: `https://v3.vuejs.org/guide/migration/custom-elements-interop.html`
  14433. },
  14434. ["COMPILER_V_BIND_SYNC" /* COMPILER_V_BIND_SYNC */]: {
  14435. message: key => `.sync modifier for v-bind has been removed. Use v-model with ` +
  14436. `argument instead. \`v-bind:${key}.sync\` should be changed to ` +
  14437. `\`v-model:${key}\`.`,
  14438. link: `https://v3.vuejs.org/guide/migration/v-model.html`
  14439. },
  14440. ["COMPILER_V_BIND_PROP" /* COMPILER_V_BIND_PROP */]: {
  14441. message: `.prop modifier for v-bind has been removed and no longer necessary. ` +
  14442. `Vue 3 will automatically set a binding as DOM property when appropriate.`
  14443. },
  14444. ["COMPILER_V_BIND_OBJECT_ORDER" /* COMPILER_V_BIND_OBJECT_ORDER */]: {
  14445. message: `v-bind="obj" usage is now order sensitive and behaves like JavaScript ` +
  14446. `object spread: it will now overwrite an existing non-mergeable attribute ` +
  14447. `that appears before v-bind in the case of conflict. ` +
  14448. `To retain 2.x behavior, move v-bind to make it the first attribute. ` +
  14449. `You can also suppress this warning if the usage is intended.`,
  14450. link: `https://v3.vuejs.org/guide/migration/v-bind.html`
  14451. },
  14452. ["COMPILER_V_ON_NATIVE" /* COMPILER_V_ON_NATIVE */]: {
  14453. message: `.native modifier for v-on has been removed as is no longer necessary.`,
  14454. link: `https://v3.vuejs.org/guide/migration/v-on-native-modifier-removed.html`
  14455. },
  14456. ["COMPILER_V_IF_V_FOR_PRECEDENCE" /* COMPILER_V_IF_V_FOR_PRECEDENCE */]: {
  14457. message: `v-if / v-for precedence when used on the same element has changed ` +
  14458. `in Vue 3: v-if now takes higher precedence and will no longer have ` +
  14459. `access to v-for scope variables. It is best to avoid the ambiguity ` +
  14460. `with <template> tags or use a computed property that filters v-for ` +
  14461. `data source.`,
  14462. link: `https://v3.vuejs.org/guide/migration/v-if-v-for.html`
  14463. },
  14464. ["COMPILER_V_FOR_REF" /* COMPILER_V_FOR_REF */]: {
  14465. message: `Ref usage on v-for no longer creates array ref values in Vue 3. ` +
  14466. `Consider using function refs or refactor to avoid ref usage altogether.`,
  14467. link: `https://v3.vuejs.org/guide/migration/array-refs.html`
  14468. },
  14469. ["COMPILER_NATIVE_TEMPLATE" /* COMPILER_NATIVE_TEMPLATE */]: {
  14470. message: `<template> with no special directives will render as a native template ` +
  14471. `element instead of its inner content in Vue 3.`
  14472. },
  14473. ["COMPILER_INLINE_TEMPLATE" /* COMPILER_INLINE_TEMPLATE */]: {
  14474. message: `"inline-template" has been removed in Vue 3.`,
  14475. link: `https://v3.vuejs.org/guide/migration/inline-template-attribute.html`
  14476. },
  14477. ["COMPILER_FILTER" /* COMPILER_FILTERS */]: {
  14478. message: `filters have been removed in Vue 3. ` +
  14479. `The "|" symbol will be treated as native JavaScript bitwise OR operator. ` +
  14480. `Use method calls or computed properties instead.`,
  14481. link: `https://v3.vuejs.org/guide/migration/filters.html`
  14482. }
  14483. };
  14484. function getCompatValue(key, context) {
  14485. const config = context.options
  14486. ? context.options.compatConfig
  14487. : context.compatConfig;
  14488. const value = config && config[key];
  14489. if (key === 'MODE') {
  14490. return value || 3; // compiler defaults to v3 behavior
  14491. }
  14492. else {
  14493. return value;
  14494. }
  14495. }
  14496. function isCompatEnabled(key, context) {
  14497. const mode = getCompatValue('MODE', context);
  14498. const value = getCompatValue(key, context);
  14499. // in v3 mode, only enable if explicitly set to true
  14500. // otherwise enable for any non-false value
  14501. return mode === 3 ? value === true : value !== false;
  14502. }
  14503. function checkCompatEnabled(key, context, loc, ...args) {
  14504. const enabled = isCompatEnabled(key, context);
  14505. if ((process.env.NODE_ENV !== 'production') && enabled) {
  14506. warnDeprecation(key, context, loc, ...args);
  14507. }
  14508. return enabled;
  14509. }
  14510. function warnDeprecation(key, context, loc, ...args) {
  14511. const val = getCompatValue(key, context);
  14512. if (val === 'suppress-warning') {
  14513. return;
  14514. }
  14515. const { message, link } = deprecationData[key];
  14516. const msg = `(deprecation ${key}) ${typeof message === 'function' ? message(...args) : message}${link ? `\n Details: ${link}` : ``}`;
  14517. const err = new SyntaxError(msg);
  14518. err.code = key;
  14519. if (loc)
  14520. err.loc = loc;
  14521. context.onWarn(err);
  14522. }
  14523. // The default decoder only provides escapes for characters reserved as part of
  14524. // the template syntax, and is only used if the custom renderer did not provide
  14525. // a platform-specific decoder.
  14526. const decodeRE = /&(gt|lt|amp|apos|quot);/g;
  14527. const decodeMap = {
  14528. gt: '>',
  14529. lt: '<',
  14530. amp: '&',
  14531. apos: "'",
  14532. quot: '"'
  14533. };
  14534. const defaultParserOptions = {
  14535. delimiters: [`{{`, `}}`],
  14536. getNamespace: () => 0 /* HTML */,
  14537. getTextMode: () => 0 /* DATA */,
  14538. isVoidTag: NO,
  14539. isPreTag: NO,
  14540. isCustomElement: NO,
  14541. decodeEntities: (rawText) => rawText.replace(decodeRE, (_, p1) => decodeMap[p1]),
  14542. onError: defaultOnError,
  14543. onWarn: defaultOnWarn,
  14544. comments: (process.env.NODE_ENV !== 'production')
  14545. };
  14546. function baseParse(content, options = {}) {
  14547. const context = createParserContext(content, options);
  14548. const start = getCursor(context);
  14549. return createRoot(parseChildren(context, 0 /* DATA */, []), getSelection(context, start));
  14550. }
  14551. function createParserContext(content, rawOptions) {
  14552. const options = extend({}, defaultParserOptions);
  14553. let key;
  14554. for (key in rawOptions) {
  14555. // @ts-ignore
  14556. options[key] =
  14557. rawOptions[key] === undefined
  14558. ? defaultParserOptions[key]
  14559. : rawOptions[key];
  14560. }
  14561. return {
  14562. options,
  14563. column: 1,
  14564. line: 1,
  14565. offset: 0,
  14566. originalSource: content,
  14567. source: content,
  14568. inPre: false,
  14569. inVPre: false,
  14570. onWarn: options.onWarn
  14571. };
  14572. }
  14573. function parseChildren(context, mode, ancestors) {
  14574. const parent = last(ancestors);
  14575. const ns = parent ? parent.ns : 0 /* HTML */;
  14576. const nodes = [];
  14577. while (!isEnd(context, mode, ancestors)) {
  14578. const s = context.source;
  14579. let node = undefined;
  14580. if (mode === 0 /* DATA */ || mode === 1 /* RCDATA */) {
  14581. if (!context.inVPre && startsWith(s, context.options.delimiters[0])) {
  14582. // '{{'
  14583. node = parseInterpolation(context, mode);
  14584. }
  14585. else if (mode === 0 /* DATA */ && s[0] === '<') {
  14586. // https://html.spec.whatwg.org/multipage/parsing.html#tag-open-state
  14587. if (s.length === 1) {
  14588. emitError(context, 5 /* EOF_BEFORE_TAG_NAME */, 1);
  14589. }
  14590. else if (s[1] === '!') {
  14591. // https://html.spec.whatwg.org/multipage/parsing.html#markup-declaration-open-state
  14592. if (startsWith(s, '<!--')) {
  14593. node = parseComment(context);
  14594. }
  14595. else if (startsWith(s, '<!DOCTYPE')) {
  14596. // Ignore DOCTYPE by a limitation.
  14597. node = parseBogusComment(context);
  14598. }
  14599. else if (startsWith(s, '<![CDATA[')) {
  14600. if (ns !== 0 /* HTML */) {
  14601. node = parseCDATA(context, ancestors);
  14602. }
  14603. else {
  14604. emitError(context, 1 /* CDATA_IN_HTML_CONTENT */);
  14605. node = parseBogusComment(context);
  14606. }
  14607. }
  14608. else {
  14609. emitError(context, 11 /* INCORRECTLY_OPENED_COMMENT */);
  14610. node = parseBogusComment(context);
  14611. }
  14612. }
  14613. else if (s[1] === '/') {
  14614. // https://html.spec.whatwg.org/multipage/parsing.html#end-tag-open-state
  14615. if (s.length === 2) {
  14616. emitError(context, 5 /* EOF_BEFORE_TAG_NAME */, 2);
  14617. }
  14618. else if (s[2] === '>') {
  14619. emitError(context, 14 /* MISSING_END_TAG_NAME */, 2);
  14620. advanceBy(context, 3);
  14621. continue;
  14622. }
  14623. else if (/[a-z]/i.test(s[2])) {
  14624. emitError(context, 23 /* X_INVALID_END_TAG */);
  14625. parseTag(context, 1 /* End */, parent);
  14626. continue;
  14627. }
  14628. else {
  14629. emitError(context, 12 /* INVALID_FIRST_CHARACTER_OF_TAG_NAME */, 2);
  14630. node = parseBogusComment(context);
  14631. }
  14632. }
  14633. else if (/[a-z]/i.test(s[1])) {
  14634. node = parseElement(context, ancestors);
  14635. // 2.x <template> with no directive compat
  14636. if (isCompatEnabled("COMPILER_NATIVE_TEMPLATE" /* COMPILER_NATIVE_TEMPLATE */, context) &&
  14637. node &&
  14638. node.tag === 'template' &&
  14639. !node.props.some(p => p.type === 7 /* DIRECTIVE */ &&
  14640. isSpecialTemplateDirective(p.name))) {
  14641. (process.env.NODE_ENV !== 'production') &&
  14642. warnDeprecation("COMPILER_NATIVE_TEMPLATE" /* COMPILER_NATIVE_TEMPLATE */, context, node.loc);
  14643. node = node.children;
  14644. }
  14645. }
  14646. else if (s[1] === '?') {
  14647. emitError(context, 21 /* UNEXPECTED_QUESTION_MARK_INSTEAD_OF_TAG_NAME */, 1);
  14648. node = parseBogusComment(context);
  14649. }
  14650. else {
  14651. emitError(context, 12 /* INVALID_FIRST_CHARACTER_OF_TAG_NAME */, 1);
  14652. }
  14653. }
  14654. }
  14655. if (!node) {
  14656. node = parseText(context, mode);
  14657. }
  14658. if (isArray(node)) {
  14659. for (let i = 0; i < node.length; i++) {
  14660. pushNode(nodes, node[i]);
  14661. }
  14662. }
  14663. else {
  14664. pushNode(nodes, node);
  14665. }
  14666. }
  14667. // Whitespace handling strategy like v2
  14668. let removedWhitespace = false;
  14669. if (mode !== 2 /* RAWTEXT */ && mode !== 1 /* RCDATA */) {
  14670. const shouldCondense = context.options.whitespace !== 'preserve';
  14671. for (let i = 0; i < nodes.length; i++) {
  14672. const node = nodes[i];
  14673. if (!context.inPre && node.type === 2 /* TEXT */) {
  14674. if (!/[^\t\r\n\f ]/.test(node.content)) {
  14675. const prev = nodes[i - 1];
  14676. const next = nodes[i + 1];
  14677. // Remove if:
  14678. // - the whitespace is the first or last node, or:
  14679. // - (condense mode) the whitespace is adjacent to a comment, or:
  14680. // - (condense mode) the whitespace is between two elements AND contains newline
  14681. if (!prev ||
  14682. !next ||
  14683. (shouldCondense &&
  14684. (prev.type === 3 /* COMMENT */ ||
  14685. next.type === 3 /* COMMENT */ ||
  14686. (prev.type === 1 /* ELEMENT */ &&
  14687. next.type === 1 /* ELEMENT */ &&
  14688. /[\r\n]/.test(node.content))))) {
  14689. removedWhitespace = true;
  14690. nodes[i] = null;
  14691. }
  14692. else {
  14693. // Otherwise, the whitespace is condensed into a single space
  14694. node.content = ' ';
  14695. }
  14696. }
  14697. else if (shouldCondense) {
  14698. // in condense mode, consecutive whitespaces in text are condensed
  14699. // down to a single space.
  14700. node.content = node.content.replace(/[\t\r\n\f ]+/g, ' ');
  14701. }
  14702. }
  14703. // Remove comment nodes if desired by configuration.
  14704. else if (node.type === 3 /* COMMENT */ && !context.options.comments) {
  14705. removedWhitespace = true;
  14706. nodes[i] = null;
  14707. }
  14708. }
  14709. if (context.inPre && parent && context.options.isPreTag(parent.tag)) {
  14710. // remove leading newline per html spec
  14711. // https://html.spec.whatwg.org/multipage/grouping-content.html#the-pre-element
  14712. const first = nodes[0];
  14713. if (first && first.type === 2 /* TEXT */) {
  14714. first.content = first.content.replace(/^\r?\n/, '');
  14715. }
  14716. }
  14717. }
  14718. return removedWhitespace ? nodes.filter(Boolean) : nodes;
  14719. }
  14720. function pushNode(nodes, node) {
  14721. if (node.type === 2 /* TEXT */) {
  14722. const prev = last(nodes);
  14723. // Merge if both this and the previous node are text and those are
  14724. // consecutive. This happens for cases like "a < b".
  14725. if (prev &&
  14726. prev.type === 2 /* TEXT */ &&
  14727. prev.loc.end.offset === node.loc.start.offset) {
  14728. prev.content += node.content;
  14729. prev.loc.end = node.loc.end;
  14730. prev.loc.source += node.loc.source;
  14731. return;
  14732. }
  14733. }
  14734. nodes.push(node);
  14735. }
  14736. function parseCDATA(context, ancestors) {
  14737. advanceBy(context, 9);
  14738. const nodes = parseChildren(context, 3 /* CDATA */, ancestors);
  14739. if (context.source.length === 0) {
  14740. emitError(context, 6 /* EOF_IN_CDATA */);
  14741. }
  14742. else {
  14743. advanceBy(context, 3);
  14744. }
  14745. return nodes;
  14746. }
  14747. function parseComment(context) {
  14748. const start = getCursor(context);
  14749. let content;
  14750. // Regular comment.
  14751. const match = /--(\!)?>/.exec(context.source);
  14752. if (!match) {
  14753. content = context.source.slice(4);
  14754. advanceBy(context, context.source.length);
  14755. emitError(context, 7 /* EOF_IN_COMMENT */);
  14756. }
  14757. else {
  14758. if (match.index <= 3) {
  14759. emitError(context, 0 /* ABRUPT_CLOSING_OF_EMPTY_COMMENT */);
  14760. }
  14761. if (match[1]) {
  14762. emitError(context, 10 /* INCORRECTLY_CLOSED_COMMENT */);
  14763. }
  14764. content = context.source.slice(4, match.index);
  14765. // Advancing with reporting nested comments.
  14766. const s = context.source.slice(0, match.index);
  14767. let prevIndex = 1, nestedIndex = 0;
  14768. while ((nestedIndex = s.indexOf('<!--', prevIndex)) !== -1) {
  14769. advanceBy(context, nestedIndex - prevIndex + 1);
  14770. if (nestedIndex + 4 < s.length) {
  14771. emitError(context, 16 /* NESTED_COMMENT */);
  14772. }
  14773. prevIndex = nestedIndex + 1;
  14774. }
  14775. advanceBy(context, match.index + match[0].length - prevIndex + 1);
  14776. }
  14777. return {
  14778. type: 3 /* COMMENT */,
  14779. content,
  14780. loc: getSelection(context, start)
  14781. };
  14782. }
  14783. function parseBogusComment(context) {
  14784. const start = getCursor(context);
  14785. const contentStart = context.source[1] === '?' ? 1 : 2;
  14786. let content;
  14787. const closeIndex = context.source.indexOf('>');
  14788. if (closeIndex === -1) {
  14789. content = context.source.slice(contentStart);
  14790. advanceBy(context, context.source.length);
  14791. }
  14792. else {
  14793. content = context.source.slice(contentStart, closeIndex);
  14794. advanceBy(context, closeIndex + 1);
  14795. }
  14796. return {
  14797. type: 3 /* COMMENT */,
  14798. content,
  14799. loc: getSelection(context, start)
  14800. };
  14801. }
  14802. function parseElement(context, ancestors) {
  14803. // Start tag.
  14804. const wasInPre = context.inPre;
  14805. const wasInVPre = context.inVPre;
  14806. const parent = last(ancestors);
  14807. const element = parseTag(context, 0 /* Start */, parent);
  14808. const isPreBoundary = context.inPre && !wasInPre;
  14809. const isVPreBoundary = context.inVPre && !wasInVPre;
  14810. if (element.isSelfClosing || context.options.isVoidTag(element.tag)) {
  14811. // #4030 self-closing <pre> tag
  14812. if (isPreBoundary) {
  14813. context.inPre = false;
  14814. }
  14815. if (isVPreBoundary) {
  14816. context.inVPre = false;
  14817. }
  14818. return element;
  14819. }
  14820. // Children.
  14821. ancestors.push(element);
  14822. const mode = context.options.getTextMode(element, parent);
  14823. const children = parseChildren(context, mode, ancestors);
  14824. ancestors.pop();
  14825. // 2.x inline-template compat
  14826. {
  14827. const inlineTemplateProp = element.props.find(p => p.type === 6 /* ATTRIBUTE */ && p.name === 'inline-template');
  14828. if (inlineTemplateProp &&
  14829. checkCompatEnabled("COMPILER_INLINE_TEMPLATE" /* COMPILER_INLINE_TEMPLATE */, context, inlineTemplateProp.loc)) {
  14830. const loc = getSelection(context, element.loc.end);
  14831. inlineTemplateProp.value = {
  14832. type: 2 /* TEXT */,
  14833. content: loc.source,
  14834. loc
  14835. };
  14836. }
  14837. }
  14838. element.children = children;
  14839. // End tag.
  14840. if (startsWithEndTagOpen(context.source, element.tag)) {
  14841. parseTag(context, 1 /* End */, parent);
  14842. }
  14843. else {
  14844. emitError(context, 24 /* X_MISSING_END_TAG */, 0, element.loc.start);
  14845. if (context.source.length === 0 && element.tag.toLowerCase() === 'script') {
  14846. const first = children[0];
  14847. if (first && startsWith(first.loc.source, '<!--')) {
  14848. emitError(context, 8 /* EOF_IN_SCRIPT_HTML_COMMENT_LIKE_TEXT */);
  14849. }
  14850. }
  14851. }
  14852. element.loc = getSelection(context, element.loc.start);
  14853. if (isPreBoundary) {
  14854. context.inPre = false;
  14855. }
  14856. if (isVPreBoundary) {
  14857. context.inVPre = false;
  14858. }
  14859. return element;
  14860. }
  14861. const isSpecialTemplateDirective = /*#__PURE__*/ makeMap(`if,else,else-if,for,slot`);
  14862. function parseTag(context, type, parent) {
  14863. // Tag open.
  14864. const start = getCursor(context);
  14865. const match = /^<\/?([a-z][^\t\r\n\f />]*)/i.exec(context.source);
  14866. const tag = match[1];
  14867. const ns = context.options.getNamespace(tag, parent);
  14868. advanceBy(context, match[0].length);
  14869. advanceSpaces(context);
  14870. // save current state in case we need to re-parse attributes with v-pre
  14871. const cursor = getCursor(context);
  14872. const currentSource = context.source;
  14873. // check <pre> tag
  14874. if (context.options.isPreTag(tag)) {
  14875. context.inPre = true;
  14876. }
  14877. // Attributes.
  14878. let props = parseAttributes(context, type);
  14879. // check v-pre
  14880. if (type === 0 /* Start */ &&
  14881. !context.inVPre &&
  14882. props.some(p => p.type === 7 /* DIRECTIVE */ && p.name === 'pre')) {
  14883. context.inVPre = true;
  14884. // reset context
  14885. extend(context, cursor);
  14886. context.source = currentSource;
  14887. // re-parse attrs and filter out v-pre itself
  14888. props = parseAttributes(context, type).filter(p => p.name !== 'v-pre');
  14889. }
  14890. // Tag close.
  14891. let isSelfClosing = false;
  14892. if (context.source.length === 0) {
  14893. emitError(context, 9 /* EOF_IN_TAG */);
  14894. }
  14895. else {
  14896. isSelfClosing = startsWith(context.source, '/>');
  14897. if (type === 1 /* End */ && isSelfClosing) {
  14898. emitError(context, 4 /* END_TAG_WITH_TRAILING_SOLIDUS */);
  14899. }
  14900. advanceBy(context, isSelfClosing ? 2 : 1);
  14901. }
  14902. if (type === 1 /* End */) {
  14903. return;
  14904. }
  14905. // 2.x deprecation checks
  14906. if ((process.env.NODE_ENV !== 'production') &&
  14907. isCompatEnabled("COMPILER_V_IF_V_FOR_PRECEDENCE" /* COMPILER_V_IF_V_FOR_PRECEDENCE */, context)) {
  14908. let hasIf = false;
  14909. let hasFor = false;
  14910. for (let i = 0; i < props.length; i++) {
  14911. const p = props[i];
  14912. if (p.type === 7 /* DIRECTIVE */) {
  14913. if (p.name === 'if') {
  14914. hasIf = true;
  14915. }
  14916. else if (p.name === 'for') {
  14917. hasFor = true;
  14918. }
  14919. }
  14920. if (hasIf && hasFor) {
  14921. warnDeprecation("COMPILER_V_IF_V_FOR_PRECEDENCE" /* COMPILER_V_IF_V_FOR_PRECEDENCE */, context, getSelection(context, start));
  14922. }
  14923. }
  14924. }
  14925. let tagType = 0 /* ELEMENT */;
  14926. if (!context.inVPre) {
  14927. if (tag === 'slot') {
  14928. tagType = 2 /* SLOT */;
  14929. }
  14930. else if (tag === 'template') {
  14931. if (props.some(p => p.type === 7 /* DIRECTIVE */ && isSpecialTemplateDirective(p.name))) {
  14932. tagType = 3 /* TEMPLATE */;
  14933. }
  14934. }
  14935. else if (isComponent(tag, props, context)) {
  14936. tagType = 1 /* COMPONENT */;
  14937. }
  14938. }
  14939. return {
  14940. type: 1 /* ELEMENT */,
  14941. ns,
  14942. tag,
  14943. tagType,
  14944. props,
  14945. isSelfClosing,
  14946. children: [],
  14947. loc: getSelection(context, start),
  14948. codegenNode: undefined // to be created during transform phase
  14949. };
  14950. }
  14951. function isComponent(tag, props, context) {
  14952. const options = context.options;
  14953. if (options.isCustomElement(tag)) {
  14954. return false;
  14955. }
  14956. if (tag === 'component' ||
  14957. /^[A-Z]/.test(tag) ||
  14958. isCoreComponent(tag) ||
  14959. (options.isBuiltInComponent && options.isBuiltInComponent(tag)) ||
  14960. (options.isNativeTag && !options.isNativeTag(tag))) {
  14961. return true;
  14962. }
  14963. // at this point the tag should be a native tag, but check for potential "is"
  14964. // casting
  14965. for (let i = 0; i < props.length; i++) {
  14966. const p = props[i];
  14967. if (p.type === 6 /* ATTRIBUTE */) {
  14968. if (p.name === 'is' && p.value) {
  14969. if (p.value.content.startsWith('vue:')) {
  14970. return true;
  14971. }
  14972. else if (checkCompatEnabled("COMPILER_IS_ON_ELEMENT" /* COMPILER_IS_ON_ELEMENT */, context, p.loc)) {
  14973. return true;
  14974. }
  14975. }
  14976. }
  14977. else {
  14978. // directive
  14979. // v-is (TODO Deprecate)
  14980. if (p.name === 'is') {
  14981. return true;
  14982. }
  14983. else if (
  14984. // :is on plain element - only treat as component in compat mode
  14985. p.name === 'bind' &&
  14986. isBindKey(p.arg, 'is') &&
  14987. true &&
  14988. checkCompatEnabled("COMPILER_IS_ON_ELEMENT" /* COMPILER_IS_ON_ELEMENT */, context, p.loc)) {
  14989. return true;
  14990. }
  14991. }
  14992. }
  14993. }
  14994. function parseAttributes(context, type) {
  14995. const props = [];
  14996. const attributeNames = new Set();
  14997. while (context.source.length > 0 &&
  14998. !startsWith(context.source, '>') &&
  14999. !startsWith(context.source, '/>')) {
  15000. if (startsWith(context.source, '/')) {
  15001. emitError(context, 22 /* UNEXPECTED_SOLIDUS_IN_TAG */);
  15002. advanceBy(context, 1);
  15003. advanceSpaces(context);
  15004. continue;
  15005. }
  15006. if (type === 1 /* End */) {
  15007. emitError(context, 3 /* END_TAG_WITH_ATTRIBUTES */);
  15008. }
  15009. const attr = parseAttribute(context, attributeNames);
  15010. if (type === 0 /* Start */) {
  15011. props.push(attr);
  15012. }
  15013. if (/^[^\t\r\n\f />]/.test(context.source)) {
  15014. emitError(context, 15 /* MISSING_WHITESPACE_BETWEEN_ATTRIBUTES */);
  15015. }
  15016. advanceSpaces(context);
  15017. }
  15018. return props;
  15019. }
  15020. function parseAttribute(context, nameSet) {
  15021. // Name.
  15022. const start = getCursor(context);
  15023. const match = /^[^\t\r\n\f />][^\t\r\n\f />=]*/.exec(context.source);
  15024. const name = match[0];
  15025. if (nameSet.has(name)) {
  15026. emitError(context, 2 /* DUPLICATE_ATTRIBUTE */);
  15027. }
  15028. nameSet.add(name);
  15029. if (name[0] === '=') {
  15030. emitError(context, 19 /* UNEXPECTED_EQUALS_SIGN_BEFORE_ATTRIBUTE_NAME */);
  15031. }
  15032. {
  15033. const pattern = /["'<]/g;
  15034. let m;
  15035. while ((m = pattern.exec(name))) {
  15036. emitError(context, 17 /* UNEXPECTED_CHARACTER_IN_ATTRIBUTE_NAME */, m.index);
  15037. }
  15038. }
  15039. advanceBy(context, name.length);
  15040. // Value
  15041. let value = undefined;
  15042. if (/^[\t\r\n\f ]*=/.test(context.source)) {
  15043. advanceSpaces(context);
  15044. advanceBy(context, 1);
  15045. advanceSpaces(context);
  15046. value = parseAttributeValue(context);
  15047. if (!value) {
  15048. emitError(context, 13 /* MISSING_ATTRIBUTE_VALUE */);
  15049. }
  15050. }
  15051. const loc = getSelection(context, start);
  15052. if (!context.inVPre && /^(v-|:|\.|@|#)/.test(name)) {
  15053. const match = /(?:^v-([a-z0-9-]+))?(?:(?::|^\.|^@|^#)(\[[^\]]+\]|[^\.]+))?(.+)?$/i.exec(name);
  15054. let isPropShorthand = startsWith(name, '.');
  15055. let dirName = match[1] ||
  15056. (isPropShorthand || startsWith(name, ':')
  15057. ? 'bind'
  15058. : startsWith(name, '@')
  15059. ? 'on'
  15060. : 'slot');
  15061. let arg;
  15062. if (match[2]) {
  15063. const isSlot = dirName === 'slot';
  15064. const startOffset = name.lastIndexOf(match[2]);
  15065. const loc = getSelection(context, getNewPosition(context, start, startOffset), getNewPosition(context, start, startOffset + match[2].length + ((isSlot && match[3]) || '').length));
  15066. let content = match[2];
  15067. let isStatic = true;
  15068. if (content.startsWith('[')) {
  15069. isStatic = false;
  15070. if (!content.endsWith(']')) {
  15071. emitError(context, 26 /* X_MISSING_DYNAMIC_DIRECTIVE_ARGUMENT_END */);
  15072. }
  15073. content = content.substr(1, content.length - 2);
  15074. }
  15075. else if (isSlot) {
  15076. // #1241 special case for v-slot: vuetify relies extensively on slot
  15077. // names containing dots. v-slot doesn't have any modifiers and Vue 2.x
  15078. // supports such usage so we are keeping it consistent with 2.x.
  15079. content += match[3] || '';
  15080. }
  15081. arg = {
  15082. type: 4 /* SIMPLE_EXPRESSION */,
  15083. content,
  15084. isStatic,
  15085. constType: isStatic
  15086. ? 3 /* CAN_STRINGIFY */
  15087. : 0 /* NOT_CONSTANT */,
  15088. loc
  15089. };
  15090. }
  15091. if (value && value.isQuoted) {
  15092. const valueLoc = value.loc;
  15093. valueLoc.start.offset++;
  15094. valueLoc.start.column++;
  15095. valueLoc.end = advancePositionWithClone(valueLoc.start, value.content);
  15096. valueLoc.source = valueLoc.source.slice(1, -1);
  15097. }
  15098. const modifiers = match[3] ? match[3].substr(1).split('.') : [];
  15099. if (isPropShorthand)
  15100. modifiers.push('prop');
  15101. // 2.x compat v-bind:foo.sync -> v-model:foo
  15102. if (dirName === 'bind' && arg) {
  15103. if (modifiers.includes('sync') &&
  15104. checkCompatEnabled("COMPILER_V_BIND_SYNC" /* COMPILER_V_BIND_SYNC */, context, loc, arg.loc.source)) {
  15105. dirName = 'model';
  15106. modifiers.splice(modifiers.indexOf('sync'), 1);
  15107. }
  15108. if ((process.env.NODE_ENV !== 'production') && modifiers.includes('prop')) {
  15109. checkCompatEnabled("COMPILER_V_BIND_PROP" /* COMPILER_V_BIND_PROP */, context, loc);
  15110. }
  15111. }
  15112. return {
  15113. type: 7 /* DIRECTIVE */,
  15114. name: dirName,
  15115. exp: value && {
  15116. type: 4 /* SIMPLE_EXPRESSION */,
  15117. content: value.content,
  15118. isStatic: false,
  15119. // Treat as non-constant by default. This can be potentially set to
  15120. // other values by `transformExpression` to make it eligible for hoisting.
  15121. constType: 0 /* NOT_CONSTANT */,
  15122. loc: value.loc
  15123. },
  15124. arg,
  15125. modifiers,
  15126. loc
  15127. };
  15128. }
  15129. return {
  15130. type: 6 /* ATTRIBUTE */,
  15131. name,
  15132. value: value && {
  15133. type: 2 /* TEXT */,
  15134. content: value.content,
  15135. loc: value.loc
  15136. },
  15137. loc
  15138. };
  15139. }
  15140. function parseAttributeValue(context) {
  15141. const start = getCursor(context);
  15142. let content;
  15143. const quote = context.source[0];
  15144. const isQuoted = quote === `"` || quote === `'`;
  15145. if (isQuoted) {
  15146. // Quoted value.
  15147. advanceBy(context, 1);
  15148. const endIndex = context.source.indexOf(quote);
  15149. if (endIndex === -1) {
  15150. content = parseTextData(context, context.source.length, 4 /* ATTRIBUTE_VALUE */);
  15151. }
  15152. else {
  15153. content = parseTextData(context, endIndex, 4 /* ATTRIBUTE_VALUE */);
  15154. advanceBy(context, 1);
  15155. }
  15156. }
  15157. else {
  15158. // Unquoted
  15159. const match = /^[^\t\r\n\f >]+/.exec(context.source);
  15160. if (!match) {
  15161. return undefined;
  15162. }
  15163. const unexpectedChars = /["'<=`]/g;
  15164. let m;
  15165. while ((m = unexpectedChars.exec(match[0]))) {
  15166. emitError(context, 18 /* UNEXPECTED_CHARACTER_IN_UNQUOTED_ATTRIBUTE_VALUE */, m.index);
  15167. }
  15168. content = parseTextData(context, match[0].length, 4 /* ATTRIBUTE_VALUE */);
  15169. }
  15170. return { content, isQuoted, loc: getSelection(context, start) };
  15171. }
  15172. function parseInterpolation(context, mode) {
  15173. const [open, close] = context.options.delimiters;
  15174. const closeIndex = context.source.indexOf(close, open.length);
  15175. if (closeIndex === -1) {
  15176. emitError(context, 25 /* X_MISSING_INTERPOLATION_END */);
  15177. return undefined;
  15178. }
  15179. const start = getCursor(context);
  15180. advanceBy(context, open.length);
  15181. const innerStart = getCursor(context);
  15182. const innerEnd = getCursor(context);
  15183. const rawContentLength = closeIndex - open.length;
  15184. const rawContent = context.source.slice(0, rawContentLength);
  15185. const preTrimContent = parseTextData(context, rawContentLength, mode);
  15186. const content = preTrimContent.trim();
  15187. const startOffset = preTrimContent.indexOf(content);
  15188. if (startOffset > 0) {
  15189. advancePositionWithMutation(innerStart, rawContent, startOffset);
  15190. }
  15191. const endOffset = rawContentLength - (preTrimContent.length - content.length - startOffset);
  15192. advancePositionWithMutation(innerEnd, rawContent, endOffset);
  15193. advanceBy(context, close.length);
  15194. return {
  15195. type: 5 /* INTERPOLATION */,
  15196. content: {
  15197. type: 4 /* SIMPLE_EXPRESSION */,
  15198. isStatic: false,
  15199. // Set `isConstant` to false by default and will decide in transformExpression
  15200. constType: 0 /* NOT_CONSTANT */,
  15201. content,
  15202. loc: getSelection(context, innerStart, innerEnd)
  15203. },
  15204. loc: getSelection(context, start)
  15205. };
  15206. }
  15207. function parseText(context, mode) {
  15208. const endTokens = ['<', context.options.delimiters[0]];
  15209. if (mode === 3 /* CDATA */) {
  15210. endTokens.push(']]>');
  15211. }
  15212. let endIndex = context.source.length;
  15213. for (let i = 0; i < endTokens.length; i++) {
  15214. const index = context.source.indexOf(endTokens[i], 1);
  15215. if (index !== -1 && endIndex > index) {
  15216. endIndex = index;
  15217. }
  15218. }
  15219. const start = getCursor(context);
  15220. const content = parseTextData(context, endIndex, mode);
  15221. return {
  15222. type: 2 /* TEXT */,
  15223. content,
  15224. loc: getSelection(context, start)
  15225. };
  15226. }
  15227. /**
  15228. * Get text data with a given length from the current location.
  15229. * This translates HTML entities in the text data.
  15230. */
  15231. function parseTextData(context, length, mode) {
  15232. const rawText = context.source.slice(0, length);
  15233. advanceBy(context, length);
  15234. if (mode === 2 /* RAWTEXT */ ||
  15235. mode === 3 /* CDATA */ ||
  15236. rawText.indexOf('&') === -1) {
  15237. return rawText;
  15238. }
  15239. else {
  15240. // DATA or RCDATA containing "&"". Entity decoding required.
  15241. return context.options.decodeEntities(rawText, mode === 4 /* ATTRIBUTE_VALUE */);
  15242. }
  15243. }
  15244. function getCursor(context) {
  15245. const { column, line, offset } = context;
  15246. return { column, line, offset };
  15247. }
  15248. function getSelection(context, start, end) {
  15249. end = end || getCursor(context);
  15250. return {
  15251. start,
  15252. end,
  15253. source: context.originalSource.slice(start.offset, end.offset)
  15254. };
  15255. }
  15256. function last(xs) {
  15257. return xs[xs.length - 1];
  15258. }
  15259. function startsWith(source, searchString) {
  15260. return source.startsWith(searchString);
  15261. }
  15262. function advanceBy(context, numberOfCharacters) {
  15263. const { source } = context;
  15264. advancePositionWithMutation(context, source, numberOfCharacters);
  15265. context.source = source.slice(numberOfCharacters);
  15266. }
  15267. function advanceSpaces(context) {
  15268. const match = /^[\t\r\n\f ]+/.exec(context.source);
  15269. if (match) {
  15270. advanceBy(context, match[0].length);
  15271. }
  15272. }
  15273. function getNewPosition(context, start, numberOfCharacters) {
  15274. return advancePositionWithClone(start, context.originalSource.slice(start.offset, numberOfCharacters), numberOfCharacters);
  15275. }
  15276. function emitError(context, code, offset, loc = getCursor(context)) {
  15277. if (offset) {
  15278. loc.offset += offset;
  15279. loc.column += offset;
  15280. }
  15281. context.options.onError(createCompilerError(code, {
  15282. start: loc,
  15283. end: loc,
  15284. source: ''
  15285. }));
  15286. }
  15287. function isEnd(context, mode, ancestors) {
  15288. const s = context.source;
  15289. switch (mode) {
  15290. case 0 /* DATA */:
  15291. if (startsWith(s, '</')) {
  15292. // TODO: probably bad performance
  15293. for (let i = ancestors.length - 1; i >= 0; --i) {
  15294. if (startsWithEndTagOpen(s, ancestors[i].tag)) {
  15295. return true;
  15296. }
  15297. }
  15298. }
  15299. break;
  15300. case 1 /* RCDATA */:
  15301. case 2 /* RAWTEXT */: {
  15302. const parent = last(ancestors);
  15303. if (parent && startsWithEndTagOpen(s, parent.tag)) {
  15304. return true;
  15305. }
  15306. break;
  15307. }
  15308. case 3 /* CDATA */:
  15309. if (startsWith(s, ']]>')) {
  15310. return true;
  15311. }
  15312. break;
  15313. }
  15314. return !s;
  15315. }
  15316. function startsWithEndTagOpen(source, tag) {
  15317. return (startsWith(source, '</') &&
  15318. source.substr(2, tag.length).toLowerCase() === tag.toLowerCase() &&
  15319. /[\t\r\n\f />]/.test(source[2 + tag.length] || '>'));
  15320. }
  15321. function hoistStatic(root, context) {
  15322. walk(root, context,
  15323. // Root node is unfortunately non-hoistable due to potential parent
  15324. // fallthrough attributes.
  15325. isSingleElementRoot(root, root.children[0]));
  15326. }
  15327. function isSingleElementRoot(root, child) {
  15328. const { children } = root;
  15329. return (children.length === 1 &&
  15330. child.type === 1 /* ELEMENT */ &&
  15331. !isSlotOutlet(child));
  15332. }
  15333. function walk(node, context, doNotHoistNode = false) {
  15334. // Some transforms, e.g. transformAssetUrls from @vue/compiler-sfc, replaces
  15335. // static bindings with expressions. These expressions are guaranteed to be
  15336. // constant so they are still eligible for hoisting, but they are only
  15337. // available at runtime and therefore cannot be evaluated ahead of time.
  15338. // This is only a concern for pre-stringification (via transformHoist by
  15339. // @vue/compiler-dom), but doing it here allows us to perform only one full
  15340. // walk of the AST and allow `stringifyStatic` to stop walking as soon as its
  15341. // stringficiation threshold is met.
  15342. let canStringify = true;
  15343. const { children } = node;
  15344. const originalCount = children.length;
  15345. let hoistedCount = 0;
  15346. for (let i = 0; i < children.length; i++) {
  15347. const child = children[i];
  15348. // only plain elements & text calls are eligible for hoisting.
  15349. if (child.type === 1 /* ELEMENT */ &&
  15350. child.tagType === 0 /* ELEMENT */) {
  15351. const constantType = doNotHoistNode
  15352. ? 0 /* NOT_CONSTANT */
  15353. : getConstantType(child, context);
  15354. if (constantType > 0 /* NOT_CONSTANT */) {
  15355. if (constantType < 3 /* CAN_STRINGIFY */) {
  15356. canStringify = false;
  15357. }
  15358. if (constantType >= 2 /* CAN_HOIST */) {
  15359. child.codegenNode.patchFlag =
  15360. -1 /* HOISTED */ + ((process.env.NODE_ENV !== 'production') ? ` /* HOISTED */` : ``);
  15361. child.codegenNode = context.hoist(child.codegenNode);
  15362. hoistedCount++;
  15363. continue;
  15364. }
  15365. }
  15366. else {
  15367. // node may contain dynamic children, but its props may be eligible for
  15368. // hoisting.
  15369. const codegenNode = child.codegenNode;
  15370. if (codegenNode.type === 13 /* VNODE_CALL */) {
  15371. const flag = getPatchFlag(codegenNode);
  15372. if ((!flag ||
  15373. flag === 512 /* NEED_PATCH */ ||
  15374. flag === 1 /* TEXT */) &&
  15375. getGeneratedPropsConstantType(child, context) >=
  15376. 2 /* CAN_HOIST */) {
  15377. const props = getNodeProps(child);
  15378. if (props) {
  15379. codegenNode.props = context.hoist(props);
  15380. }
  15381. }
  15382. if (codegenNode.dynamicProps) {
  15383. codegenNode.dynamicProps = context.hoist(codegenNode.dynamicProps);
  15384. }
  15385. }
  15386. }
  15387. }
  15388. else if (child.type === 12 /* TEXT_CALL */) {
  15389. const contentType = getConstantType(child.content, context);
  15390. if (contentType > 0) {
  15391. if (contentType < 3 /* CAN_STRINGIFY */) {
  15392. canStringify = false;
  15393. }
  15394. if (contentType >= 2 /* CAN_HOIST */) {
  15395. child.codegenNode = context.hoist(child.codegenNode);
  15396. hoistedCount++;
  15397. }
  15398. }
  15399. }
  15400. // walk further
  15401. if (child.type === 1 /* ELEMENT */) {
  15402. const isComponent = child.tagType === 1 /* COMPONENT */;
  15403. if (isComponent) {
  15404. context.scopes.vSlot++;
  15405. }
  15406. walk(child, context);
  15407. if (isComponent) {
  15408. context.scopes.vSlot--;
  15409. }
  15410. }
  15411. else if (child.type === 11 /* FOR */) {
  15412. // Do not hoist v-for single child because it has to be a block
  15413. walk(child, context, child.children.length === 1);
  15414. }
  15415. else if (child.type === 9 /* IF */) {
  15416. for (let i = 0; i < child.branches.length; i++) {
  15417. // Do not hoist v-if single child because it has to be a block
  15418. walk(child.branches[i], context, child.branches[i].children.length === 1);
  15419. }
  15420. }
  15421. }
  15422. if (canStringify && hoistedCount && context.transformHoist) {
  15423. context.transformHoist(children, context, node);
  15424. }
  15425. // all children were hoisted - the entire children array is hoistable.
  15426. if (hoistedCount &&
  15427. hoistedCount === originalCount &&
  15428. node.type === 1 /* ELEMENT */ &&
  15429. node.tagType === 0 /* ELEMENT */ &&
  15430. node.codegenNode &&
  15431. node.codegenNode.type === 13 /* VNODE_CALL */ &&
  15432. isArray(node.codegenNode.children)) {
  15433. node.codegenNode.children = context.hoist(createArrayExpression(node.codegenNode.children));
  15434. }
  15435. }
  15436. function getConstantType(node, context) {
  15437. const { constantCache } = context;
  15438. switch (node.type) {
  15439. case 1 /* ELEMENT */:
  15440. if (node.tagType !== 0 /* ELEMENT */) {
  15441. return 0 /* NOT_CONSTANT */;
  15442. }
  15443. const cached = constantCache.get(node);
  15444. if (cached !== undefined) {
  15445. return cached;
  15446. }
  15447. const codegenNode = node.codegenNode;
  15448. if (codegenNode.type !== 13 /* VNODE_CALL */) {
  15449. return 0 /* NOT_CONSTANT */;
  15450. }
  15451. const flag = getPatchFlag(codegenNode);
  15452. if (!flag) {
  15453. let returnType = 3 /* CAN_STRINGIFY */;
  15454. // Element itself has no patch flag. However we still need to check:
  15455. // 1. Even for a node with no patch flag, it is possible for it to contain
  15456. // non-hoistable expressions that refers to scope variables, e.g. compiler
  15457. // injected keys or cached event handlers. Therefore we need to always
  15458. // check the codegenNode's props to be sure.
  15459. const generatedPropsType = getGeneratedPropsConstantType(node, context);
  15460. if (generatedPropsType === 0 /* NOT_CONSTANT */) {
  15461. constantCache.set(node, 0 /* NOT_CONSTANT */);
  15462. return 0 /* NOT_CONSTANT */;
  15463. }
  15464. if (generatedPropsType < returnType) {
  15465. returnType = generatedPropsType;
  15466. }
  15467. // 2. its children.
  15468. for (let i = 0; i < node.children.length; i++) {
  15469. const childType = getConstantType(node.children[i], context);
  15470. if (childType === 0 /* NOT_CONSTANT */) {
  15471. constantCache.set(node, 0 /* NOT_CONSTANT */);
  15472. return 0 /* NOT_CONSTANT */;
  15473. }
  15474. if (childType < returnType) {
  15475. returnType = childType;
  15476. }
  15477. }
  15478. // 3. if the type is not already CAN_SKIP_PATCH which is the lowest non-0
  15479. // type, check if any of the props can cause the type to be lowered
  15480. // we can skip can_patch because it's guaranteed by the absence of a
  15481. // patchFlag.
  15482. if (returnType > 1 /* CAN_SKIP_PATCH */) {
  15483. for (let i = 0; i < node.props.length; i++) {
  15484. const p = node.props[i];
  15485. if (p.type === 7 /* DIRECTIVE */ && p.name === 'bind' && p.exp) {
  15486. const expType = getConstantType(p.exp, context);
  15487. if (expType === 0 /* NOT_CONSTANT */) {
  15488. constantCache.set(node, 0 /* NOT_CONSTANT */);
  15489. return 0 /* NOT_CONSTANT */;
  15490. }
  15491. if (expType < returnType) {
  15492. returnType = expType;
  15493. }
  15494. }
  15495. }
  15496. }
  15497. // only svg/foreignObject could be block here, however if they are
  15498. // static then they don't need to be blocks since there will be no
  15499. // nested updates.
  15500. if (codegenNode.isBlock) {
  15501. context.removeHelper(OPEN_BLOCK);
  15502. context.removeHelper(getVNodeBlockHelper(context.inSSR, codegenNode.isComponent));
  15503. codegenNode.isBlock = false;
  15504. context.helper(getVNodeHelper(context.inSSR, codegenNode.isComponent));
  15505. }
  15506. constantCache.set(node, returnType);
  15507. return returnType;
  15508. }
  15509. else {
  15510. constantCache.set(node, 0 /* NOT_CONSTANT */);
  15511. return 0 /* NOT_CONSTANT */;
  15512. }
  15513. case 2 /* TEXT */:
  15514. case 3 /* COMMENT */:
  15515. return 3 /* CAN_STRINGIFY */;
  15516. case 9 /* IF */:
  15517. case 11 /* FOR */:
  15518. case 10 /* IF_BRANCH */:
  15519. return 0 /* NOT_CONSTANT */;
  15520. case 5 /* INTERPOLATION */:
  15521. case 12 /* TEXT_CALL */:
  15522. return getConstantType(node.content, context);
  15523. case 4 /* SIMPLE_EXPRESSION */:
  15524. return node.constType;
  15525. case 8 /* COMPOUND_EXPRESSION */:
  15526. let returnType = 3 /* CAN_STRINGIFY */;
  15527. for (let i = 0; i < node.children.length; i++) {
  15528. const child = node.children[i];
  15529. if (isString(child) || isSymbol(child)) {
  15530. continue;
  15531. }
  15532. const childType = getConstantType(child, context);
  15533. if (childType === 0 /* NOT_CONSTANT */) {
  15534. return 0 /* NOT_CONSTANT */;
  15535. }
  15536. else if (childType < returnType) {
  15537. returnType = childType;
  15538. }
  15539. }
  15540. return returnType;
  15541. default:
  15542. if ((process.env.NODE_ENV !== 'production')) ;
  15543. return 0 /* NOT_CONSTANT */;
  15544. }
  15545. }
  15546. const allowHoistedHelperSet = new Set([
  15547. NORMALIZE_CLASS,
  15548. NORMALIZE_STYLE,
  15549. NORMALIZE_PROPS,
  15550. GUARD_REACTIVE_PROPS
  15551. ]);
  15552. function getConstantTypeOfHelperCall(value, context) {
  15553. if (value.type === 14 /* JS_CALL_EXPRESSION */ &&
  15554. !isString(value.callee) &&
  15555. allowHoistedHelperSet.has(value.callee)) {
  15556. const arg = value.arguments[0];
  15557. if (arg.type === 4 /* SIMPLE_EXPRESSION */) {
  15558. return getConstantType(arg, context);
  15559. }
  15560. else if (arg.type === 14 /* JS_CALL_EXPRESSION */) {
  15561. // in the case of nested helper call, e.g. `normalizeProps(guardReactiveProps(exp))`
  15562. return getConstantTypeOfHelperCall(arg, context);
  15563. }
  15564. }
  15565. return 0 /* NOT_CONSTANT */;
  15566. }
  15567. function getGeneratedPropsConstantType(node, context) {
  15568. let returnType = 3 /* CAN_STRINGIFY */;
  15569. const props = getNodeProps(node);
  15570. if (props && props.type === 15 /* JS_OBJECT_EXPRESSION */) {
  15571. const { properties } = props;
  15572. for (let i = 0; i < properties.length; i++) {
  15573. const { key, value } = properties[i];
  15574. const keyType = getConstantType(key, context);
  15575. if (keyType === 0 /* NOT_CONSTANT */) {
  15576. return keyType;
  15577. }
  15578. if (keyType < returnType) {
  15579. returnType = keyType;
  15580. }
  15581. let valueType;
  15582. if (value.type === 4 /* SIMPLE_EXPRESSION */) {
  15583. valueType = getConstantType(value, context);
  15584. }
  15585. else if (value.type === 14 /* JS_CALL_EXPRESSION */) {
  15586. // some helper calls can be hoisted,
  15587. // such as the `normalizeProps` generated by the compiler for pre-normalize class,
  15588. // in this case we need to respect the ConstanType of the helper's argments
  15589. valueType = getConstantTypeOfHelperCall(value, context);
  15590. }
  15591. else {
  15592. valueType = 0 /* NOT_CONSTANT */;
  15593. }
  15594. if (valueType === 0 /* NOT_CONSTANT */) {
  15595. return valueType;
  15596. }
  15597. if (valueType < returnType) {
  15598. returnType = valueType;
  15599. }
  15600. }
  15601. }
  15602. return returnType;
  15603. }
  15604. function getNodeProps(node) {
  15605. const codegenNode = node.codegenNode;
  15606. if (codegenNode.type === 13 /* VNODE_CALL */) {
  15607. return codegenNode.props;
  15608. }
  15609. }
  15610. function getPatchFlag(node) {
  15611. const flag = node.patchFlag;
  15612. return flag ? parseInt(flag, 10) : undefined;
  15613. }
  15614. function createTransformContext(root, { filename = '', prefixIdentifiers = false, hoistStatic = false, cacheHandlers = false, nodeTransforms = [], directiveTransforms = {}, transformHoist = null, isBuiltInComponent = NOOP, isCustomElement = NOOP, expressionPlugins = [], scopeId = null, slotted = true, ssr = false, inSSR = false, ssrCssVars = ``, bindingMetadata = EMPTY_OBJ, inline = false, isTS = false, onError = defaultOnError, onWarn = defaultOnWarn, compatConfig }) {
  15615. const nameMatch = filename.replace(/\?.*$/, '').match(/([^/\\]+)\.\w+$/);
  15616. const context = {
  15617. // options
  15618. selfName: nameMatch && capitalize(camelize$1(nameMatch[1])),
  15619. prefixIdentifiers,
  15620. hoistStatic,
  15621. cacheHandlers,
  15622. nodeTransforms,
  15623. directiveTransforms,
  15624. transformHoist,
  15625. isBuiltInComponent,
  15626. isCustomElement,
  15627. expressionPlugins,
  15628. scopeId,
  15629. slotted,
  15630. ssr,
  15631. inSSR,
  15632. ssrCssVars,
  15633. bindingMetadata,
  15634. inline,
  15635. isTS,
  15636. onError,
  15637. onWarn,
  15638. compatConfig,
  15639. // state
  15640. root,
  15641. helpers: new Map(),
  15642. components: new Set(),
  15643. directives: new Set(),
  15644. hoists: [],
  15645. imports: [],
  15646. constantCache: new Map(),
  15647. temps: 0,
  15648. cached: 0,
  15649. identifiers: Object.create(null),
  15650. scopes: {
  15651. vFor: 0,
  15652. vSlot: 0,
  15653. vPre: 0,
  15654. vOnce: 0
  15655. },
  15656. parent: null,
  15657. currentNode: root,
  15658. childIndex: 0,
  15659. inVOnce: false,
  15660. // methods
  15661. helper(name) {
  15662. const count = context.helpers.get(name) || 0;
  15663. context.helpers.set(name, count + 1);
  15664. return name;
  15665. },
  15666. removeHelper(name) {
  15667. const count = context.helpers.get(name);
  15668. if (count) {
  15669. const currentCount = count - 1;
  15670. if (!currentCount) {
  15671. context.helpers.delete(name);
  15672. }
  15673. else {
  15674. context.helpers.set(name, currentCount);
  15675. }
  15676. }
  15677. },
  15678. helperString(name) {
  15679. return `_${helperNameMap[context.helper(name)]}`;
  15680. },
  15681. replaceNode(node) {
  15682. /* istanbul ignore if */
  15683. if ((process.env.NODE_ENV !== 'production')) {
  15684. if (!context.currentNode) {
  15685. throw new Error(`Node being replaced is already removed.`);
  15686. }
  15687. if (!context.parent) {
  15688. throw new Error(`Cannot replace root node.`);
  15689. }
  15690. }
  15691. context.parent.children[context.childIndex] = context.currentNode = node;
  15692. },
  15693. removeNode(node) {
  15694. if ((process.env.NODE_ENV !== 'production') && !context.parent) {
  15695. throw new Error(`Cannot remove root node.`);
  15696. }
  15697. const list = context.parent.children;
  15698. const removalIndex = node
  15699. ? list.indexOf(node)
  15700. : context.currentNode
  15701. ? context.childIndex
  15702. : -1;
  15703. /* istanbul ignore if */
  15704. if ((process.env.NODE_ENV !== 'production') && removalIndex < 0) {
  15705. throw new Error(`node being removed is not a child of current parent`);
  15706. }
  15707. if (!node || node === context.currentNode) {
  15708. // current node removed
  15709. context.currentNode = null;
  15710. context.onNodeRemoved();
  15711. }
  15712. else {
  15713. // sibling node removed
  15714. if (context.childIndex > removalIndex) {
  15715. context.childIndex--;
  15716. context.onNodeRemoved();
  15717. }
  15718. }
  15719. context.parent.children.splice(removalIndex, 1);
  15720. },
  15721. onNodeRemoved: () => { },
  15722. addIdentifiers(exp) {
  15723. },
  15724. removeIdentifiers(exp) {
  15725. },
  15726. hoist(exp) {
  15727. if (isString(exp))
  15728. exp = createSimpleExpression(exp);
  15729. context.hoists.push(exp);
  15730. const identifier = createSimpleExpression(`_hoisted_${context.hoists.length}`, false, exp.loc, 2 /* CAN_HOIST */);
  15731. identifier.hoisted = exp;
  15732. return identifier;
  15733. },
  15734. cache(exp, isVNode = false) {
  15735. return createCacheExpression(context.cached++, exp, isVNode);
  15736. }
  15737. };
  15738. {
  15739. context.filters = new Set();
  15740. }
  15741. return context;
  15742. }
  15743. function transform(root, options) {
  15744. const context = createTransformContext(root, options);
  15745. traverseNode(root, context);
  15746. if (options.hoistStatic) {
  15747. hoistStatic(root, context);
  15748. }
  15749. if (!options.ssr) {
  15750. createRootCodegen(root, context);
  15751. }
  15752. // finalize meta information
  15753. root.helpers = [...context.helpers.keys()];
  15754. root.components = [...context.components];
  15755. root.directives = [...context.directives];
  15756. root.imports = context.imports;
  15757. root.hoists = context.hoists;
  15758. root.temps = context.temps;
  15759. root.cached = context.cached;
  15760. {
  15761. root.filters = [...context.filters];
  15762. }
  15763. }
  15764. function createRootCodegen(root, context) {
  15765. const { helper } = context;
  15766. const { children } = root;
  15767. if (children.length === 1) {
  15768. const child = children[0];
  15769. // if the single child is an element, turn it into a block.
  15770. if (isSingleElementRoot(root, child) && child.codegenNode) {
  15771. // single element root is never hoisted so codegenNode will never be
  15772. // SimpleExpressionNode
  15773. const codegenNode = child.codegenNode;
  15774. if (codegenNode.type === 13 /* VNODE_CALL */) {
  15775. makeBlock(codegenNode, context);
  15776. }
  15777. root.codegenNode = codegenNode;
  15778. }
  15779. else {
  15780. // - single <slot/>, IfNode, ForNode: already blocks.
  15781. // - single text node: always patched.
  15782. // root codegen falls through via genNode()
  15783. root.codegenNode = child;
  15784. }
  15785. }
  15786. else if (children.length > 1) {
  15787. // root has multiple nodes - return a fragment block.
  15788. let patchFlag = 64 /* STABLE_FRAGMENT */;
  15789. let patchFlagText = PatchFlagNames[64 /* STABLE_FRAGMENT */];
  15790. // check if the fragment actually contains a single valid child with
  15791. // the rest being comments
  15792. if ((process.env.NODE_ENV !== 'production') &&
  15793. children.filter(c => c.type !== 3 /* COMMENT */).length === 1) {
  15794. patchFlag |= 2048 /* DEV_ROOT_FRAGMENT */;
  15795. patchFlagText += `, ${PatchFlagNames[2048 /* DEV_ROOT_FRAGMENT */]}`;
  15796. }
  15797. root.codegenNode = createVNodeCall(context, helper(FRAGMENT), undefined, root.children, patchFlag + ((process.env.NODE_ENV !== 'production') ? ` /* ${patchFlagText} */` : ``), undefined, undefined, true, undefined, false /* isComponent */);
  15798. }
  15799. else ;
  15800. }
  15801. function traverseChildren(parent, context) {
  15802. let i = 0;
  15803. const nodeRemoved = () => {
  15804. i--;
  15805. };
  15806. for (; i < parent.children.length; i++) {
  15807. const child = parent.children[i];
  15808. if (isString(child))
  15809. continue;
  15810. context.parent = parent;
  15811. context.childIndex = i;
  15812. context.onNodeRemoved = nodeRemoved;
  15813. traverseNode(child, context);
  15814. }
  15815. }
  15816. function traverseNode(node, context) {
  15817. context.currentNode = node;
  15818. // apply transform plugins
  15819. const { nodeTransforms } = context;
  15820. const exitFns = [];
  15821. for (let i = 0; i < nodeTransforms.length; i++) {
  15822. const onExit = nodeTransforms[i](node, context);
  15823. if (onExit) {
  15824. if (isArray(onExit)) {
  15825. exitFns.push(...onExit);
  15826. }
  15827. else {
  15828. exitFns.push(onExit);
  15829. }
  15830. }
  15831. if (!context.currentNode) {
  15832. // node was removed
  15833. return;
  15834. }
  15835. else {
  15836. // node may have been replaced
  15837. node = context.currentNode;
  15838. }
  15839. }
  15840. switch (node.type) {
  15841. case 3 /* COMMENT */:
  15842. if (!context.ssr) {
  15843. // inject import for the Comment symbol, which is needed for creating
  15844. // comment nodes with `createVNode`
  15845. context.helper(CREATE_COMMENT);
  15846. }
  15847. break;
  15848. case 5 /* INTERPOLATION */:
  15849. // no need to traverse, but we need to inject toString helper
  15850. if (!context.ssr) {
  15851. context.helper(TO_DISPLAY_STRING);
  15852. }
  15853. break;
  15854. // for container types, further traverse downwards
  15855. case 9 /* IF */:
  15856. for (let i = 0; i < node.branches.length; i++) {
  15857. traverseNode(node.branches[i], context);
  15858. }
  15859. break;
  15860. case 10 /* IF_BRANCH */:
  15861. case 11 /* FOR */:
  15862. case 1 /* ELEMENT */:
  15863. case 0 /* ROOT */:
  15864. traverseChildren(node, context);
  15865. break;
  15866. }
  15867. // exit transforms
  15868. context.currentNode = node;
  15869. let i = exitFns.length;
  15870. while (i--) {
  15871. exitFns[i]();
  15872. }
  15873. }
  15874. function createStructuralDirectiveTransform(name, fn) {
  15875. const matches = isString(name)
  15876. ? (n) => n === name
  15877. : (n) => name.test(n);
  15878. return (node, context) => {
  15879. if (node.type === 1 /* ELEMENT */) {
  15880. const { props } = node;
  15881. // structural directive transforms are not concerned with slots
  15882. // as they are handled separately in vSlot.ts
  15883. if (node.tagType === 3 /* TEMPLATE */ && props.some(isVSlot)) {
  15884. return;
  15885. }
  15886. const exitFns = [];
  15887. for (let i = 0; i < props.length; i++) {
  15888. const prop = props[i];
  15889. if (prop.type === 7 /* DIRECTIVE */ && matches(prop.name)) {
  15890. // structural directives are removed to avoid infinite recursion
  15891. // also we remove them *before* applying so that it can further
  15892. // traverse itself in case it moves the node around
  15893. props.splice(i, 1);
  15894. i--;
  15895. const onExit = fn(node, prop, context);
  15896. if (onExit)
  15897. exitFns.push(onExit);
  15898. }
  15899. }
  15900. return exitFns;
  15901. }
  15902. };
  15903. }
  15904. const PURE_ANNOTATION = `/*#__PURE__*/`;
  15905. function createCodegenContext(ast, { mode = 'function', prefixIdentifiers = mode === 'module', sourceMap = false, filename = `template.vue.html`, scopeId = null, optimizeImports = false, runtimeGlobalName = `Vue`, runtimeModuleName = `vue`, ssr = false, isTS = false, inSSR = false }) {
  15906. const context = {
  15907. mode,
  15908. prefixIdentifiers,
  15909. sourceMap,
  15910. filename,
  15911. scopeId,
  15912. optimizeImports,
  15913. runtimeGlobalName,
  15914. runtimeModuleName,
  15915. ssr,
  15916. isTS,
  15917. inSSR,
  15918. source: ast.loc.source,
  15919. code: ``,
  15920. column: 1,
  15921. line: 1,
  15922. offset: 0,
  15923. indentLevel: 0,
  15924. pure: false,
  15925. map: undefined,
  15926. helper(key) {
  15927. return `_${helperNameMap[key]}`;
  15928. },
  15929. push(code, node) {
  15930. context.code += code;
  15931. },
  15932. indent() {
  15933. newline(++context.indentLevel);
  15934. },
  15935. deindent(withoutNewLine = false) {
  15936. if (withoutNewLine) {
  15937. --context.indentLevel;
  15938. }
  15939. else {
  15940. newline(--context.indentLevel);
  15941. }
  15942. },
  15943. newline() {
  15944. newline(context.indentLevel);
  15945. }
  15946. };
  15947. function newline(n) {
  15948. context.push('\n' + ` `.repeat(n));
  15949. }
  15950. return context;
  15951. }
  15952. function generate(ast, options = {}) {
  15953. const context = createCodegenContext(ast, options);
  15954. if (options.onContextCreated)
  15955. options.onContextCreated(context);
  15956. const { mode, push, prefixIdentifiers, indent, deindent, newline, scopeId, ssr } = context;
  15957. const hasHelpers = ast.helpers.length > 0;
  15958. const useWithBlock = !prefixIdentifiers && mode !== 'module';
  15959. // preambles
  15960. // in setup() inline mode, the preamble is generated in a sub context
  15961. // and returned separately.
  15962. const preambleContext = context;
  15963. {
  15964. genFunctionPreamble(ast, preambleContext);
  15965. }
  15966. // enter render function
  15967. const functionName = ssr ? `ssrRender` : `render`;
  15968. const args = ssr ? ['_ctx', '_push', '_parent', '_attrs'] : ['_ctx', '_cache'];
  15969. const signature = args.join(', ');
  15970. {
  15971. push(`function ${functionName}(${signature}) {`);
  15972. }
  15973. indent();
  15974. if (useWithBlock) {
  15975. push(`with (_ctx) {`);
  15976. indent();
  15977. // function mode const declarations should be inside with block
  15978. // also they should be renamed to avoid collision with user properties
  15979. if (hasHelpers) {
  15980. push(`const { ${ast.helpers
  15981. .map(s => `${helperNameMap[s]}: _${helperNameMap[s]}`)
  15982. .join(', ')} } = _Vue`);
  15983. push(`\n`);
  15984. newline();
  15985. }
  15986. }
  15987. // generate asset resolution statements
  15988. if (ast.components.length) {
  15989. genAssets(ast.components, 'component', context);
  15990. if (ast.directives.length || ast.temps > 0) {
  15991. newline();
  15992. }
  15993. }
  15994. if (ast.directives.length) {
  15995. genAssets(ast.directives, 'directive', context);
  15996. if (ast.temps > 0) {
  15997. newline();
  15998. }
  15999. }
  16000. if (ast.filters && ast.filters.length) {
  16001. newline();
  16002. genAssets(ast.filters, 'filter', context);
  16003. newline();
  16004. }
  16005. if (ast.temps > 0) {
  16006. push(`let `);
  16007. for (let i = 0; i < ast.temps; i++) {
  16008. push(`${i > 0 ? `, ` : ``}_temp${i}`);
  16009. }
  16010. }
  16011. if (ast.components.length || ast.directives.length || ast.temps) {
  16012. push(`\n`);
  16013. newline();
  16014. }
  16015. // generate the VNode tree expression
  16016. if (!ssr) {
  16017. push(`return `);
  16018. }
  16019. if (ast.codegenNode) {
  16020. genNode(ast.codegenNode, context);
  16021. }
  16022. else {
  16023. push(`null`);
  16024. }
  16025. if (useWithBlock) {
  16026. deindent();
  16027. push(`}`);
  16028. }
  16029. deindent();
  16030. push(`}`);
  16031. return {
  16032. ast,
  16033. code: context.code,
  16034. preamble: ``,
  16035. // SourceMapGenerator does have toJSON() method but it's not in the types
  16036. map: context.map ? context.map.toJSON() : undefined
  16037. };
  16038. }
  16039. function genFunctionPreamble(ast, context) {
  16040. const { ssr, prefixIdentifiers, push, newline, runtimeModuleName, runtimeGlobalName } = context;
  16041. const VueBinding = runtimeGlobalName;
  16042. const aliasHelper = (s) => `${helperNameMap[s]}: _${helperNameMap[s]}`;
  16043. // Generate const declaration for helpers
  16044. // In prefix mode, we place the const declaration at top so it's done
  16045. // only once; But if we not prefixing, we place the declaration inside the
  16046. // with block so it doesn't incur the `in` check cost for every helper access.
  16047. if (ast.helpers.length > 0) {
  16048. {
  16049. // "with" mode.
  16050. // save Vue in a separate variable to avoid collision
  16051. push(`const _Vue = ${VueBinding}\n`);
  16052. // in "with" mode, helpers are declared inside the with block to avoid
  16053. // has check cost, but hoists are lifted out of the function - we need
  16054. // to provide the helper here.
  16055. if (ast.hoists.length) {
  16056. const staticHelpers = [
  16057. CREATE_VNODE,
  16058. CREATE_ELEMENT_VNODE,
  16059. CREATE_COMMENT,
  16060. CREATE_TEXT,
  16061. CREATE_STATIC
  16062. ]
  16063. .filter(helper => ast.helpers.includes(helper))
  16064. .map(aliasHelper)
  16065. .join(', ');
  16066. push(`const { ${staticHelpers} } = _Vue\n`);
  16067. }
  16068. }
  16069. }
  16070. genHoists(ast.hoists, context);
  16071. newline();
  16072. push(`return `);
  16073. }
  16074. function genAssets(assets, type, { helper, push, newline, isTS }) {
  16075. const resolver = helper(type === 'filter'
  16076. ? RESOLVE_FILTER
  16077. : type === 'component'
  16078. ? RESOLVE_COMPONENT
  16079. : RESOLVE_DIRECTIVE);
  16080. for (let i = 0; i < assets.length; i++) {
  16081. let id = assets[i];
  16082. // potential component implicit self-reference inferred from SFC filename
  16083. const maybeSelfReference = id.endsWith('__self');
  16084. if (maybeSelfReference) {
  16085. id = id.slice(0, -6);
  16086. }
  16087. push(`const ${toValidAssetId(id, type)} = ${resolver}(${JSON.stringify(id)}${maybeSelfReference ? `, true` : ``})${isTS ? `!` : ``}`);
  16088. if (i < assets.length - 1) {
  16089. newline();
  16090. }
  16091. }
  16092. }
  16093. function genHoists(hoists, context) {
  16094. if (!hoists.length) {
  16095. return;
  16096. }
  16097. context.pure = true;
  16098. const { push, newline, helper, scopeId, mode } = context;
  16099. newline();
  16100. hoists.forEach((exp, i) => {
  16101. if (exp) {
  16102. push(`const _hoisted_${i + 1} = `);
  16103. genNode(exp, context);
  16104. newline();
  16105. }
  16106. });
  16107. context.pure = false;
  16108. }
  16109. function isText$1(n) {
  16110. return (isString(n) ||
  16111. n.type === 4 /* SIMPLE_EXPRESSION */ ||
  16112. n.type === 2 /* TEXT */ ||
  16113. n.type === 5 /* INTERPOLATION */ ||
  16114. n.type === 8 /* COMPOUND_EXPRESSION */);
  16115. }
  16116. function genNodeListAsArray(nodes, context) {
  16117. const multilines = nodes.length > 3 ||
  16118. (((process.env.NODE_ENV !== 'production')) && nodes.some(n => isArray(n) || !isText$1(n)));
  16119. context.push(`[`);
  16120. multilines && context.indent();
  16121. genNodeList(nodes, context, multilines);
  16122. multilines && context.deindent();
  16123. context.push(`]`);
  16124. }
  16125. function genNodeList(nodes, context, multilines = false, comma = true) {
  16126. const { push, newline } = context;
  16127. for (let i = 0; i < nodes.length; i++) {
  16128. const node = nodes[i];
  16129. if (isString(node)) {
  16130. push(node);
  16131. }
  16132. else if (isArray(node)) {
  16133. genNodeListAsArray(node, context);
  16134. }
  16135. else {
  16136. genNode(node, context);
  16137. }
  16138. if (i < nodes.length - 1) {
  16139. if (multilines) {
  16140. comma && push(',');
  16141. newline();
  16142. }
  16143. else {
  16144. comma && push(', ');
  16145. }
  16146. }
  16147. }
  16148. }
  16149. function genNode(node, context) {
  16150. if (isString(node)) {
  16151. context.push(node);
  16152. return;
  16153. }
  16154. if (isSymbol(node)) {
  16155. context.push(context.helper(node));
  16156. return;
  16157. }
  16158. switch (node.type) {
  16159. case 1 /* ELEMENT */:
  16160. case 9 /* IF */:
  16161. case 11 /* FOR */:
  16162. (process.env.NODE_ENV !== 'production') &&
  16163. assert(node.codegenNode != null, `Codegen node is missing for element/if/for node. ` +
  16164. `Apply appropriate transforms first.`);
  16165. genNode(node.codegenNode, context);
  16166. break;
  16167. case 2 /* TEXT */:
  16168. genText(node, context);
  16169. break;
  16170. case 4 /* SIMPLE_EXPRESSION */:
  16171. genExpression(node, context);
  16172. break;
  16173. case 5 /* INTERPOLATION */:
  16174. genInterpolation(node, context);
  16175. break;
  16176. case 12 /* TEXT_CALL */:
  16177. genNode(node.codegenNode, context);
  16178. break;
  16179. case 8 /* COMPOUND_EXPRESSION */:
  16180. genCompoundExpression(node, context);
  16181. break;
  16182. case 3 /* COMMENT */:
  16183. genComment(node, context);
  16184. break;
  16185. case 13 /* VNODE_CALL */:
  16186. genVNodeCall(node, context);
  16187. break;
  16188. case 14 /* JS_CALL_EXPRESSION */:
  16189. genCallExpression(node, context);
  16190. break;
  16191. case 15 /* JS_OBJECT_EXPRESSION */:
  16192. genObjectExpression(node, context);
  16193. break;
  16194. case 17 /* JS_ARRAY_EXPRESSION */:
  16195. genArrayExpression(node, context);
  16196. break;
  16197. case 18 /* JS_FUNCTION_EXPRESSION */:
  16198. genFunctionExpression(node, context);
  16199. break;
  16200. case 19 /* JS_CONDITIONAL_EXPRESSION */:
  16201. genConditionalExpression(node, context);
  16202. break;
  16203. case 20 /* JS_CACHE_EXPRESSION */:
  16204. genCacheExpression(node, context);
  16205. break;
  16206. case 21 /* JS_BLOCK_STATEMENT */:
  16207. genNodeList(node.body, context, true, false);
  16208. break;
  16209. // SSR only types
  16210. case 22 /* JS_TEMPLATE_LITERAL */:
  16211. break;
  16212. case 23 /* JS_IF_STATEMENT */:
  16213. break;
  16214. case 24 /* JS_ASSIGNMENT_EXPRESSION */:
  16215. break;
  16216. case 25 /* JS_SEQUENCE_EXPRESSION */:
  16217. break;
  16218. case 26 /* JS_RETURN_STATEMENT */:
  16219. break;
  16220. /* istanbul ignore next */
  16221. case 10 /* IF_BRANCH */:
  16222. // noop
  16223. break;
  16224. default:
  16225. if ((process.env.NODE_ENV !== 'production')) {
  16226. assert(false, `unhandled codegen node type: ${node.type}`);
  16227. // make sure we exhaust all possible types
  16228. const exhaustiveCheck = node;
  16229. return exhaustiveCheck;
  16230. }
  16231. }
  16232. }
  16233. function genText(node, context) {
  16234. context.push(JSON.stringify(node.content), node);
  16235. }
  16236. function genExpression(node, context) {
  16237. const { content, isStatic } = node;
  16238. context.push(isStatic ? JSON.stringify(content) : content, node);
  16239. }
  16240. function genInterpolation(node, context) {
  16241. const { push, helper, pure } = context;
  16242. if (pure)
  16243. push(PURE_ANNOTATION);
  16244. push(`${helper(TO_DISPLAY_STRING)}(`);
  16245. genNode(node.content, context);
  16246. push(`)`);
  16247. }
  16248. function genCompoundExpression(node, context) {
  16249. for (let i = 0; i < node.children.length; i++) {
  16250. const child = node.children[i];
  16251. if (isString(child)) {
  16252. context.push(child);
  16253. }
  16254. else {
  16255. genNode(child, context);
  16256. }
  16257. }
  16258. }
  16259. function genExpressionAsPropertyKey(node, context) {
  16260. const { push } = context;
  16261. if (node.type === 8 /* COMPOUND_EXPRESSION */) {
  16262. push(`[`);
  16263. genCompoundExpression(node, context);
  16264. push(`]`);
  16265. }
  16266. else if (node.isStatic) {
  16267. // only quote keys if necessary
  16268. const text = isSimpleIdentifier(node.content)
  16269. ? node.content
  16270. : JSON.stringify(node.content);
  16271. push(text, node);
  16272. }
  16273. else {
  16274. push(`[${node.content}]`, node);
  16275. }
  16276. }
  16277. function genComment(node, context) {
  16278. const { push, helper, pure } = context;
  16279. if (pure) {
  16280. push(PURE_ANNOTATION);
  16281. }
  16282. push(`${helper(CREATE_COMMENT)}(${JSON.stringify(node.content)})`, node);
  16283. }
  16284. function genVNodeCall(node, context) {
  16285. const { push, helper, pure } = context;
  16286. const { tag, props, children, patchFlag, dynamicProps, directives, isBlock, disableTracking, isComponent } = node;
  16287. if (directives) {
  16288. push(helper(WITH_DIRECTIVES) + `(`);
  16289. }
  16290. if (isBlock) {
  16291. push(`(${helper(OPEN_BLOCK)}(${disableTracking ? `true` : ``}), `);
  16292. }
  16293. if (pure) {
  16294. push(PURE_ANNOTATION);
  16295. }
  16296. const callHelper = isBlock
  16297. ? getVNodeBlockHelper(context.inSSR, isComponent)
  16298. : getVNodeHelper(context.inSSR, isComponent);
  16299. push(helper(callHelper) + `(`, node);
  16300. genNodeList(genNullableArgs([tag, props, children, patchFlag, dynamicProps]), context);
  16301. push(`)`);
  16302. if (isBlock) {
  16303. push(`)`);
  16304. }
  16305. if (directives) {
  16306. push(`, `);
  16307. genNode(directives, context);
  16308. push(`)`);
  16309. }
  16310. }
  16311. function genNullableArgs(args) {
  16312. let i = args.length;
  16313. while (i--) {
  16314. if (args[i] != null)
  16315. break;
  16316. }
  16317. return args.slice(0, i + 1).map(arg => arg || `null`);
  16318. }
  16319. // JavaScript
  16320. function genCallExpression(node, context) {
  16321. const { push, helper, pure } = context;
  16322. const callee = isString(node.callee) ? node.callee : helper(node.callee);
  16323. if (pure) {
  16324. push(PURE_ANNOTATION);
  16325. }
  16326. push(callee + `(`, node);
  16327. genNodeList(node.arguments, context);
  16328. push(`)`);
  16329. }
  16330. function genObjectExpression(node, context) {
  16331. const { push, indent, deindent, newline } = context;
  16332. const { properties } = node;
  16333. if (!properties.length) {
  16334. push(`{}`, node);
  16335. return;
  16336. }
  16337. const multilines = properties.length > 1 ||
  16338. (((process.env.NODE_ENV !== 'production')) &&
  16339. properties.some(p => p.value.type !== 4 /* SIMPLE_EXPRESSION */));
  16340. push(multilines ? `{` : `{ `);
  16341. multilines && indent();
  16342. for (let i = 0; i < properties.length; i++) {
  16343. const { key, value } = properties[i];
  16344. // key
  16345. genExpressionAsPropertyKey(key, context);
  16346. push(`: `);
  16347. // value
  16348. genNode(value, context);
  16349. if (i < properties.length - 1) {
  16350. // will only reach this if it's multilines
  16351. push(`,`);
  16352. newline();
  16353. }
  16354. }
  16355. multilines && deindent();
  16356. push(multilines ? `}` : ` }`);
  16357. }
  16358. function genArrayExpression(node, context) {
  16359. genNodeListAsArray(node.elements, context);
  16360. }
  16361. function genFunctionExpression(node, context) {
  16362. const { push, indent, deindent } = context;
  16363. const { params, returns, body, newline, isSlot } = node;
  16364. if (isSlot) {
  16365. // wrap slot functions with owner context
  16366. push(`_${helperNameMap[WITH_CTX]}(`);
  16367. }
  16368. push(`(`, node);
  16369. if (isArray(params)) {
  16370. genNodeList(params, context);
  16371. }
  16372. else if (params) {
  16373. genNode(params, context);
  16374. }
  16375. push(`) => `);
  16376. if (newline || body) {
  16377. push(`{`);
  16378. indent();
  16379. }
  16380. if (returns) {
  16381. if (newline) {
  16382. push(`return `);
  16383. }
  16384. if (isArray(returns)) {
  16385. genNodeListAsArray(returns, context);
  16386. }
  16387. else {
  16388. genNode(returns, context);
  16389. }
  16390. }
  16391. else if (body) {
  16392. genNode(body, context);
  16393. }
  16394. if (newline || body) {
  16395. deindent();
  16396. push(`}`);
  16397. }
  16398. if (isSlot) {
  16399. if (node.isNonScopedSlot) {
  16400. push(`, undefined, true`);
  16401. }
  16402. push(`)`);
  16403. }
  16404. }
  16405. function genConditionalExpression(node, context) {
  16406. const { test, consequent, alternate, newline: needNewline } = node;
  16407. const { push, indent, deindent, newline } = context;
  16408. if (test.type === 4 /* SIMPLE_EXPRESSION */) {
  16409. const needsParens = !isSimpleIdentifier(test.content);
  16410. needsParens && push(`(`);
  16411. genExpression(test, context);
  16412. needsParens && push(`)`);
  16413. }
  16414. else {
  16415. push(`(`);
  16416. genNode(test, context);
  16417. push(`)`);
  16418. }
  16419. needNewline && indent();
  16420. context.indentLevel++;
  16421. needNewline || push(` `);
  16422. push(`? `);
  16423. genNode(consequent, context);
  16424. context.indentLevel--;
  16425. needNewline && newline();
  16426. needNewline || push(` `);
  16427. push(`: `);
  16428. const isNested = alternate.type === 19 /* JS_CONDITIONAL_EXPRESSION */;
  16429. if (!isNested) {
  16430. context.indentLevel++;
  16431. }
  16432. genNode(alternate, context);
  16433. if (!isNested) {
  16434. context.indentLevel--;
  16435. }
  16436. needNewline && deindent(true /* without newline */);
  16437. }
  16438. function genCacheExpression(node, context) {
  16439. const { push, helper, indent, deindent, newline } = context;
  16440. push(`_cache[${node.index}] || (`);
  16441. if (node.isVNode) {
  16442. indent();
  16443. push(`${helper(SET_BLOCK_TRACKING)}(-1),`);
  16444. newline();
  16445. }
  16446. push(`_cache[${node.index}] = `);
  16447. genNode(node.value, context);
  16448. if (node.isVNode) {
  16449. push(`,`);
  16450. newline();
  16451. push(`${helper(SET_BLOCK_TRACKING)}(1),`);
  16452. newline();
  16453. push(`_cache[${node.index}]`);
  16454. deindent();
  16455. }
  16456. push(`)`);
  16457. }
  16458. function walkIdentifiers(root, onIdentifier, includeAll = false, parentStack = [], knownIds = Object.create(null)) {
  16459. const rootExp = root.type === 'Program' &&
  16460. root.body[0].type === 'ExpressionStatement' &&
  16461. root.body[0].expression;
  16462. build.walk(root, {
  16463. enter(node, parent) {
  16464. parent && parentStack.push(parent);
  16465. if (parent &&
  16466. parent.type.startsWith('TS') &&
  16467. parent.type !== 'TSAsExpression' &&
  16468. parent.type !== 'TSNonNullExpression' &&
  16469. parent.type !== 'TSTypeAssertion') {
  16470. return this.skip();
  16471. }
  16472. if (node.type === 'Identifier') {
  16473. const isLocal = !!knownIds[node.name];
  16474. const isRefed = isReferencedIdentifier(node, parent, parentStack);
  16475. if (includeAll || (isRefed && !isLocal)) {
  16476. onIdentifier(node, parent, parentStack, isRefed, isLocal);
  16477. }
  16478. }
  16479. else if (node.type === 'ObjectProperty' &&
  16480. parent.type === 'ObjectPattern') {
  16481. node.inPattern = true;
  16482. }
  16483. else if (isFunctionType(node)) {
  16484. // walk function expressions and add its arguments to known identifiers
  16485. // so that we don't prefix them
  16486. walkFunctionParams(node, id => markScopeIdentifier(node, id, knownIds));
  16487. }
  16488. else if (node.type === 'BlockStatement') {
  16489. // #3445 record block-level local variables
  16490. walkBlockDeclarations(node, id => markScopeIdentifier(node, id, knownIds));
  16491. }
  16492. },
  16493. leave(node, parent) {
  16494. parent && parentStack.pop();
  16495. if (node !== rootExp && node.scopeIds) {
  16496. for (const id of node.scopeIds) {
  16497. knownIds[id]--;
  16498. if (knownIds[id] === 0) {
  16499. delete knownIds[id];
  16500. }
  16501. }
  16502. }
  16503. }
  16504. });
  16505. }
  16506. function isReferencedIdentifier(id, parent, parentStack) {
  16507. if (!parent) {
  16508. return true;
  16509. }
  16510. // is a special keyword but parsed as identifier
  16511. if (id.name === 'arguments') {
  16512. return false;
  16513. }
  16514. if (lib$1.isReferenced(id, parent)) {
  16515. return true;
  16516. }
  16517. // babel's isReferenced check returns false for ids being assigned to, so we
  16518. // need to cover those cases here
  16519. switch (parent.type) {
  16520. case 'AssignmentExpression':
  16521. case 'AssignmentPattern':
  16522. return true;
  16523. case 'ObjectPattern':
  16524. case 'ArrayPattern':
  16525. return isInDestructureAssignment(parent, parentStack);
  16526. }
  16527. return false;
  16528. }
  16529. function isInDestructureAssignment(parent, parentStack) {
  16530. if (parent &&
  16531. (parent.type === 'ObjectProperty' || parent.type === 'ArrayPattern')) {
  16532. let i = parentStack.length;
  16533. while (i--) {
  16534. const p = parentStack[i];
  16535. if (p.type === 'AssignmentExpression') {
  16536. return true;
  16537. }
  16538. else if (p.type !== 'ObjectProperty' && !p.type.endsWith('Pattern')) {
  16539. break;
  16540. }
  16541. }
  16542. }
  16543. return false;
  16544. }
  16545. function walkFunctionParams(node, onIdent) {
  16546. for (const p of node.params) {
  16547. for (const id of extractIdentifiers(p)) {
  16548. onIdent(id);
  16549. }
  16550. }
  16551. }
  16552. function walkBlockDeclarations(block, onIdent) {
  16553. for (const stmt of block.body) {
  16554. if (stmt.type === 'VariableDeclaration') {
  16555. if (stmt.declare)
  16556. continue;
  16557. for (const decl of stmt.declarations) {
  16558. for (const id of extractIdentifiers(decl.id)) {
  16559. onIdent(id);
  16560. }
  16561. }
  16562. }
  16563. else if (stmt.type === 'FunctionDeclaration' ||
  16564. stmt.type === 'ClassDeclaration') {
  16565. if (stmt.declare || !stmt.id)
  16566. continue;
  16567. onIdent(stmt.id);
  16568. }
  16569. }
  16570. }
  16571. function extractIdentifiers(param, nodes = []) {
  16572. switch (param.type) {
  16573. case 'Identifier':
  16574. nodes.push(param);
  16575. break;
  16576. case 'MemberExpression':
  16577. let object = param;
  16578. while (object.type === 'MemberExpression') {
  16579. object = object.object;
  16580. }
  16581. nodes.push(object);
  16582. break;
  16583. case 'ObjectPattern':
  16584. for (const prop of param.properties) {
  16585. if (prop.type === 'RestElement') {
  16586. extractIdentifiers(prop.argument, nodes);
  16587. }
  16588. else {
  16589. extractIdentifiers(prop.value, nodes);
  16590. }
  16591. }
  16592. break;
  16593. case 'ArrayPattern':
  16594. param.elements.forEach(element => {
  16595. if (element)
  16596. extractIdentifiers(element, nodes);
  16597. });
  16598. break;
  16599. case 'RestElement':
  16600. extractIdentifiers(param.argument, nodes);
  16601. break;
  16602. case 'AssignmentPattern':
  16603. extractIdentifiers(param.left, nodes);
  16604. break;
  16605. }
  16606. return nodes;
  16607. }
  16608. function markScopeIdentifier(node, child, knownIds) {
  16609. const { name } = child;
  16610. if (node.scopeIds && node.scopeIds.has(name)) {
  16611. return;
  16612. }
  16613. if (name in knownIds) {
  16614. knownIds[name]++;
  16615. }
  16616. else {
  16617. knownIds[name] = 1;
  16618. }
  16619. (node.scopeIds || (node.scopeIds = new Set())).add(name);
  16620. }
  16621. const isFunctionType = (node) => {
  16622. return /Function(?:Expression|Declaration)$|Method$/.test(node.type);
  16623. };
  16624. const isStaticProperty = (node) => node &&
  16625. (node.type === 'ObjectProperty' || node.type === 'ObjectMethod') &&
  16626. !node.computed;
  16627. const isStaticPropertyKey = (node, parent) => isStaticProperty(parent) && parent.key === node;
  16628. // these keywords should not appear inside expressions, but operators like
  16629. // typeof, instanceof and in are allowed
  16630. const prohibitedKeywordRE = new RegExp('\\b' +
  16631. ('do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,' +
  16632. 'super,throw,while,yield,delete,export,import,return,switch,default,' +
  16633. 'extends,finally,continue,debugger,function,arguments,typeof,void')
  16634. .split(',')
  16635. .join('\\b|\\b') +
  16636. '\\b');
  16637. // strip strings in expressions
  16638. const stripStringRE = /'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g;
  16639. /**
  16640. * Validate a non-prefixed expression.
  16641. * This is only called when using the in-browser runtime compiler since it
  16642. * doesn't prefix expressions.
  16643. */
  16644. function validateBrowserExpression(node, context, asParams = false, asRawStatements = false) {
  16645. const exp = node.content;
  16646. // empty expressions are validated per-directive since some directives
  16647. // do allow empty expressions.
  16648. if (!exp.trim()) {
  16649. return;
  16650. }
  16651. try {
  16652. new Function(asRawStatements
  16653. ? ` ${exp} `
  16654. : `return ${asParams ? `(${exp}) => {}` : `(${exp})`}`);
  16655. }
  16656. catch (e) {
  16657. let message = e.message;
  16658. const keywordMatch = exp
  16659. .replace(stripStringRE, '')
  16660. .match(prohibitedKeywordRE);
  16661. if (keywordMatch) {
  16662. message = `avoid using JavaScript keyword as property name: "${keywordMatch[0]}"`;
  16663. }
  16664. context.onError(createCompilerError(43 /* X_INVALID_EXPRESSION */, node.loc, undefined, message));
  16665. }
  16666. }
  16667. const transformExpression = (node, context) => {
  16668. if (node.type === 5 /* INTERPOLATION */) {
  16669. node.content = processExpression(node.content, context);
  16670. }
  16671. else if (node.type === 1 /* ELEMENT */) {
  16672. // handle directives on element
  16673. for (let i = 0; i < node.props.length; i++) {
  16674. const dir = node.props[i];
  16675. // do not process for v-on & v-for since they are special handled
  16676. if (dir.type === 7 /* DIRECTIVE */ && dir.name !== 'for') {
  16677. const exp = dir.exp;
  16678. const arg = dir.arg;
  16679. // do not process exp if this is v-on:arg - we need special handling
  16680. // for wrapping inline statements.
  16681. if (exp &&
  16682. exp.type === 4 /* SIMPLE_EXPRESSION */ &&
  16683. !(dir.name === 'on' && arg)) {
  16684. dir.exp = processExpression(exp, context,
  16685. // slot args must be processed as function params
  16686. dir.name === 'slot');
  16687. }
  16688. if (arg && arg.type === 4 /* SIMPLE_EXPRESSION */ && !arg.isStatic) {
  16689. dir.arg = processExpression(arg, context);
  16690. }
  16691. }
  16692. }
  16693. }
  16694. };
  16695. // Important: since this function uses Node.js only dependencies, it should
  16696. // always be used with a leading !true check so that it can be
  16697. // tree-shaken from the browser build.
  16698. function processExpression(node, context,
  16699. // some expressions like v-slot props & v-for aliases should be parsed as
  16700. // function params
  16701. asParams = false,
  16702. // v-on handler values may contain multiple statements
  16703. asRawStatements = false) {
  16704. {
  16705. if ((process.env.NODE_ENV !== 'production')) {
  16706. // simple in-browser validation (same logic in 2.x)
  16707. validateBrowserExpression(node, context, asParams, asRawStatements);
  16708. }
  16709. return node;
  16710. }
  16711. }
  16712. const transformIf = createStructuralDirectiveTransform(/^(if|else|else-if)$/, (node, dir, context) => {
  16713. return processIf(node, dir, context, (ifNode, branch, isRoot) => {
  16714. // #1587: We need to dynamically increment the key based on the current
  16715. // node's sibling nodes, since chained v-if/else branches are
  16716. // rendered at the same depth
  16717. const siblings = context.parent.children;
  16718. let i = siblings.indexOf(ifNode);
  16719. let key = 0;
  16720. while (i-- >= 0) {
  16721. const sibling = siblings[i];
  16722. if (sibling && sibling.type === 9 /* IF */) {
  16723. key += sibling.branches.length;
  16724. }
  16725. }
  16726. // Exit callback. Complete the codegenNode when all children have been
  16727. // transformed.
  16728. return () => {
  16729. if (isRoot) {
  16730. ifNode.codegenNode = createCodegenNodeForBranch(branch, key, context);
  16731. }
  16732. else {
  16733. // attach this branch's codegen node to the v-if root.
  16734. const parentCondition = getParentCondition(ifNode.codegenNode);
  16735. parentCondition.alternate = createCodegenNodeForBranch(branch, key + ifNode.branches.length - 1, context);
  16736. }
  16737. };
  16738. });
  16739. });
  16740. // target-agnostic transform used for both Client and SSR
  16741. function processIf(node, dir, context, processCodegen) {
  16742. if (dir.name !== 'else' &&
  16743. (!dir.exp || !dir.exp.content.trim())) {
  16744. const loc = dir.exp ? dir.exp.loc : node.loc;
  16745. context.onError(createCompilerError(27 /* X_V_IF_NO_EXPRESSION */, dir.loc));
  16746. dir.exp = createSimpleExpression(`true`, false, loc);
  16747. }
  16748. if ((process.env.NODE_ENV !== 'production') && true && dir.exp) {
  16749. validateBrowserExpression(dir.exp, context);
  16750. }
  16751. if (dir.name === 'if') {
  16752. const branch = createIfBranch(node, dir);
  16753. const ifNode = {
  16754. type: 9 /* IF */,
  16755. loc: node.loc,
  16756. branches: [branch]
  16757. };
  16758. context.replaceNode(ifNode);
  16759. if (processCodegen) {
  16760. return processCodegen(ifNode, branch, true);
  16761. }
  16762. }
  16763. else {
  16764. // locate the adjacent v-if
  16765. const siblings = context.parent.children;
  16766. const comments = [];
  16767. let i = siblings.indexOf(node);
  16768. while (i-- >= -1) {
  16769. const sibling = siblings[i];
  16770. if ((process.env.NODE_ENV !== 'production') && sibling && sibling.type === 3 /* COMMENT */) {
  16771. context.removeNode(sibling);
  16772. comments.unshift(sibling);
  16773. continue;
  16774. }
  16775. if (sibling &&
  16776. sibling.type === 2 /* TEXT */ &&
  16777. !sibling.content.trim().length) {
  16778. context.removeNode(sibling);
  16779. continue;
  16780. }
  16781. if (sibling && sibling.type === 9 /* IF */) {
  16782. // move the node to the if node's branches
  16783. context.removeNode();
  16784. const branch = createIfBranch(node, dir);
  16785. if ((process.env.NODE_ENV !== 'production') &&
  16786. comments.length &&
  16787. // #3619 ignore comments if the v-if is direct child of <transition>
  16788. !(context.parent &&
  16789. context.parent.type === 1 /* ELEMENT */ &&
  16790. isBuiltInType(context.parent.tag, 'transition'))) {
  16791. branch.children = [...comments, ...branch.children];
  16792. }
  16793. // check if user is forcing same key on different branches
  16794. if ((process.env.NODE_ENV !== 'production') || !true) {
  16795. const key = branch.userKey;
  16796. if (key) {
  16797. sibling.branches.forEach(({ userKey }) => {
  16798. if (isSameKey(userKey, key)) {
  16799. context.onError(createCompilerError(28 /* X_V_IF_SAME_KEY */, branch.userKey.loc));
  16800. }
  16801. });
  16802. }
  16803. }
  16804. sibling.branches.push(branch);
  16805. const onExit = processCodegen && processCodegen(sibling, branch, false);
  16806. // since the branch was removed, it will not be traversed.
  16807. // make sure to traverse here.
  16808. traverseNode(branch, context);
  16809. // call on exit
  16810. if (onExit)
  16811. onExit();
  16812. // make sure to reset currentNode after traversal to indicate this
  16813. // node has been removed.
  16814. context.currentNode = null;
  16815. }
  16816. else {
  16817. context.onError(createCompilerError(29 /* X_V_ELSE_NO_ADJACENT_IF */, node.loc));
  16818. }
  16819. break;
  16820. }
  16821. }
  16822. }
  16823. function createIfBranch(node, dir) {
  16824. return {
  16825. type: 10 /* IF_BRANCH */,
  16826. loc: node.loc,
  16827. condition: dir.name === 'else' ? undefined : dir.exp,
  16828. children: node.tagType === 3 /* TEMPLATE */ && !findDir(node, 'for')
  16829. ? node.children
  16830. : [node],
  16831. userKey: findProp(node, `key`)
  16832. };
  16833. }
  16834. function createCodegenNodeForBranch(branch, keyIndex, context) {
  16835. if (branch.condition) {
  16836. return createConditionalExpression(branch.condition, createChildrenCodegenNode(branch, keyIndex, context),
  16837. // make sure to pass in asBlock: true so that the comment node call
  16838. // closes the current block.
  16839. createCallExpression(context.helper(CREATE_COMMENT), [
  16840. (process.env.NODE_ENV !== 'production') ? '"v-if"' : '""',
  16841. 'true'
  16842. ]));
  16843. }
  16844. else {
  16845. return createChildrenCodegenNode(branch, keyIndex, context);
  16846. }
  16847. }
  16848. function createChildrenCodegenNode(branch, keyIndex, context) {
  16849. const { helper } = context;
  16850. const keyProperty = createObjectProperty(`key`, createSimpleExpression(`${keyIndex}`, false, locStub, 2 /* CAN_HOIST */));
  16851. const { children } = branch;
  16852. const firstChild = children[0];
  16853. const needFragmentWrapper = children.length !== 1 || firstChild.type !== 1 /* ELEMENT */;
  16854. if (needFragmentWrapper) {
  16855. if (children.length === 1 && firstChild.type === 11 /* FOR */) {
  16856. // optimize away nested fragments when child is a ForNode
  16857. const vnodeCall = firstChild.codegenNode;
  16858. injectProp(vnodeCall, keyProperty, context);
  16859. return vnodeCall;
  16860. }
  16861. else {
  16862. let patchFlag = 64 /* STABLE_FRAGMENT */;
  16863. let patchFlagText = PatchFlagNames[64 /* STABLE_FRAGMENT */];
  16864. // check if the fragment actually contains a single valid child with
  16865. // the rest being comments
  16866. if ((process.env.NODE_ENV !== 'production') &&
  16867. children.filter(c => c.type !== 3 /* COMMENT */).length === 1) {
  16868. patchFlag |= 2048 /* DEV_ROOT_FRAGMENT */;
  16869. patchFlagText += `, ${PatchFlagNames[2048 /* DEV_ROOT_FRAGMENT */]}`;
  16870. }
  16871. return createVNodeCall(context, helper(FRAGMENT), createObjectExpression([keyProperty]), children, patchFlag + ((process.env.NODE_ENV !== 'production') ? ` /* ${patchFlagText} */` : ``), undefined, undefined, true, false, false /* isComponent */, branch.loc);
  16872. }
  16873. }
  16874. else {
  16875. const ret = firstChild.codegenNode;
  16876. const vnodeCall = getMemoedVNodeCall(ret);
  16877. // Change createVNode to createBlock.
  16878. if (vnodeCall.type === 13 /* VNODE_CALL */) {
  16879. makeBlock(vnodeCall, context);
  16880. }
  16881. // inject branch key
  16882. injectProp(vnodeCall, keyProperty, context);
  16883. return ret;
  16884. }
  16885. }
  16886. function isSameKey(a, b) {
  16887. if (!a || a.type !== b.type) {
  16888. return false;
  16889. }
  16890. if (a.type === 6 /* ATTRIBUTE */) {
  16891. if (a.value.content !== b.value.content) {
  16892. return false;
  16893. }
  16894. }
  16895. else {
  16896. // directive
  16897. const exp = a.exp;
  16898. const branchExp = b.exp;
  16899. if (exp.type !== branchExp.type) {
  16900. return false;
  16901. }
  16902. if (exp.type !== 4 /* SIMPLE_EXPRESSION */ ||
  16903. exp.isStatic !== branchExp.isStatic ||
  16904. exp.content !== branchExp.content) {
  16905. return false;
  16906. }
  16907. }
  16908. return true;
  16909. }
  16910. function getParentCondition(node) {
  16911. while (true) {
  16912. if (node.type === 19 /* JS_CONDITIONAL_EXPRESSION */) {
  16913. if (node.alternate.type === 19 /* JS_CONDITIONAL_EXPRESSION */) {
  16914. node = node.alternate;
  16915. }
  16916. else {
  16917. return node;
  16918. }
  16919. }
  16920. else if (node.type === 20 /* JS_CACHE_EXPRESSION */) {
  16921. node = node.value;
  16922. }
  16923. }
  16924. }
  16925. const transformFor = createStructuralDirectiveTransform('for', (node, dir, context) => {
  16926. const { helper, removeHelper } = context;
  16927. return processFor(node, dir, context, forNode => {
  16928. // create the loop render function expression now, and add the
  16929. // iterator on exit after all children have been traversed
  16930. const renderExp = createCallExpression(helper(RENDER_LIST), [
  16931. forNode.source
  16932. ]);
  16933. const memo = findDir(node, 'memo');
  16934. const keyProp = findProp(node, `key`);
  16935. const keyExp = keyProp &&
  16936. (keyProp.type === 6 /* ATTRIBUTE */
  16937. ? createSimpleExpression(keyProp.value.content, true)
  16938. : keyProp.exp);
  16939. const keyProperty = keyProp ? createObjectProperty(`key`, keyExp) : null;
  16940. const isStableFragment = forNode.source.type === 4 /* SIMPLE_EXPRESSION */ &&
  16941. forNode.source.constType > 0 /* NOT_CONSTANT */;
  16942. const fragmentFlag = isStableFragment
  16943. ? 64 /* STABLE_FRAGMENT */
  16944. : keyProp
  16945. ? 128 /* KEYED_FRAGMENT */
  16946. : 256 /* UNKEYED_FRAGMENT */;
  16947. forNode.codegenNode = createVNodeCall(context, helper(FRAGMENT), undefined, renderExp, fragmentFlag +
  16948. ((process.env.NODE_ENV !== 'production') ? ` /* ${PatchFlagNames[fragmentFlag]} */` : ``), undefined, undefined, true /* isBlock */, !isStableFragment /* disableTracking */, false /* isComponent */, node.loc);
  16949. return () => {
  16950. // finish the codegen now that all children have been traversed
  16951. let childBlock;
  16952. const isTemplate = isTemplateNode(node);
  16953. const { children } = forNode;
  16954. // check <template v-for> key placement
  16955. if (((process.env.NODE_ENV !== 'production') || !true) && isTemplate) {
  16956. node.children.some(c => {
  16957. if (c.type === 1 /* ELEMENT */) {
  16958. const key = findProp(c, 'key');
  16959. if (key) {
  16960. context.onError(createCompilerError(32 /* X_V_FOR_TEMPLATE_KEY_PLACEMENT */, key.loc));
  16961. return true;
  16962. }
  16963. }
  16964. });
  16965. }
  16966. const needFragmentWrapper = children.length !== 1 || children[0].type !== 1 /* ELEMENT */;
  16967. const slotOutlet = isSlotOutlet(node)
  16968. ? node
  16969. : isTemplate &&
  16970. node.children.length === 1 &&
  16971. isSlotOutlet(node.children[0])
  16972. ? node.children[0] // api-extractor somehow fails to infer this
  16973. : null;
  16974. if (slotOutlet) {
  16975. // <slot v-for="..."> or <template v-for="..."><slot/></template>
  16976. childBlock = slotOutlet.codegenNode;
  16977. if (isTemplate && keyProperty) {
  16978. // <template v-for="..." :key="..."><slot/></template>
  16979. // we need to inject the key to the renderSlot() call.
  16980. // the props for renderSlot is passed as the 3rd argument.
  16981. injectProp(childBlock, keyProperty, context);
  16982. }
  16983. }
  16984. else if (needFragmentWrapper) {
  16985. // <template v-for="..."> with text or multi-elements
  16986. // should generate a fragment block for each loop
  16987. childBlock = createVNodeCall(context, helper(FRAGMENT), keyProperty ? createObjectExpression([keyProperty]) : undefined, node.children, 64 /* STABLE_FRAGMENT */ +
  16988. ((process.env.NODE_ENV !== 'production')
  16989. ? ` /* ${PatchFlagNames[64 /* STABLE_FRAGMENT */]} */`
  16990. : ``), undefined, undefined, true, undefined, false /* isComponent */);
  16991. }
  16992. else {
  16993. // Normal element v-for. Directly use the child's codegenNode
  16994. // but mark it as a block.
  16995. childBlock = children[0]
  16996. .codegenNode;
  16997. if (isTemplate && keyProperty) {
  16998. injectProp(childBlock, keyProperty, context);
  16999. }
  17000. if (childBlock.isBlock !== !isStableFragment) {
  17001. if (childBlock.isBlock) {
  17002. // switch from block to vnode
  17003. removeHelper(OPEN_BLOCK);
  17004. removeHelper(getVNodeBlockHelper(context.inSSR, childBlock.isComponent));
  17005. }
  17006. else {
  17007. // switch from vnode to block
  17008. removeHelper(getVNodeHelper(context.inSSR, childBlock.isComponent));
  17009. }
  17010. }
  17011. childBlock.isBlock = !isStableFragment;
  17012. if (childBlock.isBlock) {
  17013. helper(OPEN_BLOCK);
  17014. helper(getVNodeBlockHelper(context.inSSR, childBlock.isComponent));
  17015. }
  17016. else {
  17017. helper(getVNodeHelper(context.inSSR, childBlock.isComponent));
  17018. }
  17019. }
  17020. if (memo) {
  17021. const loop = createFunctionExpression(createForLoopParams(forNode.parseResult, [
  17022. createSimpleExpression(`_cached`)
  17023. ]));
  17024. loop.body = createBlockStatement([
  17025. createCompoundExpression([`const _memo = (`, memo.exp, `)`]),
  17026. createCompoundExpression([
  17027. `if (_cached`,
  17028. ...(keyExp ? [` && _cached.key === `, keyExp] : []),
  17029. ` && ${context.helperString(IS_MEMO_SAME)}(_cached, _memo)) return _cached`
  17030. ]),
  17031. createCompoundExpression([`const _item = `, childBlock]),
  17032. createSimpleExpression(`_item.memo = _memo`),
  17033. createSimpleExpression(`return _item`)
  17034. ]);
  17035. renderExp.arguments.push(loop, createSimpleExpression(`_cache`), createSimpleExpression(String(context.cached++)));
  17036. }
  17037. else {
  17038. renderExp.arguments.push(createFunctionExpression(createForLoopParams(forNode.parseResult), childBlock, true /* force newline */));
  17039. }
  17040. };
  17041. });
  17042. });
  17043. // target-agnostic transform used for both Client and SSR
  17044. function processFor(node, dir, context, processCodegen) {
  17045. if (!dir.exp) {
  17046. context.onError(createCompilerError(30 /* X_V_FOR_NO_EXPRESSION */, dir.loc));
  17047. return;
  17048. }
  17049. const parseResult = parseForExpression(
  17050. // can only be simple expression because vFor transform is applied
  17051. // before expression transform.
  17052. dir.exp, context);
  17053. if (!parseResult) {
  17054. context.onError(createCompilerError(31 /* X_V_FOR_MALFORMED_EXPRESSION */, dir.loc));
  17055. return;
  17056. }
  17057. const { addIdentifiers, removeIdentifiers, scopes } = context;
  17058. const { source, value, key, index } = parseResult;
  17059. const forNode = {
  17060. type: 11 /* FOR */,
  17061. loc: dir.loc,
  17062. source,
  17063. valueAlias: value,
  17064. keyAlias: key,
  17065. objectIndexAlias: index,
  17066. parseResult,
  17067. children: isTemplateNode(node) ? node.children : [node]
  17068. };
  17069. context.replaceNode(forNode);
  17070. // bookkeeping
  17071. scopes.vFor++;
  17072. const onExit = processCodegen && processCodegen(forNode);
  17073. return () => {
  17074. scopes.vFor--;
  17075. if (onExit)
  17076. onExit();
  17077. };
  17078. }
  17079. const forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/;
  17080. // This regex doesn't cover the case if key or index aliases have destructuring,
  17081. // but those do not make sense in the first place, so this works in practice.
  17082. const forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/;
  17083. const stripParensRE = /^\(|\)$/g;
  17084. function parseForExpression(input, context) {
  17085. const loc = input.loc;
  17086. const exp = input.content;
  17087. const inMatch = exp.match(forAliasRE);
  17088. if (!inMatch)
  17089. return;
  17090. const [, LHS, RHS] = inMatch;
  17091. const result = {
  17092. source: createAliasExpression(loc, RHS.trim(), exp.indexOf(RHS, LHS.length)),
  17093. value: undefined,
  17094. key: undefined,
  17095. index: undefined
  17096. };
  17097. if ((process.env.NODE_ENV !== 'production') && true) {
  17098. validateBrowserExpression(result.source, context);
  17099. }
  17100. let valueContent = LHS.trim().replace(stripParensRE, '').trim();
  17101. const trimmedOffset = LHS.indexOf(valueContent);
  17102. const iteratorMatch = valueContent.match(forIteratorRE);
  17103. if (iteratorMatch) {
  17104. valueContent = valueContent.replace(forIteratorRE, '').trim();
  17105. const keyContent = iteratorMatch[1].trim();
  17106. let keyOffset;
  17107. if (keyContent) {
  17108. keyOffset = exp.indexOf(keyContent, trimmedOffset + valueContent.length);
  17109. result.key = createAliasExpression(loc, keyContent, keyOffset);
  17110. if ((process.env.NODE_ENV !== 'production') && true) {
  17111. validateBrowserExpression(result.key, context, true);
  17112. }
  17113. }
  17114. if (iteratorMatch[2]) {
  17115. const indexContent = iteratorMatch[2].trim();
  17116. if (indexContent) {
  17117. result.index = createAliasExpression(loc, indexContent, exp.indexOf(indexContent, result.key
  17118. ? keyOffset + keyContent.length
  17119. : trimmedOffset + valueContent.length));
  17120. if ((process.env.NODE_ENV !== 'production') && true) {
  17121. validateBrowserExpression(result.index, context, true);
  17122. }
  17123. }
  17124. }
  17125. }
  17126. if (valueContent) {
  17127. result.value = createAliasExpression(loc, valueContent, trimmedOffset);
  17128. if ((process.env.NODE_ENV !== 'production') && true) {
  17129. validateBrowserExpression(result.value, context, true);
  17130. }
  17131. }
  17132. return result;
  17133. }
  17134. function createAliasExpression(range, content, offset) {
  17135. return createSimpleExpression(content, false, getInnerRange(range, offset, content.length));
  17136. }
  17137. function createForLoopParams({ value, key, index }, memoArgs = []) {
  17138. return createParamsList([value, key, index, ...memoArgs]);
  17139. }
  17140. function createParamsList(args) {
  17141. let i = args.length;
  17142. while (i--) {
  17143. if (args[i])
  17144. break;
  17145. }
  17146. return args
  17147. .slice(0, i + 1)
  17148. .map((arg, i) => arg || createSimpleExpression(`_`.repeat(i + 1), false));
  17149. }
  17150. const defaultFallback = createSimpleExpression(`undefined`, false);
  17151. // A NodeTransform that:
  17152. // 1. Tracks scope identifiers for scoped slots so that they don't get prefixed
  17153. // by transformExpression. This is only applied in non-browser builds with
  17154. // { prefixIdentifiers: true }.
  17155. // 2. Track v-slot depths so that we know a slot is inside another slot.
  17156. // Note the exit callback is executed before buildSlots() on the same node,
  17157. // so only nested slots see positive numbers.
  17158. const trackSlotScopes = (node, context) => {
  17159. if (node.type === 1 /* ELEMENT */ &&
  17160. (node.tagType === 1 /* COMPONENT */ ||
  17161. node.tagType === 3 /* TEMPLATE */)) {
  17162. // We are only checking non-empty v-slot here
  17163. // since we only care about slots that introduce scope variables.
  17164. const vSlot = findDir(node, 'slot');
  17165. if (vSlot) {
  17166. context.scopes.vSlot++;
  17167. return () => {
  17168. context.scopes.vSlot--;
  17169. };
  17170. }
  17171. }
  17172. };
  17173. // A NodeTransform that tracks scope identifiers for scoped slots with v-for.
  17174. // This transform is only applied in non-browser builds with { prefixIdentifiers: true }
  17175. const trackVForSlotScopes = (node, context) => {
  17176. let vFor;
  17177. if (isTemplateNode(node) &&
  17178. node.props.some(isVSlot) &&
  17179. (vFor = findDir(node, 'for'))) {
  17180. const result = (vFor.parseResult = parseForExpression(vFor.exp, context));
  17181. if (result) {
  17182. const { value, key, index } = result;
  17183. const { addIdentifiers, removeIdentifiers } = context;
  17184. value && addIdentifiers(value);
  17185. key && addIdentifiers(key);
  17186. index && addIdentifiers(index);
  17187. return () => {
  17188. value && removeIdentifiers(value);
  17189. key && removeIdentifiers(key);
  17190. index && removeIdentifiers(index);
  17191. };
  17192. }
  17193. }
  17194. };
  17195. const buildClientSlotFn = (props, children, loc) => createFunctionExpression(props, children, false /* newline */, true /* isSlot */, children.length ? children[0].loc : loc);
  17196. // Instead of being a DirectiveTransform, v-slot processing is called during
  17197. // transformElement to build the slots object for a component.
  17198. function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
  17199. context.helper(WITH_CTX);
  17200. const { children, loc } = node;
  17201. const slotsProperties = [];
  17202. const dynamicSlots = [];
  17203. // If the slot is inside a v-for or another v-slot, force it to be dynamic
  17204. // since it likely uses a scope variable.
  17205. let hasDynamicSlots = context.scopes.vSlot > 0 || context.scopes.vFor > 0;
  17206. // 1. Check for slot with slotProps on component itself.
  17207. // <Comp v-slot="{ prop }"/>
  17208. const onComponentSlot = findDir(node, 'slot', true);
  17209. if (onComponentSlot) {
  17210. const { arg, exp } = onComponentSlot;
  17211. if (arg && !isStaticExp(arg)) {
  17212. hasDynamicSlots = true;
  17213. }
  17214. slotsProperties.push(createObjectProperty(arg || createSimpleExpression('default', true), buildSlotFn(exp, children, loc)));
  17215. }
  17216. // 2. Iterate through children and check for template slots
  17217. // <template v-slot:foo="{ prop }">
  17218. let hasTemplateSlots = false;
  17219. let hasNamedDefaultSlot = false;
  17220. const implicitDefaultChildren = [];
  17221. const seenSlotNames = new Set();
  17222. for (let i = 0; i < children.length; i++) {
  17223. const slotElement = children[i];
  17224. let slotDir;
  17225. if (!isTemplateNode(slotElement) ||
  17226. !(slotDir = findDir(slotElement, 'slot', true))) {
  17227. // not a <template v-slot>, skip.
  17228. if (slotElement.type !== 3 /* COMMENT */) {
  17229. implicitDefaultChildren.push(slotElement);
  17230. }
  17231. continue;
  17232. }
  17233. if (onComponentSlot) {
  17234. // already has on-component slot - this is incorrect usage.
  17235. context.onError(createCompilerError(36 /* X_V_SLOT_MIXED_SLOT_USAGE */, slotDir.loc));
  17236. break;
  17237. }
  17238. hasTemplateSlots = true;
  17239. const { children: slotChildren, loc: slotLoc } = slotElement;
  17240. const { arg: slotName = createSimpleExpression(`default`, true), exp: slotProps, loc: dirLoc } = slotDir;
  17241. // check if name is dynamic.
  17242. let staticSlotName;
  17243. if (isStaticExp(slotName)) {
  17244. staticSlotName = slotName ? slotName.content : `default`;
  17245. }
  17246. else {
  17247. hasDynamicSlots = true;
  17248. }
  17249. const slotFunction = buildSlotFn(slotProps, slotChildren, slotLoc);
  17250. // check if this slot is conditional (v-if/v-for)
  17251. let vIf;
  17252. let vElse;
  17253. let vFor;
  17254. if ((vIf = findDir(slotElement, 'if'))) {
  17255. hasDynamicSlots = true;
  17256. dynamicSlots.push(createConditionalExpression(vIf.exp, buildDynamicSlot(slotName, slotFunction), defaultFallback));
  17257. }
  17258. else if ((vElse = findDir(slotElement, /^else(-if)?$/, true /* allowEmpty */))) {
  17259. // find adjacent v-if
  17260. let j = i;
  17261. let prev;
  17262. while (j--) {
  17263. prev = children[j];
  17264. if (prev.type !== 3 /* COMMENT */) {
  17265. break;
  17266. }
  17267. }
  17268. if (prev && isTemplateNode(prev) && findDir(prev, 'if')) {
  17269. // remove node
  17270. children.splice(i, 1);
  17271. i--;
  17272. // attach this slot to previous conditional
  17273. let conditional = dynamicSlots[dynamicSlots.length - 1];
  17274. while (conditional.alternate.type === 19 /* JS_CONDITIONAL_EXPRESSION */) {
  17275. conditional = conditional.alternate;
  17276. }
  17277. conditional.alternate = vElse.exp
  17278. ? createConditionalExpression(vElse.exp, buildDynamicSlot(slotName, slotFunction), defaultFallback)
  17279. : buildDynamicSlot(slotName, slotFunction);
  17280. }
  17281. else {
  17282. context.onError(createCompilerError(29 /* X_V_ELSE_NO_ADJACENT_IF */, vElse.loc));
  17283. }
  17284. }
  17285. else if ((vFor = findDir(slotElement, 'for'))) {
  17286. hasDynamicSlots = true;
  17287. const parseResult = vFor.parseResult ||
  17288. parseForExpression(vFor.exp, context);
  17289. if (parseResult) {
  17290. // Render the dynamic slots as an array and add it to the createSlot()
  17291. // args. The runtime knows how to handle it appropriately.
  17292. dynamicSlots.push(createCallExpression(context.helper(RENDER_LIST), [
  17293. parseResult.source,
  17294. createFunctionExpression(createForLoopParams(parseResult), buildDynamicSlot(slotName, slotFunction), true /* force newline */)
  17295. ]));
  17296. }
  17297. else {
  17298. context.onError(createCompilerError(31 /* X_V_FOR_MALFORMED_EXPRESSION */, vFor.loc));
  17299. }
  17300. }
  17301. else {
  17302. // check duplicate static names
  17303. if (staticSlotName) {
  17304. if (seenSlotNames.has(staticSlotName)) {
  17305. context.onError(createCompilerError(37 /* X_V_SLOT_DUPLICATE_SLOT_NAMES */, dirLoc));
  17306. continue;
  17307. }
  17308. seenSlotNames.add(staticSlotName);
  17309. if (staticSlotName === 'default') {
  17310. hasNamedDefaultSlot = true;
  17311. }
  17312. }
  17313. slotsProperties.push(createObjectProperty(slotName, slotFunction));
  17314. }
  17315. }
  17316. if (!onComponentSlot) {
  17317. const buildDefaultSlotProperty = (props, children) => {
  17318. const fn = buildSlotFn(props, children, loc);
  17319. if (context.compatConfig) {
  17320. fn.isNonScopedSlot = true;
  17321. }
  17322. return createObjectProperty(`default`, fn);
  17323. };
  17324. if (!hasTemplateSlots) {
  17325. // implicit default slot (on component)
  17326. slotsProperties.push(buildDefaultSlotProperty(undefined, children));
  17327. }
  17328. else if (implicitDefaultChildren.length &&
  17329. // #3766
  17330. // with whitespace: 'preserve', whitespaces between slots will end up in
  17331. // implicitDefaultChildren. Ignore if all implicit children are whitespaces.
  17332. implicitDefaultChildren.some(node => isNonWhitespaceContent(node))) {
  17333. // implicit default slot (mixed with named slots)
  17334. if (hasNamedDefaultSlot) {
  17335. context.onError(createCompilerError(38 /* X_V_SLOT_EXTRANEOUS_DEFAULT_SLOT_CHILDREN */, implicitDefaultChildren[0].loc));
  17336. }
  17337. else {
  17338. slotsProperties.push(buildDefaultSlotProperty(undefined, implicitDefaultChildren));
  17339. }
  17340. }
  17341. }
  17342. const slotFlag = hasDynamicSlots
  17343. ? 2 /* DYNAMIC */
  17344. : hasForwardedSlots(node.children)
  17345. ? 3 /* FORWARDED */
  17346. : 1 /* STABLE */;
  17347. let slots = createObjectExpression(slotsProperties.concat(createObjectProperty(`_`,
  17348. // 2 = compiled but dynamic = can skip normalization, but must run diff
  17349. // 1 = compiled and static = can skip normalization AND diff as optimized
  17350. createSimpleExpression(slotFlag + ((process.env.NODE_ENV !== 'production') ? ` /* ${slotFlagsText[slotFlag]} */` : ``), false))), loc);
  17351. if (dynamicSlots.length) {
  17352. slots = createCallExpression(context.helper(CREATE_SLOTS), [
  17353. slots,
  17354. createArrayExpression(dynamicSlots)
  17355. ]);
  17356. }
  17357. return {
  17358. slots,
  17359. hasDynamicSlots
  17360. };
  17361. }
  17362. function buildDynamicSlot(name, fn) {
  17363. return createObjectExpression([
  17364. createObjectProperty(`name`, name),
  17365. createObjectProperty(`fn`, fn)
  17366. ]);
  17367. }
  17368. function hasForwardedSlots(children) {
  17369. for (let i = 0; i < children.length; i++) {
  17370. const child = children[i];
  17371. switch (child.type) {
  17372. case 1 /* ELEMENT */:
  17373. if (child.tagType === 2 /* SLOT */ ||
  17374. hasForwardedSlots(child.children)) {
  17375. return true;
  17376. }
  17377. break;
  17378. case 9 /* IF */:
  17379. if (hasForwardedSlots(child.branches))
  17380. return true;
  17381. break;
  17382. case 10 /* IF_BRANCH */:
  17383. case 11 /* FOR */:
  17384. if (hasForwardedSlots(child.children))
  17385. return true;
  17386. break;
  17387. }
  17388. }
  17389. return false;
  17390. }
  17391. function isNonWhitespaceContent(node) {
  17392. if (node.type !== 2 /* TEXT */ && node.type !== 12 /* TEXT_CALL */)
  17393. return true;
  17394. return node.type === 2 /* TEXT */
  17395. ? !!node.content.trim()
  17396. : isNonWhitespaceContent(node.content);
  17397. }
  17398. // some directive transforms (e.g. v-model) may return a symbol for runtime
  17399. // import, which should be used instead of a resolveDirective call.
  17400. const directiveImportMap = new WeakMap();
  17401. // generate a JavaScript AST for this element's codegen
  17402. const transformElement = (node, context) => {
  17403. // perform the work on exit, after all child expressions have been
  17404. // processed and merged.
  17405. return function postTransformElement() {
  17406. node = context.currentNode;
  17407. if (!(node.type === 1 /* ELEMENT */ &&
  17408. (node.tagType === 0 /* ELEMENT */ ||
  17409. node.tagType === 1 /* COMPONENT */))) {
  17410. return;
  17411. }
  17412. const { tag, props } = node;
  17413. const isComponent = node.tagType === 1 /* COMPONENT */;
  17414. // The goal of the transform is to create a codegenNode implementing the
  17415. // VNodeCall interface.
  17416. let vnodeTag = isComponent
  17417. ? resolveComponentType(node, context)
  17418. : `"${tag}"`;
  17419. const isDynamicComponent = isObject(vnodeTag) && vnodeTag.callee === RESOLVE_DYNAMIC_COMPONENT;
  17420. let vnodeProps;
  17421. let vnodeChildren;
  17422. let vnodePatchFlag;
  17423. let patchFlag = 0;
  17424. let vnodeDynamicProps;
  17425. let dynamicPropNames;
  17426. let vnodeDirectives;
  17427. let shouldUseBlock =
  17428. // dynamic component may resolve to plain elements
  17429. isDynamicComponent ||
  17430. vnodeTag === TELEPORT ||
  17431. vnodeTag === SUSPENSE ||
  17432. (!isComponent &&
  17433. // <svg> and <foreignObject> must be forced into blocks so that block
  17434. // updates inside get proper isSVG flag at runtime. (#639, #643)
  17435. // This is technically web-specific, but splitting the logic out of core
  17436. // leads to too much unnecessary complexity.
  17437. (tag === 'svg' ||
  17438. tag === 'foreignObject' ||
  17439. // #938: elements with dynamic keys should be forced into blocks
  17440. findProp(node, 'key', true)));
  17441. // props
  17442. if (props.length > 0) {
  17443. const propsBuildResult = buildProps(node, context);
  17444. vnodeProps = propsBuildResult.props;
  17445. patchFlag = propsBuildResult.patchFlag;
  17446. dynamicPropNames = propsBuildResult.dynamicPropNames;
  17447. const directives = propsBuildResult.directives;
  17448. vnodeDirectives =
  17449. directives && directives.length
  17450. ? createArrayExpression(directives.map(dir => buildDirectiveArgs(dir, context)))
  17451. : undefined;
  17452. }
  17453. // children
  17454. if (node.children.length > 0) {
  17455. if (vnodeTag === KEEP_ALIVE) {
  17456. // Although a built-in component, we compile KeepAlive with raw children
  17457. // instead of slot functions so that it can be used inside Transition
  17458. // or other Transition-wrapping HOCs.
  17459. // To ensure correct updates with block optimizations, we need to:
  17460. // 1. Force keep-alive into a block. This avoids its children being
  17461. // collected by a parent block.
  17462. shouldUseBlock = true;
  17463. // 2. Force keep-alive to always be updated, since it uses raw children.
  17464. patchFlag |= 1024 /* DYNAMIC_SLOTS */;
  17465. if ((process.env.NODE_ENV !== 'production') && node.children.length > 1) {
  17466. context.onError(createCompilerError(44 /* X_KEEP_ALIVE_INVALID_CHILDREN */, {
  17467. start: node.children[0].loc.start,
  17468. end: node.children[node.children.length - 1].loc.end,
  17469. source: ''
  17470. }));
  17471. }
  17472. }
  17473. const shouldBuildAsSlots = isComponent &&
  17474. // Teleport is not a real component and has dedicated runtime handling
  17475. vnodeTag !== TELEPORT &&
  17476. // explained above.
  17477. vnodeTag !== KEEP_ALIVE;
  17478. if (shouldBuildAsSlots) {
  17479. const { slots, hasDynamicSlots } = buildSlots(node, context);
  17480. vnodeChildren = slots;
  17481. if (hasDynamicSlots) {
  17482. patchFlag |= 1024 /* DYNAMIC_SLOTS */;
  17483. }
  17484. }
  17485. else if (node.children.length === 1 && vnodeTag !== TELEPORT) {
  17486. const child = node.children[0];
  17487. const type = child.type;
  17488. // check for dynamic text children
  17489. const hasDynamicTextChild = type === 5 /* INTERPOLATION */ ||
  17490. type === 8 /* COMPOUND_EXPRESSION */;
  17491. if (hasDynamicTextChild &&
  17492. getConstantType(child, context) === 0 /* NOT_CONSTANT */) {
  17493. patchFlag |= 1 /* TEXT */;
  17494. }
  17495. // pass directly if the only child is a text node
  17496. // (plain / interpolation / expression)
  17497. if (hasDynamicTextChild || type === 2 /* TEXT */) {
  17498. vnodeChildren = child;
  17499. }
  17500. else {
  17501. vnodeChildren = node.children;
  17502. }
  17503. }
  17504. else {
  17505. vnodeChildren = node.children;
  17506. }
  17507. }
  17508. // patchFlag & dynamicPropNames
  17509. if (patchFlag !== 0) {
  17510. if ((process.env.NODE_ENV !== 'production')) {
  17511. if (patchFlag < 0) {
  17512. // special flags (negative and mutually exclusive)
  17513. vnodePatchFlag = patchFlag + ` /* ${PatchFlagNames[patchFlag]} */`;
  17514. }
  17515. else {
  17516. // bitwise flags
  17517. const flagNames = Object.keys(PatchFlagNames)
  17518. .map(Number)
  17519. .filter(n => n > 0 && patchFlag & n)
  17520. .map(n => PatchFlagNames[n])
  17521. .join(`, `);
  17522. vnodePatchFlag = patchFlag + ` /* ${flagNames} */`;
  17523. }
  17524. }
  17525. else {
  17526. vnodePatchFlag = String(patchFlag);
  17527. }
  17528. if (dynamicPropNames && dynamicPropNames.length) {
  17529. vnodeDynamicProps = stringifyDynamicPropNames(dynamicPropNames);
  17530. }
  17531. }
  17532. node.codegenNode = createVNodeCall(context, vnodeTag, vnodeProps, vnodeChildren, vnodePatchFlag, vnodeDynamicProps, vnodeDirectives, !!shouldUseBlock, false /* disableTracking */, isComponent, node.loc);
  17533. };
  17534. };
  17535. function resolveComponentType(node, context, ssr = false) {
  17536. let { tag } = node;
  17537. // 1. dynamic component
  17538. const isExplicitDynamic = isComponentTag(tag);
  17539. const isProp = findProp(node, 'is');
  17540. if (isProp) {
  17541. if (isExplicitDynamic ||
  17542. (isCompatEnabled("COMPILER_IS_ON_ELEMENT" /* COMPILER_IS_ON_ELEMENT */, context))) {
  17543. const exp = isProp.type === 6 /* ATTRIBUTE */
  17544. ? isProp.value && createSimpleExpression(isProp.value.content, true)
  17545. : isProp.exp;
  17546. if (exp) {
  17547. return createCallExpression(context.helper(RESOLVE_DYNAMIC_COMPONENT), [
  17548. exp
  17549. ]);
  17550. }
  17551. }
  17552. else if (isProp.type === 6 /* ATTRIBUTE */ &&
  17553. isProp.value.content.startsWith('vue:')) {
  17554. // <button is="vue:xxx">
  17555. // if not <component>, only is value that starts with "vue:" will be
  17556. // treated as component by the parse phase and reach here, unless it's
  17557. // compat mode where all is values are considered components
  17558. tag = isProp.value.content.slice(4);
  17559. }
  17560. }
  17561. // 1.5 v-is (TODO: Deprecate)
  17562. const isDir = !isExplicitDynamic && findDir(node, 'is');
  17563. if (isDir && isDir.exp) {
  17564. return createCallExpression(context.helper(RESOLVE_DYNAMIC_COMPONENT), [
  17565. isDir.exp
  17566. ]);
  17567. }
  17568. // 2. built-in components (Teleport, Transition, KeepAlive, Suspense...)
  17569. const builtIn = isCoreComponent(tag) || context.isBuiltInComponent(tag);
  17570. if (builtIn) {
  17571. // built-ins are simply fallthroughs / have special handling during ssr
  17572. // so we don't need to import their runtime equivalents
  17573. if (!ssr)
  17574. context.helper(builtIn);
  17575. return builtIn;
  17576. }
  17577. // 5. user component (resolve)
  17578. context.helper(RESOLVE_COMPONENT);
  17579. context.components.add(tag);
  17580. return toValidAssetId(tag, `component`);
  17581. }
  17582. function buildProps(node, context, props = node.props, ssr = false) {
  17583. const { tag, loc: elementLoc } = node;
  17584. const isComponent = node.tagType === 1 /* COMPONENT */;
  17585. let properties = [];
  17586. const mergeArgs = [];
  17587. const runtimeDirectives = [];
  17588. // patchFlag analysis
  17589. let patchFlag = 0;
  17590. let hasRef = false;
  17591. let hasClassBinding = false;
  17592. let hasStyleBinding = false;
  17593. let hasHydrationEventBinding = false;
  17594. let hasDynamicKeys = false;
  17595. let hasVnodeHook = false;
  17596. const dynamicPropNames = [];
  17597. const analyzePatchFlag = ({ key, value }) => {
  17598. if (isStaticExp(key)) {
  17599. const name = key.content;
  17600. const isEventHandler = isOn(name);
  17601. if (!isComponent &&
  17602. isEventHandler &&
  17603. // omit the flag for click handlers because hydration gives click
  17604. // dedicated fast path.
  17605. name.toLowerCase() !== 'onclick' &&
  17606. // omit v-model handlers
  17607. name !== 'onUpdate:modelValue' &&
  17608. // omit onVnodeXXX hooks
  17609. !isReservedProp(name)) {
  17610. hasHydrationEventBinding = true;
  17611. }
  17612. if (isEventHandler && isReservedProp(name)) {
  17613. hasVnodeHook = true;
  17614. }
  17615. if (value.type === 20 /* JS_CACHE_EXPRESSION */ ||
  17616. ((value.type === 4 /* SIMPLE_EXPRESSION */ ||
  17617. value.type === 8 /* COMPOUND_EXPRESSION */) &&
  17618. getConstantType(value, context) > 0)) {
  17619. // skip if the prop is a cached handler or has constant value
  17620. return;
  17621. }
  17622. if (name === 'ref') {
  17623. hasRef = true;
  17624. }
  17625. else if (name === 'class') {
  17626. hasClassBinding = true;
  17627. }
  17628. else if (name === 'style') {
  17629. hasStyleBinding = true;
  17630. }
  17631. else if (name !== 'key' && !dynamicPropNames.includes(name)) {
  17632. dynamicPropNames.push(name);
  17633. }
  17634. // treat the dynamic class and style binding of the component as dynamic props
  17635. if (isComponent &&
  17636. (name === 'class' || name === 'style') &&
  17637. !dynamicPropNames.includes(name)) {
  17638. dynamicPropNames.push(name);
  17639. }
  17640. }
  17641. else {
  17642. hasDynamicKeys = true;
  17643. }
  17644. };
  17645. for (let i = 0; i < props.length; i++) {
  17646. // static attribute
  17647. const prop = props[i];
  17648. if (prop.type === 6 /* ATTRIBUTE */) {
  17649. const { loc, name, value } = prop;
  17650. let isStatic = true;
  17651. if (name === 'ref') {
  17652. hasRef = true;
  17653. }
  17654. // skip is on <component>, or is="vue:xxx"
  17655. if (name === 'is' &&
  17656. (isComponentTag(tag) ||
  17657. (value && value.content.startsWith('vue:')) ||
  17658. (isCompatEnabled("COMPILER_IS_ON_ELEMENT" /* COMPILER_IS_ON_ELEMENT */, context)))) {
  17659. continue;
  17660. }
  17661. properties.push(createObjectProperty(createSimpleExpression(name, true, getInnerRange(loc, 0, name.length)), createSimpleExpression(value ? value.content : '', isStatic, value ? value.loc : loc)));
  17662. }
  17663. else {
  17664. // directives
  17665. const { name, arg, exp, loc } = prop;
  17666. const isVBind = name === 'bind';
  17667. const isVOn = name === 'on';
  17668. // skip v-slot - it is handled by its dedicated transform.
  17669. if (name === 'slot') {
  17670. if (!isComponent) {
  17671. context.onError(createCompilerError(39 /* X_V_SLOT_MISPLACED */, loc));
  17672. }
  17673. continue;
  17674. }
  17675. // skip v-once/v-memo - they are handled by dedicated transforms.
  17676. if (name === 'once' || name === 'memo') {
  17677. continue;
  17678. }
  17679. // skip v-is and :is on <component>
  17680. if (name === 'is' ||
  17681. (isVBind &&
  17682. isBindKey(arg, 'is') &&
  17683. (isComponentTag(tag) ||
  17684. (isCompatEnabled("COMPILER_IS_ON_ELEMENT" /* COMPILER_IS_ON_ELEMENT */, context))))) {
  17685. continue;
  17686. }
  17687. // skip v-on in SSR compilation
  17688. if (isVOn && ssr) {
  17689. continue;
  17690. }
  17691. // special case for v-bind and v-on with no argument
  17692. if (!arg && (isVBind || isVOn)) {
  17693. hasDynamicKeys = true;
  17694. if (exp) {
  17695. if (properties.length) {
  17696. mergeArgs.push(createObjectExpression(dedupeProperties(properties), elementLoc));
  17697. properties = [];
  17698. }
  17699. if (isVBind) {
  17700. {
  17701. // 2.x v-bind object order compat
  17702. if ((process.env.NODE_ENV !== 'production')) {
  17703. const hasOverridableKeys = mergeArgs.some(arg => {
  17704. if (arg.type === 15 /* JS_OBJECT_EXPRESSION */) {
  17705. return arg.properties.some(({ key }) => {
  17706. if (key.type !== 4 /* SIMPLE_EXPRESSION */ ||
  17707. !key.isStatic) {
  17708. return true;
  17709. }
  17710. return (key.content !== 'class' &&
  17711. key.content !== 'style' &&
  17712. !isOn(key.content));
  17713. });
  17714. }
  17715. else {
  17716. // dynamic expression
  17717. return true;
  17718. }
  17719. });
  17720. if (hasOverridableKeys) {
  17721. checkCompatEnabled("COMPILER_V_BIND_OBJECT_ORDER" /* COMPILER_V_BIND_OBJECT_ORDER */, context, loc);
  17722. }
  17723. }
  17724. if (isCompatEnabled("COMPILER_V_BIND_OBJECT_ORDER" /* COMPILER_V_BIND_OBJECT_ORDER */, context)) {
  17725. mergeArgs.unshift(exp);
  17726. continue;
  17727. }
  17728. }
  17729. mergeArgs.push(exp);
  17730. }
  17731. else {
  17732. // v-on="obj" -> toHandlers(obj)
  17733. mergeArgs.push({
  17734. type: 14 /* JS_CALL_EXPRESSION */,
  17735. loc,
  17736. callee: context.helper(TO_HANDLERS),
  17737. arguments: [exp]
  17738. });
  17739. }
  17740. }
  17741. else {
  17742. context.onError(createCompilerError(isVBind
  17743. ? 33 /* X_V_BIND_NO_EXPRESSION */
  17744. : 34 /* X_V_ON_NO_EXPRESSION */, loc));
  17745. }
  17746. continue;
  17747. }
  17748. const directiveTransform = context.directiveTransforms[name];
  17749. if (directiveTransform) {
  17750. // has built-in directive transform.
  17751. const { props, needRuntime } = directiveTransform(prop, node, context);
  17752. !ssr && props.forEach(analyzePatchFlag);
  17753. properties.push(...props);
  17754. if (needRuntime) {
  17755. runtimeDirectives.push(prop);
  17756. if (isSymbol(needRuntime)) {
  17757. directiveImportMap.set(prop, needRuntime);
  17758. }
  17759. }
  17760. }
  17761. else {
  17762. // no built-in transform, this is a user custom directive.
  17763. runtimeDirectives.push(prop);
  17764. }
  17765. }
  17766. if (prop.type === 6 /* ATTRIBUTE */ &&
  17767. prop.name === 'ref' &&
  17768. context.scopes.vFor > 0 &&
  17769. checkCompatEnabled("COMPILER_V_FOR_REF" /* COMPILER_V_FOR_REF */, context, prop.loc)) {
  17770. properties.push(createObjectProperty(createSimpleExpression('refInFor', true), createSimpleExpression('true', false)));
  17771. }
  17772. }
  17773. let propsExpression = undefined;
  17774. // has v-bind="object" or v-on="object", wrap with mergeProps
  17775. if (mergeArgs.length) {
  17776. if (properties.length) {
  17777. mergeArgs.push(createObjectExpression(dedupeProperties(properties), elementLoc));
  17778. }
  17779. if (mergeArgs.length > 1) {
  17780. propsExpression = createCallExpression(context.helper(MERGE_PROPS), mergeArgs, elementLoc);
  17781. }
  17782. else {
  17783. // single v-bind with nothing else - no need for a mergeProps call
  17784. propsExpression = mergeArgs[0];
  17785. }
  17786. }
  17787. else if (properties.length) {
  17788. propsExpression = createObjectExpression(dedupeProperties(properties), elementLoc);
  17789. }
  17790. // patchFlag analysis
  17791. if (hasDynamicKeys) {
  17792. patchFlag |= 16 /* FULL_PROPS */;
  17793. }
  17794. else {
  17795. if (hasClassBinding && !isComponent) {
  17796. patchFlag |= 2 /* CLASS */;
  17797. }
  17798. if (hasStyleBinding && !isComponent) {
  17799. patchFlag |= 4 /* STYLE */;
  17800. }
  17801. if (dynamicPropNames.length) {
  17802. patchFlag |= 8 /* PROPS */;
  17803. }
  17804. if (hasHydrationEventBinding) {
  17805. patchFlag |= 32 /* HYDRATE_EVENTS */;
  17806. }
  17807. }
  17808. if ((patchFlag === 0 || patchFlag === 32 /* HYDRATE_EVENTS */) &&
  17809. (hasRef || hasVnodeHook || runtimeDirectives.length > 0)) {
  17810. patchFlag |= 512 /* NEED_PATCH */;
  17811. }
  17812. // pre-normalize props, SSR is skipped for now
  17813. if (!context.inSSR && propsExpression) {
  17814. switch (propsExpression.type) {
  17815. case 15 /* JS_OBJECT_EXPRESSION */:
  17816. // means that there is no v-bind,
  17817. // but still need to deal with dynamic key binding
  17818. let classKeyIndex = -1;
  17819. let styleKeyIndex = -1;
  17820. let hasDynamicKey = false;
  17821. for (let i = 0; i < propsExpression.properties.length; i++) {
  17822. const key = propsExpression.properties[i].key;
  17823. if (isStaticExp(key)) {
  17824. if (key.content === 'class') {
  17825. classKeyIndex = i;
  17826. }
  17827. else if (key.content === 'style') {
  17828. styleKeyIndex = i;
  17829. }
  17830. }
  17831. else if (!key.isHandlerKey) {
  17832. hasDynamicKey = true;
  17833. }
  17834. }
  17835. const classProp = propsExpression.properties[classKeyIndex];
  17836. const styleProp = propsExpression.properties[styleKeyIndex];
  17837. // no dynamic key
  17838. if (!hasDynamicKey) {
  17839. if (classProp && !isStaticExp(classProp.value)) {
  17840. classProp.value = createCallExpression(context.helper(NORMALIZE_CLASS), [classProp.value]);
  17841. }
  17842. if (styleProp &&
  17843. !isStaticExp(styleProp.value) &&
  17844. // the static style is compiled into an object,
  17845. // so use `hasStyleBinding` to ensure that it is a dynamic style binding
  17846. (hasStyleBinding ||
  17847. // v-bind:style and style both exist,
  17848. // v-bind:style with static literal object
  17849. styleProp.value.type === 17 /* JS_ARRAY_EXPRESSION */)) {
  17850. styleProp.value = createCallExpression(context.helper(NORMALIZE_STYLE), [styleProp.value]);
  17851. }
  17852. }
  17853. else {
  17854. // dynamic key binding, wrap with `normalizeProps`
  17855. propsExpression = createCallExpression(context.helper(NORMALIZE_PROPS), [propsExpression]);
  17856. }
  17857. break;
  17858. case 14 /* JS_CALL_EXPRESSION */:
  17859. // mergeProps call, do nothing
  17860. break;
  17861. default:
  17862. // single v-bind
  17863. propsExpression = createCallExpression(context.helper(NORMALIZE_PROPS), [
  17864. createCallExpression(context.helper(GUARD_REACTIVE_PROPS), [
  17865. propsExpression
  17866. ])
  17867. ]);
  17868. break;
  17869. }
  17870. }
  17871. return {
  17872. props: propsExpression,
  17873. directives: runtimeDirectives,
  17874. patchFlag,
  17875. dynamicPropNames
  17876. };
  17877. }
  17878. // Dedupe props in an object literal.
  17879. // Literal duplicated attributes would have been warned during the parse phase,
  17880. // however, it's possible to encounter duplicated `onXXX` handlers with different
  17881. // modifiers. We also need to merge static and dynamic class / style attributes.
  17882. // - onXXX handlers / style: merge into array
  17883. // - class: merge into single expression with concatenation
  17884. function dedupeProperties(properties) {
  17885. const knownProps = new Map();
  17886. const deduped = [];
  17887. for (let i = 0; i < properties.length; i++) {
  17888. const prop = properties[i];
  17889. // dynamic keys are always allowed
  17890. if (prop.key.type === 8 /* COMPOUND_EXPRESSION */ || !prop.key.isStatic) {
  17891. deduped.push(prop);
  17892. continue;
  17893. }
  17894. const name = prop.key.content;
  17895. const existing = knownProps.get(name);
  17896. if (existing) {
  17897. if (name === 'style' || name === 'class' || name.startsWith('on')) {
  17898. mergeAsArray(existing, prop);
  17899. }
  17900. // unexpected duplicate, should have emitted error during parse
  17901. }
  17902. else {
  17903. knownProps.set(name, prop);
  17904. deduped.push(prop);
  17905. }
  17906. }
  17907. return deduped;
  17908. }
  17909. function mergeAsArray(existing, incoming) {
  17910. if (existing.value.type === 17 /* JS_ARRAY_EXPRESSION */) {
  17911. existing.value.elements.push(incoming.value);
  17912. }
  17913. else {
  17914. existing.value = createArrayExpression([existing.value, incoming.value], existing.loc);
  17915. }
  17916. }
  17917. function buildDirectiveArgs(dir, context) {
  17918. const dirArgs = [];
  17919. const runtime = directiveImportMap.get(dir);
  17920. if (runtime) {
  17921. // built-in directive with runtime
  17922. dirArgs.push(context.helperString(runtime));
  17923. }
  17924. else {
  17925. {
  17926. // inject statement for resolving directive
  17927. context.helper(RESOLVE_DIRECTIVE);
  17928. context.directives.add(dir.name);
  17929. dirArgs.push(toValidAssetId(dir.name, `directive`));
  17930. }
  17931. }
  17932. const { loc } = dir;
  17933. if (dir.exp)
  17934. dirArgs.push(dir.exp);
  17935. if (dir.arg) {
  17936. if (!dir.exp) {
  17937. dirArgs.push(`void 0`);
  17938. }
  17939. dirArgs.push(dir.arg);
  17940. }
  17941. if (Object.keys(dir.modifiers).length) {
  17942. if (!dir.arg) {
  17943. if (!dir.exp) {
  17944. dirArgs.push(`void 0`);
  17945. }
  17946. dirArgs.push(`void 0`);
  17947. }
  17948. const trueExpression = createSimpleExpression(`true`, false, loc);
  17949. dirArgs.push(createObjectExpression(dir.modifiers.map(modifier => createObjectProperty(modifier, trueExpression)), loc));
  17950. }
  17951. return createArrayExpression(dirArgs, dir.loc);
  17952. }
  17953. function stringifyDynamicPropNames(props) {
  17954. let propsNamesString = `[`;
  17955. for (let i = 0, l = props.length; i < l; i++) {
  17956. propsNamesString += JSON.stringify(props[i]);
  17957. if (i < l - 1)
  17958. propsNamesString += ', ';
  17959. }
  17960. return propsNamesString + `]`;
  17961. }
  17962. function isComponentTag(tag) {
  17963. return tag[0].toLowerCase() + tag.slice(1) === 'component';
  17964. }
  17965. (process.env.NODE_ENV !== 'production')
  17966. ? Object.freeze({})
  17967. : {};
  17968. (process.env.NODE_ENV !== 'production') ? Object.freeze([]) : [];
  17969. const cacheStringFunction = (fn) => {
  17970. const cache = Object.create(null);
  17971. return ((str) => {
  17972. const hit = cache[str];
  17973. return hit || (cache[str] = fn(str));
  17974. });
  17975. };
  17976. const camelizeRE = /-(\w)/g;
  17977. /**
  17978. * @private
  17979. */
  17980. const camelize = cacheStringFunction((str) => {
  17981. return str.replace(camelizeRE, (_, c) => (c ? c.toUpperCase() : ''));
  17982. });
  17983. const transformSlotOutlet = (node, context) => {
  17984. if (isSlotOutlet(node)) {
  17985. const { children, loc } = node;
  17986. const { slotName, slotProps } = processSlotOutlet(node, context);
  17987. const slotArgs = [
  17988. context.prefixIdentifiers ? `_ctx.$slots` : `$slots`,
  17989. slotName
  17990. ];
  17991. if (slotProps) {
  17992. slotArgs.push(slotProps);
  17993. }
  17994. if (children.length) {
  17995. if (!slotProps) {
  17996. slotArgs.push(`{}`);
  17997. }
  17998. slotArgs.push(createFunctionExpression([], children, false, false, loc));
  17999. }
  18000. if (context.scopeId && !context.slotted) {
  18001. if (!slotProps) {
  18002. slotArgs.push(`{}`);
  18003. }
  18004. if (!children.length) {
  18005. slotArgs.push(`undefined`);
  18006. }
  18007. slotArgs.push(`true`);
  18008. }
  18009. node.codegenNode = createCallExpression(context.helper(RENDER_SLOT), slotArgs, loc);
  18010. }
  18011. };
  18012. function processSlotOutlet(node, context) {
  18013. let slotName = `"default"`;
  18014. let slotProps = undefined;
  18015. const nonNameProps = [];
  18016. for (let i = 0; i < node.props.length; i++) {
  18017. const p = node.props[i];
  18018. if (p.type === 6 /* ATTRIBUTE */) {
  18019. if (p.value) {
  18020. if (p.name === 'name') {
  18021. slotName = JSON.stringify(p.value.content);
  18022. }
  18023. else {
  18024. p.name = camelize(p.name);
  18025. nonNameProps.push(p);
  18026. }
  18027. }
  18028. }
  18029. else {
  18030. if (p.name === 'bind' && isBindKey(p.arg, 'name')) {
  18031. if (p.exp)
  18032. slotName = p.exp;
  18033. }
  18034. else {
  18035. if (p.name === 'bind' && p.arg && isStaticExp(p.arg)) {
  18036. p.arg.content = camelize(p.arg.content);
  18037. }
  18038. nonNameProps.push(p);
  18039. }
  18040. }
  18041. }
  18042. if (nonNameProps.length > 0) {
  18043. const { props, directives } = buildProps(node, context, nonNameProps);
  18044. slotProps = props;
  18045. if (directives.length) {
  18046. context.onError(createCompilerError(35 /* X_V_SLOT_UNEXPECTED_DIRECTIVE_ON_SLOT_OUTLET */, directives[0].loc));
  18047. }
  18048. }
  18049. return {
  18050. slotName,
  18051. slotProps
  18052. };
  18053. }
  18054. const fnExpRE = /^\s*([\w$_]+|\([^)]*?\))\s*=>|^\s*function(?:\s+[\w$]+)?\s*\(/;
  18055. const transformOn = (dir, node, context, augmentor) => {
  18056. const { loc, modifiers, arg } = dir;
  18057. if (!dir.exp && !modifiers.length) {
  18058. context.onError(createCompilerError(34 /* X_V_ON_NO_EXPRESSION */, loc));
  18059. }
  18060. let eventName;
  18061. if (arg.type === 4 /* SIMPLE_EXPRESSION */) {
  18062. if (arg.isStatic) {
  18063. const rawName = arg.content;
  18064. // for all event listeners, auto convert it to camelCase. See issue #2249
  18065. eventName = createSimpleExpression(toHandlerKey(camelize$1(rawName)), true, arg.loc);
  18066. }
  18067. else {
  18068. // #2388
  18069. eventName = createCompoundExpression([
  18070. `${context.helperString(TO_HANDLER_KEY)}(`,
  18071. arg,
  18072. `)`
  18073. ]);
  18074. }
  18075. }
  18076. else {
  18077. // already a compound expression.
  18078. eventName = arg;
  18079. eventName.children.unshift(`${context.helperString(TO_HANDLER_KEY)}(`);
  18080. eventName.children.push(`)`);
  18081. }
  18082. // handler processing
  18083. let exp = dir.exp;
  18084. if (exp && !exp.content.trim()) {
  18085. exp = undefined;
  18086. }
  18087. let shouldCache = context.cacheHandlers && !exp && !context.inVOnce;
  18088. if (exp) {
  18089. const isMemberExp = isMemberExpression(exp.content);
  18090. const isInlineStatement = !(isMemberExp || fnExpRE.test(exp.content));
  18091. const hasMultipleStatements = exp.content.includes(`;`);
  18092. if ((process.env.NODE_ENV !== 'production') && true) {
  18093. validateBrowserExpression(exp, context, false, hasMultipleStatements);
  18094. }
  18095. if (isInlineStatement || (shouldCache && isMemberExp)) {
  18096. // wrap inline statement in a function expression
  18097. exp = createCompoundExpression([
  18098. `${isInlineStatement
  18099. ? `$event`
  18100. : `${``}(...args)`} => ${hasMultipleStatements ? `{` : `(`}`,
  18101. exp,
  18102. hasMultipleStatements ? `}` : `)`
  18103. ]);
  18104. }
  18105. }
  18106. let ret = {
  18107. props: [
  18108. createObjectProperty(eventName, exp || createSimpleExpression(`() => {}`, false, loc))
  18109. ]
  18110. };
  18111. // apply extended compiler augmentor
  18112. if (augmentor) {
  18113. ret = augmentor(ret);
  18114. }
  18115. if (shouldCache) {
  18116. // cache handlers so that it's always the same handler being passed down.
  18117. // this avoids unnecessary re-renders when users use inline handlers on
  18118. // components.
  18119. ret.props[0].value = context.cache(ret.props[0].value);
  18120. }
  18121. // mark the key as handler for props normalization check
  18122. ret.props.forEach(p => (p.key.isHandlerKey = true));
  18123. return ret;
  18124. };
  18125. // v-bind without arg is handled directly in ./transformElements.ts due to it affecting
  18126. // codegen for the entire props object. This transform here is only for v-bind
  18127. // *with* args.
  18128. const transformBind = (dir, _node, context) => {
  18129. const { exp, modifiers, loc } = dir;
  18130. const arg = dir.arg;
  18131. if (arg.type !== 4 /* SIMPLE_EXPRESSION */) {
  18132. arg.children.unshift(`(`);
  18133. arg.children.push(`) || ""`);
  18134. }
  18135. else if (!arg.isStatic) {
  18136. arg.content = `${arg.content} || ""`;
  18137. }
  18138. // .sync is replaced by v-model:arg
  18139. if (modifiers.includes('camel')) {
  18140. if (arg.type === 4 /* SIMPLE_EXPRESSION */) {
  18141. if (arg.isStatic) {
  18142. arg.content = camelize$1(arg.content);
  18143. }
  18144. else {
  18145. arg.content = `${context.helperString(CAMELIZE)}(${arg.content})`;
  18146. }
  18147. }
  18148. else {
  18149. arg.children.unshift(`${context.helperString(CAMELIZE)}(`);
  18150. arg.children.push(`)`);
  18151. }
  18152. }
  18153. if (!context.inSSR) {
  18154. if (modifiers.includes('prop')) {
  18155. injectPrefix(arg, '.');
  18156. }
  18157. if (modifiers.includes('attr')) {
  18158. injectPrefix(arg, '^');
  18159. }
  18160. }
  18161. if (!exp ||
  18162. (exp.type === 4 /* SIMPLE_EXPRESSION */ && !exp.content.trim())) {
  18163. context.onError(createCompilerError(33 /* X_V_BIND_NO_EXPRESSION */, loc));
  18164. return {
  18165. props: [createObjectProperty(arg, createSimpleExpression('', true, loc))]
  18166. };
  18167. }
  18168. return {
  18169. props: [createObjectProperty(arg, exp)]
  18170. };
  18171. };
  18172. const injectPrefix = (arg, prefix) => {
  18173. if (arg.type === 4 /* SIMPLE_EXPRESSION */) {
  18174. if (arg.isStatic) {
  18175. arg.content = prefix + arg.content;
  18176. }
  18177. else {
  18178. arg.content = `\`${prefix}\${${arg.content}}\``;
  18179. }
  18180. }
  18181. else {
  18182. arg.children.unshift(`'${prefix}' + (`);
  18183. arg.children.push(`)`);
  18184. }
  18185. };
  18186. // Merge adjacent text nodes and expressions into a single expression
  18187. // e.g. <div>abc {{ d }} {{ e }}</div> should have a single expression node as child.
  18188. const transformText = (node, context) => {
  18189. if (node.type === 0 /* ROOT */ ||
  18190. node.type === 1 /* ELEMENT */ ||
  18191. node.type === 11 /* FOR */ ||
  18192. node.type === 10 /* IF_BRANCH */) {
  18193. // perform the transform on node exit so that all expressions have already
  18194. // been processed.
  18195. return () => {
  18196. const children = node.children;
  18197. let currentContainer = undefined;
  18198. let hasText = false;
  18199. for (let i = 0; i < children.length; i++) {
  18200. const child = children[i];
  18201. if (isText(child)) {
  18202. hasText = true;
  18203. for (let j = i + 1; j < children.length; j++) {
  18204. const next = children[j];
  18205. if (isText(next)) {
  18206. if (!currentContainer) {
  18207. currentContainer = children[i] = {
  18208. type: 8 /* COMPOUND_EXPRESSION */,
  18209. loc: child.loc,
  18210. children: [child]
  18211. };
  18212. }
  18213. // merge adjacent text node into current
  18214. currentContainer.children.push(` + `, next);
  18215. children.splice(j, 1);
  18216. j--;
  18217. }
  18218. else {
  18219. currentContainer = undefined;
  18220. break;
  18221. }
  18222. }
  18223. }
  18224. }
  18225. if (!hasText ||
  18226. // if this is a plain element with a single text child, leave it
  18227. // as-is since the runtime has dedicated fast path for this by directly
  18228. // setting textContent of the element.
  18229. // for component root it's always normalized anyway.
  18230. (children.length === 1 &&
  18231. (node.type === 0 /* ROOT */ ||
  18232. (node.type === 1 /* ELEMENT */ &&
  18233. node.tagType === 0 /* ELEMENT */ &&
  18234. // #3756
  18235. // custom directives can potentially add DOM elements arbitrarily,
  18236. // we need to avoid setting textContent of the element at runtime
  18237. // to avoid accidentally overwriting the DOM elements added
  18238. // by the user through custom directives.
  18239. !node.props.find(p => p.type === 7 /* DIRECTIVE */ &&
  18240. !context.directiveTransforms[p.name]) &&
  18241. // in compat mode, <template> tags with no special directives
  18242. // will be rendered as a fragment so its children must be
  18243. // converted into vnodes.
  18244. !(node.tag === 'template'))))) {
  18245. return;
  18246. }
  18247. // pre-convert text nodes into createTextVNode(text) calls to avoid
  18248. // runtime normalization.
  18249. for (let i = 0; i < children.length; i++) {
  18250. const child = children[i];
  18251. if (isText(child) || child.type === 8 /* COMPOUND_EXPRESSION */) {
  18252. const callArgs = [];
  18253. // createTextVNode defaults to single whitespace, so if it is a
  18254. // single space the code could be an empty call to save bytes.
  18255. if (child.type !== 2 /* TEXT */ || child.content !== ' ') {
  18256. callArgs.push(child);
  18257. }
  18258. // mark dynamic text with flag so it gets patched inside a block
  18259. if (!context.ssr &&
  18260. getConstantType(child, context) === 0 /* NOT_CONSTANT */) {
  18261. callArgs.push(1 /* TEXT */ +
  18262. ((process.env.NODE_ENV !== 'production') ? ` /* ${PatchFlagNames[1 /* TEXT */]} */` : ``));
  18263. }
  18264. children[i] = {
  18265. type: 12 /* TEXT_CALL */,
  18266. content: child,
  18267. loc: child.loc,
  18268. codegenNode: createCallExpression(context.helper(CREATE_TEXT), callArgs)
  18269. };
  18270. }
  18271. }
  18272. };
  18273. }
  18274. };
  18275. const seen = new WeakSet();
  18276. const transformOnce = (node, context) => {
  18277. if (node.type === 1 /* ELEMENT */ && findDir(node, 'once', true)) {
  18278. if (seen.has(node) || context.inVOnce) {
  18279. return;
  18280. }
  18281. seen.add(node);
  18282. context.inVOnce = true;
  18283. context.helper(SET_BLOCK_TRACKING);
  18284. return () => {
  18285. context.inVOnce = false;
  18286. const cur = context.currentNode;
  18287. if (cur.codegenNode) {
  18288. cur.codegenNode = context.cache(cur.codegenNode, true /* isVNode */);
  18289. }
  18290. };
  18291. }
  18292. };
  18293. const transformModel = (dir, node, context) => {
  18294. const { exp, arg } = dir;
  18295. if (!exp) {
  18296. context.onError(createCompilerError(40 /* X_V_MODEL_NO_EXPRESSION */, dir.loc));
  18297. return createTransformProps();
  18298. }
  18299. const rawExp = exp.loc.source;
  18300. const expString = exp.type === 4 /* SIMPLE_EXPRESSION */ ? exp.content : rawExp;
  18301. const maybeRef = !true /* SETUP_CONST */;
  18302. if (!expString.trim() || (!isMemberExpression(expString) && !maybeRef)) {
  18303. context.onError(createCompilerError(41 /* X_V_MODEL_MALFORMED_EXPRESSION */, exp.loc));
  18304. return createTransformProps();
  18305. }
  18306. const propName = arg ? arg : createSimpleExpression('modelValue', true);
  18307. const eventName = arg
  18308. ? isStaticExp(arg)
  18309. ? `onUpdate:${arg.content}`
  18310. : createCompoundExpression(['"onUpdate:" + ', arg])
  18311. : `onUpdate:modelValue`;
  18312. let assignmentExp;
  18313. const eventArg = context.isTS ? `($event: any)` : `$event`;
  18314. {
  18315. assignmentExp = createCompoundExpression([
  18316. `${eventArg} => (`,
  18317. exp,
  18318. ` = $event)`
  18319. ]);
  18320. }
  18321. const props = [
  18322. // modelValue: foo
  18323. createObjectProperty(propName, dir.exp),
  18324. // "onUpdate:modelValue": $event => (foo = $event)
  18325. createObjectProperty(eventName, assignmentExp)
  18326. ];
  18327. // modelModifiers: { foo: true, "bar-baz": true }
  18328. if (dir.modifiers.length && node.tagType === 1 /* COMPONENT */) {
  18329. const modifiers = dir.modifiers
  18330. .map(m => (isSimpleIdentifier(m) ? m : JSON.stringify(m)) + `: true`)
  18331. .join(`, `);
  18332. const modifiersKey = arg
  18333. ? isStaticExp(arg)
  18334. ? `${arg.content}Modifiers`
  18335. : createCompoundExpression([arg, ' + "Modifiers"'])
  18336. : `modelModifiers`;
  18337. props.push(createObjectProperty(modifiersKey, createSimpleExpression(`{ ${modifiers} }`, false, dir.loc, 2 /* CAN_HOIST */)));
  18338. }
  18339. return createTransformProps(props);
  18340. };
  18341. function createTransformProps(props = []) {
  18342. return { props };
  18343. }
  18344. const validDivisionCharRE = /[\w).+\-_$\]]/;
  18345. const transformFilter = (node, context) => {
  18346. if (!isCompatEnabled("COMPILER_FILTER" /* COMPILER_FILTERS */, context)) {
  18347. return;
  18348. }
  18349. if (node.type === 5 /* INTERPOLATION */) {
  18350. // filter rewrite is applied before expression transform so only
  18351. // simple expressions are possible at this stage
  18352. rewriteFilter(node.content, context);
  18353. }
  18354. if (node.type === 1 /* ELEMENT */) {
  18355. node.props.forEach((prop) => {
  18356. if (prop.type === 7 /* DIRECTIVE */ &&
  18357. prop.name !== 'for' &&
  18358. prop.exp) {
  18359. rewriteFilter(prop.exp, context);
  18360. }
  18361. });
  18362. }
  18363. };
  18364. function rewriteFilter(node, context) {
  18365. if (node.type === 4 /* SIMPLE_EXPRESSION */) {
  18366. parseFilter(node, context);
  18367. }
  18368. else {
  18369. for (let i = 0; i < node.children.length; i++) {
  18370. const child = node.children[i];
  18371. if (typeof child !== 'object')
  18372. continue;
  18373. if (child.type === 4 /* SIMPLE_EXPRESSION */) {
  18374. parseFilter(child, context);
  18375. }
  18376. else if (child.type === 8 /* COMPOUND_EXPRESSION */) {
  18377. rewriteFilter(node, context);
  18378. }
  18379. else if (child.type === 5 /* INTERPOLATION */) {
  18380. rewriteFilter(child.content, context);
  18381. }
  18382. }
  18383. }
  18384. }
  18385. function parseFilter(node, context) {
  18386. const exp = node.content;
  18387. let inSingle = false;
  18388. let inDouble = false;
  18389. let inTemplateString = false;
  18390. let inRegex = false;
  18391. let curly = 0;
  18392. let square = 0;
  18393. let paren = 0;
  18394. let lastFilterIndex = 0;
  18395. let c, prev, i, expression, filters = [];
  18396. for (i = 0; i < exp.length; i++) {
  18397. prev = c;
  18398. c = exp.charCodeAt(i);
  18399. if (inSingle) {
  18400. if (c === 0x27 && prev !== 0x5c)
  18401. inSingle = false;
  18402. }
  18403. else if (inDouble) {
  18404. if (c === 0x22 && prev !== 0x5c)
  18405. inDouble = false;
  18406. }
  18407. else if (inTemplateString) {
  18408. if (c === 0x60 && prev !== 0x5c)
  18409. inTemplateString = false;
  18410. }
  18411. else if (inRegex) {
  18412. if (c === 0x2f && prev !== 0x5c)
  18413. inRegex = false;
  18414. }
  18415. else if (c === 0x7c && // pipe
  18416. exp.charCodeAt(i + 1) !== 0x7c &&
  18417. exp.charCodeAt(i - 1) !== 0x7c &&
  18418. !curly &&
  18419. !square &&
  18420. !paren) {
  18421. if (expression === undefined) {
  18422. // first filter, end of expression
  18423. lastFilterIndex = i + 1;
  18424. expression = exp.slice(0, i).trim();
  18425. }
  18426. else {
  18427. pushFilter();
  18428. }
  18429. }
  18430. else {
  18431. switch (c) {
  18432. case 0x22:
  18433. inDouble = true;
  18434. break; // "
  18435. case 0x27:
  18436. inSingle = true;
  18437. break; // '
  18438. case 0x60:
  18439. inTemplateString = true;
  18440. break; // `
  18441. case 0x28:
  18442. paren++;
  18443. break; // (
  18444. case 0x29:
  18445. paren--;
  18446. break; // )
  18447. case 0x5b:
  18448. square++;
  18449. break; // [
  18450. case 0x5d:
  18451. square--;
  18452. break; // ]
  18453. case 0x7b:
  18454. curly++;
  18455. break; // {
  18456. case 0x7d:
  18457. curly--;
  18458. break; // }
  18459. }
  18460. if (c === 0x2f) {
  18461. // /
  18462. let j = i - 1;
  18463. let p;
  18464. // find first non-whitespace prev char
  18465. for (; j >= 0; j--) {
  18466. p = exp.charAt(j);
  18467. if (p !== ' ')
  18468. break;
  18469. }
  18470. if (!p || !validDivisionCharRE.test(p)) {
  18471. inRegex = true;
  18472. }
  18473. }
  18474. }
  18475. }
  18476. if (expression === undefined) {
  18477. expression = exp.slice(0, i).trim();
  18478. }
  18479. else if (lastFilterIndex !== 0) {
  18480. pushFilter();
  18481. }
  18482. function pushFilter() {
  18483. filters.push(exp.slice(lastFilterIndex, i).trim());
  18484. lastFilterIndex = i + 1;
  18485. }
  18486. if (filters.length) {
  18487. (process.env.NODE_ENV !== 'production') &&
  18488. warnDeprecation("COMPILER_FILTER" /* COMPILER_FILTERS */, context, node.loc);
  18489. for (i = 0; i < filters.length; i++) {
  18490. expression = wrapFilter(expression, filters[i], context);
  18491. }
  18492. node.content = expression;
  18493. }
  18494. }
  18495. function wrapFilter(exp, filter, context) {
  18496. context.helper(RESOLVE_FILTER);
  18497. const i = filter.indexOf('(');
  18498. if (i < 0) {
  18499. context.filters.add(filter);
  18500. return `${toValidAssetId(filter, 'filter')}(${exp})`;
  18501. }
  18502. else {
  18503. const name = filter.slice(0, i);
  18504. const args = filter.slice(i + 1);
  18505. context.filters.add(name);
  18506. return `${toValidAssetId(name, 'filter')}(${exp}${args !== ')' ? ',' + args : args}`;
  18507. }
  18508. }
  18509. const seen$1 = new WeakSet();
  18510. const transformMemo = (node, context) => {
  18511. if (node.type === 1 /* ELEMENT */) {
  18512. const dir = findDir(node, 'memo');
  18513. if (!dir || seen$1.has(node)) {
  18514. return;
  18515. }
  18516. seen$1.add(node);
  18517. return () => {
  18518. const codegenNode = node.codegenNode ||
  18519. context.currentNode.codegenNode;
  18520. if (codegenNode && codegenNode.type === 13 /* VNODE_CALL */) {
  18521. // non-component sub tree should be turned into a block
  18522. if (node.tagType !== 1 /* COMPONENT */) {
  18523. makeBlock(codegenNode, context);
  18524. }
  18525. node.codegenNode = createCallExpression(context.helper(WITH_MEMO), [
  18526. dir.exp,
  18527. createFunctionExpression(undefined, codegenNode),
  18528. `_cache`,
  18529. String(context.cached++)
  18530. ]);
  18531. }
  18532. };
  18533. }
  18534. };
  18535. function getBaseTransformPreset(prefixIdentifiers) {
  18536. return [
  18537. [
  18538. transformOnce,
  18539. transformIf,
  18540. transformMemo,
  18541. transformFor,
  18542. ...([transformFilter] ),
  18543. ...((process.env.NODE_ENV !== 'production')
  18544. ? [transformExpression]
  18545. : []),
  18546. transformSlotOutlet,
  18547. transformElement,
  18548. trackSlotScopes,
  18549. transformText
  18550. ],
  18551. {
  18552. on: transformOn,
  18553. bind: transformBind,
  18554. model: transformModel
  18555. }
  18556. ];
  18557. }
  18558. // we name it `baseCompile` so that higher order compilers like
  18559. // @vue/compiler-dom can export `compile` while re-exporting everything else.
  18560. function baseCompile(template, options = {}) {
  18561. const onError = options.onError || defaultOnError;
  18562. const isModuleMode = options.mode === 'module';
  18563. /* istanbul ignore if */
  18564. {
  18565. if (options.prefixIdentifiers === true) {
  18566. onError(createCompilerError(45 /* X_PREFIX_ID_NOT_SUPPORTED */));
  18567. }
  18568. else if (isModuleMode) {
  18569. onError(createCompilerError(46 /* X_MODULE_MODE_NOT_SUPPORTED */));
  18570. }
  18571. }
  18572. const prefixIdentifiers = !true ;
  18573. if (options.cacheHandlers) {
  18574. onError(createCompilerError(47 /* X_CACHE_HANDLER_NOT_SUPPORTED */));
  18575. }
  18576. if (options.scopeId && !isModuleMode) {
  18577. onError(createCompilerError(48 /* X_SCOPE_ID_NOT_SUPPORTED */));
  18578. }
  18579. const ast = isString(template) ? baseParse(template, options) : template;
  18580. const [nodeTransforms, directiveTransforms] = getBaseTransformPreset();
  18581. transform(ast, extend({}, options, {
  18582. prefixIdentifiers,
  18583. nodeTransforms: [
  18584. ...nodeTransforms,
  18585. ...(options.nodeTransforms || []) // user transforms
  18586. ],
  18587. directiveTransforms: extend({}, directiveTransforms, options.directiveTransforms || {} // user transforms
  18588. )
  18589. }));
  18590. return generate(ast, extend({}, options, {
  18591. prefixIdentifiers
  18592. }));
  18593. }
  18594. const noopDirectiveTransform = () => ({ props: [] });
  18595. var compilerCore_esmBundler = {
  18596. __proto__: null,
  18597. BASE_TRANSITION: BASE_TRANSITION,
  18598. CAMELIZE: CAMELIZE,
  18599. CAPITALIZE: CAPITALIZE,
  18600. CREATE_BLOCK: CREATE_BLOCK,
  18601. CREATE_COMMENT: CREATE_COMMENT,
  18602. CREATE_ELEMENT_BLOCK: CREATE_ELEMENT_BLOCK,
  18603. CREATE_ELEMENT_VNODE: CREATE_ELEMENT_VNODE,
  18604. CREATE_SLOTS: CREATE_SLOTS,
  18605. CREATE_STATIC: CREATE_STATIC,
  18606. CREATE_TEXT: CREATE_TEXT,
  18607. CREATE_VNODE: CREATE_VNODE,
  18608. FRAGMENT: FRAGMENT,
  18609. GUARD_REACTIVE_PROPS: GUARD_REACTIVE_PROPS,
  18610. IS_MEMO_SAME: IS_MEMO_SAME,
  18611. IS_REF: IS_REF,
  18612. KEEP_ALIVE: KEEP_ALIVE,
  18613. MERGE_PROPS: MERGE_PROPS,
  18614. NORMALIZE_CLASS: NORMALIZE_CLASS,
  18615. NORMALIZE_PROPS: NORMALIZE_PROPS,
  18616. NORMALIZE_STYLE: NORMALIZE_STYLE,
  18617. OPEN_BLOCK: OPEN_BLOCK,
  18618. POP_SCOPE_ID: POP_SCOPE_ID,
  18619. PUSH_SCOPE_ID: PUSH_SCOPE_ID,
  18620. RENDER_LIST: RENDER_LIST,
  18621. RENDER_SLOT: RENDER_SLOT,
  18622. RESOLVE_COMPONENT: RESOLVE_COMPONENT,
  18623. RESOLVE_DIRECTIVE: RESOLVE_DIRECTIVE,
  18624. RESOLVE_DYNAMIC_COMPONENT: RESOLVE_DYNAMIC_COMPONENT,
  18625. RESOLVE_FILTER: RESOLVE_FILTER,
  18626. SET_BLOCK_TRACKING: SET_BLOCK_TRACKING,
  18627. SUSPENSE: SUSPENSE,
  18628. TELEPORT: TELEPORT,
  18629. TO_DISPLAY_STRING: TO_DISPLAY_STRING,
  18630. TO_HANDLERS: TO_HANDLERS,
  18631. TO_HANDLER_KEY: TO_HANDLER_KEY,
  18632. UNREF: UNREF,
  18633. WITH_CTX: WITH_CTX,
  18634. WITH_DIRECTIVES: WITH_DIRECTIVES,
  18635. WITH_MEMO: WITH_MEMO,
  18636. WITH_SCOPE_ID: WITH_SCOPE_ID,
  18637. advancePositionWithClone: advancePositionWithClone,
  18638. advancePositionWithMutation: advancePositionWithMutation,
  18639. assert: assert,
  18640. baseCompile: baseCompile,
  18641. baseParse: baseParse,
  18642. buildProps: buildProps,
  18643. buildSlots: buildSlots,
  18644. checkCompatEnabled: checkCompatEnabled,
  18645. createArrayExpression: createArrayExpression,
  18646. createAssignmentExpression: createAssignmentExpression,
  18647. createBlockStatement: createBlockStatement,
  18648. createCacheExpression: createCacheExpression,
  18649. createCallExpression: createCallExpression,
  18650. createCompilerError: createCompilerError,
  18651. createCompoundExpression: createCompoundExpression,
  18652. createConditionalExpression: createConditionalExpression,
  18653. createForLoopParams: createForLoopParams,
  18654. createFunctionExpression: createFunctionExpression,
  18655. createIfStatement: createIfStatement,
  18656. createInterpolation: createInterpolation,
  18657. createObjectExpression: createObjectExpression,
  18658. createObjectProperty: createObjectProperty,
  18659. createReturnStatement: createReturnStatement,
  18660. createRoot: createRoot,
  18661. createSequenceExpression: createSequenceExpression,
  18662. createSimpleExpression: createSimpleExpression,
  18663. createStructuralDirectiveTransform: createStructuralDirectiveTransform,
  18664. createTemplateLiteral: createTemplateLiteral,
  18665. createTransformContext: createTransformContext,
  18666. createVNodeCall: createVNodeCall,
  18667. extractIdentifiers: extractIdentifiers,
  18668. findDir: findDir,
  18669. findProp: findProp,
  18670. generate: generate,
  18671. getBaseTransformPreset: getBaseTransformPreset,
  18672. getInnerRange: getInnerRange,
  18673. getMemoedVNodeCall: getMemoedVNodeCall,
  18674. getVNodeBlockHelper: getVNodeBlockHelper,
  18675. getVNodeHelper: getVNodeHelper,
  18676. hasDynamicKeyVBind: hasDynamicKeyVBind,
  18677. hasScopeRef: hasScopeRef,
  18678. helperNameMap: helperNameMap,
  18679. injectProp: injectProp,
  18680. isBindKey: isBindKey,
  18681. isBuiltInType: isBuiltInType,
  18682. isCoreComponent: isCoreComponent,
  18683. isFunctionType: isFunctionType,
  18684. isInDestructureAssignment: isInDestructureAssignment,
  18685. isMemberExpression: isMemberExpression,
  18686. isReferencedIdentifier: isReferencedIdentifier,
  18687. isSimpleIdentifier: isSimpleIdentifier,
  18688. isSlotOutlet: isSlotOutlet,
  18689. isStaticExp: isStaticExp,
  18690. isStaticProperty: isStaticProperty,
  18691. isStaticPropertyKey: isStaticPropertyKey,
  18692. isTemplateNode: isTemplateNode,
  18693. isText: isText,
  18694. isVSlot: isVSlot,
  18695. locStub: locStub,
  18696. makeBlock: makeBlock,
  18697. noopDirectiveTransform: noopDirectiveTransform,
  18698. processExpression: processExpression,
  18699. processFor: processFor,
  18700. processIf: processIf,
  18701. processSlotOutlet: processSlotOutlet,
  18702. registerRuntimeHelpers: registerRuntimeHelpers,
  18703. resolveComponentType: resolveComponentType,
  18704. toValidAssetId: toValidAssetId,
  18705. trackSlotScopes: trackSlotScopes,
  18706. trackVForSlotScopes: trackVForSlotScopes,
  18707. transform: transform,
  18708. transformBind: transformBind,
  18709. transformElement: transformElement,
  18710. transformExpression: transformExpression,
  18711. transformModel: transformModel,
  18712. transformOn: transformOn,
  18713. traverseNode: traverseNode,
  18714. walkBlockDeclarations: walkBlockDeclarations,
  18715. walkFunctionParams: walkFunctionParams,
  18716. walkIdentifiers: walkIdentifiers,
  18717. warnDeprecation: warnDeprecation,
  18718. generateCodeFrame: generateCodeFrame
  18719. };
  18720. var require$$0 = /*@__PURE__*/build.getAugmentedNamespace(compilerCore_esmBundler);
  18721. var require$$1 = /*@__PURE__*/build.getAugmentedNamespace(shared_esmBundler);
  18722. (function (exports) {
  18723. Object.defineProperty(exports, '__esModule', { value: true });
  18724. var compilerCore = require$$0;
  18725. var shared = require$$1;
  18726. const V_MODEL_RADIO = Symbol(`vModelRadio` );
  18727. const V_MODEL_CHECKBOX = Symbol(`vModelCheckbox` );
  18728. const V_MODEL_TEXT = Symbol(`vModelText` );
  18729. const V_MODEL_SELECT = Symbol(`vModelSelect` );
  18730. const V_MODEL_DYNAMIC = Symbol(`vModelDynamic` );
  18731. const V_ON_WITH_MODIFIERS = Symbol(`vOnModifiersGuard` );
  18732. const V_ON_WITH_KEYS = Symbol(`vOnKeysGuard` );
  18733. const V_SHOW = Symbol(`vShow` );
  18734. const TRANSITION = Symbol(`Transition` );
  18735. const TRANSITION_GROUP = Symbol(`TransitionGroup` );
  18736. compilerCore.registerRuntimeHelpers({
  18737. [V_MODEL_RADIO]: `vModelRadio`,
  18738. [V_MODEL_CHECKBOX]: `vModelCheckbox`,
  18739. [V_MODEL_TEXT]: `vModelText`,
  18740. [V_MODEL_SELECT]: `vModelSelect`,
  18741. [V_MODEL_DYNAMIC]: `vModelDynamic`,
  18742. [V_ON_WITH_MODIFIERS]: `withModifiers`,
  18743. [V_ON_WITH_KEYS]: `withKeys`,
  18744. [V_SHOW]: `vShow`,
  18745. [TRANSITION]: `Transition`,
  18746. [TRANSITION_GROUP]: `TransitionGroup`
  18747. });
  18748. var namedCharacterReferences = {
  18749. GT: ">",
  18750. gt: ">",
  18751. LT: "<",
  18752. lt: "<",
  18753. "ac;": "∾",
  18754. "af;": "⁡",
  18755. AMP: "&",
  18756. amp: "&",
  18757. "ap;": "≈",
  18758. "DD;": "ⅅ",
  18759. "dd;": "ⅆ",
  18760. deg: "°",
  18761. "ee;": "ⅇ",
  18762. "eg;": "⪚",
  18763. "el;": "⪙",
  18764. ETH: "Ð",
  18765. eth: "ð",
  18766. "gE;": "≧",
  18767. "ge;": "≥",
  18768. "Gg;": "⋙",
  18769. "gg;": "≫",
  18770. "gl;": "≷",
  18771. "GT;": ">",
  18772. "Gt;": "≫",
  18773. "gt;": ">",
  18774. "ic;": "⁣",
  18775. "ii;": "ⅈ",
  18776. "Im;": "ℑ",
  18777. "in;": "∈",
  18778. "it;": "⁢",
  18779. "lE;": "≦",
  18780. "le;": "≤",
  18781. "lg;": "≶",
  18782. "Ll;": "⋘",
  18783. "ll;": "≪",
  18784. "LT;": "<",
  18785. "Lt;": "≪",
  18786. "lt;": "<",
  18787. "mp;": "∓",
  18788. "Mu;": "Μ",
  18789. "mu;": "μ",
  18790. "ne;": "≠",
  18791. "ni;": "∋",
  18792. not: "¬",
  18793. "Nu;": "Ν",
  18794. "nu;": "ν",
  18795. "Or;": "⩔",
  18796. "or;": "∨",
  18797. "oS;": "Ⓢ",
  18798. "Pi;": "Π",
  18799. "pi;": "π",
  18800. "pm;": "±",
  18801. "Pr;": "⪻",
  18802. "pr;": "≺",
  18803. "Re;": "ℜ",
  18804. REG: "®",
  18805. reg: "®",
  18806. "rx;": "℞",
  18807. "Sc;": "⪼",
  18808. "sc;": "≻",
  18809. shy: "­",
  18810. uml: "¨",
  18811. "wp;": "℘",
  18812. "wr;": "≀",
  18813. "Xi;": "Ξ",
  18814. "xi;": "ξ",
  18815. yen: "¥",
  18816. "acd;": "∿",
  18817. "acE;": "∾̳",
  18818. "Acy;": "А",
  18819. "acy;": "а",
  18820. "Afr;": "𝔄",
  18821. "afr;": "𝔞",
  18822. "AMP;": "&",
  18823. "amp;": "&",
  18824. "And;": "⩓",
  18825. "and;": "∧",
  18826. "ang;": "∠",
  18827. "apE;": "⩰",
  18828. "ape;": "≊",
  18829. "ast;": "*",
  18830. Auml: "Ä",
  18831. auml: "ä",
  18832. "Bcy;": "Б",
  18833. "bcy;": "б",
  18834. "Bfr;": "𝔅",
  18835. "bfr;": "𝔟",
  18836. "bne;": "=⃥",
  18837. "bot;": "⊥",
  18838. "Cap;": "⋒",
  18839. "cap;": "∩",
  18840. cent: "¢",
  18841. "Cfr;": "ℭ",
  18842. "cfr;": "𝔠",
  18843. "Chi;": "Χ",
  18844. "chi;": "χ",
  18845. "cir;": "○",
  18846. COPY: "©",
  18847. copy: "©",
  18848. "Cup;": "⋓",
  18849. "cup;": "∪",
  18850. "Dcy;": "Д",
  18851. "dcy;": "д",
  18852. "deg;": "°",
  18853. "Del;": "∇",
  18854. "Dfr;": "𝔇",
  18855. "dfr;": "𝔡",
  18856. "die;": "¨",
  18857. "div;": "÷",
  18858. "Dot;": "¨",
  18859. "dot;": "˙",
  18860. "Ecy;": "Э",
  18861. "ecy;": "э",
  18862. "Efr;": "𝔈",
  18863. "efr;": "𝔢",
  18864. "egs;": "⪖",
  18865. "ell;": "ℓ",
  18866. "els;": "⪕",
  18867. "ENG;": "Ŋ",
  18868. "eng;": "ŋ",
  18869. "Eta;": "Η",
  18870. "eta;": "η",
  18871. "ETH;": "Ð",
  18872. "eth;": "ð",
  18873. Euml: "Ë",
  18874. euml: "ë",
  18875. "Fcy;": "Ф",
  18876. "fcy;": "ф",
  18877. "Ffr;": "𝔉",
  18878. "ffr;": "𝔣",
  18879. "gap;": "⪆",
  18880. "Gcy;": "Г",
  18881. "gcy;": "г",
  18882. "gEl;": "⪌",
  18883. "gel;": "⋛",
  18884. "geq;": "≥",
  18885. "ges;": "⩾",
  18886. "Gfr;": "𝔊",
  18887. "gfr;": "𝔤",
  18888. "ggg;": "⋙",
  18889. "gla;": "⪥",
  18890. "glE;": "⪒",
  18891. "glj;": "⪤",
  18892. "gnE;": "≩",
  18893. "gne;": "⪈",
  18894. "Hat;": "^",
  18895. "Hfr;": "ℌ",
  18896. "hfr;": "𝔥",
  18897. "Icy;": "И",
  18898. "icy;": "и",
  18899. "iff;": "⇔",
  18900. "Ifr;": "ℑ",
  18901. "ifr;": "𝔦",
  18902. "Int;": "∬",
  18903. "int;": "∫",
  18904. Iuml: "Ï",
  18905. iuml: "ï",
  18906. "Jcy;": "Й",
  18907. "jcy;": "й",
  18908. "Jfr;": "𝔍",
  18909. "jfr;": "𝔧",
  18910. "Kcy;": "К",
  18911. "kcy;": "к",
  18912. "Kfr;": "𝔎",
  18913. "kfr;": "𝔨",
  18914. "lap;": "⪅",
  18915. "lat;": "⪫",
  18916. "Lcy;": "Л",
  18917. "lcy;": "л",
  18918. "lEg;": "⪋",
  18919. "leg;": "⋚",
  18920. "leq;": "≤",
  18921. "les;": "⩽",
  18922. "Lfr;": "𝔏",
  18923. "lfr;": "𝔩",
  18924. "lgE;": "⪑",
  18925. "lnE;": "≨",
  18926. "lne;": "⪇",
  18927. "loz;": "◊",
  18928. "lrm;": "‎",
  18929. "Lsh;": "↰",
  18930. "lsh;": "↰",
  18931. macr: "¯",
  18932. "Map;": "⤅",
  18933. "map;": "↦",
  18934. "Mcy;": "М",
  18935. "mcy;": "м",
  18936. "Mfr;": "𝔐",
  18937. "mfr;": "𝔪",
  18938. "mho;": "℧",
  18939. "mid;": "∣",
  18940. "nap;": "≉",
  18941. nbsp: " ",
  18942. "Ncy;": "Н",
  18943. "ncy;": "н",
  18944. "Nfr;": "𝔑",
  18945. "nfr;": "𝔫",
  18946. "ngE;": "≧̸",
  18947. "nge;": "≱",
  18948. "nGg;": "⋙̸",
  18949. "nGt;": "≫⃒",
  18950. "ngt;": "≯",
  18951. "nis;": "⋼",
  18952. "niv;": "∋",
  18953. "nlE;": "≦̸",
  18954. "nle;": "≰",
  18955. "nLl;": "⋘̸",
  18956. "nLt;": "≪⃒",
  18957. "nlt;": "≮",
  18958. "Not;": "⫬",
  18959. "not;": "¬",
  18960. "npr;": "⊀",
  18961. "nsc;": "⊁",
  18962. "num;": "#",
  18963. "Ocy;": "О",
  18964. "ocy;": "о",
  18965. "Ofr;": "𝔒",
  18966. "ofr;": "𝔬",
  18967. "ogt;": "⧁",
  18968. "ohm;": "Ω",
  18969. "olt;": "⧀",
  18970. "ord;": "⩝",
  18971. ordf: "ª",
  18972. ordm: "º",
  18973. "orv;": "⩛",
  18974. Ouml: "Ö",
  18975. ouml: "ö",
  18976. "par;": "∥",
  18977. para: "¶",
  18978. "Pcy;": "П",
  18979. "pcy;": "п",
  18980. "Pfr;": "𝔓",
  18981. "pfr;": "𝔭",
  18982. "Phi;": "Φ",
  18983. "phi;": "φ",
  18984. "piv;": "ϖ",
  18985. "prE;": "⪳",
  18986. "pre;": "⪯",
  18987. "Psi;": "Ψ",
  18988. "psi;": "ψ",
  18989. "Qfr;": "𝔔",
  18990. "qfr;": "𝔮",
  18991. QUOT: "\"",
  18992. quot: "\"",
  18993. "Rcy;": "Р",
  18994. "rcy;": "р",
  18995. "REG;": "®",
  18996. "reg;": "®",
  18997. "Rfr;": "ℜ",
  18998. "rfr;": "𝔯",
  18999. "Rho;": "Ρ",
  19000. "rho;": "ρ",
  19001. "rlm;": "‏",
  19002. "Rsh;": "↱",
  19003. "rsh;": "↱",
  19004. "scE;": "⪴",
  19005. "sce;": "⪰",
  19006. "Scy;": "С",
  19007. "scy;": "с",
  19008. sect: "§",
  19009. "Sfr;": "𝔖",
  19010. "sfr;": "𝔰",
  19011. "shy;": "­",
  19012. "sim;": "∼",
  19013. "smt;": "⪪",
  19014. "sol;": "/",
  19015. "squ;": "□",
  19016. "Sub;": "⋐",
  19017. "sub;": "⊂",
  19018. "Sum;": "∑",
  19019. "sum;": "∑",
  19020. "Sup;": "⋑",
  19021. "sup;": "⊃",
  19022. sup1: "¹",
  19023. sup2: "²",
  19024. sup3: "³",
  19025. "Tab;": "\t",
  19026. "Tau;": "Τ",
  19027. "tau;": "τ",
  19028. "Tcy;": "Т",
  19029. "tcy;": "т",
  19030. "Tfr;": "𝔗",
  19031. "tfr;": "𝔱",
  19032. "top;": "⊤",
  19033. "Ucy;": "У",
  19034. "ucy;": "у",
  19035. "Ufr;": "𝔘",
  19036. "ufr;": "𝔲",
  19037. "uml;": "¨",
  19038. Uuml: "Ü",
  19039. uuml: "ü",
  19040. "Vcy;": "В",
  19041. "vcy;": "в",
  19042. "Vee;": "⋁",
  19043. "vee;": "∨",
  19044. "Vfr;": "𝔙",
  19045. "vfr;": "𝔳",
  19046. "Wfr;": "𝔚",
  19047. "wfr;": "𝔴",
  19048. "Xfr;": "𝔛",
  19049. "xfr;": "𝔵",
  19050. "Ycy;": "Ы",
  19051. "ycy;": "ы",
  19052. "yen;": "¥",
  19053. "Yfr;": "𝔜",
  19054. "yfr;": "𝔶",
  19055. yuml: "ÿ",
  19056. "Zcy;": "З",
  19057. "zcy;": "з",
  19058. "Zfr;": "ℨ",
  19059. "zfr;": "𝔷",
  19060. "zwj;": "‍",
  19061. Acirc: "Â",
  19062. acirc: "â",
  19063. acute: "´",
  19064. AElig: "Æ",
  19065. aelig: "æ",
  19066. "andd;": "⩜",
  19067. "andv;": "⩚",
  19068. "ange;": "⦤",
  19069. "Aopf;": "𝔸",
  19070. "aopf;": "𝕒",
  19071. "apid;": "≋",
  19072. "apos;": "'",
  19073. Aring: "Å",
  19074. aring: "å",
  19075. "Ascr;": "𝒜",
  19076. "ascr;": "𝒶",
  19077. "Auml;": "Ä",
  19078. "auml;": "ä",
  19079. "Barv;": "⫧",
  19080. "bbrk;": "⎵",
  19081. "Beta;": "Β",
  19082. "beta;": "β",
  19083. "beth;": "ℶ",
  19084. "bNot;": "⫭",
  19085. "bnot;": "⌐",
  19086. "Bopf;": "𝔹",
  19087. "bopf;": "𝕓",
  19088. "boxH;": "═",
  19089. "boxh;": "─",
  19090. "boxV;": "║",
  19091. "boxv;": "│",
  19092. "Bscr;": "ℬ",
  19093. "bscr;": "𝒷",
  19094. "bsim;": "∽",
  19095. "bsol;": "\\",
  19096. "bull;": "•",
  19097. "bump;": "≎",
  19098. "caps;": "∩︀",
  19099. "Cdot;": "Ċ",
  19100. "cdot;": "ċ",
  19101. cedil: "¸",
  19102. "cent;": "¢",
  19103. "CHcy;": "Ч",
  19104. "chcy;": "ч",
  19105. "circ;": "ˆ",
  19106. "cirE;": "⧃",
  19107. "cire;": "≗",
  19108. "comp;": "∁",
  19109. "cong;": "≅",
  19110. "Copf;": "ℂ",
  19111. "copf;": "𝕔",
  19112. "COPY;": "©",
  19113. "copy;": "©",
  19114. "Cscr;": "𝒞",
  19115. "cscr;": "𝒸",
  19116. "csub;": "⫏",
  19117. "csup;": "⫐",
  19118. "cups;": "∪︀",
  19119. "Darr;": "↡",
  19120. "dArr;": "⇓",
  19121. "darr;": "↓",
  19122. "dash;": "‐",
  19123. "dHar;": "⥥",
  19124. "diam;": "⋄",
  19125. "DJcy;": "Ђ",
  19126. "djcy;": "ђ",
  19127. "Dopf;": "𝔻",
  19128. "dopf;": "𝕕",
  19129. "Dscr;": "𝒟",
  19130. "dscr;": "𝒹",
  19131. "DScy;": "Ѕ",
  19132. "dscy;": "ѕ",
  19133. "dsol;": "⧶",
  19134. "dtri;": "▿",
  19135. "DZcy;": "Џ",
  19136. "dzcy;": "џ",
  19137. "ecir;": "≖",
  19138. Ecirc: "Ê",
  19139. ecirc: "ê",
  19140. "Edot;": "Ė",
  19141. "eDot;": "≑",
  19142. "edot;": "ė",
  19143. "emsp;": " ",
  19144. "ensp;": " ",
  19145. "Eopf;": "𝔼",
  19146. "eopf;": "𝕖",
  19147. "epar;": "⋕",
  19148. "epsi;": "ε",
  19149. "Escr;": "ℰ",
  19150. "escr;": "ℯ",
  19151. "Esim;": "⩳",
  19152. "esim;": "≂",
  19153. "Euml;": "Ë",
  19154. "euml;": "ë",
  19155. "euro;": "€",
  19156. "excl;": "!",
  19157. "flat;": "♭",
  19158. "fnof;": "ƒ",
  19159. "Fopf;": "𝔽",
  19160. "fopf;": "𝕗",
  19161. "fork;": "⋔",
  19162. "Fscr;": "ℱ",
  19163. "fscr;": "𝒻",
  19164. "Gdot;": "Ġ",
  19165. "gdot;": "ġ",
  19166. "geqq;": "≧",
  19167. "gesl;": "⋛︀",
  19168. "GJcy;": "Ѓ",
  19169. "gjcy;": "ѓ",
  19170. "gnap;": "⪊",
  19171. "gneq;": "⪈",
  19172. "Gopf;": "𝔾",
  19173. "gopf;": "𝕘",
  19174. "Gscr;": "𝒢",
  19175. "gscr;": "ℊ",
  19176. "gsim;": "≳",
  19177. "gtcc;": "⪧",
  19178. "gvnE;": "≩︀",
  19179. "half;": "½",
  19180. "hArr;": "⇔",
  19181. "harr;": "↔",
  19182. "hbar;": "ℏ",
  19183. "Hopf;": "ℍ",
  19184. "hopf;": "𝕙",
  19185. "Hscr;": "ℋ",
  19186. "hscr;": "𝒽",
  19187. Icirc: "Î",
  19188. icirc: "î",
  19189. "Idot;": "İ",
  19190. "IEcy;": "Е",
  19191. "iecy;": "е",
  19192. iexcl: "¡",
  19193. "imof;": "⊷",
  19194. "IOcy;": "Ё",
  19195. "iocy;": "ё",
  19196. "Iopf;": "𝕀",
  19197. "iopf;": "𝕚",
  19198. "Iota;": "Ι",
  19199. "iota;": "ι",
  19200. "Iscr;": "ℐ",
  19201. "iscr;": "𝒾",
  19202. "isin;": "∈",
  19203. "Iuml;": "Ï",
  19204. "iuml;": "ï",
  19205. "Jopf;": "𝕁",
  19206. "jopf;": "𝕛",
  19207. "Jscr;": "𝒥",
  19208. "jscr;": "𝒿",
  19209. "KHcy;": "Х",
  19210. "khcy;": "х",
  19211. "KJcy;": "Ќ",
  19212. "kjcy;": "ќ",
  19213. "Kopf;": "𝕂",
  19214. "kopf;": "𝕜",
  19215. "Kscr;": "𝒦",
  19216. "kscr;": "𝓀",
  19217. "Lang;": "⟪",
  19218. "lang;": "⟨",
  19219. laquo: "«",
  19220. "Larr;": "↞",
  19221. "lArr;": "⇐",
  19222. "larr;": "←",
  19223. "late;": "⪭",
  19224. "lcub;": "{",
  19225. "ldca;": "⤶",
  19226. "ldsh;": "↲",
  19227. "leqq;": "≦",
  19228. "lesg;": "⋚︀",
  19229. "lHar;": "⥢",
  19230. "LJcy;": "Љ",
  19231. "ljcy;": "љ",
  19232. "lnap;": "⪉",
  19233. "lneq;": "⪇",
  19234. "Lopf;": "𝕃",
  19235. "lopf;": "𝕝",
  19236. "lozf;": "⧫",
  19237. "lpar;": "(",
  19238. "Lscr;": "ℒ",
  19239. "lscr;": "𝓁",
  19240. "lsim;": "≲",
  19241. "lsqb;": "[",
  19242. "ltcc;": "⪦",
  19243. "ltri;": "◃",
  19244. "lvnE;": "≨︀",
  19245. "macr;": "¯",
  19246. "male;": "♂",
  19247. "malt;": "✠",
  19248. micro: "µ",
  19249. "mlcp;": "⫛",
  19250. "mldr;": "…",
  19251. "Mopf;": "𝕄",
  19252. "mopf;": "𝕞",
  19253. "Mscr;": "ℳ",
  19254. "mscr;": "𝓂",
  19255. "nang;": "∠⃒",
  19256. "napE;": "⩰̸",
  19257. "nbsp;": " ",
  19258. "ncap;": "⩃",
  19259. "ncup;": "⩂",
  19260. "ngeq;": "≱",
  19261. "nges;": "⩾̸",
  19262. "ngtr;": "≯",
  19263. "nGtv;": "≫̸",
  19264. "nisd;": "⋺",
  19265. "NJcy;": "Њ",
  19266. "njcy;": "њ",
  19267. "nldr;": "‥",
  19268. "nleq;": "≰",
  19269. "nles;": "⩽̸",
  19270. "nLtv;": "≪̸",
  19271. "nmid;": "∤",
  19272. "Nopf;": "ℕ",
  19273. "nopf;": "𝕟",
  19274. "npar;": "∦",
  19275. "npre;": "⪯̸",
  19276. "nsce;": "⪰̸",
  19277. "Nscr;": "𝒩",
  19278. "nscr;": "𝓃",
  19279. "nsim;": "≁",
  19280. "nsub;": "⊄",
  19281. "nsup;": "⊅",
  19282. "ntgl;": "≹",
  19283. "ntlg;": "≸",
  19284. "nvap;": "≍⃒",
  19285. "nvge;": "≥⃒",
  19286. "nvgt;": ">⃒",
  19287. "nvle;": "≤⃒",
  19288. "nvlt;": "<⃒",
  19289. "oast;": "⊛",
  19290. "ocir;": "⊚",
  19291. Ocirc: "Ô",
  19292. ocirc: "ô",
  19293. "odiv;": "⨸",
  19294. "odot;": "⊙",
  19295. "ogon;": "˛",
  19296. "oint;": "∮",
  19297. "omid;": "⦶",
  19298. "Oopf;": "𝕆",
  19299. "oopf;": "𝕠",
  19300. "opar;": "⦷",
  19301. "ordf;": "ª",
  19302. "ordm;": "º",
  19303. "oror;": "⩖",
  19304. "Oscr;": "𝒪",
  19305. "oscr;": "ℴ",
  19306. "osol;": "⊘",
  19307. "Ouml;": "Ö",
  19308. "ouml;": "ö",
  19309. "para;": "¶",
  19310. "part;": "∂",
  19311. "perp;": "⊥",
  19312. "phiv;": "ϕ",
  19313. "plus;": "+",
  19314. "Popf;": "ℙ",
  19315. "popf;": "𝕡",
  19316. pound: "£",
  19317. "prap;": "⪷",
  19318. "prec;": "≺",
  19319. "prnE;": "⪵",
  19320. "prod;": "∏",
  19321. "prop;": "∝",
  19322. "Pscr;": "𝒫",
  19323. "pscr;": "𝓅",
  19324. "qint;": "⨌",
  19325. "Qopf;": "ℚ",
  19326. "qopf;": "𝕢",
  19327. "Qscr;": "𝒬",
  19328. "qscr;": "𝓆",
  19329. "QUOT;": "\"",
  19330. "quot;": "\"",
  19331. "race;": "∽̱",
  19332. "Rang;": "⟫",
  19333. "rang;": "⟩",
  19334. raquo: "»",
  19335. "Rarr;": "↠",
  19336. "rArr;": "⇒",
  19337. "rarr;": "→",
  19338. "rcub;": "}",
  19339. "rdca;": "⤷",
  19340. "rdsh;": "↳",
  19341. "real;": "ℜ",
  19342. "rect;": "▭",
  19343. "rHar;": "⥤",
  19344. "rhov;": "ϱ",
  19345. "ring;": "˚",
  19346. "Ropf;": "ℝ",
  19347. "ropf;": "𝕣",
  19348. "rpar;": ")",
  19349. "Rscr;": "ℛ",
  19350. "rscr;": "𝓇",
  19351. "rsqb;": "]",
  19352. "rtri;": "▹",
  19353. "scap;": "⪸",
  19354. "scnE;": "⪶",
  19355. "sdot;": "⋅",
  19356. "sect;": "§",
  19357. "semi;": ";",
  19358. "sext;": "✶",
  19359. "SHcy;": "Ш",
  19360. "shcy;": "ш",
  19361. "sime;": "≃",
  19362. "simg;": "⪞",
  19363. "siml;": "⪝",
  19364. "smid;": "∣",
  19365. "smte;": "⪬",
  19366. "solb;": "⧄",
  19367. "Sopf;": "𝕊",
  19368. "sopf;": "𝕤",
  19369. "spar;": "∥",
  19370. "Sqrt;": "√",
  19371. "squf;": "▪",
  19372. "Sscr;": "𝒮",
  19373. "sscr;": "𝓈",
  19374. "Star;": "⋆",
  19375. "star;": "☆",
  19376. "subE;": "⫅",
  19377. "sube;": "⊆",
  19378. "succ;": "≻",
  19379. "sung;": "♪",
  19380. "sup1;": "¹",
  19381. "sup2;": "²",
  19382. "sup3;": "³",
  19383. "supE;": "⫆",
  19384. "supe;": "⊇",
  19385. szlig: "ß",
  19386. "tbrk;": "⎴",
  19387. "tdot;": "⃛",
  19388. THORN: "Þ",
  19389. thorn: "þ",
  19390. times: "×",
  19391. "tint;": "∭",
  19392. "toea;": "⤨",
  19393. "Topf;": "𝕋",
  19394. "topf;": "𝕥",
  19395. "tosa;": "⤩",
  19396. "trie;": "≜",
  19397. "Tscr;": "𝒯",
  19398. "tscr;": "𝓉",
  19399. "TScy;": "Ц",
  19400. "tscy;": "ц",
  19401. "Uarr;": "↟",
  19402. "uArr;": "⇑",
  19403. "uarr;": "↑",
  19404. Ucirc: "Û",
  19405. ucirc: "û",
  19406. "uHar;": "⥣",
  19407. "Uopf;": "𝕌",
  19408. "uopf;": "𝕦",
  19409. "Upsi;": "ϒ",
  19410. "upsi;": "υ",
  19411. "Uscr;": "𝒰",
  19412. "uscr;": "𝓊",
  19413. "utri;": "▵",
  19414. "Uuml;": "Ü",
  19415. "uuml;": "ü",
  19416. "vArr;": "⇕",
  19417. "varr;": "↕",
  19418. "Vbar;": "⫫",
  19419. "vBar;": "⫨",
  19420. "Vert;": "‖",
  19421. "vert;": "|",
  19422. "Vopf;": "𝕍",
  19423. "vopf;": "𝕧",
  19424. "Vscr;": "𝒱",
  19425. "vscr;": "𝓋",
  19426. "Wopf;": "𝕎",
  19427. "wopf;": "𝕨",
  19428. "Wscr;": "𝒲",
  19429. "wscr;": "𝓌",
  19430. "xcap;": "⋂",
  19431. "xcup;": "⋃",
  19432. "xmap;": "⟼",
  19433. "xnis;": "⋻",
  19434. "Xopf;": "𝕏",
  19435. "xopf;": "𝕩",
  19436. "Xscr;": "𝒳",
  19437. "xscr;": "𝓍",
  19438. "xvee;": "⋁",
  19439. "YAcy;": "Я",
  19440. "yacy;": "я",
  19441. "YIcy;": "Ї",
  19442. "yicy;": "ї",
  19443. "Yopf;": "𝕐",
  19444. "yopf;": "𝕪",
  19445. "Yscr;": "𝒴",
  19446. "yscr;": "𝓎",
  19447. "YUcy;": "Ю",
  19448. "yucy;": "ю",
  19449. "Yuml;": "Ÿ",
  19450. "yuml;": "ÿ",
  19451. "Zdot;": "Ż",
  19452. "zdot;": "ż",
  19453. "Zeta;": "Ζ",
  19454. "zeta;": "ζ",
  19455. "ZHcy;": "Ж",
  19456. "zhcy;": "ж",
  19457. "Zopf;": "ℤ",
  19458. "zopf;": "𝕫",
  19459. "Zscr;": "𝒵",
  19460. "zscr;": "𝓏",
  19461. "zwnj;": "‌",
  19462. Aacute: "Á",
  19463. aacute: "á",
  19464. "Acirc;": "Â",
  19465. "acirc;": "â",
  19466. "acute;": "´",
  19467. "AElig;": "Æ",
  19468. "aelig;": "æ",
  19469. Agrave: "À",
  19470. agrave: "à",
  19471. "aleph;": "ℵ",
  19472. "Alpha;": "Α",
  19473. "alpha;": "α",
  19474. "Amacr;": "Ā",
  19475. "amacr;": "ā",
  19476. "amalg;": "⨿",
  19477. "angle;": "∠",
  19478. "angrt;": "∟",
  19479. "angst;": "Å",
  19480. "Aogon;": "Ą",
  19481. "aogon;": "ą",
  19482. "Aring;": "Å",
  19483. "aring;": "å",
  19484. "asymp;": "≈",
  19485. Atilde: "Ã",
  19486. atilde: "ã",
  19487. "awint;": "⨑",
  19488. "bcong;": "≌",
  19489. "bdquo;": "„",
  19490. "bepsi;": "϶",
  19491. "blank;": "␣",
  19492. "blk12;": "▒",
  19493. "blk14;": "░",
  19494. "blk34;": "▓",
  19495. "block;": "█",
  19496. "boxDL;": "╗",
  19497. "boxDl;": "╖",
  19498. "boxdL;": "╕",
  19499. "boxdl;": "┐",
  19500. "boxDR;": "╔",
  19501. "boxDr;": "╓",
  19502. "boxdR;": "╒",
  19503. "boxdr;": "┌",
  19504. "boxHD;": "╦",
  19505. "boxHd;": "╤",
  19506. "boxhD;": "╥",
  19507. "boxhd;": "┬",
  19508. "boxHU;": "╩",
  19509. "boxHu;": "╧",
  19510. "boxhU;": "╨",
  19511. "boxhu;": "┴",
  19512. "boxUL;": "╝",
  19513. "boxUl;": "╜",
  19514. "boxuL;": "╛",
  19515. "boxul;": "┘",
  19516. "boxUR;": "╚",
  19517. "boxUr;": "╙",
  19518. "boxuR;": "╘",
  19519. "boxur;": "└",
  19520. "boxVH;": "╬",
  19521. "boxVh;": "╫",
  19522. "boxvH;": "╪",
  19523. "boxvh;": "┼",
  19524. "boxVL;": "╣",
  19525. "boxVl;": "╢",
  19526. "boxvL;": "╡",
  19527. "boxvl;": "┤",
  19528. "boxVR;": "╠",
  19529. "boxVr;": "╟",
  19530. "boxvR;": "╞",
  19531. "boxvr;": "├",
  19532. "Breve;": "˘",
  19533. "breve;": "˘",
  19534. brvbar: "¦",
  19535. "bsemi;": "⁏",
  19536. "bsime;": "⋍",
  19537. "bsolb;": "⧅",
  19538. "bumpE;": "⪮",
  19539. "bumpe;": "≏",
  19540. "caret;": "⁁",
  19541. "caron;": "ˇ",
  19542. "ccaps;": "⩍",
  19543. Ccedil: "Ç",
  19544. ccedil: "ç",
  19545. "Ccirc;": "Ĉ",
  19546. "ccirc;": "ĉ",
  19547. "ccups;": "⩌",
  19548. "cedil;": "¸",
  19549. "check;": "✓",
  19550. "clubs;": "♣",
  19551. "Colon;": "∷",
  19552. "colon;": ":",
  19553. "comma;": ",",
  19554. "crarr;": "↵",
  19555. "Cross;": "⨯",
  19556. "cross;": "✗",
  19557. "csube;": "⫑",
  19558. "csupe;": "⫒",
  19559. "ctdot;": "⋯",
  19560. "cuepr;": "⋞",
  19561. "cuesc;": "⋟",
  19562. "cupor;": "⩅",
  19563. curren: "¤",
  19564. "cuvee;": "⋎",
  19565. "cuwed;": "⋏",
  19566. "cwint;": "∱",
  19567. "Dashv;": "⫤",
  19568. "dashv;": "⊣",
  19569. "dblac;": "˝",
  19570. "ddarr;": "⇊",
  19571. "Delta;": "Δ",
  19572. "delta;": "δ",
  19573. "dharl;": "⇃",
  19574. "dharr;": "⇂",
  19575. "diams;": "♦",
  19576. "disin;": "⋲",
  19577. divide: "÷",
  19578. "doteq;": "≐",
  19579. "dtdot;": "⋱",
  19580. "dtrif;": "▾",
  19581. "duarr;": "⇵",
  19582. "duhar;": "⥯",
  19583. Eacute: "É",
  19584. eacute: "é",
  19585. "Ecirc;": "Ê",
  19586. "ecirc;": "ê",
  19587. "eDDot;": "⩷",
  19588. "efDot;": "≒",
  19589. Egrave: "È",
  19590. egrave: "è",
  19591. "Emacr;": "Ē",
  19592. "emacr;": "ē",
  19593. "empty;": "∅",
  19594. "Eogon;": "Ę",
  19595. "eogon;": "ę",
  19596. "eplus;": "⩱",
  19597. "epsiv;": "ϵ",
  19598. "eqsim;": "≂",
  19599. "Equal;": "⩵",
  19600. "equiv;": "≡",
  19601. "erarr;": "⥱",
  19602. "erDot;": "≓",
  19603. "esdot;": "≐",
  19604. "exist;": "∃",
  19605. "fflig;": "ff",
  19606. "filig;": "fi",
  19607. "fjlig;": "fj",
  19608. "fllig;": "fl",
  19609. "fltns;": "▱",
  19610. "forkv;": "⫙",
  19611. frac12: "½",
  19612. frac14: "¼",
  19613. frac34: "¾",
  19614. "frasl;": "⁄",
  19615. "frown;": "⌢",
  19616. "Gamma;": "Γ",
  19617. "gamma;": "γ",
  19618. "Gcirc;": "Ĝ",
  19619. "gcirc;": "ĝ",
  19620. "gescc;": "⪩",
  19621. "gimel;": "ℷ",
  19622. "gneqq;": "≩",
  19623. "gnsim;": "⋧",
  19624. "grave;": "`",
  19625. "gsime;": "⪎",
  19626. "gsiml;": "⪐",
  19627. "gtcir;": "⩺",
  19628. "gtdot;": "⋗",
  19629. "Hacek;": "ˇ",
  19630. "harrw;": "↭",
  19631. "Hcirc;": "Ĥ",
  19632. "hcirc;": "ĥ",
  19633. "hoarr;": "⇿",
  19634. Iacute: "Í",
  19635. iacute: "í",
  19636. "Icirc;": "Î",
  19637. "icirc;": "î",
  19638. "iexcl;": "¡",
  19639. Igrave: "Ì",
  19640. igrave: "ì",
  19641. "iiint;": "∭",
  19642. "iiota;": "℩",
  19643. "IJlig;": "IJ",
  19644. "ijlig;": "ij",
  19645. "Imacr;": "Ī",
  19646. "imacr;": "ī",
  19647. "image;": "ℑ",
  19648. "imath;": "ı",
  19649. "imped;": "Ƶ",
  19650. "infin;": "∞",
  19651. "Iogon;": "Į",
  19652. "iogon;": "į",
  19653. "iprod;": "⨼",
  19654. iquest: "¿",
  19655. "isinE;": "⋹",
  19656. "isins;": "⋴",
  19657. "isinv;": "∈",
  19658. "Iukcy;": "І",
  19659. "iukcy;": "і",
  19660. "Jcirc;": "Ĵ",
  19661. "jcirc;": "ĵ",
  19662. "jmath;": "ȷ",
  19663. "Jukcy;": "Є",
  19664. "jukcy;": "є",
  19665. "Kappa;": "Κ",
  19666. "kappa;": "κ",
  19667. "lAarr;": "⇚",
  19668. "langd;": "⦑",
  19669. "laquo;": "«",
  19670. "larrb;": "⇤",
  19671. "lates;": "⪭︀",
  19672. "lBarr;": "⤎",
  19673. "lbarr;": "⤌",
  19674. "lbbrk;": "❲",
  19675. "lbrke;": "⦋",
  19676. "lceil;": "⌈",
  19677. "ldquo;": "“",
  19678. "lescc;": "⪨",
  19679. "lhard;": "↽",
  19680. "lharu;": "↼",
  19681. "lhblk;": "▄",
  19682. "llarr;": "⇇",
  19683. "lltri;": "◺",
  19684. "lneqq;": "≨",
  19685. "lnsim;": "⋦",
  19686. "loang;": "⟬",
  19687. "loarr;": "⇽",
  19688. "lobrk;": "⟦",
  19689. "lopar;": "⦅",
  19690. "lrarr;": "⇆",
  19691. "lrhar;": "⇋",
  19692. "lrtri;": "⊿",
  19693. "lsime;": "⪍",
  19694. "lsimg;": "⪏",
  19695. "lsquo;": "‘",
  19696. "ltcir;": "⩹",
  19697. "ltdot;": "⋖",
  19698. "ltrie;": "⊴",
  19699. "ltrif;": "◂",
  19700. "mdash;": "—",
  19701. "mDDot;": "∺",
  19702. "micro;": "µ",
  19703. middot: "·",
  19704. "minus;": "−",
  19705. "mumap;": "⊸",
  19706. "nabla;": "∇",
  19707. "napid;": "≋̸",
  19708. "napos;": "ʼn",
  19709. "natur;": "♮",
  19710. "nbump;": "≎̸",
  19711. "ncong;": "≇",
  19712. "ndash;": "–",
  19713. "neArr;": "⇗",
  19714. "nearr;": "↗",
  19715. "nedot;": "≐̸",
  19716. "nesim;": "≂̸",
  19717. "ngeqq;": "≧̸",
  19718. "ngsim;": "≵",
  19719. "nhArr;": "⇎",
  19720. "nharr;": "↮",
  19721. "nhpar;": "⫲",
  19722. "nlArr;": "⇍",
  19723. "nlarr;": "↚",
  19724. "nleqq;": "≦̸",
  19725. "nless;": "≮",
  19726. "nlsim;": "≴",
  19727. "nltri;": "⋪",
  19728. "notin;": "∉",
  19729. "notni;": "∌",
  19730. "npart;": "∂̸",
  19731. "nprec;": "⊀",
  19732. "nrArr;": "⇏",
  19733. "nrarr;": "↛",
  19734. "nrtri;": "⋫",
  19735. "nsime;": "≄",
  19736. "nsmid;": "∤",
  19737. "nspar;": "∦",
  19738. "nsubE;": "⫅̸",
  19739. "nsube;": "⊈",
  19740. "nsucc;": "⊁",
  19741. "nsupE;": "⫆̸",
  19742. "nsupe;": "⊉",
  19743. Ntilde: "Ñ",
  19744. ntilde: "ñ",
  19745. "numsp;": " ",
  19746. "nvsim;": "∼⃒",
  19747. "nwArr;": "⇖",
  19748. "nwarr;": "↖",
  19749. Oacute: "Ó",
  19750. oacute: "ó",
  19751. "Ocirc;": "Ô",
  19752. "ocirc;": "ô",
  19753. "odash;": "⊝",
  19754. "OElig;": "Œ",
  19755. "oelig;": "œ",
  19756. "ofcir;": "⦿",
  19757. Ograve: "Ò",
  19758. ograve: "ò",
  19759. "ohbar;": "⦵",
  19760. "olarr;": "↺",
  19761. "olcir;": "⦾",
  19762. "oline;": "‾",
  19763. "Omacr;": "Ō",
  19764. "omacr;": "ō",
  19765. "Omega;": "Ω",
  19766. "omega;": "ω",
  19767. "operp;": "⦹",
  19768. "oplus;": "⊕",
  19769. "orarr;": "↻",
  19770. "order;": "ℴ",
  19771. Oslash: "Ø",
  19772. oslash: "ø",
  19773. Otilde: "Õ",
  19774. otilde: "õ",
  19775. "ovbar;": "⌽",
  19776. "parsl;": "⫽",
  19777. "phone;": "☎",
  19778. "plusb;": "⊞",
  19779. "pluse;": "⩲",
  19780. plusmn: "±",
  19781. "pound;": "£",
  19782. "prcue;": "≼",
  19783. "Prime;": "″",
  19784. "prime;": "′",
  19785. "prnap;": "⪹",
  19786. "prsim;": "≾",
  19787. "quest;": "?",
  19788. "rAarr;": "⇛",
  19789. "radic;": "√",
  19790. "rangd;": "⦒",
  19791. "range;": "⦥",
  19792. "raquo;": "»",
  19793. "rarrb;": "⇥",
  19794. "rarrc;": "⤳",
  19795. "rarrw;": "↝",
  19796. "ratio;": "∶",
  19797. "RBarr;": "⤐",
  19798. "rBarr;": "⤏",
  19799. "rbarr;": "⤍",
  19800. "rbbrk;": "❳",
  19801. "rbrke;": "⦌",
  19802. "rceil;": "⌉",
  19803. "rdquo;": "”",
  19804. "reals;": "ℝ",
  19805. "rhard;": "⇁",
  19806. "rharu;": "⇀",
  19807. "rlarr;": "⇄",
  19808. "rlhar;": "⇌",
  19809. "rnmid;": "⫮",
  19810. "roang;": "⟭",
  19811. "roarr;": "⇾",
  19812. "robrk;": "⟧",
  19813. "ropar;": "⦆",
  19814. "rrarr;": "⇉",
  19815. "rsquo;": "’",
  19816. "rtrie;": "⊵",
  19817. "rtrif;": "▸",
  19818. "sbquo;": "‚",
  19819. "sccue;": "≽",
  19820. "Scirc;": "Ŝ",
  19821. "scirc;": "ŝ",
  19822. "scnap;": "⪺",
  19823. "scsim;": "≿",
  19824. "sdotb;": "⊡",
  19825. "sdote;": "⩦",
  19826. "seArr;": "⇘",
  19827. "searr;": "↘",
  19828. "setmn;": "∖",
  19829. "sharp;": "♯",
  19830. "Sigma;": "Σ",
  19831. "sigma;": "σ",
  19832. "simeq;": "≃",
  19833. "simgE;": "⪠",
  19834. "simlE;": "⪟",
  19835. "simne;": "≆",
  19836. "slarr;": "←",
  19837. "smile;": "⌣",
  19838. "smtes;": "⪬︀",
  19839. "sqcap;": "⊓",
  19840. "sqcup;": "⊔",
  19841. "sqsub;": "⊏",
  19842. "sqsup;": "⊐",
  19843. "srarr;": "→",
  19844. "starf;": "★",
  19845. "strns;": "¯",
  19846. "subnE;": "⫋",
  19847. "subne;": "⊊",
  19848. "supnE;": "⫌",
  19849. "supne;": "⊋",
  19850. "swArr;": "⇙",
  19851. "swarr;": "↙",
  19852. "szlig;": "ß",
  19853. "Theta;": "Θ",
  19854. "theta;": "θ",
  19855. "thkap;": "≈",
  19856. "THORN;": "Þ",
  19857. "thorn;": "þ",
  19858. "Tilde;": "∼",
  19859. "tilde;": "˜",
  19860. "times;": "×",
  19861. "TRADE;": "™",
  19862. "trade;": "™",
  19863. "trisb;": "⧍",
  19864. "TSHcy;": "Ћ",
  19865. "tshcy;": "ћ",
  19866. "twixt;": "≬",
  19867. Uacute: "Ú",
  19868. uacute: "ú",
  19869. "Ubrcy;": "Ў",
  19870. "ubrcy;": "ў",
  19871. "Ucirc;": "Û",
  19872. "ucirc;": "û",
  19873. "udarr;": "⇅",
  19874. "udhar;": "⥮",
  19875. Ugrave: "Ù",
  19876. ugrave: "ù",
  19877. "uharl;": "↿",
  19878. "uharr;": "↾",
  19879. "uhblk;": "▀",
  19880. "ultri;": "◸",
  19881. "Umacr;": "Ū",
  19882. "umacr;": "ū",
  19883. "Union;": "⋃",
  19884. "Uogon;": "Ų",
  19885. "uogon;": "ų",
  19886. "uplus;": "⊎",
  19887. "upsih;": "ϒ",
  19888. "UpTee;": "⊥",
  19889. "Uring;": "Ů",
  19890. "uring;": "ů",
  19891. "urtri;": "◹",
  19892. "utdot;": "⋰",
  19893. "utrif;": "▴",
  19894. "uuarr;": "⇈",
  19895. "varpi;": "ϖ",
  19896. "vBarv;": "⫩",
  19897. "VDash;": "⊫",
  19898. "Vdash;": "⊩",
  19899. "vDash;": "⊨",
  19900. "vdash;": "⊢",
  19901. "veeeq;": "≚",
  19902. "vltri;": "⊲",
  19903. "vnsub;": "⊂⃒",
  19904. "vnsup;": "⊃⃒",
  19905. "vprop;": "∝",
  19906. "vrtri;": "⊳",
  19907. "Wcirc;": "Ŵ",
  19908. "wcirc;": "ŵ",
  19909. "Wedge;": "⋀",
  19910. "wedge;": "∧",
  19911. "xcirc;": "◯",
  19912. "xdtri;": "▽",
  19913. "xhArr;": "⟺",
  19914. "xharr;": "⟷",
  19915. "xlArr;": "⟸",
  19916. "xlarr;": "⟵",
  19917. "xodot;": "⨀",
  19918. "xrArr;": "⟹",
  19919. "xrarr;": "⟶",
  19920. "xutri;": "△",
  19921. Yacute: "Ý",
  19922. yacute: "ý",
  19923. "Ycirc;": "Ŷ",
  19924. "ycirc;": "ŷ",
  19925. "Aacute;": "Á",
  19926. "aacute;": "á",
  19927. "Abreve;": "Ă",
  19928. "abreve;": "ă",
  19929. "Agrave;": "À",
  19930. "agrave;": "à",
  19931. "andand;": "⩕",
  19932. "angmsd;": "∡",
  19933. "angsph;": "∢",
  19934. "apacir;": "⩯",
  19935. "approx;": "≈",
  19936. "Assign;": "≔",
  19937. "Atilde;": "Ã",
  19938. "atilde;": "ã",
  19939. "barvee;": "⊽",
  19940. "Barwed;": "⌆",
  19941. "barwed;": "⌅",
  19942. "becaus;": "∵",
  19943. "bernou;": "ℬ",
  19944. "bigcap;": "⋂",
  19945. "bigcup;": "⋃",
  19946. "bigvee;": "⋁",
  19947. "bkarow;": "⤍",
  19948. "bottom;": "⊥",
  19949. "bowtie;": "⋈",
  19950. "boxbox;": "⧉",
  19951. "bprime;": "‵",
  19952. "brvbar;": "¦",
  19953. "bullet;": "•",
  19954. "Bumpeq;": "≎",
  19955. "bumpeq;": "≏",
  19956. "Cacute;": "Ć",
  19957. "cacute;": "ć",
  19958. "capand;": "⩄",
  19959. "capcap;": "⩋",
  19960. "capcup;": "⩇",
  19961. "capdot;": "⩀",
  19962. "Ccaron;": "Č",
  19963. "ccaron;": "č",
  19964. "Ccedil;": "Ç",
  19965. "ccedil;": "ç",
  19966. "circeq;": "≗",
  19967. "cirmid;": "⫯",
  19968. "Colone;": "⩴",
  19969. "colone;": "≔",
  19970. "commat;": "@",
  19971. "compfn;": "∘",
  19972. "Conint;": "∯",
  19973. "conint;": "∮",
  19974. "coprod;": "∐",
  19975. "copysr;": "℗",
  19976. "cularr;": "↶",
  19977. "CupCap;": "≍",
  19978. "cupcap;": "⩆",
  19979. "cupcup;": "⩊",
  19980. "cupdot;": "⊍",
  19981. "curarr;": "↷",
  19982. "curren;": "¤",
  19983. "cylcty;": "⌭",
  19984. "Dagger;": "‡",
  19985. "dagger;": "†",
  19986. "daleth;": "ℸ",
  19987. "Dcaron;": "Ď",
  19988. "dcaron;": "ď",
  19989. "dfisht;": "⥿",
  19990. "divide;": "÷",
  19991. "divonx;": "⋇",
  19992. "dlcorn;": "⌞",
  19993. "dlcrop;": "⌍",
  19994. "dollar;": "$",
  19995. "DotDot;": "⃜",
  19996. "drcorn;": "⌟",
  19997. "drcrop;": "⌌",
  19998. "Dstrok;": "Đ",
  19999. "dstrok;": "đ",
  20000. "Eacute;": "É",
  20001. "eacute;": "é",
  20002. "easter;": "⩮",
  20003. "Ecaron;": "Ě",
  20004. "ecaron;": "ě",
  20005. "ecolon;": "≕",
  20006. "Egrave;": "È",
  20007. "egrave;": "è",
  20008. "egsdot;": "⪘",
  20009. "elsdot;": "⪗",
  20010. "emptyv;": "∅",
  20011. "emsp13;": " ",
  20012. "emsp14;": " ",
  20013. "eparsl;": "⧣",
  20014. "eqcirc;": "≖",
  20015. "equals;": "=",
  20016. "equest;": "≟",
  20017. "Exists;": "∃",
  20018. "female;": "♀",
  20019. "ffilig;": "ffi",
  20020. "ffllig;": "ffl",
  20021. "ForAll;": "∀",
  20022. "forall;": "∀",
  20023. "frac12;": "½",
  20024. "frac13;": "⅓",
  20025. "frac14;": "¼",
  20026. "frac15;": "⅕",
  20027. "frac16;": "⅙",
  20028. "frac18;": "⅛",
  20029. "frac23;": "⅔",
  20030. "frac25;": "⅖",
  20031. "frac34;": "¾",
  20032. "frac35;": "⅗",
  20033. "frac38;": "⅜",
  20034. "frac45;": "⅘",
  20035. "frac56;": "⅚",
  20036. "frac58;": "⅝",
  20037. "frac78;": "⅞",
  20038. "gacute;": "ǵ",
  20039. "Gammad;": "Ϝ",
  20040. "gammad;": "ϝ",
  20041. "Gbreve;": "Ğ",
  20042. "gbreve;": "ğ",
  20043. "Gcedil;": "Ģ",
  20044. "gesdot;": "⪀",
  20045. "gesles;": "⪔",
  20046. "gtlPar;": "⦕",
  20047. "gtrarr;": "⥸",
  20048. "gtrdot;": "⋗",
  20049. "gtrsim;": "≳",
  20050. "hairsp;": " ",
  20051. "hamilt;": "ℋ",
  20052. "HARDcy;": "Ъ",
  20053. "hardcy;": "ъ",
  20054. "hearts;": "♥",
  20055. "hellip;": "…",
  20056. "hercon;": "⊹",
  20057. "homtht;": "∻",
  20058. "horbar;": "―",
  20059. "hslash;": "ℏ",
  20060. "Hstrok;": "Ħ",
  20061. "hstrok;": "ħ",
  20062. "hybull;": "⁃",
  20063. "hyphen;": "‐",
  20064. "Iacute;": "Í",
  20065. "iacute;": "í",
  20066. "Igrave;": "Ì",
  20067. "igrave;": "ì",
  20068. "iiiint;": "⨌",
  20069. "iinfin;": "⧜",
  20070. "incare;": "℅",
  20071. "inodot;": "ı",
  20072. "intcal;": "⊺",
  20073. "iquest;": "¿",
  20074. "isinsv;": "⋳",
  20075. "Itilde;": "Ĩ",
  20076. "itilde;": "ĩ",
  20077. "Jsercy;": "Ј",
  20078. "jsercy;": "ј",
  20079. "kappav;": "ϰ",
  20080. "Kcedil;": "Ķ",
  20081. "kcedil;": "ķ",
  20082. "kgreen;": "ĸ",
  20083. "Lacute;": "Ĺ",
  20084. "lacute;": "ĺ",
  20085. "lagran;": "ℒ",
  20086. "Lambda;": "Λ",
  20087. "lambda;": "λ",
  20088. "langle;": "⟨",
  20089. "larrfs;": "⤝",
  20090. "larrhk;": "↩",
  20091. "larrlp;": "↫",
  20092. "larrpl;": "⤹",
  20093. "larrtl;": "↢",
  20094. "lAtail;": "⤛",
  20095. "latail;": "⤙",
  20096. "lbrace;": "{",
  20097. "lbrack;": "[",
  20098. "Lcaron;": "Ľ",
  20099. "lcaron;": "ľ",
  20100. "Lcedil;": "Ļ",
  20101. "lcedil;": "ļ",
  20102. "ldquor;": "„",
  20103. "lesdot;": "⩿",
  20104. "lesges;": "⪓",
  20105. "lfisht;": "⥼",
  20106. "lfloor;": "⌊",
  20107. "lharul;": "⥪",
  20108. "llhard;": "⥫",
  20109. "Lmidot;": "Ŀ",
  20110. "lmidot;": "ŀ",
  20111. "lmoust;": "⎰",
  20112. "loplus;": "⨭",
  20113. "lowast;": "∗",
  20114. "lowbar;": "_",
  20115. "lparlt;": "⦓",
  20116. "lrhard;": "⥭",
  20117. "lsaquo;": "‹",
  20118. "lsquor;": "‚",
  20119. "Lstrok;": "Ł",
  20120. "lstrok;": "ł",
  20121. "lthree;": "⋋",
  20122. "ltimes;": "⋉",
  20123. "ltlarr;": "⥶",
  20124. "ltrPar;": "⦖",
  20125. "mapsto;": "↦",
  20126. "marker;": "▮",
  20127. "mcomma;": "⨩",
  20128. "midast;": "*",
  20129. "midcir;": "⫰",
  20130. "middot;": "·",
  20131. "minusb;": "⊟",
  20132. "minusd;": "∸",
  20133. "mnplus;": "∓",
  20134. "models;": "⊧",
  20135. "mstpos;": "∾",
  20136. "Nacute;": "Ń",
  20137. "nacute;": "ń",
  20138. "nbumpe;": "≏̸",
  20139. "Ncaron;": "Ň",
  20140. "ncaron;": "ň",
  20141. "Ncedil;": "Ņ",
  20142. "ncedil;": "ņ",
  20143. "nearhk;": "⤤",
  20144. "nequiv;": "≢",
  20145. "nesear;": "⤨",
  20146. "nexist;": "∄",
  20147. "nltrie;": "⋬",
  20148. "notinE;": "⋹̸",
  20149. "nparsl;": "⫽⃥",
  20150. "nprcue;": "⋠",
  20151. "nrarrc;": "⤳̸",
  20152. "nrarrw;": "↝̸",
  20153. "nrtrie;": "⋭",
  20154. "nsccue;": "⋡",
  20155. "nsimeq;": "≄",
  20156. "Ntilde;": "Ñ",
  20157. "ntilde;": "ñ",
  20158. "numero;": "№",
  20159. "nVDash;": "⊯",
  20160. "nVdash;": "⊮",
  20161. "nvDash;": "⊭",
  20162. "nvdash;": "⊬",
  20163. "nvHarr;": "⤄",
  20164. "nvlArr;": "⤂",
  20165. "nvrArr;": "⤃",
  20166. "nwarhk;": "⤣",
  20167. "nwnear;": "⤧",
  20168. "Oacute;": "Ó",
  20169. "oacute;": "ó",
  20170. "Odblac;": "Ő",
  20171. "odblac;": "ő",
  20172. "odsold;": "⦼",
  20173. "Ograve;": "Ò",
  20174. "ograve;": "ò",
  20175. "ominus;": "⊖",
  20176. "origof;": "⊶",
  20177. "Oslash;": "Ø",
  20178. "oslash;": "ø",
  20179. "Otilde;": "Õ",
  20180. "otilde;": "õ",
  20181. "Otimes;": "⨷",
  20182. "otimes;": "⊗",
  20183. "parsim;": "⫳",
  20184. "percnt;": "%",
  20185. "period;": ".",
  20186. "permil;": "‰",
  20187. "phmmat;": "ℳ",
  20188. "planck;": "ℏ",
  20189. "plankv;": "ℏ",
  20190. "plusdo;": "∔",
  20191. "plusdu;": "⨥",
  20192. "plusmn;": "±",
  20193. "preceq;": "⪯",
  20194. "primes;": "ℙ",
  20195. "prnsim;": "⋨",
  20196. "propto;": "∝",
  20197. "prurel;": "⊰",
  20198. "puncsp;": " ",
  20199. "qprime;": "⁗",
  20200. "Racute;": "Ŕ",
  20201. "racute;": "ŕ",
  20202. "rangle;": "⟩",
  20203. "rarrap;": "⥵",
  20204. "rarrfs;": "⤞",
  20205. "rarrhk;": "↪",
  20206. "rarrlp;": "↬",
  20207. "rarrpl;": "⥅",
  20208. "Rarrtl;": "⤖",
  20209. "rarrtl;": "↣",
  20210. "rAtail;": "⤜",
  20211. "ratail;": "⤚",
  20212. "rbrace;": "}",
  20213. "rbrack;": "]",
  20214. "Rcaron;": "Ř",
  20215. "rcaron;": "ř",
  20216. "Rcedil;": "Ŗ",
  20217. "rcedil;": "ŗ",
  20218. "rdquor;": "”",
  20219. "rfisht;": "⥽",
  20220. "rfloor;": "⌋",
  20221. "rharul;": "⥬",
  20222. "rmoust;": "⎱",
  20223. "roplus;": "⨮",
  20224. "rpargt;": "⦔",
  20225. "rsaquo;": "›",
  20226. "rsquor;": "’",
  20227. "rthree;": "⋌",
  20228. "rtimes;": "⋊",
  20229. "Sacute;": "Ś",
  20230. "sacute;": "ś",
  20231. "Scaron;": "Š",
  20232. "scaron;": "š",
  20233. "Scedil;": "Ş",
  20234. "scedil;": "ş",
  20235. "scnsim;": "⋩",
  20236. "searhk;": "⤥",
  20237. "seswar;": "⤩",
  20238. "sfrown;": "⌢",
  20239. "SHCHcy;": "Щ",
  20240. "shchcy;": "щ",
  20241. "sigmaf;": "ς",
  20242. "sigmav;": "ς",
  20243. "simdot;": "⩪",
  20244. "smashp;": "⨳",
  20245. "SOFTcy;": "Ь",
  20246. "softcy;": "ь",
  20247. "solbar;": "⌿",
  20248. "spades;": "♠",
  20249. "sqcaps;": "⊓︀",
  20250. "sqcups;": "⊔︀",
  20251. "sqsube;": "⊑",
  20252. "sqsupe;": "⊒",
  20253. "Square;": "□",
  20254. "square;": "□",
  20255. "squarf;": "▪",
  20256. "ssetmn;": "∖",
  20257. "ssmile;": "⌣",
  20258. "sstarf;": "⋆",
  20259. "subdot;": "⪽",
  20260. "Subset;": "⋐",
  20261. "subset;": "⊂",
  20262. "subsim;": "⫇",
  20263. "subsub;": "⫕",
  20264. "subsup;": "⫓",
  20265. "succeq;": "⪰",
  20266. "supdot;": "⪾",
  20267. "Supset;": "⋑",
  20268. "supset;": "⊃",
  20269. "supsim;": "⫈",
  20270. "supsub;": "⫔",
  20271. "supsup;": "⫖",
  20272. "swarhk;": "⤦",
  20273. "swnwar;": "⤪",
  20274. "target;": "⌖",
  20275. "Tcaron;": "Ť",
  20276. "tcaron;": "ť",
  20277. "Tcedil;": "Ţ",
  20278. "tcedil;": "ţ",
  20279. "telrec;": "⌕",
  20280. "there4;": "∴",
  20281. "thetav;": "ϑ",
  20282. "thinsp;": " ",
  20283. "thksim;": "∼",
  20284. "timesb;": "⊠",
  20285. "timesd;": "⨰",
  20286. "topbot;": "⌶",
  20287. "topcir;": "⫱",
  20288. "tprime;": "‴",
  20289. "tridot;": "◬",
  20290. "Tstrok;": "Ŧ",
  20291. "tstrok;": "ŧ",
  20292. "Uacute;": "Ú",
  20293. "uacute;": "ú",
  20294. "Ubreve;": "Ŭ",
  20295. "ubreve;": "ŭ",
  20296. "Udblac;": "Ű",
  20297. "udblac;": "ű",
  20298. "ufisht;": "⥾",
  20299. "Ugrave;": "Ù",
  20300. "ugrave;": "ù",
  20301. "ulcorn;": "⌜",
  20302. "ulcrop;": "⌏",
  20303. "urcorn;": "⌝",
  20304. "urcrop;": "⌎",
  20305. "Utilde;": "Ũ",
  20306. "utilde;": "ũ",
  20307. "vangrt;": "⦜",
  20308. "varphi;": "ϕ",
  20309. "varrho;": "ϱ",
  20310. "Vdashl;": "⫦",
  20311. "veebar;": "⊻",
  20312. "vellip;": "⋮",
  20313. "Verbar;": "‖",
  20314. "verbar;": "|",
  20315. "vsubnE;": "⫋︀",
  20316. "vsubne;": "⊊︀",
  20317. "vsupnE;": "⫌︀",
  20318. "vsupne;": "⊋︀",
  20319. "Vvdash;": "⊪",
  20320. "wedbar;": "⩟",
  20321. "wedgeq;": "≙",
  20322. "weierp;": "℘",
  20323. "wreath;": "≀",
  20324. "xoplus;": "⨁",
  20325. "xotime;": "⨂",
  20326. "xsqcup;": "⨆",
  20327. "xuplus;": "⨄",
  20328. "xwedge;": "⋀",
  20329. "Yacute;": "Ý",
  20330. "yacute;": "ý",
  20331. "Zacute;": "Ź",
  20332. "zacute;": "ź",
  20333. "Zcaron;": "Ž",
  20334. "zcaron;": "ž",
  20335. "zeetrf;": "ℨ",
  20336. "alefsym;": "ℵ",
  20337. "angrtvb;": "⊾",
  20338. "angzarr;": "⍼",
  20339. "asympeq;": "≍",
  20340. "backsim;": "∽",
  20341. "Because;": "∵",
  20342. "because;": "∵",
  20343. "bemptyv;": "⦰",
  20344. "between;": "≬",
  20345. "bigcirc;": "◯",
  20346. "bigodot;": "⨀",
  20347. "bigstar;": "★",
  20348. "bnequiv;": "≡⃥",
  20349. "boxplus;": "⊞",
  20350. "Cayleys;": "ℭ",
  20351. "Cconint;": "∰",
  20352. "ccupssm;": "⩐",
  20353. "Cedilla;": "¸",
  20354. "cemptyv;": "⦲",
  20355. "cirscir;": "⧂",
  20356. "coloneq;": "≔",
  20357. "congdot;": "⩭",
  20358. "cudarrl;": "⤸",
  20359. "cudarrr;": "⤵",
  20360. "cularrp;": "⤽",
  20361. "curarrm;": "⤼",
  20362. "dbkarow;": "⤏",
  20363. "ddagger;": "‡",
  20364. "ddotseq;": "⩷",
  20365. "demptyv;": "⦱",
  20366. "Diamond;": "⋄",
  20367. "diamond;": "⋄",
  20368. "digamma;": "ϝ",
  20369. "dotplus;": "∔",
  20370. "DownTee;": "⊤",
  20371. "dwangle;": "⦦",
  20372. "Element;": "∈",
  20373. "Epsilon;": "Ε",
  20374. "epsilon;": "ε",
  20375. "eqcolon;": "≕",
  20376. "equivDD;": "⩸",
  20377. "gesdoto;": "⪂",
  20378. "gtquest;": "⩼",
  20379. "gtrless;": "≷",
  20380. "harrcir;": "⥈",
  20381. "Implies;": "⇒",
  20382. "intprod;": "⨼",
  20383. "isindot;": "⋵",
  20384. "larrbfs;": "⤟",
  20385. "larrsim;": "⥳",
  20386. "lbrksld;": "⦏",
  20387. "lbrkslu;": "⦍",
  20388. "ldrdhar;": "⥧",
  20389. "LeftTee;": "⊣",
  20390. "lesdoto;": "⪁",
  20391. "lessdot;": "⋖",
  20392. "lessgtr;": "≶",
  20393. "lesssim;": "≲",
  20394. "lotimes;": "⨴",
  20395. "lozenge;": "◊",
  20396. "ltquest;": "⩻",
  20397. "luruhar;": "⥦",
  20398. "maltese;": "✠",
  20399. "minusdu;": "⨪",
  20400. "napprox;": "≉",
  20401. "natural;": "♮",
  20402. "nearrow;": "↗",
  20403. "NewLine;": "\n",
  20404. "nexists;": "∄",
  20405. "NoBreak;": "⁠",
  20406. "notinva;": "∉",
  20407. "notinvb;": "⋷",
  20408. "notinvc;": "⋶",
  20409. "NotLess;": "≮",
  20410. "notniva;": "∌",
  20411. "notnivb;": "⋾",
  20412. "notnivc;": "⋽",
  20413. "npolint;": "⨔",
  20414. "npreceq;": "⪯̸",
  20415. "nsqsube;": "⋢",
  20416. "nsqsupe;": "⋣",
  20417. "nsubset;": "⊂⃒",
  20418. "nsucceq;": "⪰̸",
  20419. "nsupset;": "⊃⃒",
  20420. "nvinfin;": "⧞",
  20421. "nvltrie;": "⊴⃒",
  20422. "nvrtrie;": "⊵⃒",
  20423. "nwarrow;": "↖",
  20424. "olcross;": "⦻",
  20425. "Omicron;": "Ο",
  20426. "omicron;": "ο",
  20427. "orderof;": "ℴ",
  20428. "orslope;": "⩗",
  20429. "OverBar;": "‾",
  20430. "pertenk;": "‱",
  20431. "planckh;": "ℎ",
  20432. "pluscir;": "⨢",
  20433. "plussim;": "⨦",
  20434. "plustwo;": "⨧",
  20435. "precsim;": "≾",
  20436. "Product;": "∏",
  20437. "quatint;": "⨖",
  20438. "questeq;": "≟",
  20439. "rarrbfs;": "⤠",
  20440. "rarrsim;": "⥴",
  20441. "rbrksld;": "⦎",
  20442. "rbrkslu;": "⦐",
  20443. "rdldhar;": "⥩",
  20444. "realine;": "ℛ",
  20445. "rotimes;": "⨵",
  20446. "ruluhar;": "⥨",
  20447. "searrow;": "↘",
  20448. "simplus;": "⨤",
  20449. "simrarr;": "⥲",
  20450. "subedot;": "⫃",
  20451. "submult;": "⫁",
  20452. "subplus;": "⪿",
  20453. "subrarr;": "⥹",
  20454. "succsim;": "≿",
  20455. "supdsub;": "⫘",
  20456. "supedot;": "⫄",
  20457. "suphsol;": "⟉",
  20458. "suphsub;": "⫗",
  20459. "suplarr;": "⥻",
  20460. "supmult;": "⫂",
  20461. "supplus;": "⫀",
  20462. "swarrow;": "↙",
  20463. "topfork;": "⫚",
  20464. "triplus;": "⨹",
  20465. "tritime;": "⨻",
  20466. "UpArrow;": "↑",
  20467. "Uparrow;": "⇑",
  20468. "uparrow;": "↑",
  20469. "Upsilon;": "Υ",
  20470. "upsilon;": "υ",
  20471. "uwangle;": "⦧",
  20472. "vzigzag;": "⦚",
  20473. "zigrarr;": "⇝",
  20474. "andslope;": "⩘",
  20475. "angmsdaa;": "⦨",
  20476. "angmsdab;": "⦩",
  20477. "angmsdac;": "⦪",
  20478. "angmsdad;": "⦫",
  20479. "angmsdae;": "⦬",
  20480. "angmsdaf;": "⦭",
  20481. "angmsdag;": "⦮",
  20482. "angmsdah;": "⦯",
  20483. "angrtvbd;": "⦝",
  20484. "approxeq;": "≊",
  20485. "awconint;": "∳",
  20486. "backcong;": "≌",
  20487. "barwedge;": "⌅",
  20488. "bbrktbrk;": "⎶",
  20489. "bigoplus;": "⨁",
  20490. "bigsqcup;": "⨆",
  20491. "biguplus;": "⨄",
  20492. "bigwedge;": "⋀",
  20493. "boxminus;": "⊟",
  20494. "boxtimes;": "⊠",
  20495. "bsolhsub;": "⟈",
  20496. "capbrcup;": "⩉",
  20497. "circledR;": "®",
  20498. "circledS;": "Ⓢ",
  20499. "cirfnint;": "⨐",
  20500. "clubsuit;": "♣",
  20501. "cupbrcap;": "⩈",
  20502. "curlyvee;": "⋎",
  20503. "cwconint;": "∲",
  20504. "DDotrahd;": "⤑",
  20505. "doteqdot;": "≑",
  20506. "DotEqual;": "≐",
  20507. "dotminus;": "∸",
  20508. "drbkarow;": "⤐",
  20509. "dzigrarr;": "⟿",
  20510. "elinters;": "⏧",
  20511. "emptyset;": "∅",
  20512. "eqvparsl;": "⧥",
  20513. "fpartint;": "⨍",
  20514. "geqslant;": "⩾",
  20515. "gesdotol;": "⪄",
  20516. "gnapprox;": "⪊",
  20517. "hksearow;": "⤥",
  20518. "hkswarow;": "⤦",
  20519. "imagline;": "ℐ",
  20520. "imagpart;": "ℑ",
  20521. "infintie;": "⧝",
  20522. "integers;": "ℤ",
  20523. "Integral;": "∫",
  20524. "intercal;": "⊺",
  20525. "intlarhk;": "⨗",
  20526. "laemptyv;": "⦴",
  20527. "ldrushar;": "⥋",
  20528. "leqslant;": "⩽",
  20529. "lesdotor;": "⪃",
  20530. "LessLess;": "⪡",
  20531. "llcorner;": "⌞",
  20532. "lnapprox;": "⪉",
  20533. "lrcorner;": "⌟",
  20534. "lurdshar;": "⥊",
  20535. "mapstoup;": "↥",
  20536. "multimap;": "⊸",
  20537. "naturals;": "ℕ",
  20538. "ncongdot;": "⩭̸",
  20539. "NotEqual;": "≠",
  20540. "notindot;": "⋵̸",
  20541. "NotTilde;": "≁",
  20542. "otimesas;": "⨶",
  20543. "parallel;": "∥",
  20544. "PartialD;": "∂",
  20545. "plusacir;": "⨣",
  20546. "pointint;": "⨕",
  20547. "Precedes;": "≺",
  20548. "precneqq;": "⪵",
  20549. "precnsim;": "⋨",
  20550. "profalar;": "⌮",
  20551. "profline;": "⌒",
  20552. "profsurf;": "⌓",
  20553. "raemptyv;": "⦳",
  20554. "realpart;": "ℜ",
  20555. "RightTee;": "⊢",
  20556. "rppolint;": "⨒",
  20557. "rtriltri;": "⧎",
  20558. "scpolint;": "⨓",
  20559. "setminus;": "∖",
  20560. "shortmid;": "∣",
  20561. "smeparsl;": "⧤",
  20562. "sqsubset;": "⊏",
  20563. "sqsupset;": "⊐",
  20564. "subseteq;": "⊆",
  20565. "Succeeds;": "≻",
  20566. "succneqq;": "⪶",
  20567. "succnsim;": "⋩",
  20568. "SuchThat;": "∋",
  20569. "Superset;": "⊃",
  20570. "supseteq;": "⊇",
  20571. "thetasym;": "ϑ",
  20572. "thicksim;": "∼",
  20573. "timesbar;": "⨱",
  20574. "triangle;": "▵",
  20575. "triminus;": "⨺",
  20576. "trpezium;": "⏢",
  20577. "Uarrocir;": "⥉",
  20578. "ulcorner;": "⌜",
  20579. "UnderBar;": "_",
  20580. "urcorner;": "⌝",
  20581. "varkappa;": "ϰ",
  20582. "varsigma;": "ς",
  20583. "vartheta;": "ϑ",
  20584. "backprime;": "‵",
  20585. "backsimeq;": "⋍",
  20586. "Backslash;": "∖",
  20587. "bigotimes;": "⨂",
  20588. "CenterDot;": "·",
  20589. "centerdot;": "·",
  20590. "checkmark;": "✓",
  20591. "CircleDot;": "⊙",
  20592. "complexes;": "ℂ",
  20593. "Congruent;": "≡",
  20594. "Coproduct;": "∐",
  20595. "dotsquare;": "⊡",
  20596. "DoubleDot;": "¨",
  20597. "DownArrow;": "↓",
  20598. "Downarrow;": "⇓",
  20599. "downarrow;": "↓",
  20600. "DownBreve;": "̑",
  20601. "gtrapprox;": "⪆",
  20602. "gtreqless;": "⋛",
  20603. "gvertneqq;": "≩︀",
  20604. "heartsuit;": "♥",
  20605. "HumpEqual;": "≏",
  20606. "LeftArrow;": "←",
  20607. "Leftarrow;": "⇐",
  20608. "leftarrow;": "←",
  20609. "LeftFloor;": "⌊",
  20610. "lesseqgtr;": "⋚",
  20611. "LessTilde;": "≲",
  20612. "lvertneqq;": "≨︀",
  20613. "Mellintrf;": "ℳ",
  20614. "MinusPlus;": "∓",
  20615. "ngeqslant;": "⩾̸",
  20616. "nleqslant;": "⩽̸",
  20617. "NotCupCap;": "≭",
  20618. "NotExists;": "∄",
  20619. "NotSubset;": "⊂⃒",
  20620. "nparallel;": "∦",
  20621. "nshortmid;": "∤",
  20622. "nsubseteq;": "⊈",
  20623. "nsupseteq;": "⊉",
  20624. "OverBrace;": "⏞",
  20625. "pitchfork;": "⋔",
  20626. "PlusMinus;": "±",
  20627. "rationals;": "ℚ",
  20628. "spadesuit;": "♠",
  20629. "subseteqq;": "⫅",
  20630. "subsetneq;": "⊊",
  20631. "supseteqq;": "⫆",
  20632. "supsetneq;": "⊋",
  20633. "Therefore;": "∴",
  20634. "therefore;": "∴",
  20635. "ThinSpace;": " ",
  20636. "triangleq;": "≜",
  20637. "TripleDot;": "⃛",
  20638. "UnionPlus;": "⊎",
  20639. "varpropto;": "∝",
  20640. "Bernoullis;": "ℬ",
  20641. "circledast;": "⊛",
  20642. "CirclePlus;": "⊕",
  20643. "complement;": "∁",
  20644. "curlywedge;": "⋏",
  20645. "eqslantgtr;": "⪖",
  20646. "EqualTilde;": "≂",
  20647. "Fouriertrf;": "ℱ",
  20648. "gtreqqless;": "⪌",
  20649. "ImaginaryI;": "ⅈ",
  20650. "Laplacetrf;": "ℒ",
  20651. "LeftVector;": "↼",
  20652. "lessapprox;": "⪅",
  20653. "lesseqqgtr;": "⪋",
  20654. "Lleftarrow;": "⇚",
  20655. "lmoustache;": "⎰",
  20656. "longmapsto;": "⟼",
  20657. "mapstodown;": "↧",
  20658. "mapstoleft;": "↤",
  20659. "nLeftarrow;": "⇍",
  20660. "nleftarrow;": "↚",
  20661. "NotElement;": "∉",
  20662. "NotGreater;": "≯",
  20663. "nsubseteqq;": "⫅̸",
  20664. "nsupseteqq;": "⫆̸",
  20665. "precapprox;": "⪷",
  20666. "Proportion;": "∷",
  20667. "RightArrow;": "→",
  20668. "Rightarrow;": "⇒",
  20669. "rightarrow;": "→",
  20670. "RightFloor;": "⌋",
  20671. "rmoustache;": "⎱",
  20672. "sqsubseteq;": "⊑",
  20673. "sqsupseteq;": "⊒",
  20674. "subsetneqq;": "⫋",
  20675. "succapprox;": "⪸",
  20676. "supsetneqq;": "⫌",
  20677. "ThickSpace;": "  ",
  20678. "TildeEqual;": "≃",
  20679. "TildeTilde;": "≈",
  20680. "UnderBrace;": "⏟",
  20681. "UpArrowBar;": "⤒",
  20682. "UpTeeArrow;": "↥",
  20683. "upuparrows;": "⇈",
  20684. "varepsilon;": "ϵ",
  20685. "varnothing;": "∅",
  20686. "backepsilon;": "϶",
  20687. "blacksquare;": "▪",
  20688. "circledcirc;": "⊚",
  20689. "circleddash;": "⊝",
  20690. "CircleMinus;": "⊖",
  20691. "CircleTimes;": "⊗",
  20692. "curlyeqprec;": "⋞",
  20693. "curlyeqsucc;": "⋟",
  20694. "diamondsuit;": "♦",
  20695. "eqslantless;": "⪕",
  20696. "Equilibrium;": "⇌",
  20697. "expectation;": "ℰ",
  20698. "GreaterLess;": "≷",
  20699. "LeftCeiling;": "⌈",
  20700. "LessGreater;": "≶",
  20701. "MediumSpace;": " ",
  20702. "NotLessLess;": "≪̸",
  20703. "NotPrecedes;": "⊀",
  20704. "NotSucceeds;": "⊁",
  20705. "NotSuperset;": "⊃⃒",
  20706. "nRightarrow;": "⇏",
  20707. "nrightarrow;": "↛",
  20708. "OverBracket;": "⎴",
  20709. "preccurlyeq;": "≼",
  20710. "precnapprox;": "⪹",
  20711. "quaternions;": "ℍ",
  20712. "RightVector;": "⇀",
  20713. "Rrightarrow;": "⇛",
  20714. "RuleDelayed;": "⧴",
  20715. "SmallCircle;": "∘",
  20716. "SquareUnion;": "⊔",
  20717. "straightphi;": "ϕ",
  20718. "SubsetEqual;": "⊆",
  20719. "succcurlyeq;": "≽",
  20720. "succnapprox;": "⪺",
  20721. "thickapprox;": "≈",
  20722. "UpDownArrow;": "↕",
  20723. "Updownarrow;": "⇕",
  20724. "updownarrow;": "↕",
  20725. "VerticalBar;": "∣",
  20726. "blacklozenge;": "⧫",
  20727. "DownArrowBar;": "⤓",
  20728. "DownTeeArrow;": "↧",
  20729. "ExponentialE;": "ⅇ",
  20730. "exponentiale;": "ⅇ",
  20731. "GreaterEqual;": "≥",
  20732. "GreaterTilde;": "≳",
  20733. "HilbertSpace;": "ℋ",
  20734. "HumpDownHump;": "≎",
  20735. "Intersection;": "⋂",
  20736. "LeftArrowBar;": "⇤",
  20737. "LeftTeeArrow;": "↤",
  20738. "LeftTriangle;": "⊲",
  20739. "LeftUpVector;": "↿",
  20740. "NotCongruent;": "≢",
  20741. "NotHumpEqual;": "≏̸",
  20742. "NotLessEqual;": "≰",
  20743. "NotLessTilde;": "≴",
  20744. "Proportional;": "∝",
  20745. "RightCeiling;": "⌉",
  20746. "risingdotseq;": "≓",
  20747. "RoundImplies;": "⥰",
  20748. "ShortUpArrow;": "↑",
  20749. "SquareSubset;": "⊏",
  20750. "triangledown;": "▿",
  20751. "triangleleft;": "◃",
  20752. "UnderBracket;": "⎵",
  20753. "varsubsetneq;": "⊊︀",
  20754. "varsupsetneq;": "⊋︀",
  20755. "VerticalLine;": "|",
  20756. "ApplyFunction;": "⁡",
  20757. "bigtriangleup;": "△",
  20758. "blacktriangle;": "▴",
  20759. "DifferentialD;": "ⅆ",
  20760. "divideontimes;": "⋇",
  20761. "DoubleLeftTee;": "⫤",
  20762. "DoubleUpArrow;": "⇑",
  20763. "fallingdotseq;": "≒",
  20764. "hookleftarrow;": "↩",
  20765. "leftarrowtail;": "↢",
  20766. "leftharpoonup;": "↼",
  20767. "LeftTeeVector;": "⥚",
  20768. "LeftVectorBar;": "⥒",
  20769. "LessFullEqual;": "≦",
  20770. "LongLeftArrow;": "⟵",
  20771. "Longleftarrow;": "⟸",
  20772. "longleftarrow;": "⟵",
  20773. "looparrowleft;": "↫",
  20774. "measuredangle;": "∡",
  20775. "NotEqualTilde;": "≂̸",
  20776. "NotTildeEqual;": "≄",
  20777. "NotTildeTilde;": "≉",
  20778. "ntriangleleft;": "⋪",
  20779. "Poincareplane;": "ℌ",
  20780. "PrecedesEqual;": "⪯",
  20781. "PrecedesTilde;": "≾",
  20782. "RightArrowBar;": "⇥",
  20783. "RightTeeArrow;": "↦",
  20784. "RightTriangle;": "⊳",
  20785. "RightUpVector;": "↾",
  20786. "shortparallel;": "∥",
  20787. "smallsetminus;": "∖",
  20788. "SucceedsEqual;": "⪰",
  20789. "SucceedsTilde;": "≿",
  20790. "SupersetEqual;": "⊇",
  20791. "triangleright;": "▹",
  20792. "UpEquilibrium;": "⥮",
  20793. "upharpoonleft;": "↿",
  20794. "varsubsetneqq;": "⫋︀",
  20795. "varsupsetneqq;": "⫌︀",
  20796. "VerticalTilde;": "≀",
  20797. "VeryThinSpace;": " ",
  20798. "curvearrowleft;": "↶",
  20799. "DiacriticalDot;": "˙",
  20800. "doublebarwedge;": "⌆",
  20801. "DoubleRightTee;": "⊨",
  20802. "downdownarrows;": "⇊",
  20803. "DownLeftVector;": "↽",
  20804. "GreaterGreater;": "⪢",
  20805. "hookrightarrow;": "↪",
  20806. "HorizontalLine;": "─",
  20807. "InvisibleComma;": "⁣",
  20808. "InvisibleTimes;": "⁢",
  20809. "LeftDownVector;": "⇃",
  20810. "leftleftarrows;": "⇇",
  20811. "LeftRightArrow;": "↔",
  20812. "Leftrightarrow;": "⇔",
  20813. "leftrightarrow;": "↔",
  20814. "leftthreetimes;": "⋋",
  20815. "LessSlantEqual;": "⩽",
  20816. "LongRightArrow;": "⟶",
  20817. "Longrightarrow;": "⟹",
  20818. "longrightarrow;": "⟶",
  20819. "looparrowright;": "↬",
  20820. "LowerLeftArrow;": "↙",
  20821. "NestedLessLess;": "≪",
  20822. "NotGreaterLess;": "≹",
  20823. "NotLessGreater;": "≸",
  20824. "NotSubsetEqual;": "⊈",
  20825. "NotVerticalBar;": "∤",
  20826. "nshortparallel;": "∦",
  20827. "ntriangleright;": "⋫",
  20828. "OpenCurlyQuote;": "‘",
  20829. "ReverseElement;": "∋",
  20830. "rightarrowtail;": "↣",
  20831. "rightharpoonup;": "⇀",
  20832. "RightTeeVector;": "⥛",
  20833. "RightVectorBar;": "⥓",
  20834. "ShortDownArrow;": "↓",
  20835. "ShortLeftArrow;": "←",
  20836. "SquareSuperset;": "⊐",
  20837. "TildeFullEqual;": "≅",
  20838. "trianglelefteq;": "⊴",
  20839. "upharpoonright;": "↾",
  20840. "UpperLeftArrow;": "↖",
  20841. "ZeroWidthSpace;": "​",
  20842. "bigtriangledown;": "▽",
  20843. "circlearrowleft;": "↺",
  20844. "CloseCurlyQuote;": "’",
  20845. "ContourIntegral;": "∮",
  20846. "curvearrowright;": "↷",
  20847. "DoubleDownArrow;": "⇓",
  20848. "DoubleLeftArrow;": "⇐",
  20849. "downharpoonleft;": "⇃",
  20850. "DownRightVector;": "⇁",
  20851. "leftharpoondown;": "↽",
  20852. "leftrightarrows;": "⇆",
  20853. "LeftRightVector;": "⥎",
  20854. "LeftTriangleBar;": "⧏",
  20855. "LeftUpTeeVector;": "⥠",
  20856. "LeftUpVectorBar;": "⥘",
  20857. "LowerRightArrow;": "↘",
  20858. "nLeftrightarrow;": "⇎",
  20859. "nleftrightarrow;": "↮",
  20860. "NotGreaterEqual;": "≱",
  20861. "NotGreaterTilde;": "≵",
  20862. "NotHumpDownHump;": "≎̸",
  20863. "NotLeftTriangle;": "⋪",
  20864. "NotSquareSubset;": "⊏̸",
  20865. "ntrianglelefteq;": "⋬",
  20866. "OverParenthesis;": "⏜",
  20867. "RightDownVector;": "⇂",
  20868. "rightleftarrows;": "⇄",
  20869. "rightsquigarrow;": "↝",
  20870. "rightthreetimes;": "⋌",
  20871. "ShortRightArrow;": "→",
  20872. "straightepsilon;": "ϵ",
  20873. "trianglerighteq;": "⊵",
  20874. "UpperRightArrow;": "↗",
  20875. "vartriangleleft;": "⊲",
  20876. "circlearrowright;": "↻",
  20877. "DiacriticalAcute;": "´",
  20878. "DiacriticalGrave;": "`",
  20879. "DiacriticalTilde;": "˜",
  20880. "DoubleRightArrow;": "⇒",
  20881. "DownArrowUpArrow;": "⇵",
  20882. "downharpoonright;": "⇂",
  20883. "EmptySmallSquare;": "◻",
  20884. "GreaterEqualLess;": "⋛",
  20885. "GreaterFullEqual;": "≧",
  20886. "LeftAngleBracket;": "⟨",
  20887. "LeftUpDownVector;": "⥑",
  20888. "LessEqualGreater;": "⋚",
  20889. "NonBreakingSpace;": " ",
  20890. "NotPrecedesEqual;": "⪯̸",
  20891. "NotRightTriangle;": "⋫",
  20892. "NotSucceedsEqual;": "⪰̸",
  20893. "NotSucceedsTilde;": "≿̸",
  20894. "NotSupersetEqual;": "⊉",
  20895. "ntrianglerighteq;": "⋭",
  20896. "rightharpoondown;": "⇁",
  20897. "rightrightarrows;": "⇉",
  20898. "RightTriangleBar;": "⧐",
  20899. "RightUpTeeVector;": "⥜",
  20900. "RightUpVectorBar;": "⥔",
  20901. "twoheadleftarrow;": "↞",
  20902. "UnderParenthesis;": "⏝",
  20903. "UpArrowDownArrow;": "⇅",
  20904. "vartriangleright;": "⊳",
  20905. "blacktriangledown;": "▾",
  20906. "blacktriangleleft;": "◂",
  20907. "DoubleUpDownArrow;": "⇕",
  20908. "DoubleVerticalBar;": "∥",
  20909. "DownLeftTeeVector;": "⥞",
  20910. "DownLeftVectorBar;": "⥖",
  20911. "FilledSmallSquare;": "◼",
  20912. "GreaterSlantEqual;": "⩾",
  20913. "LeftDoubleBracket;": "⟦",
  20914. "LeftDownTeeVector;": "⥡",
  20915. "LeftDownVectorBar;": "⥙",
  20916. "leftrightharpoons;": "⇋",
  20917. "LeftTriangleEqual;": "⊴",
  20918. "NegativeThinSpace;": "​",
  20919. "NotGreaterGreater;": "≫̸",
  20920. "NotLessSlantEqual;": "⩽̸",
  20921. "NotNestedLessLess;": "⪡̸",
  20922. "NotReverseElement;": "∌",
  20923. "NotSquareSuperset;": "⊐̸",
  20924. "NotTildeFullEqual;": "≇",
  20925. "RightAngleBracket;": "⟩",
  20926. "rightleftharpoons;": "⇌",
  20927. "RightUpDownVector;": "⥏",
  20928. "SquareSubsetEqual;": "⊑",
  20929. "twoheadrightarrow;": "↠",
  20930. "VerticalSeparator;": "❘",
  20931. "blacktriangleright;": "▸",
  20932. "DownRightTeeVector;": "⥟",
  20933. "DownRightVectorBar;": "⥗",
  20934. "LongLeftRightArrow;": "⟷",
  20935. "Longleftrightarrow;": "⟺",
  20936. "longleftrightarrow;": "⟷",
  20937. "NegativeThickSpace;": "​",
  20938. "NotLeftTriangleBar;": "⧏̸",
  20939. "PrecedesSlantEqual;": "≼",
  20940. "ReverseEquilibrium;": "⇋",
  20941. "RightDoubleBracket;": "⟧",
  20942. "RightDownTeeVector;": "⥝",
  20943. "RightDownVectorBar;": "⥕",
  20944. "RightTriangleEqual;": "⊵",
  20945. "SquareIntersection;": "⊓",
  20946. "SucceedsSlantEqual;": "≽",
  20947. "DoubleLongLeftArrow;": "⟸",
  20948. "DownLeftRightVector;": "⥐",
  20949. "LeftArrowRightArrow;": "⇆",
  20950. "leftrightsquigarrow;": "↭",
  20951. "NegativeMediumSpace;": "​",
  20952. "NotGreaterFullEqual;": "≧̸",
  20953. "NotRightTriangleBar;": "⧐̸",
  20954. "RightArrowLeftArrow;": "⇄",
  20955. "SquareSupersetEqual;": "⊒",
  20956. "CapitalDifferentialD;": "ⅅ",
  20957. "DoubleLeftRightArrow;": "⇔",
  20958. "DoubleLongRightArrow;": "⟹",
  20959. "EmptyVerySmallSquare;": "▫",
  20960. "NestedGreaterGreater;": "≫",
  20961. "NotDoubleVerticalBar;": "∦",
  20962. "NotGreaterSlantEqual;": "⩾̸",
  20963. "NotLeftTriangleEqual;": "⋬",
  20964. "NotSquareSubsetEqual;": "⋢",
  20965. "OpenCurlyDoubleQuote;": "“",
  20966. "ReverseUpEquilibrium;": "⥯",
  20967. "CloseCurlyDoubleQuote;": "”",
  20968. "DoubleContourIntegral;": "∯",
  20969. "FilledVerySmallSquare;": "▪",
  20970. "NegativeVeryThinSpace;": "​",
  20971. "NotPrecedesSlantEqual;": "⋠",
  20972. "NotRightTriangleEqual;": "⋭",
  20973. "NotSucceedsSlantEqual;": "⋡",
  20974. "DiacriticalDoubleAcute;": "˝",
  20975. "NotSquareSupersetEqual;": "⋣",
  20976. "NotNestedGreaterGreater;": "⪢̸",
  20977. "ClockwiseContourIntegral;": "∲",
  20978. "DoubleLongLeftRightArrow;": "⟺",
  20979. "CounterClockwiseContourIntegral;": "∳"
  20980. };
  20981. // lazy compute this to make this file tree-shakable for browser
  20982. let maxCRNameLength;
  20983. const decodeHtml = (rawText, asAttr) => {
  20984. let offset = 0;
  20985. const end = rawText.length;
  20986. let decodedText = '';
  20987. function advance(length) {
  20988. offset += length;
  20989. rawText = rawText.slice(length);
  20990. }
  20991. while (offset < end) {
  20992. const head = /&(?:#x?)?/i.exec(rawText);
  20993. if (!head || offset + head.index >= end) {
  20994. const remaining = end - offset;
  20995. decodedText += rawText.slice(0, remaining);
  20996. advance(remaining);
  20997. break;
  20998. }
  20999. // Advance to the "&".
  21000. decodedText += rawText.slice(0, head.index);
  21001. advance(head.index);
  21002. if (head[0] === '&') {
  21003. // Named character reference.
  21004. let name = '';
  21005. let value = undefined;
  21006. if (/[0-9a-z]/i.test(rawText[1])) {
  21007. if (!maxCRNameLength) {
  21008. maxCRNameLength = Object.keys(namedCharacterReferences).reduce((max, name) => Math.max(max, name.length), 0);
  21009. }
  21010. for (let length = maxCRNameLength; !value && length > 0; --length) {
  21011. name = rawText.substr(1, length);
  21012. value = namedCharacterReferences[name];
  21013. }
  21014. if (value) {
  21015. const semi = name.endsWith(';');
  21016. if (asAttr &&
  21017. !semi &&
  21018. /[=a-z0-9]/i.test(rawText[name.length + 1] || '')) {
  21019. decodedText += '&' + name;
  21020. advance(1 + name.length);
  21021. }
  21022. else {
  21023. decodedText += value;
  21024. advance(1 + name.length);
  21025. }
  21026. }
  21027. else {
  21028. decodedText += '&' + name;
  21029. advance(1 + name.length);
  21030. }
  21031. }
  21032. else {
  21033. decodedText += '&';
  21034. advance(1);
  21035. }
  21036. }
  21037. else {
  21038. // Numeric character reference.
  21039. const hex = head[0] === '&#x';
  21040. const pattern = hex ? /^&#x([0-9a-f]+);?/i : /^&#([0-9]+);?/;
  21041. const body = pattern.exec(rawText);
  21042. if (!body) {
  21043. decodedText += head[0];
  21044. advance(head[0].length);
  21045. }
  21046. else {
  21047. // https://html.spec.whatwg.org/multipage/parsing.html#numeric-character-reference-end-state
  21048. let cp = Number.parseInt(body[1], hex ? 16 : 10);
  21049. if (cp === 0) {
  21050. cp = 0xfffd;
  21051. }
  21052. else if (cp > 0x10ffff) {
  21053. cp = 0xfffd;
  21054. }
  21055. else if (cp >= 0xd800 && cp <= 0xdfff) {
  21056. cp = 0xfffd;
  21057. }
  21058. else if ((cp >= 0xfdd0 && cp <= 0xfdef) || (cp & 0xfffe) === 0xfffe) ;
  21059. else if ((cp >= 0x01 && cp <= 0x08) ||
  21060. cp === 0x0b ||
  21061. (cp >= 0x0d && cp <= 0x1f) ||
  21062. (cp >= 0x7f && cp <= 0x9f)) {
  21063. cp = CCR_REPLACEMENTS[cp] || cp;
  21064. }
  21065. decodedText += String.fromCodePoint(cp);
  21066. advance(body[0].length);
  21067. }
  21068. }
  21069. }
  21070. return decodedText;
  21071. };
  21072. // https://html.spec.whatwg.org/multipage/parsing.html#numeric-character-reference-end-state
  21073. const CCR_REPLACEMENTS = {
  21074. 0x80: 0x20ac,
  21075. 0x82: 0x201a,
  21076. 0x83: 0x0192,
  21077. 0x84: 0x201e,
  21078. 0x85: 0x2026,
  21079. 0x86: 0x2020,
  21080. 0x87: 0x2021,
  21081. 0x88: 0x02c6,
  21082. 0x89: 0x2030,
  21083. 0x8a: 0x0160,
  21084. 0x8b: 0x2039,
  21085. 0x8c: 0x0152,
  21086. 0x8e: 0x017d,
  21087. 0x91: 0x2018,
  21088. 0x92: 0x2019,
  21089. 0x93: 0x201c,
  21090. 0x94: 0x201d,
  21091. 0x95: 0x2022,
  21092. 0x96: 0x2013,
  21093. 0x97: 0x2014,
  21094. 0x98: 0x02dc,
  21095. 0x99: 0x2122,
  21096. 0x9a: 0x0161,
  21097. 0x9b: 0x203a,
  21098. 0x9c: 0x0153,
  21099. 0x9e: 0x017e,
  21100. 0x9f: 0x0178
  21101. };
  21102. const isRawTextContainer = /*#__PURE__*/ shared.makeMap('style,iframe,script,noscript', true);
  21103. const parserOptions = {
  21104. isVoidTag: shared.isVoidTag,
  21105. isNativeTag: tag => shared.isHTMLTag(tag) || shared.isSVGTag(tag),
  21106. isPreTag: tag => tag === 'pre',
  21107. decodeEntities: decodeHtml,
  21108. isBuiltInComponent: (tag) => {
  21109. if (compilerCore.isBuiltInType(tag, `Transition`)) {
  21110. return TRANSITION;
  21111. }
  21112. else if (compilerCore.isBuiltInType(tag, `TransitionGroup`)) {
  21113. return TRANSITION_GROUP;
  21114. }
  21115. },
  21116. // https://html.spec.whatwg.org/multipage/parsing.html#tree-construction-dispatcher
  21117. getNamespace(tag, parent) {
  21118. let ns = parent ? parent.ns : 0 /* HTML */;
  21119. if (parent && ns === 2 /* MATH_ML */) {
  21120. if (parent.tag === 'annotation-xml') {
  21121. if (tag === 'svg') {
  21122. return 1 /* SVG */;
  21123. }
  21124. if (parent.props.some(a => a.type === 6 /* ATTRIBUTE */ &&
  21125. a.name === 'encoding' &&
  21126. a.value != null &&
  21127. (a.value.content === 'text/html' ||
  21128. a.value.content === 'application/xhtml+xml'))) {
  21129. ns = 0 /* HTML */;
  21130. }
  21131. }
  21132. else if (/^m(?:[ions]|text)$/.test(parent.tag) &&
  21133. tag !== 'mglyph' &&
  21134. tag !== 'malignmark') {
  21135. ns = 0 /* HTML */;
  21136. }
  21137. }
  21138. else if (parent && ns === 1 /* SVG */) {
  21139. if (parent.tag === 'foreignObject' ||
  21140. parent.tag === 'desc' ||
  21141. parent.tag === 'title') {
  21142. ns = 0 /* HTML */;
  21143. }
  21144. }
  21145. if (ns === 0 /* HTML */) {
  21146. if (tag === 'svg') {
  21147. return 1 /* SVG */;
  21148. }
  21149. if (tag === 'math') {
  21150. return 2 /* MATH_ML */;
  21151. }
  21152. }
  21153. return ns;
  21154. },
  21155. // https://html.spec.whatwg.org/multipage/parsing.html#parsing-html-fragments
  21156. getTextMode({ tag, ns }) {
  21157. if (ns === 0 /* HTML */) {
  21158. if (tag === 'textarea' || tag === 'title') {
  21159. return 1 /* RCDATA */;
  21160. }
  21161. if (isRawTextContainer(tag)) {
  21162. return 2 /* RAWTEXT */;
  21163. }
  21164. }
  21165. return 0 /* DATA */;
  21166. }
  21167. };
  21168. // Parse inline CSS strings for static style attributes into an object.
  21169. // This is a NodeTransform since it works on the static `style` attribute and
  21170. // converts it into a dynamic equivalent:
  21171. // style="color: red" -> :style='{ "color": "red" }'
  21172. // It is then processed by `transformElement` and included in the generated
  21173. // props.
  21174. const transformStyle = node => {
  21175. if (node.type === 1 /* ELEMENT */) {
  21176. node.props.forEach((p, i) => {
  21177. if (p.type === 6 /* ATTRIBUTE */ && p.name === 'style' && p.value) {
  21178. // replace p with an expression node
  21179. node.props[i] = {
  21180. type: 7 /* DIRECTIVE */,
  21181. name: `bind`,
  21182. arg: compilerCore.createSimpleExpression(`style`, true, p.loc),
  21183. exp: parseInlineCSS(p.value.content, p.loc),
  21184. modifiers: [],
  21185. loc: p.loc
  21186. };
  21187. }
  21188. });
  21189. }
  21190. };
  21191. const parseInlineCSS = (cssText, loc) => {
  21192. const normalized = shared.parseStringStyle(cssText);
  21193. return compilerCore.createSimpleExpression(JSON.stringify(normalized), false, loc, 3 /* CAN_STRINGIFY */);
  21194. };
  21195. function createDOMCompilerError(code, loc) {
  21196. return compilerCore.createCompilerError(code, loc, DOMErrorMessages );
  21197. }
  21198. const DOMErrorMessages = {
  21199. [49 /* X_V_HTML_NO_EXPRESSION */]: `v-html is missing expression.`,
  21200. [50 /* X_V_HTML_WITH_CHILDREN */]: `v-html will override element children.`,
  21201. [51 /* X_V_TEXT_NO_EXPRESSION */]: `v-text is missing expression.`,
  21202. [52 /* X_V_TEXT_WITH_CHILDREN */]: `v-text will override element children.`,
  21203. [53 /* X_V_MODEL_ON_INVALID_ELEMENT */]: `v-model can only be used on <input>, <textarea> and <select> elements.`,
  21204. [54 /* X_V_MODEL_ARG_ON_ELEMENT */]: `v-model argument is not supported on plain elements.`,
  21205. [55 /* X_V_MODEL_ON_FILE_INPUT_ELEMENT */]: `v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.`,
  21206. [56 /* X_V_MODEL_UNNECESSARY_VALUE */]: `Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.`,
  21207. [57 /* X_V_SHOW_NO_EXPRESSION */]: `v-show is missing expression.`,
  21208. [58 /* X_TRANSITION_INVALID_CHILDREN */]: `<Transition> expects exactly one child element or component.`,
  21209. [59 /* X_IGNORED_SIDE_EFFECT_TAG */]: `Tags with side effect (<script> and <style>) are ignored in client component templates.`
  21210. };
  21211. const transformVHtml = (dir, node, context) => {
  21212. const { exp, loc } = dir;
  21213. if (!exp) {
  21214. context.onError(createDOMCompilerError(49 /* X_V_HTML_NO_EXPRESSION */, loc));
  21215. }
  21216. if (node.children.length) {
  21217. context.onError(createDOMCompilerError(50 /* X_V_HTML_WITH_CHILDREN */, loc));
  21218. node.children.length = 0;
  21219. }
  21220. return {
  21221. props: [
  21222. compilerCore.createObjectProperty(compilerCore.createSimpleExpression(`innerHTML`, true, loc), exp || compilerCore.createSimpleExpression('', true))
  21223. ]
  21224. };
  21225. };
  21226. const transformVText = (dir, node, context) => {
  21227. const { exp, loc } = dir;
  21228. if (!exp) {
  21229. context.onError(createDOMCompilerError(51 /* X_V_TEXT_NO_EXPRESSION */, loc));
  21230. }
  21231. if (node.children.length) {
  21232. context.onError(createDOMCompilerError(52 /* X_V_TEXT_WITH_CHILDREN */, loc));
  21233. node.children.length = 0;
  21234. }
  21235. return {
  21236. props: [
  21237. compilerCore.createObjectProperty(compilerCore.createSimpleExpression(`textContent`, true), exp
  21238. ? compilerCore.createCallExpression(context.helperString(compilerCore.TO_DISPLAY_STRING), [exp], loc)
  21239. : compilerCore.createSimpleExpression('', true))
  21240. ]
  21241. };
  21242. };
  21243. const transformModel = (dir, node, context) => {
  21244. const baseResult = compilerCore.transformModel(dir, node, context);
  21245. // base transform has errors OR component v-model (only need props)
  21246. if (!baseResult.props.length || node.tagType === 1 /* COMPONENT */) {
  21247. return baseResult;
  21248. }
  21249. if (dir.arg) {
  21250. context.onError(createDOMCompilerError(54 /* X_V_MODEL_ARG_ON_ELEMENT */, dir.arg.loc));
  21251. }
  21252. function checkDuplicatedValue() {
  21253. const value = compilerCore.findProp(node, 'value');
  21254. if (value) {
  21255. context.onError(createDOMCompilerError(56 /* X_V_MODEL_UNNECESSARY_VALUE */, value.loc));
  21256. }
  21257. }
  21258. const { tag } = node;
  21259. const isCustomElement = context.isCustomElement(tag);
  21260. if (tag === 'input' ||
  21261. tag === 'textarea' ||
  21262. tag === 'select' ||
  21263. isCustomElement) {
  21264. let directiveToUse = V_MODEL_TEXT;
  21265. let isInvalidType = false;
  21266. if (tag === 'input' || isCustomElement) {
  21267. const type = compilerCore.findProp(node, `type`);
  21268. if (type) {
  21269. if (type.type === 7 /* DIRECTIVE */) {
  21270. // :type="foo"
  21271. directiveToUse = V_MODEL_DYNAMIC;
  21272. }
  21273. else if (type.value) {
  21274. switch (type.value.content) {
  21275. case 'radio':
  21276. directiveToUse = V_MODEL_RADIO;
  21277. break;
  21278. case 'checkbox':
  21279. directiveToUse = V_MODEL_CHECKBOX;
  21280. break;
  21281. case 'file':
  21282. isInvalidType = true;
  21283. context.onError(createDOMCompilerError(55 /* X_V_MODEL_ON_FILE_INPUT_ELEMENT */, dir.loc));
  21284. break;
  21285. default:
  21286. // text type
  21287. checkDuplicatedValue();
  21288. break;
  21289. }
  21290. }
  21291. }
  21292. else if (compilerCore.hasDynamicKeyVBind(node)) {
  21293. // element has bindings with dynamic keys, which can possibly contain
  21294. // "type".
  21295. directiveToUse = V_MODEL_DYNAMIC;
  21296. }
  21297. else {
  21298. // text type
  21299. checkDuplicatedValue();
  21300. }
  21301. }
  21302. else if (tag === 'select') {
  21303. directiveToUse = V_MODEL_SELECT;
  21304. }
  21305. else {
  21306. // textarea
  21307. checkDuplicatedValue();
  21308. }
  21309. // inject runtime directive
  21310. // by returning the helper symbol via needRuntime
  21311. // the import will replaced a resolveDirective call.
  21312. if (!isInvalidType) {
  21313. baseResult.needRuntime = context.helper(directiveToUse);
  21314. }
  21315. }
  21316. else {
  21317. context.onError(createDOMCompilerError(53 /* X_V_MODEL_ON_INVALID_ELEMENT */, dir.loc));
  21318. }
  21319. // native vmodel doesn't need the `modelValue` props since they are also
  21320. // passed to the runtime as `binding.value`. removing it reduces code size.
  21321. baseResult.props = baseResult.props.filter(p => !(p.key.type === 4 /* SIMPLE_EXPRESSION */ &&
  21322. p.key.content === 'modelValue'));
  21323. return baseResult;
  21324. };
  21325. const isEventOptionModifier = /*#__PURE__*/ shared.makeMap(`passive,once,capture`);
  21326. const isNonKeyModifier = /*#__PURE__*/ shared.makeMap(
  21327. // event propagation management
  21328. `stop,prevent,self,` +
  21329. // system modifiers + exact
  21330. `ctrl,shift,alt,meta,exact,` +
  21331. // mouse
  21332. `middle`);
  21333. // left & right could be mouse or key modifiers based on event type
  21334. const maybeKeyModifier = /*#__PURE__*/ shared.makeMap('left,right');
  21335. const isKeyboardEvent = /*#__PURE__*/ shared.makeMap(`onkeyup,onkeydown,onkeypress`, true);
  21336. const resolveModifiers = (key, modifiers, context, loc) => {
  21337. const keyModifiers = [];
  21338. const nonKeyModifiers = [];
  21339. const eventOptionModifiers = [];
  21340. for (let i = 0; i < modifiers.length; i++) {
  21341. const modifier = modifiers[i];
  21342. if (modifier === 'native' &&
  21343. compilerCore.checkCompatEnabled("COMPILER_V_ON_NATIVE" /* COMPILER_V_ON_NATIVE */, context, loc)) {
  21344. eventOptionModifiers.push(modifier);
  21345. }
  21346. else if (isEventOptionModifier(modifier)) {
  21347. // eventOptionModifiers: modifiers for addEventListener() options,
  21348. // e.g. .passive & .capture
  21349. eventOptionModifiers.push(modifier);
  21350. }
  21351. else {
  21352. // runtimeModifiers: modifiers that needs runtime guards
  21353. if (maybeKeyModifier(modifier)) {
  21354. if (compilerCore.isStaticExp(key)) {
  21355. if (isKeyboardEvent(key.content)) {
  21356. keyModifiers.push(modifier);
  21357. }
  21358. else {
  21359. nonKeyModifiers.push(modifier);
  21360. }
  21361. }
  21362. else {
  21363. keyModifiers.push(modifier);
  21364. nonKeyModifiers.push(modifier);
  21365. }
  21366. }
  21367. else {
  21368. if (isNonKeyModifier(modifier)) {
  21369. nonKeyModifiers.push(modifier);
  21370. }
  21371. else {
  21372. keyModifiers.push(modifier);
  21373. }
  21374. }
  21375. }
  21376. }
  21377. return {
  21378. keyModifiers,
  21379. nonKeyModifiers,
  21380. eventOptionModifiers
  21381. };
  21382. };
  21383. const transformClick = (key, event) => {
  21384. const isStaticClick = compilerCore.isStaticExp(key) && key.content.toLowerCase() === 'onclick';
  21385. return isStaticClick
  21386. ? compilerCore.createSimpleExpression(event, true)
  21387. : key.type !== 4 /* SIMPLE_EXPRESSION */
  21388. ? compilerCore.createCompoundExpression([
  21389. `(`,
  21390. key,
  21391. `) === "onClick" ? "${event}" : (`,
  21392. key,
  21393. `)`
  21394. ])
  21395. : key;
  21396. };
  21397. const transformOn = (dir, node, context) => {
  21398. return compilerCore.transformOn(dir, node, context, baseResult => {
  21399. const { modifiers } = dir;
  21400. if (!modifiers.length)
  21401. return baseResult;
  21402. let { key, value: handlerExp } = baseResult.props[0];
  21403. const { keyModifiers, nonKeyModifiers, eventOptionModifiers } = resolveModifiers(key, modifiers, context, dir.loc);
  21404. // normalize click.right and click.middle since they don't actually fire
  21405. if (nonKeyModifiers.includes('right')) {
  21406. key = transformClick(key, `onContextmenu`);
  21407. }
  21408. if (nonKeyModifiers.includes('middle')) {
  21409. key = transformClick(key, `onMouseup`);
  21410. }
  21411. if (nonKeyModifiers.length) {
  21412. handlerExp = compilerCore.createCallExpression(context.helper(V_ON_WITH_MODIFIERS), [
  21413. handlerExp,
  21414. JSON.stringify(nonKeyModifiers)
  21415. ]);
  21416. }
  21417. if (keyModifiers.length &&
  21418. // if event name is dynamic, always wrap with keys guard
  21419. (!compilerCore.isStaticExp(key) || isKeyboardEvent(key.content))) {
  21420. handlerExp = compilerCore.createCallExpression(context.helper(V_ON_WITH_KEYS), [
  21421. handlerExp,
  21422. JSON.stringify(keyModifiers)
  21423. ]);
  21424. }
  21425. if (eventOptionModifiers.length) {
  21426. const modifierPostfix = eventOptionModifiers.map(shared.capitalize).join('');
  21427. key = compilerCore.isStaticExp(key)
  21428. ? compilerCore.createSimpleExpression(`${key.content}${modifierPostfix}`, true)
  21429. : compilerCore.createCompoundExpression([`(`, key, `) + "${modifierPostfix}"`]);
  21430. }
  21431. return {
  21432. props: [compilerCore.createObjectProperty(key, handlerExp)]
  21433. };
  21434. });
  21435. };
  21436. const transformShow = (dir, node, context) => {
  21437. const { exp, loc } = dir;
  21438. if (!exp) {
  21439. context.onError(createDOMCompilerError(57 /* X_V_SHOW_NO_EXPRESSION */, loc));
  21440. }
  21441. return {
  21442. props: [],
  21443. needRuntime: context.helper(V_SHOW)
  21444. };
  21445. };
  21446. const warnTransitionChildren = (node, context) => {
  21447. if (node.type === 1 /* ELEMENT */ &&
  21448. node.tagType === 1 /* COMPONENT */) {
  21449. const component = context.isBuiltInComponent(node.tag);
  21450. if (component === TRANSITION) {
  21451. return () => {
  21452. if (node.children.length && hasMultipleChildren(node)) {
  21453. context.onError(createDOMCompilerError(58 /* X_TRANSITION_INVALID_CHILDREN */, {
  21454. start: node.children[0].loc.start,
  21455. end: node.children[node.children.length - 1].loc.end,
  21456. source: ''
  21457. }));
  21458. }
  21459. };
  21460. }
  21461. }
  21462. };
  21463. function hasMultipleChildren(node) {
  21464. // #1352 filter out potential comment nodes.
  21465. const children = (node.children = node.children.filter(c => c.type !== 3 /* COMMENT */));
  21466. const child = children[0];
  21467. return (children.length !== 1 ||
  21468. child.type === 11 /* FOR */ ||
  21469. (child.type === 9 /* IF */ && child.branches.some(hasMultipleChildren)));
  21470. }
  21471. /**
  21472. * This module is Node-only.
  21473. */
  21474. /**
  21475. * Turn eligible hoisted static trees into stringified static nodes, e.g.
  21476. *
  21477. * ```js
  21478. * const _hoisted_1 = createStaticVNode(`<div class="foo">bar</div>`)
  21479. * ```
  21480. *
  21481. * A single static vnode can contain stringified content for **multiple**
  21482. * consecutive nodes (element and plain text), called a "chunk".
  21483. * `@vue/runtime-dom` will create the content via innerHTML in a hidden
  21484. * container element and insert all the nodes in place. The call must also
  21485. * provide the number of nodes contained in the chunk so that during hydration
  21486. * we can know how many nodes the static vnode should adopt.
  21487. *
  21488. * The optimization scans a children list that contains hoisted nodes, and
  21489. * tries to find the largest chunk of consecutive hoisted nodes before running
  21490. * into a non-hoisted node or the end of the list. A chunk is then converted
  21491. * into a single static vnode and replaces the hoisted expression of the first
  21492. * node in the chunk. Other nodes in the chunk are considered "merged" and
  21493. * therefore removed from both the hoist list and the children array.
  21494. *
  21495. * This optimization is only performed in Node.js.
  21496. */
  21497. const stringifyStatic = (children, context, parent) => {
  21498. // bail stringification for slot content
  21499. if (context.scopes.vSlot > 0) {
  21500. return;
  21501. }
  21502. let nc = 0; // current node count
  21503. let ec = 0; // current element with binding count
  21504. const currentChunk = [];
  21505. const stringifyCurrentChunk = (currentIndex) => {
  21506. if (nc >= 20 /* NODE_COUNT */ ||
  21507. ec >= 5 /* ELEMENT_WITH_BINDING_COUNT */) {
  21508. // combine all currently eligible nodes into a single static vnode call
  21509. const staticCall = compilerCore.createCallExpression(context.helper(compilerCore.CREATE_STATIC), [
  21510. JSON.stringify(currentChunk.map(node => stringifyNode(node, context)).join('')),
  21511. // the 2nd argument indicates the number of DOM nodes this static vnode
  21512. // will insert / hydrate
  21513. String(currentChunk.length)
  21514. ]);
  21515. // replace the first node's hoisted expression with the static vnode call
  21516. replaceHoist(currentChunk[0], staticCall, context);
  21517. if (currentChunk.length > 1) {
  21518. for (let i = 1; i < currentChunk.length; i++) {
  21519. // for the merged nodes, set their hoisted expression to null
  21520. replaceHoist(currentChunk[i], null, context);
  21521. }
  21522. // also remove merged nodes from children
  21523. const deleteCount = currentChunk.length - 1;
  21524. children.splice(currentIndex - currentChunk.length + 1, deleteCount);
  21525. return deleteCount;
  21526. }
  21527. }
  21528. return 0;
  21529. };
  21530. let i = 0;
  21531. for (; i < children.length; i++) {
  21532. const child = children[i];
  21533. const hoisted = getHoistedNode(child);
  21534. if (hoisted) {
  21535. // presence of hoisted means child must be a stringifiable node
  21536. const node = child;
  21537. const result = analyzeNode(node);
  21538. if (result) {
  21539. // node is stringifiable, record state
  21540. nc += result[0];
  21541. ec += result[1];
  21542. currentChunk.push(node);
  21543. continue;
  21544. }
  21545. }
  21546. // we only reach here if we ran into a node that is not stringifiable
  21547. // check if currently analyzed nodes meet criteria for stringification.
  21548. // adjust iteration index
  21549. i -= stringifyCurrentChunk(i);
  21550. // reset state
  21551. nc = 0;
  21552. ec = 0;
  21553. currentChunk.length = 0;
  21554. }
  21555. // in case the last node was also stringifiable
  21556. stringifyCurrentChunk(i);
  21557. };
  21558. const getHoistedNode = (node) => ((node.type === 1 /* ELEMENT */ && node.tagType === 0 /* ELEMENT */) ||
  21559. node.type == 12 /* TEXT_CALL */) &&
  21560. node.codegenNode &&
  21561. node.codegenNode.type === 4 /* SIMPLE_EXPRESSION */ &&
  21562. node.codegenNode.hoisted;
  21563. const dataAriaRE = /^(data|aria)-/;
  21564. const isStringifiableAttr = (name, ns) => {
  21565. return ((ns === 0 /* HTML */
  21566. ? shared.isKnownHtmlAttr(name)
  21567. : ns === 1 /* SVG */
  21568. ? shared.isKnownSvgAttr(name)
  21569. : false) || dataAriaRE.test(name));
  21570. };
  21571. const replaceHoist = (node, replacement, context) => {
  21572. const hoistToReplace = node.codegenNode.hoisted;
  21573. context.hoists[context.hoists.indexOf(hoistToReplace)] = replacement;
  21574. };
  21575. const isNonStringifiable = /*#__PURE__*/ shared.makeMap(`caption,thead,tr,th,tbody,td,tfoot,colgroup,col`);
  21576. /**
  21577. * for a hoisted node, analyze it and return:
  21578. * - false: bailed (contains runtime constant)
  21579. * - [nc, ec] where
  21580. * - nc is the number of nodes inside
  21581. * - ec is the number of element with bindings inside
  21582. */
  21583. function analyzeNode(node) {
  21584. if (node.type === 1 /* ELEMENT */ && isNonStringifiable(node.tag)) {
  21585. return false;
  21586. }
  21587. if (node.type === 12 /* TEXT_CALL */) {
  21588. return [1, 0];
  21589. }
  21590. let nc = 1; // node count
  21591. let ec = node.props.length > 0 ? 1 : 0; // element w/ binding count
  21592. let bailed = false;
  21593. const bail = () => {
  21594. bailed = true;
  21595. return false;
  21596. };
  21597. // TODO: check for cases where using innerHTML will result in different
  21598. // output compared to imperative node insertions.
  21599. // probably only need to check for most common case
  21600. // i.e. non-phrasing-content tags inside `<p>`
  21601. function walk(node) {
  21602. for (let i = 0; i < node.props.length; i++) {
  21603. const p = node.props[i];
  21604. // bail on non-attr bindings
  21605. if (p.type === 6 /* ATTRIBUTE */ &&
  21606. !isStringifiableAttr(p.name, node.ns)) {
  21607. return bail();
  21608. }
  21609. if (p.type === 7 /* DIRECTIVE */ && p.name === 'bind') {
  21610. // bail on non-attr bindings
  21611. if (p.arg &&
  21612. (p.arg.type === 8 /* COMPOUND_EXPRESSION */ ||
  21613. (p.arg.isStatic && !isStringifiableAttr(p.arg.content, node.ns)))) {
  21614. return bail();
  21615. }
  21616. }
  21617. }
  21618. for (let i = 0; i < node.children.length; i++) {
  21619. nc++;
  21620. const child = node.children[i];
  21621. if (child.type === 1 /* ELEMENT */) {
  21622. if (child.props.length > 0) {
  21623. ec++;
  21624. }
  21625. walk(child);
  21626. if (bailed) {
  21627. return false;
  21628. }
  21629. }
  21630. }
  21631. return true;
  21632. }
  21633. return walk(node) ? [nc, ec] : false;
  21634. }
  21635. function stringifyNode(node, context) {
  21636. if (shared.isString(node)) {
  21637. return node;
  21638. }
  21639. if (shared.isSymbol(node)) {
  21640. return ``;
  21641. }
  21642. switch (node.type) {
  21643. case 1 /* ELEMENT */:
  21644. return stringifyElement(node, context);
  21645. case 2 /* TEXT */:
  21646. return shared.escapeHtml(node.content);
  21647. case 3 /* COMMENT */:
  21648. return `<!--${shared.escapeHtml(node.content)}-->`;
  21649. case 5 /* INTERPOLATION */:
  21650. return shared.escapeHtml(shared.toDisplayString(evaluateConstant(node.content)));
  21651. case 8 /* COMPOUND_EXPRESSION */:
  21652. return shared.escapeHtml(evaluateConstant(node));
  21653. case 12 /* TEXT_CALL */:
  21654. return stringifyNode(node.content, context);
  21655. default:
  21656. // static trees will not contain if/for nodes
  21657. return '';
  21658. }
  21659. }
  21660. function stringifyElement(node, context) {
  21661. let res = `<${node.tag}`;
  21662. for (let i = 0; i < node.props.length; i++) {
  21663. const p = node.props[i];
  21664. if (p.type === 6 /* ATTRIBUTE */) {
  21665. res += ` ${p.name}`;
  21666. if (p.value) {
  21667. res += `="${shared.escapeHtml(p.value.content)}"`;
  21668. }
  21669. }
  21670. else if (p.type === 7 /* DIRECTIVE */ && p.name === 'bind') {
  21671. // constant v-bind, e.g. :foo="1"
  21672. let evaluated = evaluateConstant(p.exp);
  21673. if (evaluated != null) {
  21674. const arg = p.arg && p.arg.content;
  21675. if (arg === 'class') {
  21676. evaluated = shared.normalizeClass(evaluated);
  21677. }
  21678. else if (arg === 'style') {
  21679. evaluated = shared.stringifyStyle(shared.normalizeStyle(evaluated));
  21680. }
  21681. res += ` ${p.arg.content}="${shared.escapeHtml(evaluated)}"`;
  21682. }
  21683. }
  21684. }
  21685. if (context.scopeId) {
  21686. res += ` ${context.scopeId}`;
  21687. }
  21688. res += `>`;
  21689. for (let i = 0; i < node.children.length; i++) {
  21690. res += stringifyNode(node.children[i], context);
  21691. }
  21692. if (!shared.isVoidTag(node.tag)) {
  21693. res += `</${node.tag}>`;
  21694. }
  21695. return res;
  21696. }
  21697. // __UNSAFE__
  21698. // Reason: eval.
  21699. // It's technically safe to eval because only constant expressions are possible
  21700. // here, e.g. `{{ 1 }}` or `{{ 'foo' }}`
  21701. // in addition, constant exps bail on presence of parens so you can't even
  21702. // run JSFuck in here. But we mark it unsafe for security review purposes.
  21703. // (see compiler-core/src/transformExpressions)
  21704. function evaluateConstant(exp) {
  21705. if (exp.type === 4 /* SIMPLE_EXPRESSION */) {
  21706. return new Function(`return ${exp.content}`)();
  21707. }
  21708. else {
  21709. // compound
  21710. let res = ``;
  21711. exp.children.forEach(c => {
  21712. if (shared.isString(c) || shared.isSymbol(c)) {
  21713. return;
  21714. }
  21715. if (c.type === 2 /* TEXT */) {
  21716. res += c.content;
  21717. }
  21718. else if (c.type === 5 /* INTERPOLATION */) {
  21719. res += shared.toDisplayString(evaluateConstant(c.content));
  21720. }
  21721. else {
  21722. res += evaluateConstant(c);
  21723. }
  21724. });
  21725. return res;
  21726. }
  21727. }
  21728. const ignoreSideEffectTags = (node, context) => {
  21729. if (node.type === 1 /* ELEMENT */ &&
  21730. node.tagType === 0 /* ELEMENT */ &&
  21731. (node.tag === 'script' || node.tag === 'style')) {
  21732. context.onError(createDOMCompilerError(59 /* X_IGNORED_SIDE_EFFECT_TAG */, node.loc));
  21733. context.removeNode();
  21734. }
  21735. };
  21736. const DOMNodeTransforms = [
  21737. transformStyle,
  21738. ...([warnTransitionChildren] )
  21739. ];
  21740. const DOMDirectiveTransforms = {
  21741. cloak: compilerCore.noopDirectiveTransform,
  21742. html: transformVHtml,
  21743. text: transformVText,
  21744. model: transformModel,
  21745. on: transformOn,
  21746. show: transformShow
  21747. };
  21748. function compile(template, options = {}) {
  21749. return compilerCore.baseCompile(template, shared.extend({}, parserOptions, options, {
  21750. nodeTransforms: [
  21751. // ignore <script> and <tag>
  21752. // this is not put inside DOMNodeTransforms because that list is used
  21753. // by compiler-ssr to generate vnode fallback branches
  21754. ignoreSideEffectTags,
  21755. ...DOMNodeTransforms,
  21756. ...(options.nodeTransforms || [])
  21757. ],
  21758. directiveTransforms: shared.extend({}, DOMDirectiveTransforms, options.directiveTransforms || {}),
  21759. transformHoist: stringifyStatic
  21760. }));
  21761. }
  21762. function parse(template, options = {}) {
  21763. return compilerCore.baseParse(template, shared.extend({}, parserOptions, options));
  21764. }
  21765. Object.keys(compilerCore).forEach(function (k) {
  21766. if (k !== 'default') exports[k] = compilerCore[k];
  21767. });
  21768. exports.DOMDirectiveTransforms = DOMDirectiveTransforms;
  21769. exports.DOMNodeTransforms = DOMNodeTransforms;
  21770. exports.TRANSITION = TRANSITION;
  21771. exports.TRANSITION_GROUP = TRANSITION_GROUP;
  21772. exports.V_MODEL_CHECKBOX = V_MODEL_CHECKBOX;
  21773. exports.V_MODEL_DYNAMIC = V_MODEL_DYNAMIC;
  21774. exports.V_MODEL_RADIO = V_MODEL_RADIO;
  21775. exports.V_MODEL_SELECT = V_MODEL_SELECT;
  21776. exports.V_MODEL_TEXT = V_MODEL_TEXT;
  21777. exports.V_ON_WITH_KEYS = V_ON_WITH_KEYS;
  21778. exports.V_ON_WITH_MODIFIERS = V_ON_WITH_MODIFIERS;
  21779. exports.V_SHOW = V_SHOW;
  21780. exports.compile = compile;
  21781. exports.createDOMCompilerError = createDOMCompilerError;
  21782. exports.parse = parse;
  21783. exports.parserOptions = parserOptions;
  21784. exports.transformStyle = transformStyle;
  21785. }(compilerDom_cjs$2));
  21786. var compilerDom_cjs = /*@__PURE__*/build.getDefaultExportFromCjs(compilerDom_cjs$2);
  21787. var compilerDom_cjs$1 = /*#__PURE__*/Object.assign(/*#__PURE__*/Object.create(null), compilerDom_cjs$2, {
  21788. 'default': compilerDom_cjs
  21789. });
  21790. exports.compilerDom_cjs = compilerDom_cjs$1;
  21791. //# sourceMappingURL=dep-b541373d.js.map