mdx-3.0.1-cjs.js 923 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811
  1. var __create = Object.create;
  2. var __defProp = Object.defineProperty;
  3. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  4. var __getOwnPropNames = Object.getOwnPropertyNames;
  5. var __getProtoOf = Object.getPrototypeOf;
  6. var __hasOwnProp = Object.prototype.hasOwnProperty;
  7. var __commonJS = (cb, mod) => function __require() {
  8. return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
  9. };
  10. var __export = (target, all3) => {
  11. for (var name2 in all3)
  12. __defProp(target, name2, { get: all3[name2], enumerable: true });
  13. };
  14. var __copyProps = (to, from, except, desc) => {
  15. if (from && typeof from === "object" || typeof from === "function") {
  16. for (let key of __getOwnPropNames(from))
  17. if (!__hasOwnProp.call(to, key) && key !== except)
  18. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  19. }
  20. return to;
  21. };
  22. var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  23. // If the importer is in node compatibility mode or this is not an ESM
  24. // file that has been converted to a CommonJS file using a Babel-
  25. // compatible transform (i.e. "__esModule" has not been set), then set
  26. // "default" to the CommonJS "module.exports" for node compatibility.
  27. isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  28. mod
  29. ));
  30. var PATH = require('path');
  31. var PROCESS = require('process');
  32. var URL = require('url');
  33. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  34. // node_modules/micromark-extension-mdxjs/node_modules/acorn-jsx/xhtml.js
  35. var require_xhtml = __commonJS({
  36. "node_modules/micromark-extension-mdxjs/node_modules/acorn-jsx/xhtml.js"(exports2, module2) {
  37. module2.exports = {
  38. quot: '"',
  39. amp: "&",
  40. apos: "'",
  41. lt: "<",
  42. gt: ">",
  43. nbsp: "\xA0",
  44. iexcl: "\xA1",
  45. cent: "\xA2",
  46. pound: "\xA3",
  47. curren: "\xA4",
  48. yen: "\xA5",
  49. brvbar: "\xA6",
  50. sect: "\xA7",
  51. uml: "\xA8",
  52. copy: "\xA9",
  53. ordf: "\xAA",
  54. laquo: "\xAB",
  55. not: "\xAC",
  56. shy: "\xAD",
  57. reg: "\xAE",
  58. macr: "\xAF",
  59. deg: "\xB0",
  60. plusmn: "\xB1",
  61. sup2: "\xB2",
  62. sup3: "\xB3",
  63. acute: "\xB4",
  64. micro: "\xB5",
  65. para: "\xB6",
  66. middot: "\xB7",
  67. cedil: "\xB8",
  68. sup1: "\xB9",
  69. ordm: "\xBA",
  70. raquo: "\xBB",
  71. frac14: "\xBC",
  72. frac12: "\xBD",
  73. frac34: "\xBE",
  74. iquest: "\xBF",
  75. Agrave: "\xC0",
  76. Aacute: "\xC1",
  77. Acirc: "\xC2",
  78. Atilde: "\xC3",
  79. Auml: "\xC4",
  80. Aring: "\xC5",
  81. AElig: "\xC6",
  82. Ccedil: "\xC7",
  83. Egrave: "\xC8",
  84. Eacute: "\xC9",
  85. Ecirc: "\xCA",
  86. Euml: "\xCB",
  87. Igrave: "\xCC",
  88. Iacute: "\xCD",
  89. Icirc: "\xCE",
  90. Iuml: "\xCF",
  91. ETH: "\xD0",
  92. Ntilde: "\xD1",
  93. Ograve: "\xD2",
  94. Oacute: "\xD3",
  95. Ocirc: "\xD4",
  96. Otilde: "\xD5",
  97. Ouml: "\xD6",
  98. times: "\xD7",
  99. Oslash: "\xD8",
  100. Ugrave: "\xD9",
  101. Uacute: "\xDA",
  102. Ucirc: "\xDB",
  103. Uuml: "\xDC",
  104. Yacute: "\xDD",
  105. THORN: "\xDE",
  106. szlig: "\xDF",
  107. agrave: "\xE0",
  108. aacute: "\xE1",
  109. acirc: "\xE2",
  110. atilde: "\xE3",
  111. auml: "\xE4",
  112. aring: "\xE5",
  113. aelig: "\xE6",
  114. ccedil: "\xE7",
  115. egrave: "\xE8",
  116. eacute: "\xE9",
  117. ecirc: "\xEA",
  118. euml: "\xEB",
  119. igrave: "\xEC",
  120. iacute: "\xED",
  121. icirc: "\xEE",
  122. iuml: "\xEF",
  123. eth: "\xF0",
  124. ntilde: "\xF1",
  125. ograve: "\xF2",
  126. oacute: "\xF3",
  127. ocirc: "\xF4",
  128. otilde: "\xF5",
  129. ouml: "\xF6",
  130. divide: "\xF7",
  131. oslash: "\xF8",
  132. ugrave: "\xF9",
  133. uacute: "\xFA",
  134. ucirc: "\xFB",
  135. uuml: "\xFC",
  136. yacute: "\xFD",
  137. thorn: "\xFE",
  138. yuml: "\xFF",
  139. OElig: "\u0152",
  140. oelig: "\u0153",
  141. Scaron: "\u0160",
  142. scaron: "\u0161",
  143. Yuml: "\u0178",
  144. fnof: "\u0192",
  145. circ: "\u02C6",
  146. tilde: "\u02DC",
  147. Alpha: "\u0391",
  148. Beta: "\u0392",
  149. Gamma: "\u0393",
  150. Delta: "\u0394",
  151. Epsilon: "\u0395",
  152. Zeta: "\u0396",
  153. Eta: "\u0397",
  154. Theta: "\u0398",
  155. Iota: "\u0399",
  156. Kappa: "\u039A",
  157. Lambda: "\u039B",
  158. Mu: "\u039C",
  159. Nu: "\u039D",
  160. Xi: "\u039E",
  161. Omicron: "\u039F",
  162. Pi: "\u03A0",
  163. Rho: "\u03A1",
  164. Sigma: "\u03A3",
  165. Tau: "\u03A4",
  166. Upsilon: "\u03A5",
  167. Phi: "\u03A6",
  168. Chi: "\u03A7",
  169. Psi: "\u03A8",
  170. Omega: "\u03A9",
  171. alpha: "\u03B1",
  172. beta: "\u03B2",
  173. gamma: "\u03B3",
  174. delta: "\u03B4",
  175. epsilon: "\u03B5",
  176. zeta: "\u03B6",
  177. eta: "\u03B7",
  178. theta: "\u03B8",
  179. iota: "\u03B9",
  180. kappa: "\u03BA",
  181. lambda: "\u03BB",
  182. mu: "\u03BC",
  183. nu: "\u03BD",
  184. xi: "\u03BE",
  185. omicron: "\u03BF",
  186. pi: "\u03C0",
  187. rho: "\u03C1",
  188. sigmaf: "\u03C2",
  189. sigma: "\u03C3",
  190. tau: "\u03C4",
  191. upsilon: "\u03C5",
  192. phi: "\u03C6",
  193. chi: "\u03C7",
  194. psi: "\u03C8",
  195. omega: "\u03C9",
  196. thetasym: "\u03D1",
  197. upsih: "\u03D2",
  198. piv: "\u03D6",
  199. ensp: "\u2002",
  200. emsp: "\u2003",
  201. thinsp: "\u2009",
  202. zwnj: "\u200C",
  203. zwj: "\u200D",
  204. lrm: "\u200E",
  205. rlm: "\u200F",
  206. ndash: "\u2013",
  207. mdash: "\u2014",
  208. lsquo: "\u2018",
  209. rsquo: "\u2019",
  210. sbquo: "\u201A",
  211. ldquo: "\u201C",
  212. rdquo: "\u201D",
  213. bdquo: "\u201E",
  214. dagger: "\u2020",
  215. Dagger: "\u2021",
  216. bull: "\u2022",
  217. hellip: "\u2026",
  218. permil: "\u2030",
  219. prime: "\u2032",
  220. Prime: "\u2033",
  221. lsaquo: "\u2039",
  222. rsaquo: "\u203A",
  223. oline: "\u203E",
  224. frasl: "\u2044",
  225. euro: "\u20AC",
  226. image: "\u2111",
  227. weierp: "\u2118",
  228. real: "\u211C",
  229. trade: "\u2122",
  230. alefsym: "\u2135",
  231. larr: "\u2190",
  232. uarr: "\u2191",
  233. rarr: "\u2192",
  234. darr: "\u2193",
  235. harr: "\u2194",
  236. crarr: "\u21B5",
  237. lArr: "\u21D0",
  238. uArr: "\u21D1",
  239. rArr: "\u21D2",
  240. dArr: "\u21D3",
  241. hArr: "\u21D4",
  242. forall: "\u2200",
  243. part: "\u2202",
  244. exist: "\u2203",
  245. empty: "\u2205",
  246. nabla: "\u2207",
  247. isin: "\u2208",
  248. notin: "\u2209",
  249. ni: "\u220B",
  250. prod: "\u220F",
  251. sum: "\u2211",
  252. minus: "\u2212",
  253. lowast: "\u2217",
  254. radic: "\u221A",
  255. prop: "\u221D",
  256. infin: "\u221E",
  257. ang: "\u2220",
  258. and: "\u2227",
  259. or: "\u2228",
  260. cap: "\u2229",
  261. cup: "\u222A",
  262. "int": "\u222B",
  263. there4: "\u2234",
  264. sim: "\u223C",
  265. cong: "\u2245",
  266. asymp: "\u2248",
  267. ne: "\u2260",
  268. equiv: "\u2261",
  269. le: "\u2264",
  270. ge: "\u2265",
  271. sub: "\u2282",
  272. sup: "\u2283",
  273. nsub: "\u2284",
  274. sube: "\u2286",
  275. supe: "\u2287",
  276. oplus: "\u2295",
  277. otimes: "\u2297",
  278. perp: "\u22A5",
  279. sdot: "\u22C5",
  280. lceil: "\u2308",
  281. rceil: "\u2309",
  282. lfloor: "\u230A",
  283. rfloor: "\u230B",
  284. lang: "\u2329",
  285. rang: "\u232A",
  286. loz: "\u25CA",
  287. spades: "\u2660",
  288. clubs: "\u2663",
  289. hearts: "\u2665",
  290. diams: "\u2666"
  291. };
  292. }
  293. });
  294. // node_modules/micromark-extension-mdxjs/node_modules/acorn-jsx/node_modules/acorn/dist/acorn.js
  295. var require_acorn = __commonJS({
  296. "node_modules/micromark-extension-mdxjs/node_modules/acorn-jsx/node_modules/acorn/dist/acorn.js"(exports2, module2) {
  297. (function(global, factory) {
  298. typeof exports2 === "object" && typeof module2 !== "undefined" ? factory(exports2) : typeof define === "function" && define.amd ? define(["exports"], factory) : (global = global || self, factory(global.acorn = {}));
  299. })(exports2, function(exports3) {
  300. "use strict";
  301. var reservedWords2 = {
  302. 3: "abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",
  303. 5: "class enum extends super const export import",
  304. 6: "enum",
  305. strict: "implements interface let package private protected public static yield",
  306. strictBind: "eval arguments"
  307. };
  308. var ecma5AndLessKeywords2 = "break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this";
  309. var keywords2 = {
  310. 5: ecma5AndLessKeywords2,
  311. "5module": ecma5AndLessKeywords2 + " export import",
  312. 6: ecma5AndLessKeywords2 + " const class extends export import super"
  313. };
  314. var keywordRelationalOperator2 = /^in(stanceof)?$/;
  315. var nonASCIIidentifierStartChars2 = "\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";
  316. var nonASCIIidentifierChars2 = "\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";
  317. var nonASCIIidentifierStart2 = new RegExp("[" + nonASCIIidentifierStartChars2 + "]");
  318. var nonASCIIidentifier2 = new RegExp("[" + nonASCIIidentifierStartChars2 + nonASCIIidentifierChars2 + "]");
  319. nonASCIIidentifierStartChars2 = nonASCIIidentifierChars2 = null;
  320. var astralIdentifierStartCodes2 = [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];
  321. var astralIdentifierCodes2 = [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];
  322. function isInAstralSet2(code2, set) {
  323. var pos = 65536;
  324. for (var i = 0; i < set.length; i += 2) {
  325. pos += set[i];
  326. if (pos > code2) {
  327. return false;
  328. }
  329. pos += set[i + 1];
  330. if (pos >= code2) {
  331. return true;
  332. }
  333. }
  334. }
  335. function isIdentifierStart2(code2, astral) {
  336. if (code2 < 65) {
  337. return code2 === 36;
  338. }
  339. if (code2 < 91) {
  340. return true;
  341. }
  342. if (code2 < 97) {
  343. return code2 === 95;
  344. }
  345. if (code2 < 123) {
  346. return true;
  347. }
  348. if (code2 <= 65535) {
  349. return code2 >= 170 && nonASCIIidentifierStart2.test(String.fromCharCode(code2));
  350. }
  351. if (astral === false) {
  352. return false;
  353. }
  354. return isInAstralSet2(code2, astralIdentifierStartCodes2);
  355. }
  356. function isIdentifierChar2(code2, astral) {
  357. if (code2 < 48) {
  358. return code2 === 36;
  359. }
  360. if (code2 < 58) {
  361. return true;
  362. }
  363. if (code2 < 65) {
  364. return false;
  365. }
  366. if (code2 < 91) {
  367. return true;
  368. }
  369. if (code2 < 97) {
  370. return code2 === 95;
  371. }
  372. if (code2 < 123) {
  373. return true;
  374. }
  375. if (code2 <= 65535) {
  376. return code2 >= 170 && nonASCIIidentifier2.test(String.fromCharCode(code2));
  377. }
  378. if (astral === false) {
  379. return false;
  380. }
  381. return isInAstralSet2(code2, astralIdentifierStartCodes2) || isInAstralSet2(code2, astralIdentifierCodes2);
  382. }
  383. var TokenType3 = function TokenType4(label, conf) {
  384. if (conf === void 0) conf = {};
  385. this.label = label;
  386. this.keyword = conf.keyword;
  387. this.beforeExpr = !!conf.beforeExpr;
  388. this.startsExpr = !!conf.startsExpr;
  389. this.isLoop = !!conf.isLoop;
  390. this.isAssign = !!conf.isAssign;
  391. this.prefix = !!conf.prefix;
  392. this.postfix = !!conf.postfix;
  393. this.binop = conf.binop || null;
  394. this.updateContext = null;
  395. };
  396. function binop2(name2, prec) {
  397. return new TokenType3(name2, { beforeExpr: true, binop: prec });
  398. }
  399. var beforeExpr2 = { beforeExpr: true }, startsExpr2 = { startsExpr: true };
  400. var keywords$12 = {};
  401. function kw2(name2, options) {
  402. if (options === void 0) options = {};
  403. options.keyword = name2;
  404. return keywords$12[name2] = new TokenType3(name2, options);
  405. }
  406. var types2 = {
  407. num: new TokenType3("num", startsExpr2),
  408. regexp: new TokenType3("regexp", startsExpr2),
  409. string: new TokenType3("string", startsExpr2),
  410. name: new TokenType3("name", startsExpr2),
  411. eof: new TokenType3("eof"),
  412. // Punctuation token types.
  413. bracketL: new TokenType3("[", { beforeExpr: true, startsExpr: true }),
  414. bracketR: new TokenType3("]"),
  415. braceL: new TokenType3("{", { beforeExpr: true, startsExpr: true }),
  416. braceR: new TokenType3("}"),
  417. parenL: new TokenType3("(", { beforeExpr: true, startsExpr: true }),
  418. parenR: new TokenType3(")"),
  419. comma: new TokenType3(",", beforeExpr2),
  420. semi: new TokenType3(";", beforeExpr2),
  421. colon: new TokenType3(":", beforeExpr2),
  422. dot: new TokenType3("."),
  423. question: new TokenType3("?", beforeExpr2),
  424. questionDot: new TokenType3("?."),
  425. arrow: new TokenType3("=>", beforeExpr2),
  426. template: new TokenType3("template"),
  427. invalidTemplate: new TokenType3("invalidTemplate"),
  428. ellipsis: new TokenType3("...", beforeExpr2),
  429. backQuote: new TokenType3("`", startsExpr2),
  430. dollarBraceL: new TokenType3("${", { beforeExpr: true, startsExpr: true }),
  431. // Operators. These carry several kinds of properties to help the
  432. // parser use them properly (the presence of these properties is
  433. // what categorizes them as operators).
  434. //
  435. // `binop`, when present, specifies that this operator is a binary
  436. // operator, and will refer to its precedence.
  437. //
  438. // `prefix` and `postfix` mark the operator as a prefix or postfix
  439. // unary operator.
  440. //
  441. // `isAssign` marks all of `=`, `+=`, `-=` etcetera, which act as
  442. // binary operators with a very low precedence, that should result
  443. // in AssignmentExpression nodes.
  444. eq: new TokenType3("=", { beforeExpr: true, isAssign: true }),
  445. assign: new TokenType3("_=", { beforeExpr: true, isAssign: true }),
  446. incDec: new TokenType3("++/--", { prefix: true, postfix: true, startsExpr: true }),
  447. prefix: new TokenType3("!/~", { beforeExpr: true, prefix: true, startsExpr: true }),
  448. logicalOR: binop2("||", 1),
  449. logicalAND: binop2("&&", 2),
  450. bitwiseOR: binop2("|", 3),
  451. bitwiseXOR: binop2("^", 4),
  452. bitwiseAND: binop2("&", 5),
  453. equality: binop2("==/!=/===/!==", 6),
  454. relational: binop2("</>/<=/>=", 7),
  455. bitShift: binop2("<</>>/>>>", 8),
  456. plusMin: new TokenType3("+/-", { beforeExpr: true, binop: 9, prefix: true, startsExpr: true }),
  457. modulo: binop2("%", 10),
  458. star: binop2("*", 10),
  459. slash: binop2("/", 10),
  460. starstar: new TokenType3("**", { beforeExpr: true }),
  461. coalesce: binop2("??", 1),
  462. // Keyword token types.
  463. _break: kw2("break"),
  464. _case: kw2("case", beforeExpr2),
  465. _catch: kw2("catch"),
  466. _continue: kw2("continue"),
  467. _debugger: kw2("debugger"),
  468. _default: kw2("default", beforeExpr2),
  469. _do: kw2("do", { isLoop: true, beforeExpr: true }),
  470. _else: kw2("else", beforeExpr2),
  471. _finally: kw2("finally"),
  472. _for: kw2("for", { isLoop: true }),
  473. _function: kw2("function", startsExpr2),
  474. _if: kw2("if"),
  475. _return: kw2("return", beforeExpr2),
  476. _switch: kw2("switch"),
  477. _throw: kw2("throw", beforeExpr2),
  478. _try: kw2("try"),
  479. _var: kw2("var"),
  480. _const: kw2("const"),
  481. _while: kw2("while", { isLoop: true }),
  482. _with: kw2("with"),
  483. _new: kw2("new", { beforeExpr: true, startsExpr: true }),
  484. _this: kw2("this", startsExpr2),
  485. _super: kw2("super", startsExpr2),
  486. _class: kw2("class", startsExpr2),
  487. _extends: kw2("extends", beforeExpr2),
  488. _export: kw2("export"),
  489. _import: kw2("import", startsExpr2),
  490. _null: kw2("null", startsExpr2),
  491. _true: kw2("true", startsExpr2),
  492. _false: kw2("false", startsExpr2),
  493. _in: kw2("in", { beforeExpr: true, binop: 7 }),
  494. _instanceof: kw2("instanceof", { beforeExpr: true, binop: 7 }),
  495. _typeof: kw2("typeof", { beforeExpr: true, prefix: true, startsExpr: true }),
  496. _void: kw2("void", { beforeExpr: true, prefix: true, startsExpr: true }),
  497. _delete: kw2("delete", { beforeExpr: true, prefix: true, startsExpr: true })
  498. };
  499. var lineBreak2 = /\r\n?|\n|\u2028|\u2029/;
  500. var lineBreakG2 = new RegExp(lineBreak2.source, "g");
  501. function isNewLine2(code2, ecma2019String) {
  502. return code2 === 10 || code2 === 13 || !ecma2019String && (code2 === 8232 || code2 === 8233);
  503. }
  504. var nonASCIIwhitespace2 = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/;
  505. var skipWhiteSpace2 = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g;
  506. var ref2 = Object.prototype;
  507. var hasOwnProperty3 = ref2.hasOwnProperty;
  508. var toString4 = ref2.toString;
  509. function has(obj, propName) {
  510. return hasOwnProperty3.call(obj, propName);
  511. }
  512. var isArray2 = Array.isArray || function(obj) {
  513. return toString4.call(obj) === "[object Array]";
  514. };
  515. function wordsRegexp2(words) {
  516. return new RegExp("^(?:" + words.replace(/ /g, "|") + ")$");
  517. }
  518. var Position3 = function Position4(line, col) {
  519. this.line = line;
  520. this.column = col;
  521. };
  522. Position3.prototype.offset = function offset2(n) {
  523. return new Position3(this.line, this.column + n);
  524. };
  525. var SourceLocation3 = function SourceLocation4(p, start2, end) {
  526. this.start = start2;
  527. this.end = end;
  528. if (p.sourceFile !== null) {
  529. this.source = p.sourceFile;
  530. }
  531. };
  532. function getLineInfo2(input, offset2) {
  533. for (var line = 1, cur = 0; ; ) {
  534. lineBreakG2.lastIndex = cur;
  535. var match = lineBreakG2.exec(input);
  536. if (match && match.index < offset2) {
  537. ++line;
  538. cur = match.index + match[0].length;
  539. } else {
  540. return new Position3(line, offset2 - cur);
  541. }
  542. }
  543. }
  544. var defaultOptions2 = {
  545. // `ecmaVersion` indicates the ECMAScript version to parse. Must be
  546. // either 3, 5, 6 (2015), 7 (2016), 8 (2017), 9 (2018), or 10
  547. // (2019). This influences support for strict mode, the set of
  548. // reserved words, and support for new syntax features. The default
  549. // is 10.
  550. ecmaVersion: 10,
  551. // `sourceType` indicates the mode the code should be parsed in.
  552. // Can be either `"script"` or `"module"`. This influences global
  553. // strict mode and parsing of `import` and `export` declarations.
  554. sourceType: "script",
  555. // `onInsertedSemicolon` can be a callback that will be called
  556. // when a semicolon is automatically inserted. It will be passed
  557. // the position of the comma as an offset, and if `locations` is
  558. // enabled, it is given the location as a `{line, column}` object
  559. // as second argument.
  560. onInsertedSemicolon: null,
  561. // `onTrailingComma` is similar to `onInsertedSemicolon`, but for
  562. // trailing commas.
  563. onTrailingComma: null,
  564. // By default, reserved words are only enforced if ecmaVersion >= 5.
  565. // Set `allowReserved` to a boolean value to explicitly turn this on
  566. // an off. When this option has the value "never", reserved words
  567. // and keywords can also not be used as property names.
  568. allowReserved: null,
  569. // When enabled, a return at the top level is not considered an
  570. // error.
  571. allowReturnOutsideFunction: false,
  572. // When enabled, import/export statements are not constrained to
  573. // appearing at the top of the program.
  574. allowImportExportEverywhere: false,
  575. // When enabled, await identifiers are allowed to appear at the top-level scope,
  576. // but they are still not allowed in non-async functions.
  577. allowAwaitOutsideFunction: false,
  578. // When enabled, hashbang directive in the beginning of file
  579. // is allowed and treated as a line comment.
  580. allowHashBang: false,
  581. // When `locations` is on, `loc` properties holding objects with
  582. // `start` and `end` properties in `{line, column}` form (with
  583. // line being 1-based and column 0-based) will be attached to the
  584. // nodes.
  585. locations: false,
  586. // A function can be passed as `onToken` option, which will
  587. // cause Acorn to call that function with object in the same
  588. // format as tokens returned from `tokenizer().getToken()`. Note
  589. // that you are not allowed to call the parser from the
  590. // callback—that will corrupt its internal state.
  591. onToken: null,
  592. // A function can be passed as `onComment` option, which will
  593. // cause Acorn to call that function with `(block, text, start,
  594. // end)` parameters whenever a comment is skipped. `block` is a
  595. // boolean indicating whether this is a block (`/* */`) comment,
  596. // `text` is the content of the comment, and `start` and `end` are
  597. // character offsets that denote the start and end of the comment.
  598. // When the `locations` option is on, two more parameters are
  599. // passed, the full `{line, column}` locations of the start and
  600. // end of the comments. Note that you are not allowed to call the
  601. // parser from the callback—that will corrupt its internal state.
  602. onComment: null,
  603. // Nodes have their start and end characters offsets recorded in
  604. // `start` and `end` properties (directly on the node, rather than
  605. // the `loc` object, which holds line/column data. To also add a
  606. // [semi-standardized][range] `range` property holding a `[start,
  607. // end]` array with the same numbers, set the `ranges` option to
  608. // `true`.
  609. //
  610. // [range]: https://bugzilla.mozilla.org/show_bug.cgi?id=745678
  611. ranges: false,
  612. // It is possible to parse multiple files into a single AST by
  613. // passing the tree produced by parsing the first file as
  614. // `program` option in subsequent parses. This will add the
  615. // toplevel forms of the parsed file to the `Program` (top) node
  616. // of an existing parse tree.
  617. program: null,
  618. // When `locations` is on, you can pass this to record the source
  619. // file in every node's `loc` object.
  620. sourceFile: null,
  621. // This value, if given, is stored in every node, whether
  622. // `locations` is on or off.
  623. directSourceFile: null,
  624. // When enabled, parenthesized expressions are represented by
  625. // (non-standard) ParenthesizedExpression nodes
  626. preserveParens: false
  627. };
  628. function getOptions2(opts) {
  629. var options = {};
  630. for (var opt in defaultOptions2) {
  631. options[opt] = opts && has(opts, opt) ? opts[opt] : defaultOptions2[opt];
  632. }
  633. if (options.ecmaVersion >= 2015) {
  634. options.ecmaVersion -= 2009;
  635. }
  636. if (options.allowReserved == null) {
  637. options.allowReserved = options.ecmaVersion < 5;
  638. }
  639. if (isArray2(options.onToken)) {
  640. var tokens = options.onToken;
  641. options.onToken = function(token) {
  642. return tokens.push(token);
  643. };
  644. }
  645. if (isArray2(options.onComment)) {
  646. options.onComment = pushComment2(options, options.onComment);
  647. }
  648. return options;
  649. }
  650. function pushComment2(options, array) {
  651. return function(block, text5, start2, end, startLoc, endLoc) {
  652. var comment2 = {
  653. type: block ? "Block" : "Line",
  654. value: text5,
  655. start: start2,
  656. end
  657. };
  658. if (options.locations) {
  659. comment2.loc = new SourceLocation3(this, startLoc, endLoc);
  660. }
  661. if (options.ranges) {
  662. comment2.range = [start2, end];
  663. }
  664. array.push(comment2);
  665. };
  666. }
  667. var SCOPE_TOP2 = 1, SCOPE_FUNCTION2 = 2, SCOPE_VAR2 = SCOPE_TOP2 | SCOPE_FUNCTION2, SCOPE_ASYNC2 = 4, SCOPE_GENERATOR2 = 8, SCOPE_ARROW2 = 16, SCOPE_SIMPLE_CATCH2 = 32, SCOPE_SUPER2 = 64, SCOPE_DIRECT_SUPER2 = 128;
  668. function functionFlags2(async, generator) {
  669. return SCOPE_FUNCTION2 | (async ? SCOPE_ASYNC2 : 0) | (generator ? SCOPE_GENERATOR2 : 0);
  670. }
  671. var BIND_NONE2 = 0, BIND_VAR2 = 1, BIND_LEXICAL2 = 2, BIND_FUNCTION2 = 3, BIND_SIMPLE_CATCH2 = 4, BIND_OUTSIDE2 = 5;
  672. var Parser3 = function Parser4(options, input, startPos) {
  673. this.options = options = getOptions2(options);
  674. this.sourceFile = options.sourceFile;
  675. this.keywords = wordsRegexp2(keywords2[options.ecmaVersion >= 6 ? 6 : options.sourceType === "module" ? "5module" : 5]);
  676. var reserved = "";
  677. if (options.allowReserved !== true) {
  678. for (var v = options.ecmaVersion; ; v--) {
  679. if (reserved = reservedWords2[v]) {
  680. break;
  681. }
  682. }
  683. if (options.sourceType === "module") {
  684. reserved += " await";
  685. }
  686. }
  687. this.reservedWords = wordsRegexp2(reserved);
  688. var reservedStrict = (reserved ? reserved + " " : "") + reservedWords2.strict;
  689. this.reservedWordsStrict = wordsRegexp2(reservedStrict);
  690. this.reservedWordsStrictBind = wordsRegexp2(reservedStrict + " " + reservedWords2.strictBind);
  691. this.input = String(input);
  692. this.containsEsc = false;
  693. if (startPos) {
  694. this.pos = startPos;
  695. this.lineStart = this.input.lastIndexOf("\n", startPos - 1) + 1;
  696. this.curLine = this.input.slice(0, this.lineStart).split(lineBreak2).length;
  697. } else {
  698. this.pos = this.lineStart = 0;
  699. this.curLine = 1;
  700. }
  701. this.type = types2.eof;
  702. this.value = null;
  703. this.start = this.end = this.pos;
  704. this.startLoc = this.endLoc = this.curPosition();
  705. this.lastTokEndLoc = this.lastTokStartLoc = null;
  706. this.lastTokStart = this.lastTokEnd = this.pos;
  707. this.context = this.initialContext();
  708. this.exprAllowed = true;
  709. this.inModule = options.sourceType === "module";
  710. this.strict = this.inModule || this.strictDirective(this.pos);
  711. this.potentialArrowAt = -1;
  712. this.yieldPos = this.awaitPos = this.awaitIdentPos = 0;
  713. this.labels = [];
  714. this.undefinedExports = {};
  715. if (this.pos === 0 && options.allowHashBang && this.input.slice(0, 2) === "#!") {
  716. this.skipLineComment(2);
  717. }
  718. this.scopeStack = [];
  719. this.enterScope(SCOPE_TOP2);
  720. this.regexpState = null;
  721. };
  722. var prototypeAccessors2 = { inFunction: { configurable: true }, inGenerator: { configurable: true }, inAsync: { configurable: true }, allowSuper: { configurable: true }, allowDirectSuper: { configurable: true }, treatFunctionsAsVar: { configurable: true } };
  723. Parser3.prototype.parse = function parse5() {
  724. var node2 = this.options.program || this.startNode();
  725. this.nextToken();
  726. return this.parseTopLevel(node2);
  727. };
  728. prototypeAccessors2.inFunction.get = function() {
  729. return (this.currentVarScope().flags & SCOPE_FUNCTION2) > 0;
  730. };
  731. prototypeAccessors2.inGenerator.get = function() {
  732. return (this.currentVarScope().flags & SCOPE_GENERATOR2) > 0;
  733. };
  734. prototypeAccessors2.inAsync.get = function() {
  735. return (this.currentVarScope().flags & SCOPE_ASYNC2) > 0;
  736. };
  737. prototypeAccessors2.allowSuper.get = function() {
  738. return (this.currentThisScope().flags & SCOPE_SUPER2) > 0;
  739. };
  740. prototypeAccessors2.allowDirectSuper.get = function() {
  741. return (this.currentThisScope().flags & SCOPE_DIRECT_SUPER2) > 0;
  742. };
  743. prototypeAccessors2.treatFunctionsAsVar.get = function() {
  744. return this.treatFunctionsAsVarInScope(this.currentScope());
  745. };
  746. Parser3.prototype.inNonArrowFunction = function inNonArrowFunction() {
  747. return (this.currentThisScope().flags & SCOPE_FUNCTION2) > 0;
  748. };
  749. Parser3.extend = function extend3() {
  750. var plugins = [], len = arguments.length;
  751. while (len--) plugins[len] = arguments[len];
  752. var cls = this;
  753. for (var i = 0; i < plugins.length; i++) {
  754. cls = plugins[i](cls);
  755. }
  756. return cls;
  757. };
  758. Parser3.parse = function parse5(input, options) {
  759. return new this(options, input).parse();
  760. };
  761. Parser3.parseExpressionAt = function parseExpressionAt3(input, pos, options) {
  762. var parser = new this(options, input, pos);
  763. parser.nextToken();
  764. return parser.parseExpression();
  765. };
  766. Parser3.tokenizer = function tokenizer3(input, options) {
  767. return new this(options, input);
  768. };
  769. Object.defineProperties(Parser3.prototype, prototypeAccessors2);
  770. var pp2 = Parser3.prototype;
  771. var literal2 = /^(?:'((?:\\.|[^'\\])*?)'|"((?:\\.|[^"\\])*?)")/;
  772. pp2.strictDirective = function(start2) {
  773. for (; ; ) {
  774. skipWhiteSpace2.lastIndex = start2;
  775. start2 += skipWhiteSpace2.exec(this.input)[0].length;
  776. var match = literal2.exec(this.input.slice(start2));
  777. if (!match) {
  778. return false;
  779. }
  780. if ((match[1] || match[2]) === "use strict") {
  781. skipWhiteSpace2.lastIndex = start2 + match[0].length;
  782. var spaceAfter = skipWhiteSpace2.exec(this.input), end = spaceAfter.index + spaceAfter[0].length;
  783. var next = this.input.charAt(end);
  784. return next === ";" || next === "}" || lineBreak2.test(spaceAfter[0]) && !(/[(`.[+\-/*%<>=,?^&]/.test(next) || next === "!" && this.input.charAt(end + 1) === "=");
  785. }
  786. start2 += match[0].length;
  787. skipWhiteSpace2.lastIndex = start2;
  788. start2 += skipWhiteSpace2.exec(this.input)[0].length;
  789. if (this.input[start2] === ";") {
  790. start2++;
  791. }
  792. }
  793. };
  794. pp2.eat = function(type) {
  795. if (this.type === type) {
  796. this.next();
  797. return true;
  798. } else {
  799. return false;
  800. }
  801. };
  802. pp2.isContextual = function(name2) {
  803. return this.type === types2.name && this.value === name2 && !this.containsEsc;
  804. };
  805. pp2.eatContextual = function(name2) {
  806. if (!this.isContextual(name2)) {
  807. return false;
  808. }
  809. this.next();
  810. return true;
  811. };
  812. pp2.expectContextual = function(name2) {
  813. if (!this.eatContextual(name2)) {
  814. this.unexpected();
  815. }
  816. };
  817. pp2.canInsertSemicolon = function() {
  818. return this.type === types2.eof || this.type === types2.braceR || lineBreak2.test(this.input.slice(this.lastTokEnd, this.start));
  819. };
  820. pp2.insertSemicolon = function() {
  821. if (this.canInsertSemicolon()) {
  822. if (this.options.onInsertedSemicolon) {
  823. this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc);
  824. }
  825. return true;
  826. }
  827. };
  828. pp2.semicolon = function() {
  829. if (!this.eat(types2.semi) && !this.insertSemicolon()) {
  830. this.unexpected();
  831. }
  832. };
  833. pp2.afterTrailingComma = function(tokType, notNext) {
  834. if (this.type === tokType) {
  835. if (this.options.onTrailingComma) {
  836. this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc);
  837. }
  838. if (!notNext) {
  839. this.next();
  840. }
  841. return true;
  842. }
  843. };
  844. pp2.expect = function(type) {
  845. this.eat(type) || this.unexpected();
  846. };
  847. pp2.unexpected = function(pos) {
  848. this.raise(pos != null ? pos : this.start, "Unexpected token");
  849. };
  850. function DestructuringErrors3() {
  851. this.shorthandAssign = this.trailingComma = this.parenthesizedAssign = this.parenthesizedBind = this.doubleProto = -1;
  852. }
  853. pp2.checkPatternErrors = function(refDestructuringErrors, isAssign) {
  854. if (!refDestructuringErrors) {
  855. return;
  856. }
  857. if (refDestructuringErrors.trailingComma > -1) {
  858. this.raiseRecoverable(refDestructuringErrors.trailingComma, "Comma is not permitted after the rest element");
  859. }
  860. var parens = isAssign ? refDestructuringErrors.parenthesizedAssign : refDestructuringErrors.parenthesizedBind;
  861. if (parens > -1) {
  862. this.raiseRecoverable(parens, "Parenthesized pattern");
  863. }
  864. };
  865. pp2.checkExpressionErrors = function(refDestructuringErrors, andThrow) {
  866. if (!refDestructuringErrors) {
  867. return false;
  868. }
  869. var shorthandAssign = refDestructuringErrors.shorthandAssign;
  870. var doubleProto = refDestructuringErrors.doubleProto;
  871. if (!andThrow) {
  872. return shorthandAssign >= 0 || doubleProto >= 0;
  873. }
  874. if (shorthandAssign >= 0) {
  875. this.raise(shorthandAssign, "Shorthand property assignments are valid only in destructuring patterns");
  876. }
  877. if (doubleProto >= 0) {
  878. this.raiseRecoverable(doubleProto, "Redefinition of __proto__ property");
  879. }
  880. };
  881. pp2.checkYieldAwaitInDefaultParams = function() {
  882. if (this.yieldPos && (!this.awaitPos || this.yieldPos < this.awaitPos)) {
  883. this.raise(this.yieldPos, "Yield expression cannot be a default value");
  884. }
  885. if (this.awaitPos) {
  886. this.raise(this.awaitPos, "Await expression cannot be a default value");
  887. }
  888. };
  889. pp2.isSimpleAssignTarget = function(expr) {
  890. if (expr.type === "ParenthesizedExpression") {
  891. return this.isSimpleAssignTarget(expr.expression);
  892. }
  893. return expr.type === "Identifier" || expr.type === "MemberExpression";
  894. };
  895. var pp$12 = Parser3.prototype;
  896. pp$12.parseTopLevel = function(node2) {
  897. var exports4 = {};
  898. if (!node2.body) {
  899. node2.body = [];
  900. }
  901. while (this.type !== types2.eof) {
  902. var stmt = this.parseStatement(null, true, exports4);
  903. node2.body.push(stmt);
  904. }
  905. if (this.inModule) {
  906. for (var i = 0, list3 = Object.keys(this.undefinedExports); i < list3.length; i += 1) {
  907. var name2 = list3[i];
  908. this.raiseRecoverable(this.undefinedExports[name2].start, "Export '" + name2 + "' is not defined");
  909. }
  910. }
  911. this.adaptDirectivePrologue(node2.body);
  912. this.next();
  913. node2.sourceType = this.options.sourceType;
  914. return this.finishNode(node2, "Program");
  915. };
  916. var loopLabel2 = { kind: "loop" }, switchLabel2 = { kind: "switch" };
  917. pp$12.isLet = function(context) {
  918. if (this.options.ecmaVersion < 6 || !this.isContextual("let")) {
  919. return false;
  920. }
  921. skipWhiteSpace2.lastIndex = this.pos;
  922. var skip = skipWhiteSpace2.exec(this.input);
  923. var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next);
  924. if (nextCh === 91) {
  925. return true;
  926. }
  927. if (context) {
  928. return false;
  929. }
  930. if (nextCh === 123) {
  931. return true;
  932. }
  933. if (isIdentifierStart2(nextCh, true)) {
  934. var pos = next + 1;
  935. while (isIdentifierChar2(this.input.charCodeAt(pos), true)) {
  936. ++pos;
  937. }
  938. var ident = this.input.slice(next, pos);
  939. if (!keywordRelationalOperator2.test(ident)) {
  940. return true;
  941. }
  942. }
  943. return false;
  944. };
  945. pp$12.isAsyncFunction = function() {
  946. if (this.options.ecmaVersion < 8 || !this.isContextual("async")) {
  947. return false;
  948. }
  949. skipWhiteSpace2.lastIndex = this.pos;
  950. var skip = skipWhiteSpace2.exec(this.input);
  951. var next = this.pos + skip[0].length;
  952. return !lineBreak2.test(this.input.slice(this.pos, next)) && this.input.slice(next, next + 8) === "function" && (next + 8 === this.input.length || !isIdentifierChar2(this.input.charAt(next + 8)));
  953. };
  954. pp$12.parseStatement = function(context, topLevel, exports4) {
  955. var starttype = this.type, node2 = this.startNode(), kind;
  956. if (this.isLet(context)) {
  957. starttype = types2._var;
  958. kind = "let";
  959. }
  960. switch (starttype) {
  961. case types2._break:
  962. case types2._continue:
  963. return this.parseBreakContinueStatement(node2, starttype.keyword);
  964. case types2._debugger:
  965. return this.parseDebuggerStatement(node2);
  966. case types2._do:
  967. return this.parseDoStatement(node2);
  968. case types2._for:
  969. return this.parseForStatement(node2);
  970. case types2._function:
  971. if (context && (this.strict || context !== "if" && context !== "label") && this.options.ecmaVersion >= 6) {
  972. this.unexpected();
  973. }
  974. return this.parseFunctionStatement(node2, false, !context);
  975. case types2._class:
  976. if (context) {
  977. this.unexpected();
  978. }
  979. return this.parseClass(node2, true);
  980. case types2._if:
  981. return this.parseIfStatement(node2);
  982. case types2._return:
  983. return this.parseReturnStatement(node2);
  984. case types2._switch:
  985. return this.parseSwitchStatement(node2);
  986. case types2._throw:
  987. return this.parseThrowStatement(node2);
  988. case types2._try:
  989. return this.parseTryStatement(node2);
  990. case types2._const:
  991. case types2._var:
  992. kind = kind || this.value;
  993. if (context && kind !== "var") {
  994. this.unexpected();
  995. }
  996. return this.parseVarStatement(node2, kind);
  997. case types2._while:
  998. return this.parseWhileStatement(node2);
  999. case types2._with:
  1000. return this.parseWithStatement(node2);
  1001. case types2.braceL:
  1002. return this.parseBlock(true, node2);
  1003. case types2.semi:
  1004. return this.parseEmptyStatement(node2);
  1005. case types2._export:
  1006. case types2._import:
  1007. if (this.options.ecmaVersion > 10 && starttype === types2._import) {
  1008. skipWhiteSpace2.lastIndex = this.pos;
  1009. var skip = skipWhiteSpace2.exec(this.input);
  1010. var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next);
  1011. if (nextCh === 40 || nextCh === 46) {
  1012. return this.parseExpressionStatement(node2, this.parseExpression());
  1013. }
  1014. }
  1015. if (!this.options.allowImportExportEverywhere) {
  1016. if (!topLevel) {
  1017. this.raise(this.start, "'import' and 'export' may only appear at the top level");
  1018. }
  1019. if (!this.inModule) {
  1020. this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'");
  1021. }
  1022. }
  1023. return starttype === types2._import ? this.parseImport(node2) : this.parseExport(node2, exports4);
  1024. default:
  1025. if (this.isAsyncFunction()) {
  1026. if (context) {
  1027. this.unexpected();
  1028. }
  1029. this.next();
  1030. return this.parseFunctionStatement(node2, true, !context);
  1031. }
  1032. var maybeName = this.value, expr = this.parseExpression();
  1033. if (starttype === types2.name && expr.type === "Identifier" && this.eat(types2.colon)) {
  1034. return this.parseLabeledStatement(node2, maybeName, expr, context);
  1035. } else {
  1036. return this.parseExpressionStatement(node2, expr);
  1037. }
  1038. }
  1039. };
  1040. pp$12.parseBreakContinueStatement = function(node2, keyword) {
  1041. var isBreak = keyword === "break";
  1042. this.next();
  1043. if (this.eat(types2.semi) || this.insertSemicolon()) {
  1044. node2.label = null;
  1045. } else if (this.type !== types2.name) {
  1046. this.unexpected();
  1047. } else {
  1048. node2.label = this.parseIdent();
  1049. this.semicolon();
  1050. }
  1051. var i = 0;
  1052. for (; i < this.labels.length; ++i) {
  1053. var lab = this.labels[i];
  1054. if (node2.label == null || lab.name === node2.label.name) {
  1055. if (lab.kind != null && (isBreak || lab.kind === "loop")) {
  1056. break;
  1057. }
  1058. if (node2.label && isBreak) {
  1059. break;
  1060. }
  1061. }
  1062. }
  1063. if (i === this.labels.length) {
  1064. this.raise(node2.start, "Unsyntactic " + keyword);
  1065. }
  1066. return this.finishNode(node2, isBreak ? "BreakStatement" : "ContinueStatement");
  1067. };
  1068. pp$12.parseDebuggerStatement = function(node2) {
  1069. this.next();
  1070. this.semicolon();
  1071. return this.finishNode(node2, "DebuggerStatement");
  1072. };
  1073. pp$12.parseDoStatement = function(node2) {
  1074. this.next();
  1075. this.labels.push(loopLabel2);
  1076. node2.body = this.parseStatement("do");
  1077. this.labels.pop();
  1078. this.expect(types2._while);
  1079. node2.test = this.parseParenExpression();
  1080. if (this.options.ecmaVersion >= 6) {
  1081. this.eat(types2.semi);
  1082. } else {
  1083. this.semicolon();
  1084. }
  1085. return this.finishNode(node2, "DoWhileStatement");
  1086. };
  1087. pp$12.parseForStatement = function(node2) {
  1088. this.next();
  1089. var awaitAt = this.options.ecmaVersion >= 9 && (this.inAsync || !this.inFunction && this.options.allowAwaitOutsideFunction) && this.eatContextual("await") ? this.lastTokStart : -1;
  1090. this.labels.push(loopLabel2);
  1091. this.enterScope(0);
  1092. this.expect(types2.parenL);
  1093. if (this.type === types2.semi) {
  1094. if (awaitAt > -1) {
  1095. this.unexpected(awaitAt);
  1096. }
  1097. return this.parseFor(node2, null);
  1098. }
  1099. var isLet = this.isLet();
  1100. if (this.type === types2._var || this.type === types2._const || isLet) {
  1101. var init$1 = this.startNode(), kind = isLet ? "let" : this.value;
  1102. this.next();
  1103. this.parseVar(init$1, true, kind);
  1104. this.finishNode(init$1, "VariableDeclaration");
  1105. if ((this.type === types2._in || this.options.ecmaVersion >= 6 && this.isContextual("of")) && init$1.declarations.length === 1) {
  1106. if (this.options.ecmaVersion >= 9) {
  1107. if (this.type === types2._in) {
  1108. if (awaitAt > -1) {
  1109. this.unexpected(awaitAt);
  1110. }
  1111. } else {
  1112. node2.await = awaitAt > -1;
  1113. }
  1114. }
  1115. return this.parseForIn(node2, init$1);
  1116. }
  1117. if (awaitAt > -1) {
  1118. this.unexpected(awaitAt);
  1119. }
  1120. return this.parseFor(node2, init$1);
  1121. }
  1122. var refDestructuringErrors = new DestructuringErrors3();
  1123. var init = this.parseExpression(true, refDestructuringErrors);
  1124. if (this.type === types2._in || this.options.ecmaVersion >= 6 && this.isContextual("of")) {
  1125. if (this.options.ecmaVersion >= 9) {
  1126. if (this.type === types2._in) {
  1127. if (awaitAt > -1) {
  1128. this.unexpected(awaitAt);
  1129. }
  1130. } else {
  1131. node2.await = awaitAt > -1;
  1132. }
  1133. }
  1134. this.toAssignable(init, false, refDestructuringErrors);
  1135. this.checkLVal(init);
  1136. return this.parseForIn(node2, init);
  1137. } else {
  1138. this.checkExpressionErrors(refDestructuringErrors, true);
  1139. }
  1140. if (awaitAt > -1) {
  1141. this.unexpected(awaitAt);
  1142. }
  1143. return this.parseFor(node2, init);
  1144. };
  1145. pp$12.parseFunctionStatement = function(node2, isAsync, declarationPosition) {
  1146. this.next();
  1147. return this.parseFunction(node2, FUNC_STATEMENT2 | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT2), false, isAsync);
  1148. };
  1149. pp$12.parseIfStatement = function(node2) {
  1150. this.next();
  1151. node2.test = this.parseParenExpression();
  1152. node2.consequent = this.parseStatement("if");
  1153. node2.alternate = this.eat(types2._else) ? this.parseStatement("if") : null;
  1154. return this.finishNode(node2, "IfStatement");
  1155. };
  1156. pp$12.parseReturnStatement = function(node2) {
  1157. if (!this.inFunction && !this.options.allowReturnOutsideFunction) {
  1158. this.raise(this.start, "'return' outside of function");
  1159. }
  1160. this.next();
  1161. if (this.eat(types2.semi) || this.insertSemicolon()) {
  1162. node2.argument = null;
  1163. } else {
  1164. node2.argument = this.parseExpression();
  1165. this.semicolon();
  1166. }
  1167. return this.finishNode(node2, "ReturnStatement");
  1168. };
  1169. pp$12.parseSwitchStatement = function(node2) {
  1170. this.next();
  1171. node2.discriminant = this.parseParenExpression();
  1172. node2.cases = [];
  1173. this.expect(types2.braceL);
  1174. this.labels.push(switchLabel2);
  1175. this.enterScope(0);
  1176. var cur;
  1177. for (var sawDefault = false; this.type !== types2.braceR; ) {
  1178. if (this.type === types2._case || this.type === types2._default) {
  1179. var isCase = this.type === types2._case;
  1180. if (cur) {
  1181. this.finishNode(cur, "SwitchCase");
  1182. }
  1183. node2.cases.push(cur = this.startNode());
  1184. cur.consequent = [];
  1185. this.next();
  1186. if (isCase) {
  1187. cur.test = this.parseExpression();
  1188. } else {
  1189. if (sawDefault) {
  1190. this.raiseRecoverable(this.lastTokStart, "Multiple default clauses");
  1191. }
  1192. sawDefault = true;
  1193. cur.test = null;
  1194. }
  1195. this.expect(types2.colon);
  1196. } else {
  1197. if (!cur) {
  1198. this.unexpected();
  1199. }
  1200. cur.consequent.push(this.parseStatement(null));
  1201. }
  1202. }
  1203. this.exitScope();
  1204. if (cur) {
  1205. this.finishNode(cur, "SwitchCase");
  1206. }
  1207. this.next();
  1208. this.labels.pop();
  1209. return this.finishNode(node2, "SwitchStatement");
  1210. };
  1211. pp$12.parseThrowStatement = function(node2) {
  1212. this.next();
  1213. if (lineBreak2.test(this.input.slice(this.lastTokEnd, this.start))) {
  1214. this.raise(this.lastTokEnd, "Illegal newline after throw");
  1215. }
  1216. node2.argument = this.parseExpression();
  1217. this.semicolon();
  1218. return this.finishNode(node2, "ThrowStatement");
  1219. };
  1220. var empty6 = [];
  1221. pp$12.parseTryStatement = function(node2) {
  1222. this.next();
  1223. node2.block = this.parseBlock();
  1224. node2.handler = null;
  1225. if (this.type === types2._catch) {
  1226. var clause = this.startNode();
  1227. this.next();
  1228. if (this.eat(types2.parenL)) {
  1229. clause.param = this.parseBindingAtom();
  1230. var simple = clause.param.type === "Identifier";
  1231. this.enterScope(simple ? SCOPE_SIMPLE_CATCH2 : 0);
  1232. this.checkLVal(clause.param, simple ? BIND_SIMPLE_CATCH2 : BIND_LEXICAL2);
  1233. this.expect(types2.parenR);
  1234. } else {
  1235. if (this.options.ecmaVersion < 10) {
  1236. this.unexpected();
  1237. }
  1238. clause.param = null;
  1239. this.enterScope(0);
  1240. }
  1241. clause.body = this.parseBlock(false);
  1242. this.exitScope();
  1243. node2.handler = this.finishNode(clause, "CatchClause");
  1244. }
  1245. node2.finalizer = this.eat(types2._finally) ? this.parseBlock() : null;
  1246. if (!node2.handler && !node2.finalizer) {
  1247. this.raise(node2.start, "Missing catch or finally clause");
  1248. }
  1249. return this.finishNode(node2, "TryStatement");
  1250. };
  1251. pp$12.parseVarStatement = function(node2, kind) {
  1252. this.next();
  1253. this.parseVar(node2, false, kind);
  1254. this.semicolon();
  1255. return this.finishNode(node2, "VariableDeclaration");
  1256. };
  1257. pp$12.parseWhileStatement = function(node2) {
  1258. this.next();
  1259. node2.test = this.parseParenExpression();
  1260. this.labels.push(loopLabel2);
  1261. node2.body = this.parseStatement("while");
  1262. this.labels.pop();
  1263. return this.finishNode(node2, "WhileStatement");
  1264. };
  1265. pp$12.parseWithStatement = function(node2) {
  1266. if (this.strict) {
  1267. this.raise(this.start, "'with' in strict mode");
  1268. }
  1269. this.next();
  1270. node2.object = this.parseParenExpression();
  1271. node2.body = this.parseStatement("with");
  1272. return this.finishNode(node2, "WithStatement");
  1273. };
  1274. pp$12.parseEmptyStatement = function(node2) {
  1275. this.next();
  1276. return this.finishNode(node2, "EmptyStatement");
  1277. };
  1278. pp$12.parseLabeledStatement = function(node2, maybeName, expr, context) {
  1279. for (var i$1 = 0, list3 = this.labels; i$1 < list3.length; i$1 += 1) {
  1280. var label = list3[i$1];
  1281. if (label.name === maybeName) {
  1282. this.raise(expr.start, "Label '" + maybeName + "' is already declared");
  1283. }
  1284. }
  1285. var kind = this.type.isLoop ? "loop" : this.type === types2._switch ? "switch" : null;
  1286. for (var i = this.labels.length - 1; i >= 0; i--) {
  1287. var label$1 = this.labels[i];
  1288. if (label$1.statementStart === node2.start) {
  1289. label$1.statementStart = this.start;
  1290. label$1.kind = kind;
  1291. } else {
  1292. break;
  1293. }
  1294. }
  1295. this.labels.push({ name: maybeName, kind, statementStart: this.start });
  1296. node2.body = this.parseStatement(context ? context.indexOf("label") === -1 ? context + "label" : context : "label");
  1297. this.labels.pop();
  1298. node2.label = expr;
  1299. return this.finishNode(node2, "LabeledStatement");
  1300. };
  1301. pp$12.parseExpressionStatement = function(node2, expr) {
  1302. node2.expression = expr;
  1303. this.semicolon();
  1304. return this.finishNode(node2, "ExpressionStatement");
  1305. };
  1306. pp$12.parseBlock = function(createNewLexicalScope, node2, exitStrict) {
  1307. if (createNewLexicalScope === void 0) createNewLexicalScope = true;
  1308. if (node2 === void 0) node2 = this.startNode();
  1309. node2.body = [];
  1310. this.expect(types2.braceL);
  1311. if (createNewLexicalScope) {
  1312. this.enterScope(0);
  1313. }
  1314. while (this.type !== types2.braceR) {
  1315. var stmt = this.parseStatement(null);
  1316. node2.body.push(stmt);
  1317. }
  1318. if (exitStrict) {
  1319. this.strict = false;
  1320. }
  1321. this.next();
  1322. if (createNewLexicalScope) {
  1323. this.exitScope();
  1324. }
  1325. return this.finishNode(node2, "BlockStatement");
  1326. };
  1327. pp$12.parseFor = function(node2, init) {
  1328. node2.init = init;
  1329. this.expect(types2.semi);
  1330. node2.test = this.type === types2.semi ? null : this.parseExpression();
  1331. this.expect(types2.semi);
  1332. node2.update = this.type === types2.parenR ? null : this.parseExpression();
  1333. this.expect(types2.parenR);
  1334. node2.body = this.parseStatement("for");
  1335. this.exitScope();
  1336. this.labels.pop();
  1337. return this.finishNode(node2, "ForStatement");
  1338. };
  1339. pp$12.parseForIn = function(node2, init) {
  1340. var isForIn = this.type === types2._in;
  1341. this.next();
  1342. if (init.type === "VariableDeclaration" && init.declarations[0].init != null && (!isForIn || this.options.ecmaVersion < 8 || this.strict || init.kind !== "var" || init.declarations[0].id.type !== "Identifier")) {
  1343. this.raise(
  1344. init.start,
  1345. (isForIn ? "for-in" : "for-of") + " loop variable declaration may not have an initializer"
  1346. );
  1347. } else if (init.type === "AssignmentPattern") {
  1348. this.raise(init.start, "Invalid left-hand side in for-loop");
  1349. }
  1350. node2.left = init;
  1351. node2.right = isForIn ? this.parseExpression() : this.parseMaybeAssign();
  1352. this.expect(types2.parenR);
  1353. node2.body = this.parseStatement("for");
  1354. this.exitScope();
  1355. this.labels.pop();
  1356. return this.finishNode(node2, isForIn ? "ForInStatement" : "ForOfStatement");
  1357. };
  1358. pp$12.parseVar = function(node2, isFor, kind) {
  1359. node2.declarations = [];
  1360. node2.kind = kind;
  1361. for (; ; ) {
  1362. var decl = this.startNode();
  1363. this.parseVarId(decl, kind);
  1364. if (this.eat(types2.eq)) {
  1365. decl.init = this.parseMaybeAssign(isFor);
  1366. } else if (kind === "const" && !(this.type === types2._in || this.options.ecmaVersion >= 6 && this.isContextual("of"))) {
  1367. this.unexpected();
  1368. } else if (decl.id.type !== "Identifier" && !(isFor && (this.type === types2._in || this.isContextual("of")))) {
  1369. this.raise(this.lastTokEnd, "Complex binding patterns require an initialization value");
  1370. } else {
  1371. decl.init = null;
  1372. }
  1373. node2.declarations.push(this.finishNode(decl, "VariableDeclarator"));
  1374. if (!this.eat(types2.comma)) {
  1375. break;
  1376. }
  1377. }
  1378. return node2;
  1379. };
  1380. pp$12.parseVarId = function(decl, kind) {
  1381. decl.id = this.parseBindingAtom();
  1382. this.checkLVal(decl.id, kind === "var" ? BIND_VAR2 : BIND_LEXICAL2, false);
  1383. };
  1384. var FUNC_STATEMENT2 = 1, FUNC_HANGING_STATEMENT2 = 2, FUNC_NULLABLE_ID2 = 4;
  1385. pp$12.parseFunction = function(node2, statement, allowExpressionBody, isAsync) {
  1386. this.initFunction(node2);
  1387. if (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !isAsync) {
  1388. if (this.type === types2.star && statement & FUNC_HANGING_STATEMENT2) {
  1389. this.unexpected();
  1390. }
  1391. node2.generator = this.eat(types2.star);
  1392. }
  1393. if (this.options.ecmaVersion >= 8) {
  1394. node2.async = !!isAsync;
  1395. }
  1396. if (statement & FUNC_STATEMENT2) {
  1397. node2.id = statement & FUNC_NULLABLE_ID2 && this.type !== types2.name ? null : this.parseIdent();
  1398. if (node2.id && !(statement & FUNC_HANGING_STATEMENT2)) {
  1399. this.checkLVal(node2.id, this.strict || node2.generator || node2.async ? this.treatFunctionsAsVar ? BIND_VAR2 : BIND_LEXICAL2 : BIND_FUNCTION2);
  1400. }
  1401. }
  1402. var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;
  1403. this.yieldPos = 0;
  1404. this.awaitPos = 0;
  1405. this.awaitIdentPos = 0;
  1406. this.enterScope(functionFlags2(node2.async, node2.generator));
  1407. if (!(statement & FUNC_STATEMENT2)) {
  1408. node2.id = this.type === types2.name ? this.parseIdent() : null;
  1409. }
  1410. this.parseFunctionParams(node2);
  1411. this.parseFunctionBody(node2, allowExpressionBody, false);
  1412. this.yieldPos = oldYieldPos;
  1413. this.awaitPos = oldAwaitPos;
  1414. this.awaitIdentPos = oldAwaitIdentPos;
  1415. return this.finishNode(node2, statement & FUNC_STATEMENT2 ? "FunctionDeclaration" : "FunctionExpression");
  1416. };
  1417. pp$12.parseFunctionParams = function(node2) {
  1418. this.expect(types2.parenL);
  1419. node2.params = this.parseBindingList(types2.parenR, false, this.options.ecmaVersion >= 8);
  1420. this.checkYieldAwaitInDefaultParams();
  1421. };
  1422. pp$12.parseClass = function(node2, isStatement) {
  1423. this.next();
  1424. var oldStrict = this.strict;
  1425. this.strict = true;
  1426. this.parseClassId(node2, isStatement);
  1427. this.parseClassSuper(node2);
  1428. var classBody = this.startNode();
  1429. var hadConstructor = false;
  1430. classBody.body = [];
  1431. this.expect(types2.braceL);
  1432. while (this.type !== types2.braceR) {
  1433. var element2 = this.parseClassElement(node2.superClass !== null);
  1434. if (element2) {
  1435. classBody.body.push(element2);
  1436. if (element2.type === "MethodDefinition" && element2.kind === "constructor") {
  1437. if (hadConstructor) {
  1438. this.raise(element2.start, "Duplicate constructor in the same class");
  1439. }
  1440. hadConstructor = true;
  1441. }
  1442. }
  1443. }
  1444. this.strict = oldStrict;
  1445. this.next();
  1446. node2.body = this.finishNode(classBody, "ClassBody");
  1447. return this.finishNode(node2, isStatement ? "ClassDeclaration" : "ClassExpression");
  1448. };
  1449. pp$12.parseClassElement = function(constructorAllowsSuper) {
  1450. var this$1 = this;
  1451. if (this.eat(types2.semi)) {
  1452. return null;
  1453. }
  1454. var method = this.startNode();
  1455. var tryContextual = function(k, noLineBreak) {
  1456. if (noLineBreak === void 0) noLineBreak = false;
  1457. var start2 = this$1.start, startLoc = this$1.startLoc;
  1458. if (!this$1.eatContextual(k)) {
  1459. return false;
  1460. }
  1461. if (this$1.type !== types2.parenL && (!noLineBreak || !this$1.canInsertSemicolon())) {
  1462. return true;
  1463. }
  1464. if (method.key) {
  1465. this$1.unexpected();
  1466. }
  1467. method.computed = false;
  1468. method.key = this$1.startNodeAt(start2, startLoc);
  1469. method.key.name = k;
  1470. this$1.finishNode(method.key, "Identifier");
  1471. return false;
  1472. };
  1473. method.kind = "method";
  1474. method.static = tryContextual("static");
  1475. var isGenerator = this.eat(types2.star);
  1476. var isAsync = false;
  1477. if (!isGenerator) {
  1478. if (this.options.ecmaVersion >= 8 && tryContextual("async", true)) {
  1479. isAsync = true;
  1480. isGenerator = this.options.ecmaVersion >= 9 && this.eat(types2.star);
  1481. } else if (tryContextual("get")) {
  1482. method.kind = "get";
  1483. } else if (tryContextual("set")) {
  1484. method.kind = "set";
  1485. }
  1486. }
  1487. if (!method.key) {
  1488. this.parsePropertyName(method);
  1489. }
  1490. var key = method.key;
  1491. var allowsDirectSuper = false;
  1492. if (!method.computed && !method.static && (key.type === "Identifier" && key.name === "constructor" || key.type === "Literal" && key.value === "constructor")) {
  1493. if (method.kind !== "method") {
  1494. this.raise(key.start, "Constructor can't have get/set modifier");
  1495. }
  1496. if (isGenerator) {
  1497. this.raise(key.start, "Constructor can't be a generator");
  1498. }
  1499. if (isAsync) {
  1500. this.raise(key.start, "Constructor can't be an async method");
  1501. }
  1502. method.kind = "constructor";
  1503. allowsDirectSuper = constructorAllowsSuper;
  1504. } else if (method.static && key.type === "Identifier" && key.name === "prototype") {
  1505. this.raise(key.start, "Classes may not have a static property named prototype");
  1506. }
  1507. this.parseClassMethod(method, isGenerator, isAsync, allowsDirectSuper);
  1508. if (method.kind === "get" && method.value.params.length !== 0) {
  1509. this.raiseRecoverable(method.value.start, "getter should have no params");
  1510. }
  1511. if (method.kind === "set" && method.value.params.length !== 1) {
  1512. this.raiseRecoverable(method.value.start, "setter should have exactly one param");
  1513. }
  1514. if (method.kind === "set" && method.value.params[0].type === "RestElement") {
  1515. this.raiseRecoverable(method.value.params[0].start, "Setter cannot use rest params");
  1516. }
  1517. return method;
  1518. };
  1519. pp$12.parseClassMethod = function(method, isGenerator, isAsync, allowsDirectSuper) {
  1520. method.value = this.parseMethod(isGenerator, isAsync, allowsDirectSuper);
  1521. return this.finishNode(method, "MethodDefinition");
  1522. };
  1523. pp$12.parseClassId = function(node2, isStatement) {
  1524. if (this.type === types2.name) {
  1525. node2.id = this.parseIdent();
  1526. if (isStatement) {
  1527. this.checkLVal(node2.id, BIND_LEXICAL2, false);
  1528. }
  1529. } else {
  1530. if (isStatement === true) {
  1531. this.unexpected();
  1532. }
  1533. node2.id = null;
  1534. }
  1535. };
  1536. pp$12.parseClassSuper = function(node2) {
  1537. node2.superClass = this.eat(types2._extends) ? this.parseExprSubscripts() : null;
  1538. };
  1539. pp$12.parseExport = function(node2, exports4) {
  1540. this.next();
  1541. if (this.eat(types2.star)) {
  1542. if (this.options.ecmaVersion >= 11) {
  1543. if (this.eatContextual("as")) {
  1544. node2.exported = this.parseIdent(true);
  1545. this.checkExport(exports4, node2.exported.name, this.lastTokStart);
  1546. } else {
  1547. node2.exported = null;
  1548. }
  1549. }
  1550. this.expectContextual("from");
  1551. if (this.type !== types2.string) {
  1552. this.unexpected();
  1553. }
  1554. node2.source = this.parseExprAtom();
  1555. this.semicolon();
  1556. return this.finishNode(node2, "ExportAllDeclaration");
  1557. }
  1558. if (this.eat(types2._default)) {
  1559. this.checkExport(exports4, "default", this.lastTokStart);
  1560. var isAsync;
  1561. if (this.type === types2._function || (isAsync = this.isAsyncFunction())) {
  1562. var fNode = this.startNode();
  1563. this.next();
  1564. if (isAsync) {
  1565. this.next();
  1566. }
  1567. node2.declaration = this.parseFunction(fNode, FUNC_STATEMENT2 | FUNC_NULLABLE_ID2, false, isAsync);
  1568. } else if (this.type === types2._class) {
  1569. var cNode = this.startNode();
  1570. node2.declaration = this.parseClass(cNode, "nullableID");
  1571. } else {
  1572. node2.declaration = this.parseMaybeAssign();
  1573. this.semicolon();
  1574. }
  1575. return this.finishNode(node2, "ExportDefaultDeclaration");
  1576. }
  1577. if (this.shouldParseExportStatement()) {
  1578. node2.declaration = this.parseStatement(null);
  1579. if (node2.declaration.type === "VariableDeclaration") {
  1580. this.checkVariableExport(exports4, node2.declaration.declarations);
  1581. } else {
  1582. this.checkExport(exports4, node2.declaration.id.name, node2.declaration.id.start);
  1583. }
  1584. node2.specifiers = [];
  1585. node2.source = null;
  1586. } else {
  1587. node2.declaration = null;
  1588. node2.specifiers = this.parseExportSpecifiers(exports4);
  1589. if (this.eatContextual("from")) {
  1590. if (this.type !== types2.string) {
  1591. this.unexpected();
  1592. }
  1593. node2.source = this.parseExprAtom();
  1594. } else {
  1595. for (var i = 0, list3 = node2.specifiers; i < list3.length; i += 1) {
  1596. var spec = list3[i];
  1597. this.checkUnreserved(spec.local);
  1598. this.checkLocalExport(spec.local);
  1599. }
  1600. node2.source = null;
  1601. }
  1602. this.semicolon();
  1603. }
  1604. return this.finishNode(node2, "ExportNamedDeclaration");
  1605. };
  1606. pp$12.checkExport = function(exports4, name2, pos) {
  1607. if (!exports4) {
  1608. return;
  1609. }
  1610. if (has(exports4, name2)) {
  1611. this.raiseRecoverable(pos, "Duplicate export '" + name2 + "'");
  1612. }
  1613. exports4[name2] = true;
  1614. };
  1615. pp$12.checkPatternExport = function(exports4, pat) {
  1616. var type = pat.type;
  1617. if (type === "Identifier") {
  1618. this.checkExport(exports4, pat.name, pat.start);
  1619. } else if (type === "ObjectPattern") {
  1620. for (var i = 0, list3 = pat.properties; i < list3.length; i += 1) {
  1621. var prop = list3[i];
  1622. this.checkPatternExport(exports4, prop);
  1623. }
  1624. } else if (type === "ArrayPattern") {
  1625. for (var i$1 = 0, list$1 = pat.elements; i$1 < list$1.length; i$1 += 1) {
  1626. var elt = list$1[i$1];
  1627. if (elt) {
  1628. this.checkPatternExport(exports4, elt);
  1629. }
  1630. }
  1631. } else if (type === "Property") {
  1632. this.checkPatternExport(exports4, pat.value);
  1633. } else if (type === "AssignmentPattern") {
  1634. this.checkPatternExport(exports4, pat.left);
  1635. } else if (type === "RestElement") {
  1636. this.checkPatternExport(exports4, pat.argument);
  1637. } else if (type === "ParenthesizedExpression") {
  1638. this.checkPatternExport(exports4, pat.expression);
  1639. }
  1640. };
  1641. pp$12.checkVariableExport = function(exports4, decls) {
  1642. if (!exports4) {
  1643. return;
  1644. }
  1645. for (var i = 0, list3 = decls; i < list3.length; i += 1) {
  1646. var decl = list3[i];
  1647. this.checkPatternExport(exports4, decl.id);
  1648. }
  1649. };
  1650. pp$12.shouldParseExportStatement = function() {
  1651. return this.type.keyword === "var" || this.type.keyword === "const" || this.type.keyword === "class" || this.type.keyword === "function" || this.isLet() || this.isAsyncFunction();
  1652. };
  1653. pp$12.parseExportSpecifiers = function(exports4) {
  1654. var nodes = [], first = true;
  1655. this.expect(types2.braceL);
  1656. while (!this.eat(types2.braceR)) {
  1657. if (!first) {
  1658. this.expect(types2.comma);
  1659. if (this.afterTrailingComma(types2.braceR)) {
  1660. break;
  1661. }
  1662. } else {
  1663. first = false;
  1664. }
  1665. var node2 = this.startNode();
  1666. node2.local = this.parseIdent(true);
  1667. node2.exported = this.eatContextual("as") ? this.parseIdent(true) : node2.local;
  1668. this.checkExport(exports4, node2.exported.name, node2.exported.start);
  1669. nodes.push(this.finishNode(node2, "ExportSpecifier"));
  1670. }
  1671. return nodes;
  1672. };
  1673. pp$12.parseImport = function(node2) {
  1674. this.next();
  1675. if (this.type === types2.string) {
  1676. node2.specifiers = empty6;
  1677. node2.source = this.parseExprAtom();
  1678. } else {
  1679. node2.specifiers = this.parseImportSpecifiers();
  1680. this.expectContextual("from");
  1681. node2.source = this.type === types2.string ? this.parseExprAtom() : this.unexpected();
  1682. }
  1683. this.semicolon();
  1684. return this.finishNode(node2, "ImportDeclaration");
  1685. };
  1686. pp$12.parseImportSpecifiers = function() {
  1687. var nodes = [], first = true;
  1688. if (this.type === types2.name) {
  1689. var node2 = this.startNode();
  1690. node2.local = this.parseIdent();
  1691. this.checkLVal(node2.local, BIND_LEXICAL2);
  1692. nodes.push(this.finishNode(node2, "ImportDefaultSpecifier"));
  1693. if (!this.eat(types2.comma)) {
  1694. return nodes;
  1695. }
  1696. }
  1697. if (this.type === types2.star) {
  1698. var node$1 = this.startNode();
  1699. this.next();
  1700. this.expectContextual("as");
  1701. node$1.local = this.parseIdent();
  1702. this.checkLVal(node$1.local, BIND_LEXICAL2);
  1703. nodes.push(this.finishNode(node$1, "ImportNamespaceSpecifier"));
  1704. return nodes;
  1705. }
  1706. this.expect(types2.braceL);
  1707. while (!this.eat(types2.braceR)) {
  1708. if (!first) {
  1709. this.expect(types2.comma);
  1710. if (this.afterTrailingComma(types2.braceR)) {
  1711. break;
  1712. }
  1713. } else {
  1714. first = false;
  1715. }
  1716. var node$2 = this.startNode();
  1717. node$2.imported = this.parseIdent(true);
  1718. if (this.eatContextual("as")) {
  1719. node$2.local = this.parseIdent();
  1720. } else {
  1721. this.checkUnreserved(node$2.imported);
  1722. node$2.local = node$2.imported;
  1723. }
  1724. this.checkLVal(node$2.local, BIND_LEXICAL2);
  1725. nodes.push(this.finishNode(node$2, "ImportSpecifier"));
  1726. }
  1727. return nodes;
  1728. };
  1729. pp$12.adaptDirectivePrologue = function(statements) {
  1730. for (var i = 0; i < statements.length && this.isDirectiveCandidate(statements[i]); ++i) {
  1731. statements[i].directive = statements[i].expression.raw.slice(1, -1);
  1732. }
  1733. };
  1734. pp$12.isDirectiveCandidate = function(statement) {
  1735. return statement.type === "ExpressionStatement" && statement.expression.type === "Literal" && typeof statement.expression.value === "string" && // Reject parenthesized strings.
  1736. (this.input[statement.start] === '"' || this.input[statement.start] === "'");
  1737. };
  1738. var pp$22 = Parser3.prototype;
  1739. pp$22.toAssignable = function(node2, isBinding, refDestructuringErrors) {
  1740. if (this.options.ecmaVersion >= 6 && node2) {
  1741. switch (node2.type) {
  1742. case "Identifier":
  1743. if (this.inAsync && node2.name === "await") {
  1744. this.raise(node2.start, "Cannot use 'await' as identifier inside an async function");
  1745. }
  1746. break;
  1747. case "ObjectPattern":
  1748. case "ArrayPattern":
  1749. case "RestElement":
  1750. break;
  1751. case "ObjectExpression":
  1752. node2.type = "ObjectPattern";
  1753. if (refDestructuringErrors) {
  1754. this.checkPatternErrors(refDestructuringErrors, true);
  1755. }
  1756. for (var i = 0, list3 = node2.properties; i < list3.length; i += 1) {
  1757. var prop = list3[i];
  1758. this.toAssignable(prop, isBinding);
  1759. if (prop.type === "RestElement" && (prop.argument.type === "ArrayPattern" || prop.argument.type === "ObjectPattern")) {
  1760. this.raise(prop.argument.start, "Unexpected token");
  1761. }
  1762. }
  1763. break;
  1764. case "Property":
  1765. if (node2.kind !== "init") {
  1766. this.raise(node2.key.start, "Object pattern can't contain getter or setter");
  1767. }
  1768. this.toAssignable(node2.value, isBinding);
  1769. break;
  1770. case "ArrayExpression":
  1771. node2.type = "ArrayPattern";
  1772. if (refDestructuringErrors) {
  1773. this.checkPatternErrors(refDestructuringErrors, true);
  1774. }
  1775. this.toAssignableList(node2.elements, isBinding);
  1776. break;
  1777. case "SpreadElement":
  1778. node2.type = "RestElement";
  1779. this.toAssignable(node2.argument, isBinding);
  1780. if (node2.argument.type === "AssignmentPattern") {
  1781. this.raise(node2.argument.start, "Rest elements cannot have a default value");
  1782. }
  1783. break;
  1784. case "AssignmentExpression":
  1785. if (node2.operator !== "=") {
  1786. this.raise(node2.left.end, "Only '=' operator can be used for specifying default value.");
  1787. }
  1788. node2.type = "AssignmentPattern";
  1789. delete node2.operator;
  1790. this.toAssignable(node2.left, isBinding);
  1791. case "AssignmentPattern":
  1792. break;
  1793. case "ParenthesizedExpression":
  1794. this.toAssignable(node2.expression, isBinding, refDestructuringErrors);
  1795. break;
  1796. case "ChainExpression":
  1797. this.raiseRecoverable(node2.start, "Optional chaining cannot appear in left-hand side");
  1798. break;
  1799. case "MemberExpression":
  1800. if (!isBinding) {
  1801. break;
  1802. }
  1803. default:
  1804. this.raise(node2.start, "Assigning to rvalue");
  1805. }
  1806. } else if (refDestructuringErrors) {
  1807. this.checkPatternErrors(refDestructuringErrors, true);
  1808. }
  1809. return node2;
  1810. };
  1811. pp$22.toAssignableList = function(exprList, isBinding) {
  1812. var end = exprList.length;
  1813. for (var i = 0; i < end; i++) {
  1814. var elt = exprList[i];
  1815. if (elt) {
  1816. this.toAssignable(elt, isBinding);
  1817. }
  1818. }
  1819. if (end) {
  1820. var last = exprList[end - 1];
  1821. if (this.options.ecmaVersion === 6 && isBinding && last && last.type === "RestElement" && last.argument.type !== "Identifier") {
  1822. this.unexpected(last.argument.start);
  1823. }
  1824. }
  1825. return exprList;
  1826. };
  1827. pp$22.parseSpread = function(refDestructuringErrors) {
  1828. var node2 = this.startNode();
  1829. this.next();
  1830. node2.argument = this.parseMaybeAssign(false, refDestructuringErrors);
  1831. return this.finishNode(node2, "SpreadElement");
  1832. };
  1833. pp$22.parseRestBinding = function() {
  1834. var node2 = this.startNode();
  1835. this.next();
  1836. if (this.options.ecmaVersion === 6 && this.type !== types2.name) {
  1837. this.unexpected();
  1838. }
  1839. node2.argument = this.parseBindingAtom();
  1840. return this.finishNode(node2, "RestElement");
  1841. };
  1842. pp$22.parseBindingAtom = function() {
  1843. if (this.options.ecmaVersion >= 6) {
  1844. switch (this.type) {
  1845. case types2.bracketL:
  1846. var node2 = this.startNode();
  1847. this.next();
  1848. node2.elements = this.parseBindingList(types2.bracketR, true, true);
  1849. return this.finishNode(node2, "ArrayPattern");
  1850. case types2.braceL:
  1851. return this.parseObj(true);
  1852. }
  1853. }
  1854. return this.parseIdent();
  1855. };
  1856. pp$22.parseBindingList = function(close, allowEmpty, allowTrailingComma) {
  1857. var elts = [], first = true;
  1858. while (!this.eat(close)) {
  1859. if (first) {
  1860. first = false;
  1861. } else {
  1862. this.expect(types2.comma);
  1863. }
  1864. if (allowEmpty && this.type === types2.comma) {
  1865. elts.push(null);
  1866. } else if (allowTrailingComma && this.afterTrailingComma(close)) {
  1867. break;
  1868. } else if (this.type === types2.ellipsis) {
  1869. var rest = this.parseRestBinding();
  1870. this.parseBindingListItem(rest);
  1871. elts.push(rest);
  1872. if (this.type === types2.comma) {
  1873. this.raise(this.start, "Comma is not permitted after the rest element");
  1874. }
  1875. this.expect(close);
  1876. break;
  1877. } else {
  1878. var elem = this.parseMaybeDefault(this.start, this.startLoc);
  1879. this.parseBindingListItem(elem);
  1880. elts.push(elem);
  1881. }
  1882. }
  1883. return elts;
  1884. };
  1885. pp$22.parseBindingListItem = function(param) {
  1886. return param;
  1887. };
  1888. pp$22.parseMaybeDefault = function(startPos, startLoc, left) {
  1889. left = left || this.parseBindingAtom();
  1890. if (this.options.ecmaVersion < 6 || !this.eat(types2.eq)) {
  1891. return left;
  1892. }
  1893. var node2 = this.startNodeAt(startPos, startLoc);
  1894. node2.left = left;
  1895. node2.right = this.parseMaybeAssign();
  1896. return this.finishNode(node2, "AssignmentPattern");
  1897. };
  1898. pp$22.checkLVal = function(expr, bindingType, checkClashes) {
  1899. if (bindingType === void 0) bindingType = BIND_NONE2;
  1900. switch (expr.type) {
  1901. case "Identifier":
  1902. if (bindingType === BIND_LEXICAL2 && expr.name === "let") {
  1903. this.raiseRecoverable(expr.start, "let is disallowed as a lexically bound name");
  1904. }
  1905. if (this.strict && this.reservedWordsStrictBind.test(expr.name)) {
  1906. this.raiseRecoverable(expr.start, (bindingType ? "Binding " : "Assigning to ") + expr.name + " in strict mode");
  1907. }
  1908. if (checkClashes) {
  1909. if (has(checkClashes, expr.name)) {
  1910. this.raiseRecoverable(expr.start, "Argument name clash");
  1911. }
  1912. checkClashes[expr.name] = true;
  1913. }
  1914. if (bindingType !== BIND_NONE2 && bindingType !== BIND_OUTSIDE2) {
  1915. this.declareName(expr.name, bindingType, expr.start);
  1916. }
  1917. break;
  1918. case "ChainExpression":
  1919. this.raiseRecoverable(expr.start, "Optional chaining cannot appear in left-hand side");
  1920. break;
  1921. case "MemberExpression":
  1922. if (bindingType) {
  1923. this.raiseRecoverable(expr.start, "Binding member expression");
  1924. }
  1925. break;
  1926. case "ObjectPattern":
  1927. for (var i = 0, list3 = expr.properties; i < list3.length; i += 1) {
  1928. var prop = list3[i];
  1929. this.checkLVal(prop, bindingType, checkClashes);
  1930. }
  1931. break;
  1932. case "Property":
  1933. this.checkLVal(expr.value, bindingType, checkClashes);
  1934. break;
  1935. case "ArrayPattern":
  1936. for (var i$1 = 0, list$1 = expr.elements; i$1 < list$1.length; i$1 += 1) {
  1937. var elem = list$1[i$1];
  1938. if (elem) {
  1939. this.checkLVal(elem, bindingType, checkClashes);
  1940. }
  1941. }
  1942. break;
  1943. case "AssignmentPattern":
  1944. this.checkLVal(expr.left, bindingType, checkClashes);
  1945. break;
  1946. case "RestElement":
  1947. this.checkLVal(expr.argument, bindingType, checkClashes);
  1948. break;
  1949. case "ParenthesizedExpression":
  1950. this.checkLVal(expr.expression, bindingType, checkClashes);
  1951. break;
  1952. default:
  1953. this.raise(expr.start, (bindingType ? "Binding" : "Assigning to") + " rvalue");
  1954. }
  1955. };
  1956. var pp$32 = Parser3.prototype;
  1957. pp$32.checkPropClash = function(prop, propHash, refDestructuringErrors) {
  1958. if (this.options.ecmaVersion >= 9 && prop.type === "SpreadElement") {
  1959. return;
  1960. }
  1961. if (this.options.ecmaVersion >= 6 && (prop.computed || prop.method || prop.shorthand)) {
  1962. return;
  1963. }
  1964. var key = prop.key;
  1965. var name2;
  1966. switch (key.type) {
  1967. case "Identifier":
  1968. name2 = key.name;
  1969. break;
  1970. case "Literal":
  1971. name2 = String(key.value);
  1972. break;
  1973. default:
  1974. return;
  1975. }
  1976. var kind = prop.kind;
  1977. if (this.options.ecmaVersion >= 6) {
  1978. if (name2 === "__proto__" && kind === "init") {
  1979. if (propHash.proto) {
  1980. if (refDestructuringErrors) {
  1981. if (refDestructuringErrors.doubleProto < 0) {
  1982. refDestructuringErrors.doubleProto = key.start;
  1983. }
  1984. } else {
  1985. this.raiseRecoverable(key.start, "Redefinition of __proto__ property");
  1986. }
  1987. }
  1988. propHash.proto = true;
  1989. }
  1990. return;
  1991. }
  1992. name2 = "$" + name2;
  1993. var other = propHash[name2];
  1994. if (other) {
  1995. var redefinition;
  1996. if (kind === "init") {
  1997. redefinition = this.strict && other.init || other.get || other.set;
  1998. } else {
  1999. redefinition = other.init || other[kind];
  2000. }
  2001. if (redefinition) {
  2002. this.raiseRecoverable(key.start, "Redefinition of property");
  2003. }
  2004. } else {
  2005. other = propHash[name2] = {
  2006. init: false,
  2007. get: false,
  2008. set: false
  2009. };
  2010. }
  2011. other[kind] = true;
  2012. };
  2013. pp$32.parseExpression = function(noIn, refDestructuringErrors) {
  2014. var startPos = this.start, startLoc = this.startLoc;
  2015. var expr = this.parseMaybeAssign(noIn, refDestructuringErrors);
  2016. if (this.type === types2.comma) {
  2017. var node2 = this.startNodeAt(startPos, startLoc);
  2018. node2.expressions = [expr];
  2019. while (this.eat(types2.comma)) {
  2020. node2.expressions.push(this.parseMaybeAssign(noIn, refDestructuringErrors));
  2021. }
  2022. return this.finishNode(node2, "SequenceExpression");
  2023. }
  2024. return expr;
  2025. };
  2026. pp$32.parseMaybeAssign = function(noIn, refDestructuringErrors, afterLeftParse) {
  2027. if (this.isContextual("yield")) {
  2028. if (this.inGenerator) {
  2029. return this.parseYield(noIn);
  2030. } else {
  2031. this.exprAllowed = false;
  2032. }
  2033. }
  2034. var ownDestructuringErrors = false, oldParenAssign = -1, oldTrailingComma = -1;
  2035. if (refDestructuringErrors) {
  2036. oldParenAssign = refDestructuringErrors.parenthesizedAssign;
  2037. oldTrailingComma = refDestructuringErrors.trailingComma;
  2038. refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = -1;
  2039. } else {
  2040. refDestructuringErrors = new DestructuringErrors3();
  2041. ownDestructuringErrors = true;
  2042. }
  2043. var startPos = this.start, startLoc = this.startLoc;
  2044. if (this.type === types2.parenL || this.type === types2.name) {
  2045. this.potentialArrowAt = this.start;
  2046. }
  2047. var left = this.parseMaybeConditional(noIn, refDestructuringErrors);
  2048. if (afterLeftParse) {
  2049. left = afterLeftParse.call(this, left, startPos, startLoc);
  2050. }
  2051. if (this.type.isAssign) {
  2052. var node2 = this.startNodeAt(startPos, startLoc);
  2053. node2.operator = this.value;
  2054. node2.left = this.type === types2.eq ? this.toAssignable(left, false, refDestructuringErrors) : left;
  2055. if (!ownDestructuringErrors) {
  2056. refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = refDestructuringErrors.doubleProto = -1;
  2057. }
  2058. if (refDestructuringErrors.shorthandAssign >= node2.left.start) {
  2059. refDestructuringErrors.shorthandAssign = -1;
  2060. }
  2061. this.checkLVal(left);
  2062. this.next();
  2063. node2.right = this.parseMaybeAssign(noIn);
  2064. return this.finishNode(node2, "AssignmentExpression");
  2065. } else {
  2066. if (ownDestructuringErrors) {
  2067. this.checkExpressionErrors(refDestructuringErrors, true);
  2068. }
  2069. }
  2070. if (oldParenAssign > -1) {
  2071. refDestructuringErrors.parenthesizedAssign = oldParenAssign;
  2072. }
  2073. if (oldTrailingComma > -1) {
  2074. refDestructuringErrors.trailingComma = oldTrailingComma;
  2075. }
  2076. return left;
  2077. };
  2078. pp$32.parseMaybeConditional = function(noIn, refDestructuringErrors) {
  2079. var startPos = this.start, startLoc = this.startLoc;
  2080. var expr = this.parseExprOps(noIn, refDestructuringErrors);
  2081. if (this.checkExpressionErrors(refDestructuringErrors)) {
  2082. return expr;
  2083. }
  2084. if (this.eat(types2.question)) {
  2085. var node2 = this.startNodeAt(startPos, startLoc);
  2086. node2.test = expr;
  2087. node2.consequent = this.parseMaybeAssign();
  2088. this.expect(types2.colon);
  2089. node2.alternate = this.parseMaybeAssign(noIn);
  2090. return this.finishNode(node2, "ConditionalExpression");
  2091. }
  2092. return expr;
  2093. };
  2094. pp$32.parseExprOps = function(noIn, refDestructuringErrors) {
  2095. var startPos = this.start, startLoc = this.startLoc;
  2096. var expr = this.parseMaybeUnary(refDestructuringErrors, false);
  2097. if (this.checkExpressionErrors(refDestructuringErrors)) {
  2098. return expr;
  2099. }
  2100. return expr.start === startPos && expr.type === "ArrowFunctionExpression" ? expr : this.parseExprOp(expr, startPos, startLoc, -1, noIn);
  2101. };
  2102. pp$32.parseExprOp = function(left, leftStartPos, leftStartLoc, minPrec, noIn) {
  2103. var prec = this.type.binop;
  2104. if (prec != null && (!noIn || this.type !== types2._in)) {
  2105. if (prec > minPrec) {
  2106. var logical = this.type === types2.logicalOR || this.type === types2.logicalAND;
  2107. var coalesce = this.type === types2.coalesce;
  2108. if (coalesce) {
  2109. prec = types2.logicalAND.binop;
  2110. }
  2111. var op = this.value;
  2112. this.next();
  2113. var startPos = this.start, startLoc = this.startLoc;
  2114. var right = this.parseExprOp(this.parseMaybeUnary(null, false), startPos, startLoc, prec, noIn);
  2115. var node2 = this.buildBinary(leftStartPos, leftStartLoc, left, right, op, logical || coalesce);
  2116. if (logical && this.type === types2.coalesce || coalesce && (this.type === types2.logicalOR || this.type === types2.logicalAND)) {
  2117. this.raiseRecoverable(this.start, "Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses");
  2118. }
  2119. return this.parseExprOp(node2, leftStartPos, leftStartLoc, minPrec, noIn);
  2120. }
  2121. }
  2122. return left;
  2123. };
  2124. pp$32.buildBinary = function(startPos, startLoc, left, right, op, logical) {
  2125. var node2 = this.startNodeAt(startPos, startLoc);
  2126. node2.left = left;
  2127. node2.operator = op;
  2128. node2.right = right;
  2129. return this.finishNode(node2, logical ? "LogicalExpression" : "BinaryExpression");
  2130. };
  2131. pp$32.parseMaybeUnary = function(refDestructuringErrors, sawUnary) {
  2132. var startPos = this.start, startLoc = this.startLoc, expr;
  2133. if (this.isContextual("await") && (this.inAsync || !this.inFunction && this.options.allowAwaitOutsideFunction)) {
  2134. expr = this.parseAwait();
  2135. sawUnary = true;
  2136. } else if (this.type.prefix) {
  2137. var node2 = this.startNode(), update = this.type === types2.incDec;
  2138. node2.operator = this.value;
  2139. node2.prefix = true;
  2140. this.next();
  2141. node2.argument = this.parseMaybeUnary(null, true);
  2142. this.checkExpressionErrors(refDestructuringErrors, true);
  2143. if (update) {
  2144. this.checkLVal(node2.argument);
  2145. } else if (this.strict && node2.operator === "delete" && node2.argument.type === "Identifier") {
  2146. this.raiseRecoverable(node2.start, "Deleting local variable in strict mode");
  2147. } else {
  2148. sawUnary = true;
  2149. }
  2150. expr = this.finishNode(node2, update ? "UpdateExpression" : "UnaryExpression");
  2151. } else {
  2152. expr = this.parseExprSubscripts(refDestructuringErrors);
  2153. if (this.checkExpressionErrors(refDestructuringErrors)) {
  2154. return expr;
  2155. }
  2156. while (this.type.postfix && !this.canInsertSemicolon()) {
  2157. var node$1 = this.startNodeAt(startPos, startLoc);
  2158. node$1.operator = this.value;
  2159. node$1.prefix = false;
  2160. node$1.argument = expr;
  2161. this.checkLVal(expr);
  2162. this.next();
  2163. expr = this.finishNode(node$1, "UpdateExpression");
  2164. }
  2165. }
  2166. if (!sawUnary && this.eat(types2.starstar)) {
  2167. return this.buildBinary(startPos, startLoc, expr, this.parseMaybeUnary(null, false), "**", false);
  2168. } else {
  2169. return expr;
  2170. }
  2171. };
  2172. pp$32.parseExprSubscripts = function(refDestructuringErrors) {
  2173. var startPos = this.start, startLoc = this.startLoc;
  2174. var expr = this.parseExprAtom(refDestructuringErrors);
  2175. if (expr.type === "ArrowFunctionExpression" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== ")") {
  2176. return expr;
  2177. }
  2178. var result = this.parseSubscripts(expr, startPos, startLoc);
  2179. if (refDestructuringErrors && result.type === "MemberExpression") {
  2180. if (refDestructuringErrors.parenthesizedAssign >= result.start) {
  2181. refDestructuringErrors.parenthesizedAssign = -1;
  2182. }
  2183. if (refDestructuringErrors.parenthesizedBind >= result.start) {
  2184. refDestructuringErrors.parenthesizedBind = -1;
  2185. }
  2186. }
  2187. return result;
  2188. };
  2189. pp$32.parseSubscripts = function(base, startPos, startLoc, noCalls) {
  2190. var maybeAsyncArrow = this.options.ecmaVersion >= 8 && base.type === "Identifier" && base.name === "async" && this.lastTokEnd === base.end && !this.canInsertSemicolon() && base.end - base.start === 5 && this.potentialArrowAt === base.start;
  2191. var optionalChained = false;
  2192. while (true) {
  2193. var element2 = this.parseSubscript(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained);
  2194. if (element2.optional) {
  2195. optionalChained = true;
  2196. }
  2197. if (element2 === base || element2.type === "ArrowFunctionExpression") {
  2198. if (optionalChained) {
  2199. var chainNode = this.startNodeAt(startPos, startLoc);
  2200. chainNode.expression = element2;
  2201. element2 = this.finishNode(chainNode, "ChainExpression");
  2202. }
  2203. return element2;
  2204. }
  2205. base = element2;
  2206. }
  2207. };
  2208. pp$32.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained) {
  2209. var optionalSupported = this.options.ecmaVersion >= 11;
  2210. var optional = optionalSupported && this.eat(types2.questionDot);
  2211. if (noCalls && optional) {
  2212. this.raise(this.lastTokStart, "Optional chaining cannot appear in the callee of new expressions");
  2213. }
  2214. var computed = this.eat(types2.bracketL);
  2215. if (computed || optional && this.type !== types2.parenL && this.type !== types2.backQuote || this.eat(types2.dot)) {
  2216. var node2 = this.startNodeAt(startPos, startLoc);
  2217. node2.object = base;
  2218. node2.property = computed ? this.parseExpression() : this.parseIdent(this.options.allowReserved !== "never");
  2219. node2.computed = !!computed;
  2220. if (computed) {
  2221. this.expect(types2.bracketR);
  2222. }
  2223. if (optionalSupported) {
  2224. node2.optional = optional;
  2225. }
  2226. base = this.finishNode(node2, "MemberExpression");
  2227. } else if (!noCalls && this.eat(types2.parenL)) {
  2228. var refDestructuringErrors = new DestructuringErrors3(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;
  2229. this.yieldPos = 0;
  2230. this.awaitPos = 0;
  2231. this.awaitIdentPos = 0;
  2232. var exprList = this.parseExprList(types2.parenR, this.options.ecmaVersion >= 8, false, refDestructuringErrors);
  2233. if (maybeAsyncArrow && !optional && !this.canInsertSemicolon() && this.eat(types2.arrow)) {
  2234. this.checkPatternErrors(refDestructuringErrors, false);
  2235. this.checkYieldAwaitInDefaultParams();
  2236. if (this.awaitIdentPos > 0) {
  2237. this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function");
  2238. }
  2239. this.yieldPos = oldYieldPos;
  2240. this.awaitPos = oldAwaitPos;
  2241. this.awaitIdentPos = oldAwaitIdentPos;
  2242. return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, true);
  2243. }
  2244. this.checkExpressionErrors(refDestructuringErrors, true);
  2245. this.yieldPos = oldYieldPos || this.yieldPos;
  2246. this.awaitPos = oldAwaitPos || this.awaitPos;
  2247. this.awaitIdentPos = oldAwaitIdentPos || this.awaitIdentPos;
  2248. var node$1 = this.startNodeAt(startPos, startLoc);
  2249. node$1.callee = base;
  2250. node$1.arguments = exprList;
  2251. if (optionalSupported) {
  2252. node$1.optional = optional;
  2253. }
  2254. base = this.finishNode(node$1, "CallExpression");
  2255. } else if (this.type === types2.backQuote) {
  2256. if (optional || optionalChained) {
  2257. this.raise(this.start, "Optional chaining cannot appear in the tag of tagged template expressions");
  2258. }
  2259. var node$2 = this.startNodeAt(startPos, startLoc);
  2260. node$2.tag = base;
  2261. node$2.quasi = this.parseTemplate({ isTagged: true });
  2262. base = this.finishNode(node$2, "TaggedTemplateExpression");
  2263. }
  2264. return base;
  2265. };
  2266. pp$32.parseExprAtom = function(refDestructuringErrors) {
  2267. if (this.type === types2.slash) {
  2268. this.readRegexp();
  2269. }
  2270. var node2, canBeArrow = this.potentialArrowAt === this.start;
  2271. switch (this.type) {
  2272. case types2._super:
  2273. if (!this.allowSuper) {
  2274. this.raise(this.start, "'super' keyword outside a method");
  2275. }
  2276. node2 = this.startNode();
  2277. this.next();
  2278. if (this.type === types2.parenL && !this.allowDirectSuper) {
  2279. this.raise(node2.start, "super() call outside constructor of a subclass");
  2280. }
  2281. if (this.type !== types2.dot && this.type !== types2.bracketL && this.type !== types2.parenL) {
  2282. this.unexpected();
  2283. }
  2284. return this.finishNode(node2, "Super");
  2285. case types2._this:
  2286. node2 = this.startNode();
  2287. this.next();
  2288. return this.finishNode(node2, "ThisExpression");
  2289. case types2.name:
  2290. var startPos = this.start, startLoc = this.startLoc, containsEsc = this.containsEsc;
  2291. var id = this.parseIdent(false);
  2292. if (this.options.ecmaVersion >= 8 && !containsEsc && id.name === "async" && !this.canInsertSemicolon() && this.eat(types2._function)) {
  2293. return this.parseFunction(this.startNodeAt(startPos, startLoc), 0, false, true);
  2294. }
  2295. if (canBeArrow && !this.canInsertSemicolon()) {
  2296. if (this.eat(types2.arrow)) {
  2297. return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], false);
  2298. }
  2299. if (this.options.ecmaVersion >= 8 && id.name === "async" && this.type === types2.name && !containsEsc) {
  2300. id = this.parseIdent(false);
  2301. if (this.canInsertSemicolon() || !this.eat(types2.arrow)) {
  2302. this.unexpected();
  2303. }
  2304. return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], true);
  2305. }
  2306. }
  2307. return id;
  2308. case types2.regexp:
  2309. var value = this.value;
  2310. node2 = this.parseLiteral(value.value);
  2311. node2.regex = { pattern: value.pattern, flags: value.flags };
  2312. return node2;
  2313. case types2.num:
  2314. case types2.string:
  2315. return this.parseLiteral(this.value);
  2316. case types2._null:
  2317. case types2._true:
  2318. case types2._false:
  2319. node2 = this.startNode();
  2320. node2.value = this.type === types2._null ? null : this.type === types2._true;
  2321. node2.raw = this.type.keyword;
  2322. this.next();
  2323. return this.finishNode(node2, "Literal");
  2324. case types2.parenL:
  2325. var start2 = this.start, expr = this.parseParenAndDistinguishExpression(canBeArrow);
  2326. if (refDestructuringErrors) {
  2327. if (refDestructuringErrors.parenthesizedAssign < 0 && !this.isSimpleAssignTarget(expr)) {
  2328. refDestructuringErrors.parenthesizedAssign = start2;
  2329. }
  2330. if (refDestructuringErrors.parenthesizedBind < 0) {
  2331. refDestructuringErrors.parenthesizedBind = start2;
  2332. }
  2333. }
  2334. return expr;
  2335. case types2.bracketL:
  2336. node2 = this.startNode();
  2337. this.next();
  2338. node2.elements = this.parseExprList(types2.bracketR, true, true, refDestructuringErrors);
  2339. return this.finishNode(node2, "ArrayExpression");
  2340. case types2.braceL:
  2341. return this.parseObj(false, refDestructuringErrors);
  2342. case types2._function:
  2343. node2 = this.startNode();
  2344. this.next();
  2345. return this.parseFunction(node2, 0);
  2346. case types2._class:
  2347. return this.parseClass(this.startNode(), false);
  2348. case types2._new:
  2349. return this.parseNew();
  2350. case types2.backQuote:
  2351. return this.parseTemplate();
  2352. case types2._import:
  2353. if (this.options.ecmaVersion >= 11) {
  2354. return this.parseExprImport();
  2355. } else {
  2356. return this.unexpected();
  2357. }
  2358. default:
  2359. this.unexpected();
  2360. }
  2361. };
  2362. pp$32.parseExprImport = function() {
  2363. var node2 = this.startNode();
  2364. if (this.containsEsc) {
  2365. this.raiseRecoverable(this.start, "Escape sequence in keyword import");
  2366. }
  2367. var meta = this.parseIdent(true);
  2368. switch (this.type) {
  2369. case types2.parenL:
  2370. return this.parseDynamicImport(node2);
  2371. case types2.dot:
  2372. node2.meta = meta;
  2373. return this.parseImportMeta(node2);
  2374. default:
  2375. this.unexpected();
  2376. }
  2377. };
  2378. pp$32.parseDynamicImport = function(node2) {
  2379. this.next();
  2380. node2.source = this.parseMaybeAssign();
  2381. if (!this.eat(types2.parenR)) {
  2382. var errorPos = this.start;
  2383. if (this.eat(types2.comma) && this.eat(types2.parenR)) {
  2384. this.raiseRecoverable(errorPos, "Trailing comma is not allowed in import()");
  2385. } else {
  2386. this.unexpected(errorPos);
  2387. }
  2388. }
  2389. return this.finishNode(node2, "ImportExpression");
  2390. };
  2391. pp$32.parseImportMeta = function(node2) {
  2392. this.next();
  2393. var containsEsc = this.containsEsc;
  2394. node2.property = this.parseIdent(true);
  2395. if (node2.property.name !== "meta") {
  2396. this.raiseRecoverable(node2.property.start, "The only valid meta property for import is 'import.meta'");
  2397. }
  2398. if (containsEsc) {
  2399. this.raiseRecoverable(node2.start, "'import.meta' must not contain escaped characters");
  2400. }
  2401. if (this.options.sourceType !== "module") {
  2402. this.raiseRecoverable(node2.start, "Cannot use 'import.meta' outside a module");
  2403. }
  2404. return this.finishNode(node2, "MetaProperty");
  2405. };
  2406. pp$32.parseLiteral = function(value) {
  2407. var node2 = this.startNode();
  2408. node2.value = value;
  2409. node2.raw = this.input.slice(this.start, this.end);
  2410. if (node2.raw.charCodeAt(node2.raw.length - 1) === 110) {
  2411. node2.bigint = node2.raw.slice(0, -1).replace(/_/g, "");
  2412. }
  2413. this.next();
  2414. return this.finishNode(node2, "Literal");
  2415. };
  2416. pp$32.parseParenExpression = function() {
  2417. this.expect(types2.parenL);
  2418. var val = this.parseExpression();
  2419. this.expect(types2.parenR);
  2420. return val;
  2421. };
  2422. pp$32.parseParenAndDistinguishExpression = function(canBeArrow) {
  2423. var startPos = this.start, startLoc = this.startLoc, val, allowTrailingComma = this.options.ecmaVersion >= 8;
  2424. if (this.options.ecmaVersion >= 6) {
  2425. this.next();
  2426. var innerStartPos = this.start, innerStartLoc = this.startLoc;
  2427. var exprList = [], first = true, lastIsComma = false;
  2428. var refDestructuringErrors = new DestructuringErrors3(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, spreadStart;
  2429. this.yieldPos = 0;
  2430. this.awaitPos = 0;
  2431. while (this.type !== types2.parenR) {
  2432. first ? first = false : this.expect(types2.comma);
  2433. if (allowTrailingComma && this.afterTrailingComma(types2.parenR, true)) {
  2434. lastIsComma = true;
  2435. break;
  2436. } else if (this.type === types2.ellipsis) {
  2437. spreadStart = this.start;
  2438. exprList.push(this.parseParenItem(this.parseRestBinding()));
  2439. if (this.type === types2.comma) {
  2440. this.raise(this.start, "Comma is not permitted after the rest element");
  2441. }
  2442. break;
  2443. } else {
  2444. exprList.push(this.parseMaybeAssign(false, refDestructuringErrors, this.parseParenItem));
  2445. }
  2446. }
  2447. var innerEndPos = this.start, innerEndLoc = this.startLoc;
  2448. this.expect(types2.parenR);
  2449. if (canBeArrow && !this.canInsertSemicolon() && this.eat(types2.arrow)) {
  2450. this.checkPatternErrors(refDestructuringErrors, false);
  2451. this.checkYieldAwaitInDefaultParams();
  2452. this.yieldPos = oldYieldPos;
  2453. this.awaitPos = oldAwaitPos;
  2454. return this.parseParenArrowList(startPos, startLoc, exprList);
  2455. }
  2456. if (!exprList.length || lastIsComma) {
  2457. this.unexpected(this.lastTokStart);
  2458. }
  2459. if (spreadStart) {
  2460. this.unexpected(spreadStart);
  2461. }
  2462. this.checkExpressionErrors(refDestructuringErrors, true);
  2463. this.yieldPos = oldYieldPos || this.yieldPos;
  2464. this.awaitPos = oldAwaitPos || this.awaitPos;
  2465. if (exprList.length > 1) {
  2466. val = this.startNodeAt(innerStartPos, innerStartLoc);
  2467. val.expressions = exprList;
  2468. this.finishNodeAt(val, "SequenceExpression", innerEndPos, innerEndLoc);
  2469. } else {
  2470. val = exprList[0];
  2471. }
  2472. } else {
  2473. val = this.parseParenExpression();
  2474. }
  2475. if (this.options.preserveParens) {
  2476. var par = this.startNodeAt(startPos, startLoc);
  2477. par.expression = val;
  2478. return this.finishNode(par, "ParenthesizedExpression");
  2479. } else {
  2480. return val;
  2481. }
  2482. };
  2483. pp$32.parseParenItem = function(item) {
  2484. return item;
  2485. };
  2486. pp$32.parseParenArrowList = function(startPos, startLoc, exprList) {
  2487. return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList);
  2488. };
  2489. var empty$12 = [];
  2490. pp$32.parseNew = function() {
  2491. if (this.containsEsc) {
  2492. this.raiseRecoverable(this.start, "Escape sequence in keyword new");
  2493. }
  2494. var node2 = this.startNode();
  2495. var meta = this.parseIdent(true);
  2496. if (this.options.ecmaVersion >= 6 && this.eat(types2.dot)) {
  2497. node2.meta = meta;
  2498. var containsEsc = this.containsEsc;
  2499. node2.property = this.parseIdent(true);
  2500. if (node2.property.name !== "target") {
  2501. this.raiseRecoverable(node2.property.start, "The only valid meta property for new is 'new.target'");
  2502. }
  2503. if (containsEsc) {
  2504. this.raiseRecoverable(node2.start, "'new.target' must not contain escaped characters");
  2505. }
  2506. if (!this.inNonArrowFunction()) {
  2507. this.raiseRecoverable(node2.start, "'new.target' can only be used in functions");
  2508. }
  2509. return this.finishNode(node2, "MetaProperty");
  2510. }
  2511. var startPos = this.start, startLoc = this.startLoc, isImport = this.type === types2._import;
  2512. node2.callee = this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true);
  2513. if (isImport && node2.callee.type === "ImportExpression") {
  2514. this.raise(startPos, "Cannot use new with import()");
  2515. }
  2516. if (this.eat(types2.parenL)) {
  2517. node2.arguments = this.parseExprList(types2.parenR, this.options.ecmaVersion >= 8, false);
  2518. } else {
  2519. node2.arguments = empty$12;
  2520. }
  2521. return this.finishNode(node2, "NewExpression");
  2522. };
  2523. pp$32.parseTemplateElement = function(ref3) {
  2524. var isTagged = ref3.isTagged;
  2525. var elem = this.startNode();
  2526. if (this.type === types2.invalidTemplate) {
  2527. if (!isTagged) {
  2528. this.raiseRecoverable(this.start, "Bad escape sequence in untagged template literal");
  2529. }
  2530. elem.value = {
  2531. raw: this.value,
  2532. cooked: null
  2533. };
  2534. } else {
  2535. elem.value = {
  2536. raw: this.input.slice(this.start, this.end).replace(/\r\n?/g, "\n"),
  2537. cooked: this.value
  2538. };
  2539. }
  2540. this.next();
  2541. elem.tail = this.type === types2.backQuote;
  2542. return this.finishNode(elem, "TemplateElement");
  2543. };
  2544. pp$32.parseTemplate = function(ref3) {
  2545. if (ref3 === void 0) ref3 = {};
  2546. var isTagged = ref3.isTagged;
  2547. if (isTagged === void 0) isTagged = false;
  2548. var node2 = this.startNode();
  2549. this.next();
  2550. node2.expressions = [];
  2551. var curElt = this.parseTemplateElement({ isTagged });
  2552. node2.quasis = [curElt];
  2553. while (!curElt.tail) {
  2554. if (this.type === types2.eof) {
  2555. this.raise(this.pos, "Unterminated template literal");
  2556. }
  2557. this.expect(types2.dollarBraceL);
  2558. node2.expressions.push(this.parseExpression());
  2559. this.expect(types2.braceR);
  2560. node2.quasis.push(curElt = this.parseTemplateElement({ isTagged }));
  2561. }
  2562. this.next();
  2563. return this.finishNode(node2, "TemplateLiteral");
  2564. };
  2565. pp$32.isAsyncProp = function(prop) {
  2566. return !prop.computed && prop.key.type === "Identifier" && prop.key.name === "async" && (this.type === types2.name || this.type === types2.num || this.type === types2.string || this.type === types2.bracketL || this.type.keyword || this.options.ecmaVersion >= 9 && this.type === types2.star) && !lineBreak2.test(this.input.slice(this.lastTokEnd, this.start));
  2567. };
  2568. pp$32.parseObj = function(isPattern, refDestructuringErrors) {
  2569. var node2 = this.startNode(), first = true, propHash = {};
  2570. node2.properties = [];
  2571. this.next();
  2572. while (!this.eat(types2.braceR)) {
  2573. if (!first) {
  2574. this.expect(types2.comma);
  2575. if (this.options.ecmaVersion >= 5 && this.afterTrailingComma(types2.braceR)) {
  2576. break;
  2577. }
  2578. } else {
  2579. first = false;
  2580. }
  2581. var prop = this.parseProperty(isPattern, refDestructuringErrors);
  2582. if (!isPattern) {
  2583. this.checkPropClash(prop, propHash, refDestructuringErrors);
  2584. }
  2585. node2.properties.push(prop);
  2586. }
  2587. return this.finishNode(node2, isPattern ? "ObjectPattern" : "ObjectExpression");
  2588. };
  2589. pp$32.parseProperty = function(isPattern, refDestructuringErrors) {
  2590. var prop = this.startNode(), isGenerator, isAsync, startPos, startLoc;
  2591. if (this.options.ecmaVersion >= 9 && this.eat(types2.ellipsis)) {
  2592. if (isPattern) {
  2593. prop.argument = this.parseIdent(false);
  2594. if (this.type === types2.comma) {
  2595. this.raise(this.start, "Comma is not permitted after the rest element");
  2596. }
  2597. return this.finishNode(prop, "RestElement");
  2598. }
  2599. if (this.type === types2.parenL && refDestructuringErrors) {
  2600. if (refDestructuringErrors.parenthesizedAssign < 0) {
  2601. refDestructuringErrors.parenthesizedAssign = this.start;
  2602. }
  2603. if (refDestructuringErrors.parenthesizedBind < 0) {
  2604. refDestructuringErrors.parenthesizedBind = this.start;
  2605. }
  2606. }
  2607. prop.argument = this.parseMaybeAssign(false, refDestructuringErrors);
  2608. if (this.type === types2.comma && refDestructuringErrors && refDestructuringErrors.trailingComma < 0) {
  2609. refDestructuringErrors.trailingComma = this.start;
  2610. }
  2611. return this.finishNode(prop, "SpreadElement");
  2612. }
  2613. if (this.options.ecmaVersion >= 6) {
  2614. prop.method = false;
  2615. prop.shorthand = false;
  2616. if (isPattern || refDestructuringErrors) {
  2617. startPos = this.start;
  2618. startLoc = this.startLoc;
  2619. }
  2620. if (!isPattern) {
  2621. isGenerator = this.eat(types2.star);
  2622. }
  2623. }
  2624. var containsEsc = this.containsEsc;
  2625. this.parsePropertyName(prop);
  2626. if (!isPattern && !containsEsc && this.options.ecmaVersion >= 8 && !isGenerator && this.isAsyncProp(prop)) {
  2627. isAsync = true;
  2628. isGenerator = this.options.ecmaVersion >= 9 && this.eat(types2.star);
  2629. this.parsePropertyName(prop, refDestructuringErrors);
  2630. } else {
  2631. isAsync = false;
  2632. }
  2633. this.parsePropertyValue(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc);
  2634. return this.finishNode(prop, "Property");
  2635. };
  2636. pp$32.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc) {
  2637. if ((isGenerator || isAsync) && this.type === types2.colon) {
  2638. this.unexpected();
  2639. }
  2640. if (this.eat(types2.colon)) {
  2641. prop.value = isPattern ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(false, refDestructuringErrors);
  2642. prop.kind = "init";
  2643. } else if (this.options.ecmaVersion >= 6 && this.type === types2.parenL) {
  2644. if (isPattern) {
  2645. this.unexpected();
  2646. }
  2647. prop.kind = "init";
  2648. prop.method = true;
  2649. prop.value = this.parseMethod(isGenerator, isAsync);
  2650. } else if (!isPattern && !containsEsc && this.options.ecmaVersion >= 5 && !prop.computed && prop.key.type === "Identifier" && (prop.key.name === "get" || prop.key.name === "set") && (this.type !== types2.comma && this.type !== types2.braceR && this.type !== types2.eq)) {
  2651. if (isGenerator || isAsync) {
  2652. this.unexpected();
  2653. }
  2654. prop.kind = prop.key.name;
  2655. this.parsePropertyName(prop);
  2656. prop.value = this.parseMethod(false);
  2657. var paramCount = prop.kind === "get" ? 0 : 1;
  2658. if (prop.value.params.length !== paramCount) {
  2659. var start2 = prop.value.start;
  2660. if (prop.kind === "get") {
  2661. this.raiseRecoverable(start2, "getter should have no params");
  2662. } else {
  2663. this.raiseRecoverable(start2, "setter should have exactly one param");
  2664. }
  2665. } else {
  2666. if (prop.kind === "set" && prop.value.params[0].type === "RestElement") {
  2667. this.raiseRecoverable(prop.value.params[0].start, "Setter cannot use rest params");
  2668. }
  2669. }
  2670. } else if (this.options.ecmaVersion >= 6 && !prop.computed && prop.key.type === "Identifier") {
  2671. if (isGenerator || isAsync) {
  2672. this.unexpected();
  2673. }
  2674. this.checkUnreserved(prop.key);
  2675. if (prop.key.name === "await" && !this.awaitIdentPos) {
  2676. this.awaitIdentPos = startPos;
  2677. }
  2678. prop.kind = "init";
  2679. if (isPattern) {
  2680. prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key);
  2681. } else if (this.type === types2.eq && refDestructuringErrors) {
  2682. if (refDestructuringErrors.shorthandAssign < 0) {
  2683. refDestructuringErrors.shorthandAssign = this.start;
  2684. }
  2685. prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key);
  2686. } else {
  2687. prop.value = prop.key;
  2688. }
  2689. prop.shorthand = true;
  2690. } else {
  2691. this.unexpected();
  2692. }
  2693. };
  2694. pp$32.parsePropertyName = function(prop) {
  2695. if (this.options.ecmaVersion >= 6) {
  2696. if (this.eat(types2.bracketL)) {
  2697. prop.computed = true;
  2698. prop.key = this.parseMaybeAssign();
  2699. this.expect(types2.bracketR);
  2700. return prop.key;
  2701. } else {
  2702. prop.computed = false;
  2703. }
  2704. }
  2705. return prop.key = this.type === types2.num || this.type === types2.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never");
  2706. };
  2707. pp$32.initFunction = function(node2) {
  2708. node2.id = null;
  2709. if (this.options.ecmaVersion >= 6) {
  2710. node2.generator = node2.expression = false;
  2711. }
  2712. if (this.options.ecmaVersion >= 8) {
  2713. node2.async = false;
  2714. }
  2715. };
  2716. pp$32.parseMethod = function(isGenerator, isAsync, allowDirectSuper) {
  2717. var node2 = this.startNode(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;
  2718. this.initFunction(node2);
  2719. if (this.options.ecmaVersion >= 6) {
  2720. node2.generator = isGenerator;
  2721. }
  2722. if (this.options.ecmaVersion >= 8) {
  2723. node2.async = !!isAsync;
  2724. }
  2725. this.yieldPos = 0;
  2726. this.awaitPos = 0;
  2727. this.awaitIdentPos = 0;
  2728. this.enterScope(functionFlags2(isAsync, node2.generator) | SCOPE_SUPER2 | (allowDirectSuper ? SCOPE_DIRECT_SUPER2 : 0));
  2729. this.expect(types2.parenL);
  2730. node2.params = this.parseBindingList(types2.parenR, false, this.options.ecmaVersion >= 8);
  2731. this.checkYieldAwaitInDefaultParams();
  2732. this.parseFunctionBody(node2, false, true);
  2733. this.yieldPos = oldYieldPos;
  2734. this.awaitPos = oldAwaitPos;
  2735. this.awaitIdentPos = oldAwaitIdentPos;
  2736. return this.finishNode(node2, "FunctionExpression");
  2737. };
  2738. pp$32.parseArrowExpression = function(node2, params, isAsync) {
  2739. var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;
  2740. this.enterScope(functionFlags2(isAsync, false) | SCOPE_ARROW2);
  2741. this.initFunction(node2);
  2742. if (this.options.ecmaVersion >= 8) {
  2743. node2.async = !!isAsync;
  2744. }
  2745. this.yieldPos = 0;
  2746. this.awaitPos = 0;
  2747. this.awaitIdentPos = 0;
  2748. node2.params = this.toAssignableList(params, true);
  2749. this.parseFunctionBody(node2, true, false);
  2750. this.yieldPos = oldYieldPos;
  2751. this.awaitPos = oldAwaitPos;
  2752. this.awaitIdentPos = oldAwaitIdentPos;
  2753. return this.finishNode(node2, "ArrowFunctionExpression");
  2754. };
  2755. pp$32.parseFunctionBody = function(node2, isArrowFunction, isMethod) {
  2756. var isExpression = isArrowFunction && this.type !== types2.braceL;
  2757. var oldStrict = this.strict, useStrict = false;
  2758. if (isExpression) {
  2759. node2.body = this.parseMaybeAssign();
  2760. node2.expression = true;
  2761. this.checkParams(node2, false);
  2762. } else {
  2763. var nonSimple = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(node2.params);
  2764. if (!oldStrict || nonSimple) {
  2765. useStrict = this.strictDirective(this.end);
  2766. if (useStrict && nonSimple) {
  2767. this.raiseRecoverable(node2.start, "Illegal 'use strict' directive in function with non-simple parameter list");
  2768. }
  2769. }
  2770. var oldLabels = this.labels;
  2771. this.labels = [];
  2772. if (useStrict) {
  2773. this.strict = true;
  2774. }
  2775. this.checkParams(node2, !oldStrict && !useStrict && !isArrowFunction && !isMethod && this.isSimpleParamList(node2.params));
  2776. if (this.strict && node2.id) {
  2777. this.checkLVal(node2.id, BIND_OUTSIDE2);
  2778. }
  2779. node2.body = this.parseBlock(false, void 0, useStrict && !oldStrict);
  2780. node2.expression = false;
  2781. this.adaptDirectivePrologue(node2.body.body);
  2782. this.labels = oldLabels;
  2783. }
  2784. this.exitScope();
  2785. };
  2786. pp$32.isSimpleParamList = function(params) {
  2787. for (var i = 0, list3 = params; i < list3.length; i += 1) {
  2788. var param = list3[i];
  2789. if (param.type !== "Identifier") {
  2790. return false;
  2791. }
  2792. }
  2793. return true;
  2794. };
  2795. pp$32.checkParams = function(node2, allowDuplicates) {
  2796. var nameHash = {};
  2797. for (var i = 0, list3 = node2.params; i < list3.length; i += 1) {
  2798. var param = list3[i];
  2799. this.checkLVal(param, BIND_VAR2, allowDuplicates ? null : nameHash);
  2800. }
  2801. };
  2802. pp$32.parseExprList = function(close, allowTrailingComma, allowEmpty, refDestructuringErrors) {
  2803. var elts = [], first = true;
  2804. while (!this.eat(close)) {
  2805. if (!first) {
  2806. this.expect(types2.comma);
  2807. if (allowTrailingComma && this.afterTrailingComma(close)) {
  2808. break;
  2809. }
  2810. } else {
  2811. first = false;
  2812. }
  2813. var elt = void 0;
  2814. if (allowEmpty && this.type === types2.comma) {
  2815. elt = null;
  2816. } else if (this.type === types2.ellipsis) {
  2817. elt = this.parseSpread(refDestructuringErrors);
  2818. if (refDestructuringErrors && this.type === types2.comma && refDestructuringErrors.trailingComma < 0) {
  2819. refDestructuringErrors.trailingComma = this.start;
  2820. }
  2821. } else {
  2822. elt = this.parseMaybeAssign(false, refDestructuringErrors);
  2823. }
  2824. elts.push(elt);
  2825. }
  2826. return elts;
  2827. };
  2828. pp$32.checkUnreserved = function(ref3) {
  2829. var start2 = ref3.start;
  2830. var end = ref3.end;
  2831. var name2 = ref3.name;
  2832. if (this.inGenerator && name2 === "yield") {
  2833. this.raiseRecoverable(start2, "Cannot use 'yield' as identifier inside a generator");
  2834. }
  2835. if (this.inAsync && name2 === "await") {
  2836. this.raiseRecoverable(start2, "Cannot use 'await' as identifier inside an async function");
  2837. }
  2838. if (this.keywords.test(name2)) {
  2839. this.raise(start2, "Unexpected keyword '" + name2 + "'");
  2840. }
  2841. if (this.options.ecmaVersion < 6 && this.input.slice(start2, end).indexOf("\\") !== -1) {
  2842. return;
  2843. }
  2844. var re2 = this.strict ? this.reservedWordsStrict : this.reservedWords;
  2845. if (re2.test(name2)) {
  2846. if (!this.inAsync && name2 === "await") {
  2847. this.raiseRecoverable(start2, "Cannot use keyword 'await' outside an async function");
  2848. }
  2849. this.raiseRecoverable(start2, "The keyword '" + name2 + "' is reserved");
  2850. }
  2851. };
  2852. pp$32.parseIdent = function(liberal, isBinding) {
  2853. var node2 = this.startNode();
  2854. if (this.type === types2.name) {
  2855. node2.name = this.value;
  2856. } else if (this.type.keyword) {
  2857. node2.name = this.type.keyword;
  2858. if ((node2.name === "class" || node2.name === "function") && (this.lastTokEnd !== this.lastTokStart + 1 || this.input.charCodeAt(this.lastTokStart) !== 46)) {
  2859. this.context.pop();
  2860. }
  2861. } else {
  2862. this.unexpected();
  2863. }
  2864. this.next(!!liberal);
  2865. this.finishNode(node2, "Identifier");
  2866. if (!liberal) {
  2867. this.checkUnreserved(node2);
  2868. if (node2.name === "await" && !this.awaitIdentPos) {
  2869. this.awaitIdentPos = node2.start;
  2870. }
  2871. }
  2872. return node2;
  2873. };
  2874. pp$32.parseYield = function(noIn) {
  2875. if (!this.yieldPos) {
  2876. this.yieldPos = this.start;
  2877. }
  2878. var node2 = this.startNode();
  2879. this.next();
  2880. if (this.type === types2.semi || this.canInsertSemicolon() || this.type !== types2.star && !this.type.startsExpr) {
  2881. node2.delegate = false;
  2882. node2.argument = null;
  2883. } else {
  2884. node2.delegate = this.eat(types2.star);
  2885. node2.argument = this.parseMaybeAssign(noIn);
  2886. }
  2887. return this.finishNode(node2, "YieldExpression");
  2888. };
  2889. pp$32.parseAwait = function() {
  2890. if (!this.awaitPos) {
  2891. this.awaitPos = this.start;
  2892. }
  2893. var node2 = this.startNode();
  2894. this.next();
  2895. node2.argument = this.parseMaybeUnary(null, false);
  2896. return this.finishNode(node2, "AwaitExpression");
  2897. };
  2898. var pp$42 = Parser3.prototype;
  2899. pp$42.raise = function(pos, message) {
  2900. var loc = getLineInfo2(this.input, pos);
  2901. message += " (" + loc.line + ":" + loc.column + ")";
  2902. var err = new SyntaxError(message);
  2903. err.pos = pos;
  2904. err.loc = loc;
  2905. err.raisedAt = this.pos;
  2906. throw err;
  2907. };
  2908. pp$42.raiseRecoverable = pp$42.raise;
  2909. pp$42.curPosition = function() {
  2910. if (this.options.locations) {
  2911. return new Position3(this.curLine, this.pos - this.lineStart);
  2912. }
  2913. };
  2914. var pp$52 = Parser3.prototype;
  2915. var Scope4 = function Scope5(flags) {
  2916. this.flags = flags;
  2917. this.var = [];
  2918. this.lexical = [];
  2919. this.functions = [];
  2920. };
  2921. pp$52.enterScope = function(flags) {
  2922. this.scopeStack.push(new Scope4(flags));
  2923. };
  2924. pp$52.exitScope = function() {
  2925. this.scopeStack.pop();
  2926. };
  2927. pp$52.treatFunctionsAsVarInScope = function(scope) {
  2928. return scope.flags & SCOPE_FUNCTION2 || !this.inModule && scope.flags & SCOPE_TOP2;
  2929. };
  2930. pp$52.declareName = function(name2, bindingType, pos) {
  2931. var redeclared = false;
  2932. if (bindingType === BIND_LEXICAL2) {
  2933. var scope = this.currentScope();
  2934. redeclared = scope.lexical.indexOf(name2) > -1 || scope.functions.indexOf(name2) > -1 || scope.var.indexOf(name2) > -1;
  2935. scope.lexical.push(name2);
  2936. if (this.inModule && scope.flags & SCOPE_TOP2) {
  2937. delete this.undefinedExports[name2];
  2938. }
  2939. } else if (bindingType === BIND_SIMPLE_CATCH2) {
  2940. var scope$1 = this.currentScope();
  2941. scope$1.lexical.push(name2);
  2942. } else if (bindingType === BIND_FUNCTION2) {
  2943. var scope$2 = this.currentScope();
  2944. if (this.treatFunctionsAsVar) {
  2945. redeclared = scope$2.lexical.indexOf(name2) > -1;
  2946. } else {
  2947. redeclared = scope$2.lexical.indexOf(name2) > -1 || scope$2.var.indexOf(name2) > -1;
  2948. }
  2949. scope$2.functions.push(name2);
  2950. } else {
  2951. for (var i = this.scopeStack.length - 1; i >= 0; --i) {
  2952. var scope$3 = this.scopeStack[i];
  2953. if (scope$3.lexical.indexOf(name2) > -1 && !(scope$3.flags & SCOPE_SIMPLE_CATCH2 && scope$3.lexical[0] === name2) || !this.treatFunctionsAsVarInScope(scope$3) && scope$3.functions.indexOf(name2) > -1) {
  2954. redeclared = true;
  2955. break;
  2956. }
  2957. scope$3.var.push(name2);
  2958. if (this.inModule && scope$3.flags & SCOPE_TOP2) {
  2959. delete this.undefinedExports[name2];
  2960. }
  2961. if (scope$3.flags & SCOPE_VAR2) {
  2962. break;
  2963. }
  2964. }
  2965. }
  2966. if (redeclared) {
  2967. this.raiseRecoverable(pos, "Identifier '" + name2 + "' has already been declared");
  2968. }
  2969. };
  2970. pp$52.checkLocalExport = function(id) {
  2971. if (this.scopeStack[0].lexical.indexOf(id.name) === -1 && this.scopeStack[0].var.indexOf(id.name) === -1) {
  2972. this.undefinedExports[id.name] = id;
  2973. }
  2974. };
  2975. pp$52.currentScope = function() {
  2976. return this.scopeStack[this.scopeStack.length - 1];
  2977. };
  2978. pp$52.currentVarScope = function() {
  2979. for (var i = this.scopeStack.length - 1; ; i--) {
  2980. var scope = this.scopeStack[i];
  2981. if (scope.flags & SCOPE_VAR2) {
  2982. return scope;
  2983. }
  2984. }
  2985. };
  2986. pp$52.currentThisScope = function() {
  2987. for (var i = this.scopeStack.length - 1; ; i--) {
  2988. var scope = this.scopeStack[i];
  2989. if (scope.flags & SCOPE_VAR2 && !(scope.flags & SCOPE_ARROW2)) {
  2990. return scope;
  2991. }
  2992. }
  2993. };
  2994. var Node3 = function Node4(parser, pos, loc) {
  2995. this.type = "";
  2996. this.start = pos;
  2997. this.end = 0;
  2998. if (parser.options.locations) {
  2999. this.loc = new SourceLocation3(parser, loc);
  3000. }
  3001. if (parser.options.directSourceFile) {
  3002. this.sourceFile = parser.options.directSourceFile;
  3003. }
  3004. if (parser.options.ranges) {
  3005. this.range = [pos, 0];
  3006. }
  3007. };
  3008. var pp$62 = Parser3.prototype;
  3009. pp$62.startNode = function() {
  3010. return new Node3(this, this.start, this.startLoc);
  3011. };
  3012. pp$62.startNodeAt = function(pos, loc) {
  3013. return new Node3(this, pos, loc);
  3014. };
  3015. function finishNodeAt2(node2, type, pos, loc) {
  3016. node2.type = type;
  3017. node2.end = pos;
  3018. if (this.options.locations) {
  3019. node2.loc.end = loc;
  3020. }
  3021. if (this.options.ranges) {
  3022. node2.range[1] = pos;
  3023. }
  3024. return node2;
  3025. }
  3026. pp$62.finishNode = function(node2, type) {
  3027. return finishNodeAt2.call(this, node2, type, this.lastTokEnd, this.lastTokEndLoc);
  3028. };
  3029. pp$62.finishNodeAt = function(node2, type, pos, loc) {
  3030. return finishNodeAt2.call(this, node2, type, pos, loc);
  3031. };
  3032. var TokContext3 = function TokContext4(token, isExpr, preserveSpace, override, generator) {
  3033. this.token = token;
  3034. this.isExpr = !!isExpr;
  3035. this.preserveSpace = !!preserveSpace;
  3036. this.override = override;
  3037. this.generator = !!generator;
  3038. };
  3039. var types$12 = {
  3040. b_stat: new TokContext3("{", false),
  3041. b_expr: new TokContext3("{", true),
  3042. b_tmpl: new TokContext3("${", false),
  3043. p_stat: new TokContext3("(", false),
  3044. p_expr: new TokContext3("(", true),
  3045. q_tmpl: new TokContext3("`", true, true, function(p) {
  3046. return p.tryReadTemplateToken();
  3047. }),
  3048. f_stat: new TokContext3("function", false),
  3049. f_expr: new TokContext3("function", true),
  3050. f_expr_gen: new TokContext3("function", true, false, null, true),
  3051. f_gen: new TokContext3("function", false, false, null, true)
  3052. };
  3053. var pp$72 = Parser3.prototype;
  3054. pp$72.initialContext = function() {
  3055. return [types$12.b_stat];
  3056. };
  3057. pp$72.braceIsBlock = function(prevType) {
  3058. var parent = this.curContext();
  3059. if (parent === types$12.f_expr || parent === types$12.f_stat) {
  3060. return true;
  3061. }
  3062. if (prevType === types2.colon && (parent === types$12.b_stat || parent === types$12.b_expr)) {
  3063. return !parent.isExpr;
  3064. }
  3065. if (prevType === types2._return || prevType === types2.name && this.exprAllowed) {
  3066. return lineBreak2.test(this.input.slice(this.lastTokEnd, this.start));
  3067. }
  3068. if (prevType === types2._else || prevType === types2.semi || prevType === types2.eof || prevType === types2.parenR || prevType === types2.arrow) {
  3069. return true;
  3070. }
  3071. if (prevType === types2.braceL) {
  3072. return parent === types$12.b_stat;
  3073. }
  3074. if (prevType === types2._var || prevType === types2._const || prevType === types2.name) {
  3075. return false;
  3076. }
  3077. return !this.exprAllowed;
  3078. };
  3079. pp$72.inGeneratorContext = function() {
  3080. for (var i = this.context.length - 1; i >= 1; i--) {
  3081. var context = this.context[i];
  3082. if (context.token === "function") {
  3083. return context.generator;
  3084. }
  3085. }
  3086. return false;
  3087. };
  3088. pp$72.updateContext = function(prevType) {
  3089. var update, type = this.type;
  3090. if (type.keyword && prevType === types2.dot) {
  3091. this.exprAllowed = false;
  3092. } else if (update = type.updateContext) {
  3093. update.call(this, prevType);
  3094. } else {
  3095. this.exprAllowed = type.beforeExpr;
  3096. }
  3097. };
  3098. types2.parenR.updateContext = types2.braceR.updateContext = function() {
  3099. if (this.context.length === 1) {
  3100. this.exprAllowed = true;
  3101. return;
  3102. }
  3103. var out = this.context.pop();
  3104. if (out === types$12.b_stat && this.curContext().token === "function") {
  3105. out = this.context.pop();
  3106. }
  3107. this.exprAllowed = !out.isExpr;
  3108. };
  3109. types2.braceL.updateContext = function(prevType) {
  3110. this.context.push(this.braceIsBlock(prevType) ? types$12.b_stat : types$12.b_expr);
  3111. this.exprAllowed = true;
  3112. };
  3113. types2.dollarBraceL.updateContext = function() {
  3114. this.context.push(types$12.b_tmpl);
  3115. this.exprAllowed = true;
  3116. };
  3117. types2.parenL.updateContext = function(prevType) {
  3118. var statementParens = prevType === types2._if || prevType === types2._for || prevType === types2._with || prevType === types2._while;
  3119. this.context.push(statementParens ? types$12.p_stat : types$12.p_expr);
  3120. this.exprAllowed = true;
  3121. };
  3122. types2.incDec.updateContext = function() {
  3123. };
  3124. types2._function.updateContext = types2._class.updateContext = function(prevType) {
  3125. if (prevType.beforeExpr && prevType !== types2.semi && prevType !== types2._else && !(prevType === types2._return && lineBreak2.test(this.input.slice(this.lastTokEnd, this.start))) && !((prevType === types2.colon || prevType === types2.braceL) && this.curContext() === types$12.b_stat)) {
  3126. this.context.push(types$12.f_expr);
  3127. } else {
  3128. this.context.push(types$12.f_stat);
  3129. }
  3130. this.exprAllowed = false;
  3131. };
  3132. types2.backQuote.updateContext = function() {
  3133. if (this.curContext() === types$12.q_tmpl) {
  3134. this.context.pop();
  3135. } else {
  3136. this.context.push(types$12.q_tmpl);
  3137. }
  3138. this.exprAllowed = false;
  3139. };
  3140. types2.star.updateContext = function(prevType) {
  3141. if (prevType === types2._function) {
  3142. var index2 = this.context.length - 1;
  3143. if (this.context[index2] === types$12.f_expr) {
  3144. this.context[index2] = types$12.f_expr_gen;
  3145. } else {
  3146. this.context[index2] = types$12.f_gen;
  3147. }
  3148. }
  3149. this.exprAllowed = true;
  3150. };
  3151. types2.name.updateContext = function(prevType) {
  3152. var allowed = false;
  3153. if (this.options.ecmaVersion >= 6 && prevType !== types2.dot) {
  3154. if (this.value === "of" && !this.exprAllowed || this.value === "yield" && this.inGeneratorContext()) {
  3155. allowed = true;
  3156. }
  3157. }
  3158. this.exprAllowed = allowed;
  3159. };
  3160. var ecma9BinaryProperties2 = "ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS";
  3161. var ecma10BinaryProperties2 = ecma9BinaryProperties2 + " Extended_Pictographic";
  3162. var ecma11BinaryProperties2 = ecma10BinaryProperties2;
  3163. var unicodeBinaryProperties2 = {
  3164. 9: ecma9BinaryProperties2,
  3165. 10: ecma10BinaryProperties2,
  3166. 11: ecma11BinaryProperties2
  3167. };
  3168. var unicodeGeneralCategoryValues2 = "Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu";
  3169. var ecma9ScriptValues2 = "Adlam Adlm Ahom Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb";
  3170. var ecma10ScriptValues2 = ecma9ScriptValues2 + " Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd";
  3171. var ecma11ScriptValues2 = ecma10ScriptValues2 + " Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho";
  3172. var unicodeScriptValues2 = {
  3173. 9: ecma9ScriptValues2,
  3174. 10: ecma10ScriptValues2,
  3175. 11: ecma11ScriptValues2
  3176. };
  3177. var data2 = {};
  3178. function buildUnicodeData2(ecmaVersion) {
  3179. var d = data2[ecmaVersion] = {
  3180. binary: wordsRegexp2(unicodeBinaryProperties2[ecmaVersion] + " " + unicodeGeneralCategoryValues2),
  3181. nonBinary: {
  3182. General_Category: wordsRegexp2(unicodeGeneralCategoryValues2),
  3183. Script: wordsRegexp2(unicodeScriptValues2[ecmaVersion])
  3184. }
  3185. };
  3186. d.nonBinary.Script_Extensions = d.nonBinary.Script;
  3187. d.nonBinary.gc = d.nonBinary.General_Category;
  3188. d.nonBinary.sc = d.nonBinary.Script;
  3189. d.nonBinary.scx = d.nonBinary.Script_Extensions;
  3190. }
  3191. buildUnicodeData2(9);
  3192. buildUnicodeData2(10);
  3193. buildUnicodeData2(11);
  3194. var pp$82 = Parser3.prototype;
  3195. var RegExpValidationState3 = function RegExpValidationState4(parser) {
  3196. this.parser = parser;
  3197. this.validFlags = "gim" + (parser.options.ecmaVersion >= 6 ? "uy" : "") + (parser.options.ecmaVersion >= 9 ? "s" : "");
  3198. this.unicodeProperties = data2[parser.options.ecmaVersion >= 11 ? 11 : parser.options.ecmaVersion];
  3199. this.source = "";
  3200. this.flags = "";
  3201. this.start = 0;
  3202. this.switchU = false;
  3203. this.switchN = false;
  3204. this.pos = 0;
  3205. this.lastIntValue = 0;
  3206. this.lastStringValue = "";
  3207. this.lastAssertionIsQuantifiable = false;
  3208. this.numCapturingParens = 0;
  3209. this.maxBackReference = 0;
  3210. this.groupNames = [];
  3211. this.backReferenceNames = [];
  3212. };
  3213. RegExpValidationState3.prototype.reset = function reset2(start2, pattern, flags) {
  3214. var unicode = flags.indexOf("u") !== -1;
  3215. this.start = start2 | 0;
  3216. this.source = pattern + "";
  3217. this.flags = flags;
  3218. this.switchU = unicode && this.parser.options.ecmaVersion >= 6;
  3219. this.switchN = unicode && this.parser.options.ecmaVersion >= 9;
  3220. };
  3221. RegExpValidationState3.prototype.raise = function raise2(message) {
  3222. this.parser.raiseRecoverable(this.start, "Invalid regular expression: /" + this.source + "/: " + message);
  3223. };
  3224. RegExpValidationState3.prototype.at = function at2(i, forceU) {
  3225. if (forceU === void 0) forceU = false;
  3226. var s = this.source;
  3227. var l = s.length;
  3228. if (i >= l) {
  3229. return -1;
  3230. }
  3231. var c = s.charCodeAt(i);
  3232. if (!(forceU || this.switchU) || c <= 55295 || c >= 57344 || i + 1 >= l) {
  3233. return c;
  3234. }
  3235. var next = s.charCodeAt(i + 1);
  3236. return next >= 56320 && next <= 57343 ? (c << 10) + next - 56613888 : c;
  3237. };
  3238. RegExpValidationState3.prototype.nextIndex = function nextIndex2(i, forceU) {
  3239. if (forceU === void 0) forceU = false;
  3240. var s = this.source;
  3241. var l = s.length;
  3242. if (i >= l) {
  3243. return l;
  3244. }
  3245. var c = s.charCodeAt(i), next;
  3246. if (!(forceU || this.switchU) || c <= 55295 || c >= 57344 || i + 1 >= l || (next = s.charCodeAt(i + 1)) < 56320 || next > 57343) {
  3247. return i + 1;
  3248. }
  3249. return i + 2;
  3250. };
  3251. RegExpValidationState3.prototype.current = function current2(forceU) {
  3252. if (forceU === void 0) forceU = false;
  3253. return this.at(this.pos, forceU);
  3254. };
  3255. RegExpValidationState3.prototype.lookahead = function lookahead2(forceU) {
  3256. if (forceU === void 0) forceU = false;
  3257. return this.at(this.nextIndex(this.pos, forceU), forceU);
  3258. };
  3259. RegExpValidationState3.prototype.advance = function advance2(forceU) {
  3260. if (forceU === void 0) forceU = false;
  3261. this.pos = this.nextIndex(this.pos, forceU);
  3262. };
  3263. RegExpValidationState3.prototype.eat = function eat2(ch, forceU) {
  3264. if (forceU === void 0) forceU = false;
  3265. if (this.current(forceU) === ch) {
  3266. this.advance(forceU);
  3267. return true;
  3268. }
  3269. return false;
  3270. };
  3271. function codePointToString2(ch) {
  3272. if (ch <= 65535) {
  3273. return String.fromCharCode(ch);
  3274. }
  3275. ch -= 65536;
  3276. return String.fromCharCode((ch >> 10) + 55296, (ch & 1023) + 56320);
  3277. }
  3278. pp$82.validateRegExpFlags = function(state) {
  3279. var validFlags = state.validFlags;
  3280. var flags = state.flags;
  3281. for (var i = 0; i < flags.length; i++) {
  3282. var flag = flags.charAt(i);
  3283. if (validFlags.indexOf(flag) === -1) {
  3284. this.raise(state.start, "Invalid regular expression flag");
  3285. }
  3286. if (flags.indexOf(flag, i + 1) > -1) {
  3287. this.raise(state.start, "Duplicate regular expression flag");
  3288. }
  3289. }
  3290. };
  3291. pp$82.validateRegExpPattern = function(state) {
  3292. this.regexp_pattern(state);
  3293. if (!state.switchN && this.options.ecmaVersion >= 9 && state.groupNames.length > 0) {
  3294. state.switchN = true;
  3295. this.regexp_pattern(state);
  3296. }
  3297. };
  3298. pp$82.regexp_pattern = function(state) {
  3299. state.pos = 0;
  3300. state.lastIntValue = 0;
  3301. state.lastStringValue = "";
  3302. state.lastAssertionIsQuantifiable = false;
  3303. state.numCapturingParens = 0;
  3304. state.maxBackReference = 0;
  3305. state.groupNames.length = 0;
  3306. state.backReferenceNames.length = 0;
  3307. this.regexp_disjunction(state);
  3308. if (state.pos !== state.source.length) {
  3309. if (state.eat(
  3310. 41
  3311. /* ) */
  3312. )) {
  3313. state.raise("Unmatched ')'");
  3314. }
  3315. if (state.eat(
  3316. 93
  3317. /* ] */
  3318. ) || state.eat(
  3319. 125
  3320. /* } */
  3321. )) {
  3322. state.raise("Lone quantifier brackets");
  3323. }
  3324. }
  3325. if (state.maxBackReference > state.numCapturingParens) {
  3326. state.raise("Invalid escape");
  3327. }
  3328. for (var i = 0, list3 = state.backReferenceNames; i < list3.length; i += 1) {
  3329. var name2 = list3[i];
  3330. if (state.groupNames.indexOf(name2) === -1) {
  3331. state.raise("Invalid named capture referenced");
  3332. }
  3333. }
  3334. };
  3335. pp$82.regexp_disjunction = function(state) {
  3336. this.regexp_alternative(state);
  3337. while (state.eat(
  3338. 124
  3339. /* | */
  3340. )) {
  3341. this.regexp_alternative(state);
  3342. }
  3343. if (this.regexp_eatQuantifier(state, true)) {
  3344. state.raise("Nothing to repeat");
  3345. }
  3346. if (state.eat(
  3347. 123
  3348. /* { */
  3349. )) {
  3350. state.raise("Lone quantifier brackets");
  3351. }
  3352. };
  3353. pp$82.regexp_alternative = function(state) {
  3354. while (state.pos < state.source.length && this.regexp_eatTerm(state)) {
  3355. }
  3356. };
  3357. pp$82.regexp_eatTerm = function(state) {
  3358. if (this.regexp_eatAssertion(state)) {
  3359. if (state.lastAssertionIsQuantifiable && this.regexp_eatQuantifier(state)) {
  3360. if (state.switchU) {
  3361. state.raise("Invalid quantifier");
  3362. }
  3363. }
  3364. return true;
  3365. }
  3366. if (state.switchU ? this.regexp_eatAtom(state) : this.regexp_eatExtendedAtom(state)) {
  3367. this.regexp_eatQuantifier(state);
  3368. return true;
  3369. }
  3370. return false;
  3371. };
  3372. pp$82.regexp_eatAssertion = function(state) {
  3373. var start2 = state.pos;
  3374. state.lastAssertionIsQuantifiable = false;
  3375. if (state.eat(
  3376. 94
  3377. /* ^ */
  3378. ) || state.eat(
  3379. 36
  3380. /* $ */
  3381. )) {
  3382. return true;
  3383. }
  3384. if (state.eat(
  3385. 92
  3386. /* \ */
  3387. )) {
  3388. if (state.eat(
  3389. 66
  3390. /* B */
  3391. ) || state.eat(
  3392. 98
  3393. /* b */
  3394. )) {
  3395. return true;
  3396. }
  3397. state.pos = start2;
  3398. }
  3399. if (state.eat(
  3400. 40
  3401. /* ( */
  3402. ) && state.eat(
  3403. 63
  3404. /* ? */
  3405. )) {
  3406. var lookbehind = false;
  3407. if (this.options.ecmaVersion >= 9) {
  3408. lookbehind = state.eat(
  3409. 60
  3410. /* < */
  3411. );
  3412. }
  3413. if (state.eat(
  3414. 61
  3415. /* = */
  3416. ) || state.eat(
  3417. 33
  3418. /* ! */
  3419. )) {
  3420. this.regexp_disjunction(state);
  3421. if (!state.eat(
  3422. 41
  3423. /* ) */
  3424. )) {
  3425. state.raise("Unterminated group");
  3426. }
  3427. state.lastAssertionIsQuantifiable = !lookbehind;
  3428. return true;
  3429. }
  3430. }
  3431. state.pos = start2;
  3432. return false;
  3433. };
  3434. pp$82.regexp_eatQuantifier = function(state, noError) {
  3435. if (noError === void 0) noError = false;
  3436. if (this.regexp_eatQuantifierPrefix(state, noError)) {
  3437. state.eat(
  3438. 63
  3439. /* ? */
  3440. );
  3441. return true;
  3442. }
  3443. return false;
  3444. };
  3445. pp$82.regexp_eatQuantifierPrefix = function(state, noError) {
  3446. return state.eat(
  3447. 42
  3448. /* * */
  3449. ) || state.eat(
  3450. 43
  3451. /* + */
  3452. ) || state.eat(
  3453. 63
  3454. /* ? */
  3455. ) || this.regexp_eatBracedQuantifier(state, noError);
  3456. };
  3457. pp$82.regexp_eatBracedQuantifier = function(state, noError) {
  3458. var start2 = state.pos;
  3459. if (state.eat(
  3460. 123
  3461. /* { */
  3462. )) {
  3463. var min = 0, max = -1;
  3464. if (this.regexp_eatDecimalDigits(state)) {
  3465. min = state.lastIntValue;
  3466. if (state.eat(
  3467. 44
  3468. /* , */
  3469. ) && this.regexp_eatDecimalDigits(state)) {
  3470. max = state.lastIntValue;
  3471. }
  3472. if (state.eat(
  3473. 125
  3474. /* } */
  3475. )) {
  3476. if (max !== -1 && max < min && !noError) {
  3477. state.raise("numbers out of order in {} quantifier");
  3478. }
  3479. return true;
  3480. }
  3481. }
  3482. if (state.switchU && !noError) {
  3483. state.raise("Incomplete quantifier");
  3484. }
  3485. state.pos = start2;
  3486. }
  3487. return false;
  3488. };
  3489. pp$82.regexp_eatAtom = function(state) {
  3490. return this.regexp_eatPatternCharacters(state) || state.eat(
  3491. 46
  3492. /* . */
  3493. ) || this.regexp_eatReverseSolidusAtomEscape(state) || this.regexp_eatCharacterClass(state) || this.regexp_eatUncapturingGroup(state) || this.regexp_eatCapturingGroup(state);
  3494. };
  3495. pp$82.regexp_eatReverseSolidusAtomEscape = function(state) {
  3496. var start2 = state.pos;
  3497. if (state.eat(
  3498. 92
  3499. /* \ */
  3500. )) {
  3501. if (this.regexp_eatAtomEscape(state)) {
  3502. return true;
  3503. }
  3504. state.pos = start2;
  3505. }
  3506. return false;
  3507. };
  3508. pp$82.regexp_eatUncapturingGroup = function(state) {
  3509. var start2 = state.pos;
  3510. if (state.eat(
  3511. 40
  3512. /* ( */
  3513. )) {
  3514. if (state.eat(
  3515. 63
  3516. /* ? */
  3517. ) && state.eat(
  3518. 58
  3519. /* : */
  3520. )) {
  3521. this.regexp_disjunction(state);
  3522. if (state.eat(
  3523. 41
  3524. /* ) */
  3525. )) {
  3526. return true;
  3527. }
  3528. state.raise("Unterminated group");
  3529. }
  3530. state.pos = start2;
  3531. }
  3532. return false;
  3533. };
  3534. pp$82.regexp_eatCapturingGroup = function(state) {
  3535. if (state.eat(
  3536. 40
  3537. /* ( */
  3538. )) {
  3539. if (this.options.ecmaVersion >= 9) {
  3540. this.regexp_groupSpecifier(state);
  3541. } else if (state.current() === 63) {
  3542. state.raise("Invalid group");
  3543. }
  3544. this.regexp_disjunction(state);
  3545. if (state.eat(
  3546. 41
  3547. /* ) */
  3548. )) {
  3549. state.numCapturingParens += 1;
  3550. return true;
  3551. }
  3552. state.raise("Unterminated group");
  3553. }
  3554. return false;
  3555. };
  3556. pp$82.regexp_eatExtendedAtom = function(state) {
  3557. return state.eat(
  3558. 46
  3559. /* . */
  3560. ) || this.regexp_eatReverseSolidusAtomEscape(state) || this.regexp_eatCharacterClass(state) || this.regexp_eatUncapturingGroup(state) || this.regexp_eatCapturingGroup(state) || this.regexp_eatInvalidBracedQuantifier(state) || this.regexp_eatExtendedPatternCharacter(state);
  3561. };
  3562. pp$82.regexp_eatInvalidBracedQuantifier = function(state) {
  3563. if (this.regexp_eatBracedQuantifier(state, true)) {
  3564. state.raise("Nothing to repeat");
  3565. }
  3566. return false;
  3567. };
  3568. pp$82.regexp_eatSyntaxCharacter = function(state) {
  3569. var ch = state.current();
  3570. if (isSyntaxCharacter2(ch)) {
  3571. state.lastIntValue = ch;
  3572. state.advance();
  3573. return true;
  3574. }
  3575. return false;
  3576. };
  3577. function isSyntaxCharacter2(ch) {
  3578. return ch === 36 || ch >= 40 && ch <= 43 || ch === 46 || ch === 63 || ch >= 91 && ch <= 94 || ch >= 123 && ch <= 125;
  3579. }
  3580. pp$82.regexp_eatPatternCharacters = function(state) {
  3581. var start2 = state.pos;
  3582. var ch = 0;
  3583. while ((ch = state.current()) !== -1 && !isSyntaxCharacter2(ch)) {
  3584. state.advance();
  3585. }
  3586. return state.pos !== start2;
  3587. };
  3588. pp$82.regexp_eatExtendedPatternCharacter = function(state) {
  3589. var ch = state.current();
  3590. if (ch !== -1 && ch !== 36 && !(ch >= 40 && ch <= 43) && ch !== 46 && ch !== 63 && ch !== 91 && ch !== 94 && ch !== 124) {
  3591. state.advance();
  3592. return true;
  3593. }
  3594. return false;
  3595. };
  3596. pp$82.regexp_groupSpecifier = function(state) {
  3597. if (state.eat(
  3598. 63
  3599. /* ? */
  3600. )) {
  3601. if (this.regexp_eatGroupName(state)) {
  3602. if (state.groupNames.indexOf(state.lastStringValue) !== -1) {
  3603. state.raise("Duplicate capture group name");
  3604. }
  3605. state.groupNames.push(state.lastStringValue);
  3606. return;
  3607. }
  3608. state.raise("Invalid group");
  3609. }
  3610. };
  3611. pp$82.regexp_eatGroupName = function(state) {
  3612. state.lastStringValue = "";
  3613. if (state.eat(
  3614. 60
  3615. /* < */
  3616. )) {
  3617. if (this.regexp_eatRegExpIdentifierName(state) && state.eat(
  3618. 62
  3619. /* > */
  3620. )) {
  3621. return true;
  3622. }
  3623. state.raise("Invalid capture group name");
  3624. }
  3625. return false;
  3626. };
  3627. pp$82.regexp_eatRegExpIdentifierName = function(state) {
  3628. state.lastStringValue = "";
  3629. if (this.regexp_eatRegExpIdentifierStart(state)) {
  3630. state.lastStringValue += codePointToString2(state.lastIntValue);
  3631. while (this.regexp_eatRegExpIdentifierPart(state)) {
  3632. state.lastStringValue += codePointToString2(state.lastIntValue);
  3633. }
  3634. return true;
  3635. }
  3636. return false;
  3637. };
  3638. pp$82.regexp_eatRegExpIdentifierStart = function(state) {
  3639. var start2 = state.pos;
  3640. var forceU = this.options.ecmaVersion >= 11;
  3641. var ch = state.current(forceU);
  3642. state.advance(forceU);
  3643. if (ch === 92 && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) {
  3644. ch = state.lastIntValue;
  3645. }
  3646. if (isRegExpIdentifierStart2(ch)) {
  3647. state.lastIntValue = ch;
  3648. return true;
  3649. }
  3650. state.pos = start2;
  3651. return false;
  3652. };
  3653. function isRegExpIdentifierStart2(ch) {
  3654. return isIdentifierStart2(ch, true) || ch === 36 || ch === 95;
  3655. }
  3656. pp$82.regexp_eatRegExpIdentifierPart = function(state) {
  3657. var start2 = state.pos;
  3658. var forceU = this.options.ecmaVersion >= 11;
  3659. var ch = state.current(forceU);
  3660. state.advance(forceU);
  3661. if (ch === 92 && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) {
  3662. ch = state.lastIntValue;
  3663. }
  3664. if (isRegExpIdentifierPart2(ch)) {
  3665. state.lastIntValue = ch;
  3666. return true;
  3667. }
  3668. state.pos = start2;
  3669. return false;
  3670. };
  3671. function isRegExpIdentifierPart2(ch) {
  3672. return isIdentifierChar2(ch, true) || ch === 36 || ch === 95 || ch === 8204 || ch === 8205;
  3673. }
  3674. pp$82.regexp_eatAtomEscape = function(state) {
  3675. if (this.regexp_eatBackReference(state) || this.regexp_eatCharacterClassEscape(state) || this.regexp_eatCharacterEscape(state) || state.switchN && this.regexp_eatKGroupName(state)) {
  3676. return true;
  3677. }
  3678. if (state.switchU) {
  3679. if (state.current() === 99) {
  3680. state.raise("Invalid unicode escape");
  3681. }
  3682. state.raise("Invalid escape");
  3683. }
  3684. return false;
  3685. };
  3686. pp$82.regexp_eatBackReference = function(state) {
  3687. var start2 = state.pos;
  3688. if (this.regexp_eatDecimalEscape(state)) {
  3689. var n = state.lastIntValue;
  3690. if (state.switchU) {
  3691. if (n > state.maxBackReference) {
  3692. state.maxBackReference = n;
  3693. }
  3694. return true;
  3695. }
  3696. if (n <= state.numCapturingParens) {
  3697. return true;
  3698. }
  3699. state.pos = start2;
  3700. }
  3701. return false;
  3702. };
  3703. pp$82.regexp_eatKGroupName = function(state) {
  3704. if (state.eat(
  3705. 107
  3706. /* k */
  3707. )) {
  3708. if (this.regexp_eatGroupName(state)) {
  3709. state.backReferenceNames.push(state.lastStringValue);
  3710. return true;
  3711. }
  3712. state.raise("Invalid named reference");
  3713. }
  3714. return false;
  3715. };
  3716. pp$82.regexp_eatCharacterEscape = function(state) {
  3717. return this.regexp_eatControlEscape(state) || this.regexp_eatCControlLetter(state) || this.regexp_eatZero(state) || this.regexp_eatHexEscapeSequence(state) || this.regexp_eatRegExpUnicodeEscapeSequence(state, false) || !state.switchU && this.regexp_eatLegacyOctalEscapeSequence(state) || this.regexp_eatIdentityEscape(state);
  3718. };
  3719. pp$82.regexp_eatCControlLetter = function(state) {
  3720. var start2 = state.pos;
  3721. if (state.eat(
  3722. 99
  3723. /* c */
  3724. )) {
  3725. if (this.regexp_eatControlLetter(state)) {
  3726. return true;
  3727. }
  3728. state.pos = start2;
  3729. }
  3730. return false;
  3731. };
  3732. pp$82.regexp_eatZero = function(state) {
  3733. if (state.current() === 48 && !isDecimalDigit2(state.lookahead())) {
  3734. state.lastIntValue = 0;
  3735. state.advance();
  3736. return true;
  3737. }
  3738. return false;
  3739. };
  3740. pp$82.regexp_eatControlEscape = function(state) {
  3741. var ch = state.current();
  3742. if (ch === 116) {
  3743. state.lastIntValue = 9;
  3744. state.advance();
  3745. return true;
  3746. }
  3747. if (ch === 110) {
  3748. state.lastIntValue = 10;
  3749. state.advance();
  3750. return true;
  3751. }
  3752. if (ch === 118) {
  3753. state.lastIntValue = 11;
  3754. state.advance();
  3755. return true;
  3756. }
  3757. if (ch === 102) {
  3758. state.lastIntValue = 12;
  3759. state.advance();
  3760. return true;
  3761. }
  3762. if (ch === 114) {
  3763. state.lastIntValue = 13;
  3764. state.advance();
  3765. return true;
  3766. }
  3767. return false;
  3768. };
  3769. pp$82.regexp_eatControlLetter = function(state) {
  3770. var ch = state.current();
  3771. if (isControlLetter2(ch)) {
  3772. state.lastIntValue = ch % 32;
  3773. state.advance();
  3774. return true;
  3775. }
  3776. return false;
  3777. };
  3778. function isControlLetter2(ch) {
  3779. return ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122;
  3780. }
  3781. pp$82.regexp_eatRegExpUnicodeEscapeSequence = function(state, forceU) {
  3782. if (forceU === void 0) forceU = false;
  3783. var start2 = state.pos;
  3784. var switchU = forceU || state.switchU;
  3785. if (state.eat(
  3786. 117
  3787. /* u */
  3788. )) {
  3789. if (this.regexp_eatFixedHexDigits(state, 4)) {
  3790. var lead = state.lastIntValue;
  3791. if (switchU && lead >= 55296 && lead <= 56319) {
  3792. var leadSurrogateEnd = state.pos;
  3793. if (state.eat(
  3794. 92
  3795. /* \ */
  3796. ) && state.eat(
  3797. 117
  3798. /* u */
  3799. ) && this.regexp_eatFixedHexDigits(state, 4)) {
  3800. var trail = state.lastIntValue;
  3801. if (trail >= 56320 && trail <= 57343) {
  3802. state.lastIntValue = (lead - 55296) * 1024 + (trail - 56320) + 65536;
  3803. return true;
  3804. }
  3805. }
  3806. state.pos = leadSurrogateEnd;
  3807. state.lastIntValue = lead;
  3808. }
  3809. return true;
  3810. }
  3811. if (switchU && state.eat(
  3812. 123
  3813. /* { */
  3814. ) && this.regexp_eatHexDigits(state) && state.eat(
  3815. 125
  3816. /* } */
  3817. ) && isValidUnicode2(state.lastIntValue)) {
  3818. return true;
  3819. }
  3820. if (switchU) {
  3821. state.raise("Invalid unicode escape");
  3822. }
  3823. state.pos = start2;
  3824. }
  3825. return false;
  3826. };
  3827. function isValidUnicode2(ch) {
  3828. return ch >= 0 && ch <= 1114111;
  3829. }
  3830. pp$82.regexp_eatIdentityEscape = function(state) {
  3831. if (state.switchU) {
  3832. if (this.regexp_eatSyntaxCharacter(state)) {
  3833. return true;
  3834. }
  3835. if (state.eat(
  3836. 47
  3837. /* / */
  3838. )) {
  3839. state.lastIntValue = 47;
  3840. return true;
  3841. }
  3842. return false;
  3843. }
  3844. var ch = state.current();
  3845. if (ch !== 99 && (!state.switchN || ch !== 107)) {
  3846. state.lastIntValue = ch;
  3847. state.advance();
  3848. return true;
  3849. }
  3850. return false;
  3851. };
  3852. pp$82.regexp_eatDecimalEscape = function(state) {
  3853. state.lastIntValue = 0;
  3854. var ch = state.current();
  3855. if (ch >= 49 && ch <= 57) {
  3856. do {
  3857. state.lastIntValue = 10 * state.lastIntValue + (ch - 48);
  3858. state.advance();
  3859. } while ((ch = state.current()) >= 48 && ch <= 57);
  3860. return true;
  3861. }
  3862. return false;
  3863. };
  3864. pp$82.regexp_eatCharacterClassEscape = function(state) {
  3865. var ch = state.current();
  3866. if (isCharacterClassEscape2(ch)) {
  3867. state.lastIntValue = -1;
  3868. state.advance();
  3869. return true;
  3870. }
  3871. if (state.switchU && this.options.ecmaVersion >= 9 && (ch === 80 || ch === 112)) {
  3872. state.lastIntValue = -1;
  3873. state.advance();
  3874. if (state.eat(
  3875. 123
  3876. /* { */
  3877. ) && this.regexp_eatUnicodePropertyValueExpression(state) && state.eat(
  3878. 125
  3879. /* } */
  3880. )) {
  3881. return true;
  3882. }
  3883. state.raise("Invalid property name");
  3884. }
  3885. return false;
  3886. };
  3887. function isCharacterClassEscape2(ch) {
  3888. return ch === 100 || ch === 68 || ch === 115 || ch === 83 || ch === 119 || ch === 87;
  3889. }
  3890. pp$82.regexp_eatUnicodePropertyValueExpression = function(state) {
  3891. var start2 = state.pos;
  3892. if (this.regexp_eatUnicodePropertyName(state) && state.eat(
  3893. 61
  3894. /* = */
  3895. )) {
  3896. var name2 = state.lastStringValue;
  3897. if (this.regexp_eatUnicodePropertyValue(state)) {
  3898. var value = state.lastStringValue;
  3899. this.regexp_validateUnicodePropertyNameAndValue(state, name2, value);
  3900. return true;
  3901. }
  3902. }
  3903. state.pos = start2;
  3904. if (this.regexp_eatLoneUnicodePropertyNameOrValue(state)) {
  3905. var nameOrValue = state.lastStringValue;
  3906. this.regexp_validateUnicodePropertyNameOrValue(state, nameOrValue);
  3907. return true;
  3908. }
  3909. return false;
  3910. };
  3911. pp$82.regexp_validateUnicodePropertyNameAndValue = function(state, name2, value) {
  3912. if (!has(state.unicodeProperties.nonBinary, name2)) {
  3913. state.raise("Invalid property name");
  3914. }
  3915. if (!state.unicodeProperties.nonBinary[name2].test(value)) {
  3916. state.raise("Invalid property value");
  3917. }
  3918. };
  3919. pp$82.regexp_validateUnicodePropertyNameOrValue = function(state, nameOrValue) {
  3920. if (!state.unicodeProperties.binary.test(nameOrValue)) {
  3921. state.raise("Invalid property name");
  3922. }
  3923. };
  3924. pp$82.regexp_eatUnicodePropertyName = function(state) {
  3925. var ch = 0;
  3926. state.lastStringValue = "";
  3927. while (isUnicodePropertyNameCharacter2(ch = state.current())) {
  3928. state.lastStringValue += codePointToString2(ch);
  3929. state.advance();
  3930. }
  3931. return state.lastStringValue !== "";
  3932. };
  3933. function isUnicodePropertyNameCharacter2(ch) {
  3934. return isControlLetter2(ch) || ch === 95;
  3935. }
  3936. pp$82.regexp_eatUnicodePropertyValue = function(state) {
  3937. var ch = 0;
  3938. state.lastStringValue = "";
  3939. while (isUnicodePropertyValueCharacter2(ch = state.current())) {
  3940. state.lastStringValue += codePointToString2(ch);
  3941. state.advance();
  3942. }
  3943. return state.lastStringValue !== "";
  3944. };
  3945. function isUnicodePropertyValueCharacter2(ch) {
  3946. return isUnicodePropertyNameCharacter2(ch) || isDecimalDigit2(ch);
  3947. }
  3948. pp$82.regexp_eatLoneUnicodePropertyNameOrValue = function(state) {
  3949. return this.regexp_eatUnicodePropertyValue(state);
  3950. };
  3951. pp$82.regexp_eatCharacterClass = function(state) {
  3952. if (state.eat(
  3953. 91
  3954. /* [ */
  3955. )) {
  3956. state.eat(
  3957. 94
  3958. /* ^ */
  3959. );
  3960. this.regexp_classRanges(state);
  3961. if (state.eat(
  3962. 93
  3963. /* ] */
  3964. )) {
  3965. return true;
  3966. }
  3967. state.raise("Unterminated character class");
  3968. }
  3969. return false;
  3970. };
  3971. pp$82.regexp_classRanges = function(state) {
  3972. while (this.regexp_eatClassAtom(state)) {
  3973. var left = state.lastIntValue;
  3974. if (state.eat(
  3975. 45
  3976. /* - */
  3977. ) && this.regexp_eatClassAtom(state)) {
  3978. var right = state.lastIntValue;
  3979. if (state.switchU && (left === -1 || right === -1)) {
  3980. state.raise("Invalid character class");
  3981. }
  3982. if (left !== -1 && right !== -1 && left > right) {
  3983. state.raise("Range out of order in character class");
  3984. }
  3985. }
  3986. }
  3987. };
  3988. pp$82.regexp_eatClassAtom = function(state) {
  3989. var start2 = state.pos;
  3990. if (state.eat(
  3991. 92
  3992. /* \ */
  3993. )) {
  3994. if (this.regexp_eatClassEscape(state)) {
  3995. return true;
  3996. }
  3997. if (state.switchU) {
  3998. var ch$1 = state.current();
  3999. if (ch$1 === 99 || isOctalDigit2(ch$1)) {
  4000. state.raise("Invalid class escape");
  4001. }
  4002. state.raise("Invalid escape");
  4003. }
  4004. state.pos = start2;
  4005. }
  4006. var ch = state.current();
  4007. if (ch !== 93) {
  4008. state.lastIntValue = ch;
  4009. state.advance();
  4010. return true;
  4011. }
  4012. return false;
  4013. };
  4014. pp$82.regexp_eatClassEscape = function(state) {
  4015. var start2 = state.pos;
  4016. if (state.eat(
  4017. 98
  4018. /* b */
  4019. )) {
  4020. state.lastIntValue = 8;
  4021. return true;
  4022. }
  4023. if (state.switchU && state.eat(
  4024. 45
  4025. /* - */
  4026. )) {
  4027. state.lastIntValue = 45;
  4028. return true;
  4029. }
  4030. if (!state.switchU && state.eat(
  4031. 99
  4032. /* c */
  4033. )) {
  4034. if (this.regexp_eatClassControlLetter(state)) {
  4035. return true;
  4036. }
  4037. state.pos = start2;
  4038. }
  4039. return this.regexp_eatCharacterClassEscape(state) || this.regexp_eatCharacterEscape(state);
  4040. };
  4041. pp$82.regexp_eatClassControlLetter = function(state) {
  4042. var ch = state.current();
  4043. if (isDecimalDigit2(ch) || ch === 95) {
  4044. state.lastIntValue = ch % 32;
  4045. state.advance();
  4046. return true;
  4047. }
  4048. return false;
  4049. };
  4050. pp$82.regexp_eatHexEscapeSequence = function(state) {
  4051. var start2 = state.pos;
  4052. if (state.eat(
  4053. 120
  4054. /* x */
  4055. )) {
  4056. if (this.regexp_eatFixedHexDigits(state, 2)) {
  4057. return true;
  4058. }
  4059. if (state.switchU) {
  4060. state.raise("Invalid escape");
  4061. }
  4062. state.pos = start2;
  4063. }
  4064. return false;
  4065. };
  4066. pp$82.regexp_eatDecimalDigits = function(state) {
  4067. var start2 = state.pos;
  4068. var ch = 0;
  4069. state.lastIntValue = 0;
  4070. while (isDecimalDigit2(ch = state.current())) {
  4071. state.lastIntValue = 10 * state.lastIntValue + (ch - 48);
  4072. state.advance();
  4073. }
  4074. return state.pos !== start2;
  4075. };
  4076. function isDecimalDigit2(ch) {
  4077. return ch >= 48 && ch <= 57;
  4078. }
  4079. pp$82.regexp_eatHexDigits = function(state) {
  4080. var start2 = state.pos;
  4081. var ch = 0;
  4082. state.lastIntValue = 0;
  4083. while (isHexDigit2(ch = state.current())) {
  4084. state.lastIntValue = 16 * state.lastIntValue + hexToInt2(ch);
  4085. state.advance();
  4086. }
  4087. return state.pos !== start2;
  4088. };
  4089. function isHexDigit2(ch) {
  4090. return ch >= 48 && ch <= 57 || ch >= 65 && ch <= 70 || ch >= 97 && ch <= 102;
  4091. }
  4092. function hexToInt2(ch) {
  4093. if (ch >= 65 && ch <= 70) {
  4094. return 10 + (ch - 65);
  4095. }
  4096. if (ch >= 97 && ch <= 102) {
  4097. return 10 + (ch - 97);
  4098. }
  4099. return ch - 48;
  4100. }
  4101. pp$82.regexp_eatLegacyOctalEscapeSequence = function(state) {
  4102. if (this.regexp_eatOctalDigit(state)) {
  4103. var n1 = state.lastIntValue;
  4104. if (this.regexp_eatOctalDigit(state)) {
  4105. var n2 = state.lastIntValue;
  4106. if (n1 <= 3 && this.regexp_eatOctalDigit(state)) {
  4107. state.lastIntValue = n1 * 64 + n2 * 8 + state.lastIntValue;
  4108. } else {
  4109. state.lastIntValue = n1 * 8 + n2;
  4110. }
  4111. } else {
  4112. state.lastIntValue = n1;
  4113. }
  4114. return true;
  4115. }
  4116. return false;
  4117. };
  4118. pp$82.regexp_eatOctalDigit = function(state) {
  4119. var ch = state.current();
  4120. if (isOctalDigit2(ch)) {
  4121. state.lastIntValue = ch - 48;
  4122. state.advance();
  4123. return true;
  4124. }
  4125. state.lastIntValue = 0;
  4126. return false;
  4127. };
  4128. function isOctalDigit2(ch) {
  4129. return ch >= 48 && ch <= 55;
  4130. }
  4131. pp$82.regexp_eatFixedHexDigits = function(state, length) {
  4132. var start2 = state.pos;
  4133. state.lastIntValue = 0;
  4134. for (var i = 0; i < length; ++i) {
  4135. var ch = state.current();
  4136. if (!isHexDigit2(ch)) {
  4137. state.pos = start2;
  4138. return false;
  4139. }
  4140. state.lastIntValue = 16 * state.lastIntValue + hexToInt2(ch);
  4141. state.advance();
  4142. }
  4143. return true;
  4144. };
  4145. var Token3 = function Token4(p) {
  4146. this.type = p.type;
  4147. this.value = p.value;
  4148. this.start = p.start;
  4149. this.end = p.end;
  4150. if (p.options.locations) {
  4151. this.loc = new SourceLocation3(p, p.startLoc, p.endLoc);
  4152. }
  4153. if (p.options.ranges) {
  4154. this.range = [p.start, p.end];
  4155. }
  4156. };
  4157. var pp$92 = Parser3.prototype;
  4158. pp$92.next = function(ignoreEscapeSequenceInKeyword) {
  4159. if (!ignoreEscapeSequenceInKeyword && this.type.keyword && this.containsEsc) {
  4160. this.raiseRecoverable(this.start, "Escape sequence in keyword " + this.type.keyword);
  4161. }
  4162. if (this.options.onToken) {
  4163. this.options.onToken(new Token3(this));
  4164. }
  4165. this.lastTokEnd = this.end;
  4166. this.lastTokStart = this.start;
  4167. this.lastTokEndLoc = this.endLoc;
  4168. this.lastTokStartLoc = this.startLoc;
  4169. this.nextToken();
  4170. };
  4171. pp$92.getToken = function() {
  4172. this.next();
  4173. return new Token3(this);
  4174. };
  4175. if (typeof Symbol !== "undefined") {
  4176. pp$92[Symbol.iterator] = function() {
  4177. var this$1 = this;
  4178. return {
  4179. next: function() {
  4180. var token = this$1.getToken();
  4181. return {
  4182. done: token.type === types2.eof,
  4183. value: token
  4184. };
  4185. }
  4186. };
  4187. };
  4188. }
  4189. pp$92.curContext = function() {
  4190. return this.context[this.context.length - 1];
  4191. };
  4192. pp$92.nextToken = function() {
  4193. var curContext = this.curContext();
  4194. if (!curContext || !curContext.preserveSpace) {
  4195. this.skipSpace();
  4196. }
  4197. this.start = this.pos;
  4198. if (this.options.locations) {
  4199. this.startLoc = this.curPosition();
  4200. }
  4201. if (this.pos >= this.input.length) {
  4202. return this.finishToken(types2.eof);
  4203. }
  4204. if (curContext.override) {
  4205. return curContext.override(this);
  4206. } else {
  4207. this.readToken(this.fullCharCodeAtPos());
  4208. }
  4209. };
  4210. pp$92.readToken = function(code2) {
  4211. if (isIdentifierStart2(code2, this.options.ecmaVersion >= 6) || code2 === 92) {
  4212. return this.readWord();
  4213. }
  4214. return this.getTokenFromCode(code2);
  4215. };
  4216. pp$92.fullCharCodeAtPos = function() {
  4217. var code2 = this.input.charCodeAt(this.pos);
  4218. if (code2 <= 55295 || code2 >= 57344) {
  4219. return code2;
  4220. }
  4221. var next = this.input.charCodeAt(this.pos + 1);
  4222. return (code2 << 10) + next - 56613888;
  4223. };
  4224. pp$92.skipBlockComment = function() {
  4225. var startLoc = this.options.onComment && this.curPosition();
  4226. var start2 = this.pos, end = this.input.indexOf("*/", this.pos += 2);
  4227. if (end === -1) {
  4228. this.raise(this.pos - 2, "Unterminated comment");
  4229. }
  4230. this.pos = end + 2;
  4231. if (this.options.locations) {
  4232. lineBreakG2.lastIndex = start2;
  4233. var match;
  4234. while ((match = lineBreakG2.exec(this.input)) && match.index < this.pos) {
  4235. ++this.curLine;
  4236. this.lineStart = match.index + match[0].length;
  4237. }
  4238. }
  4239. if (this.options.onComment) {
  4240. this.options.onComment(
  4241. true,
  4242. this.input.slice(start2 + 2, end),
  4243. start2,
  4244. this.pos,
  4245. startLoc,
  4246. this.curPosition()
  4247. );
  4248. }
  4249. };
  4250. pp$92.skipLineComment = function(startSkip) {
  4251. var start2 = this.pos;
  4252. var startLoc = this.options.onComment && this.curPosition();
  4253. var ch = this.input.charCodeAt(this.pos += startSkip);
  4254. while (this.pos < this.input.length && !isNewLine2(ch)) {
  4255. ch = this.input.charCodeAt(++this.pos);
  4256. }
  4257. if (this.options.onComment) {
  4258. this.options.onComment(
  4259. false,
  4260. this.input.slice(start2 + startSkip, this.pos),
  4261. start2,
  4262. this.pos,
  4263. startLoc,
  4264. this.curPosition()
  4265. );
  4266. }
  4267. };
  4268. pp$92.skipSpace = function() {
  4269. loop: while (this.pos < this.input.length) {
  4270. var ch = this.input.charCodeAt(this.pos);
  4271. switch (ch) {
  4272. case 32:
  4273. case 160:
  4274. ++this.pos;
  4275. break;
  4276. case 13:
  4277. if (this.input.charCodeAt(this.pos + 1) === 10) {
  4278. ++this.pos;
  4279. }
  4280. case 10:
  4281. case 8232:
  4282. case 8233:
  4283. ++this.pos;
  4284. if (this.options.locations) {
  4285. ++this.curLine;
  4286. this.lineStart = this.pos;
  4287. }
  4288. break;
  4289. case 47:
  4290. switch (this.input.charCodeAt(this.pos + 1)) {
  4291. case 42:
  4292. this.skipBlockComment();
  4293. break;
  4294. case 47:
  4295. this.skipLineComment(2);
  4296. break;
  4297. default:
  4298. break loop;
  4299. }
  4300. break;
  4301. default:
  4302. if (ch > 8 && ch < 14 || ch >= 5760 && nonASCIIwhitespace2.test(String.fromCharCode(ch))) {
  4303. ++this.pos;
  4304. } else {
  4305. break loop;
  4306. }
  4307. }
  4308. }
  4309. };
  4310. pp$92.finishToken = function(type, val) {
  4311. this.end = this.pos;
  4312. if (this.options.locations) {
  4313. this.endLoc = this.curPosition();
  4314. }
  4315. var prevType = this.type;
  4316. this.type = type;
  4317. this.value = val;
  4318. this.updateContext(prevType);
  4319. };
  4320. pp$92.readToken_dot = function() {
  4321. var next = this.input.charCodeAt(this.pos + 1);
  4322. if (next >= 48 && next <= 57) {
  4323. return this.readNumber(true);
  4324. }
  4325. var next2 = this.input.charCodeAt(this.pos + 2);
  4326. if (this.options.ecmaVersion >= 6 && next === 46 && next2 === 46) {
  4327. this.pos += 3;
  4328. return this.finishToken(types2.ellipsis);
  4329. } else {
  4330. ++this.pos;
  4331. return this.finishToken(types2.dot);
  4332. }
  4333. };
  4334. pp$92.readToken_slash = function() {
  4335. var next = this.input.charCodeAt(this.pos + 1);
  4336. if (this.exprAllowed) {
  4337. ++this.pos;
  4338. return this.readRegexp();
  4339. }
  4340. if (next === 61) {
  4341. return this.finishOp(types2.assign, 2);
  4342. }
  4343. return this.finishOp(types2.slash, 1);
  4344. };
  4345. pp$92.readToken_mult_modulo_exp = function(code2) {
  4346. var next = this.input.charCodeAt(this.pos + 1);
  4347. var size = 1;
  4348. var tokentype = code2 === 42 ? types2.star : types2.modulo;
  4349. if (this.options.ecmaVersion >= 7 && code2 === 42 && next === 42) {
  4350. ++size;
  4351. tokentype = types2.starstar;
  4352. next = this.input.charCodeAt(this.pos + 2);
  4353. }
  4354. if (next === 61) {
  4355. return this.finishOp(types2.assign, size + 1);
  4356. }
  4357. return this.finishOp(tokentype, size);
  4358. };
  4359. pp$92.readToken_pipe_amp = function(code2) {
  4360. var next = this.input.charCodeAt(this.pos + 1);
  4361. if (next === code2) {
  4362. if (this.options.ecmaVersion >= 12) {
  4363. var next2 = this.input.charCodeAt(this.pos + 2);
  4364. if (next2 === 61) {
  4365. return this.finishOp(types2.assign, 3);
  4366. }
  4367. }
  4368. return this.finishOp(code2 === 124 ? types2.logicalOR : types2.logicalAND, 2);
  4369. }
  4370. if (next === 61) {
  4371. return this.finishOp(types2.assign, 2);
  4372. }
  4373. return this.finishOp(code2 === 124 ? types2.bitwiseOR : types2.bitwiseAND, 1);
  4374. };
  4375. pp$92.readToken_caret = function() {
  4376. var next = this.input.charCodeAt(this.pos + 1);
  4377. if (next === 61) {
  4378. return this.finishOp(types2.assign, 2);
  4379. }
  4380. return this.finishOp(types2.bitwiseXOR, 1);
  4381. };
  4382. pp$92.readToken_plus_min = function(code2) {
  4383. var next = this.input.charCodeAt(this.pos + 1);
  4384. if (next === code2) {
  4385. if (next === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 && (this.lastTokEnd === 0 || lineBreak2.test(this.input.slice(this.lastTokEnd, this.pos)))) {
  4386. this.skipLineComment(3);
  4387. this.skipSpace();
  4388. return this.nextToken();
  4389. }
  4390. return this.finishOp(types2.incDec, 2);
  4391. }
  4392. if (next === 61) {
  4393. return this.finishOp(types2.assign, 2);
  4394. }
  4395. return this.finishOp(types2.plusMin, 1);
  4396. };
  4397. pp$92.readToken_lt_gt = function(code2) {
  4398. var next = this.input.charCodeAt(this.pos + 1);
  4399. var size = 1;
  4400. if (next === code2) {
  4401. size = code2 === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2;
  4402. if (this.input.charCodeAt(this.pos + size) === 61) {
  4403. return this.finishOp(types2.assign, size + 1);
  4404. }
  4405. return this.finishOp(types2.bitShift, size);
  4406. }
  4407. if (next === 33 && code2 === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 && this.input.charCodeAt(this.pos + 3) === 45) {
  4408. this.skipLineComment(4);
  4409. this.skipSpace();
  4410. return this.nextToken();
  4411. }
  4412. if (next === 61) {
  4413. size = 2;
  4414. }
  4415. return this.finishOp(types2.relational, size);
  4416. };
  4417. pp$92.readToken_eq_excl = function(code2) {
  4418. var next = this.input.charCodeAt(this.pos + 1);
  4419. if (next === 61) {
  4420. return this.finishOp(types2.equality, this.input.charCodeAt(this.pos + 2) === 61 ? 3 : 2);
  4421. }
  4422. if (code2 === 61 && next === 62 && this.options.ecmaVersion >= 6) {
  4423. this.pos += 2;
  4424. return this.finishToken(types2.arrow);
  4425. }
  4426. return this.finishOp(code2 === 61 ? types2.eq : types2.prefix, 1);
  4427. };
  4428. pp$92.readToken_question = function() {
  4429. var ecmaVersion = this.options.ecmaVersion;
  4430. if (ecmaVersion >= 11) {
  4431. var next = this.input.charCodeAt(this.pos + 1);
  4432. if (next === 46) {
  4433. var next2 = this.input.charCodeAt(this.pos + 2);
  4434. if (next2 < 48 || next2 > 57) {
  4435. return this.finishOp(types2.questionDot, 2);
  4436. }
  4437. }
  4438. if (next === 63) {
  4439. if (ecmaVersion >= 12) {
  4440. var next2$1 = this.input.charCodeAt(this.pos + 2);
  4441. if (next2$1 === 61) {
  4442. return this.finishOp(types2.assign, 3);
  4443. }
  4444. }
  4445. return this.finishOp(types2.coalesce, 2);
  4446. }
  4447. }
  4448. return this.finishOp(types2.question, 1);
  4449. };
  4450. pp$92.getTokenFromCode = function(code2) {
  4451. switch (code2) {
  4452. case 46:
  4453. return this.readToken_dot();
  4454. case 40:
  4455. ++this.pos;
  4456. return this.finishToken(types2.parenL);
  4457. case 41:
  4458. ++this.pos;
  4459. return this.finishToken(types2.parenR);
  4460. case 59:
  4461. ++this.pos;
  4462. return this.finishToken(types2.semi);
  4463. case 44:
  4464. ++this.pos;
  4465. return this.finishToken(types2.comma);
  4466. case 91:
  4467. ++this.pos;
  4468. return this.finishToken(types2.bracketL);
  4469. case 93:
  4470. ++this.pos;
  4471. return this.finishToken(types2.bracketR);
  4472. case 123:
  4473. ++this.pos;
  4474. return this.finishToken(types2.braceL);
  4475. case 125:
  4476. ++this.pos;
  4477. return this.finishToken(types2.braceR);
  4478. case 58:
  4479. ++this.pos;
  4480. return this.finishToken(types2.colon);
  4481. case 96:
  4482. if (this.options.ecmaVersion < 6) {
  4483. break;
  4484. }
  4485. ++this.pos;
  4486. return this.finishToken(types2.backQuote);
  4487. case 48:
  4488. var next = this.input.charCodeAt(this.pos + 1);
  4489. if (next === 120 || next === 88) {
  4490. return this.readRadixNumber(16);
  4491. }
  4492. if (this.options.ecmaVersion >= 6) {
  4493. if (next === 111 || next === 79) {
  4494. return this.readRadixNumber(8);
  4495. }
  4496. if (next === 98 || next === 66) {
  4497. return this.readRadixNumber(2);
  4498. }
  4499. }
  4500. case 49:
  4501. case 50:
  4502. case 51:
  4503. case 52:
  4504. case 53:
  4505. case 54:
  4506. case 55:
  4507. case 56:
  4508. case 57:
  4509. return this.readNumber(false);
  4510. case 34:
  4511. case 39:
  4512. return this.readString(code2);
  4513. case 47:
  4514. return this.readToken_slash();
  4515. case 37:
  4516. case 42:
  4517. return this.readToken_mult_modulo_exp(code2);
  4518. case 124:
  4519. case 38:
  4520. return this.readToken_pipe_amp(code2);
  4521. case 94:
  4522. return this.readToken_caret();
  4523. case 43:
  4524. case 45:
  4525. return this.readToken_plus_min(code2);
  4526. case 60:
  4527. case 62:
  4528. return this.readToken_lt_gt(code2);
  4529. case 61:
  4530. case 33:
  4531. return this.readToken_eq_excl(code2);
  4532. case 63:
  4533. return this.readToken_question();
  4534. case 126:
  4535. return this.finishOp(types2.prefix, 1);
  4536. }
  4537. this.raise(this.pos, "Unexpected character '" + codePointToString$1(code2) + "'");
  4538. };
  4539. pp$92.finishOp = function(type, size) {
  4540. var str = this.input.slice(this.pos, this.pos + size);
  4541. this.pos += size;
  4542. return this.finishToken(type, str);
  4543. };
  4544. pp$92.readRegexp = function() {
  4545. var escaped, inClass, start2 = this.pos;
  4546. for (; ; ) {
  4547. if (this.pos >= this.input.length) {
  4548. this.raise(start2, "Unterminated regular expression");
  4549. }
  4550. var ch = this.input.charAt(this.pos);
  4551. if (lineBreak2.test(ch)) {
  4552. this.raise(start2, "Unterminated regular expression");
  4553. }
  4554. if (!escaped) {
  4555. if (ch === "[") {
  4556. inClass = true;
  4557. } else if (ch === "]" && inClass) {
  4558. inClass = false;
  4559. } else if (ch === "/" && !inClass) {
  4560. break;
  4561. }
  4562. escaped = ch === "\\";
  4563. } else {
  4564. escaped = false;
  4565. }
  4566. ++this.pos;
  4567. }
  4568. var pattern = this.input.slice(start2, this.pos);
  4569. ++this.pos;
  4570. var flagsStart = this.pos;
  4571. var flags = this.readWord1();
  4572. if (this.containsEsc) {
  4573. this.unexpected(flagsStart);
  4574. }
  4575. var state = this.regexpState || (this.regexpState = new RegExpValidationState3(this));
  4576. state.reset(start2, pattern, flags);
  4577. this.validateRegExpFlags(state);
  4578. this.validateRegExpPattern(state);
  4579. var value = null;
  4580. try {
  4581. value = new RegExp(pattern, flags);
  4582. } catch (e) {
  4583. }
  4584. return this.finishToken(types2.regexp, { pattern, flags, value });
  4585. };
  4586. pp$92.readInt = function(radix, len, maybeLegacyOctalNumericLiteral) {
  4587. var allowSeparators = this.options.ecmaVersion >= 12 && len === void 0;
  4588. var isLegacyOctalNumericLiteral = maybeLegacyOctalNumericLiteral && this.input.charCodeAt(this.pos) === 48;
  4589. var start2 = this.pos, total = 0, lastCode = 0;
  4590. for (var i = 0, e = len == null ? Infinity : len; i < e; ++i, ++this.pos) {
  4591. var code2 = this.input.charCodeAt(this.pos), val = void 0;
  4592. if (allowSeparators && code2 === 95) {
  4593. if (isLegacyOctalNumericLiteral) {
  4594. this.raiseRecoverable(this.pos, "Numeric separator is not allowed in legacy octal numeric literals");
  4595. }
  4596. if (lastCode === 95) {
  4597. this.raiseRecoverable(this.pos, "Numeric separator must be exactly one underscore");
  4598. }
  4599. if (i === 0) {
  4600. this.raiseRecoverable(this.pos, "Numeric separator is not allowed at the first of digits");
  4601. }
  4602. lastCode = code2;
  4603. continue;
  4604. }
  4605. if (code2 >= 97) {
  4606. val = code2 - 97 + 10;
  4607. } else if (code2 >= 65) {
  4608. val = code2 - 65 + 10;
  4609. } else if (code2 >= 48 && code2 <= 57) {
  4610. val = code2 - 48;
  4611. } else {
  4612. val = Infinity;
  4613. }
  4614. if (val >= radix) {
  4615. break;
  4616. }
  4617. lastCode = code2;
  4618. total = total * radix + val;
  4619. }
  4620. if (allowSeparators && lastCode === 95) {
  4621. this.raiseRecoverable(this.pos - 1, "Numeric separator is not allowed at the last of digits");
  4622. }
  4623. if (this.pos === start2 || len != null && this.pos - start2 !== len) {
  4624. return null;
  4625. }
  4626. return total;
  4627. };
  4628. function stringToNumber2(str, isLegacyOctalNumericLiteral) {
  4629. if (isLegacyOctalNumericLiteral) {
  4630. return parseInt(str, 8);
  4631. }
  4632. return parseFloat(str.replace(/_/g, ""));
  4633. }
  4634. function stringToBigInt2(str) {
  4635. if (typeof BigInt !== "function") {
  4636. return null;
  4637. }
  4638. return BigInt(str.replace(/_/g, ""));
  4639. }
  4640. pp$92.readRadixNumber = function(radix) {
  4641. var start2 = this.pos;
  4642. this.pos += 2;
  4643. var val = this.readInt(radix);
  4644. if (val == null) {
  4645. this.raise(this.start + 2, "Expected number in radix " + radix);
  4646. }
  4647. if (this.options.ecmaVersion >= 11 && this.input.charCodeAt(this.pos) === 110) {
  4648. val = stringToBigInt2(this.input.slice(start2, this.pos));
  4649. ++this.pos;
  4650. } else if (isIdentifierStart2(this.fullCharCodeAtPos())) {
  4651. this.raise(this.pos, "Identifier directly after number");
  4652. }
  4653. return this.finishToken(types2.num, val);
  4654. };
  4655. pp$92.readNumber = function(startsWithDot) {
  4656. var start2 = this.pos;
  4657. if (!startsWithDot && this.readInt(10, void 0, true) === null) {
  4658. this.raise(start2, "Invalid number");
  4659. }
  4660. var octal = this.pos - start2 >= 2 && this.input.charCodeAt(start2) === 48;
  4661. if (octal && this.strict) {
  4662. this.raise(start2, "Invalid number");
  4663. }
  4664. var next = this.input.charCodeAt(this.pos);
  4665. if (!octal && !startsWithDot && this.options.ecmaVersion >= 11 && next === 110) {
  4666. var val$1 = stringToBigInt2(this.input.slice(start2, this.pos));
  4667. ++this.pos;
  4668. if (isIdentifierStart2(this.fullCharCodeAtPos())) {
  4669. this.raise(this.pos, "Identifier directly after number");
  4670. }
  4671. return this.finishToken(types2.num, val$1);
  4672. }
  4673. if (octal && /[89]/.test(this.input.slice(start2, this.pos))) {
  4674. octal = false;
  4675. }
  4676. if (next === 46 && !octal) {
  4677. ++this.pos;
  4678. this.readInt(10);
  4679. next = this.input.charCodeAt(this.pos);
  4680. }
  4681. if ((next === 69 || next === 101) && !octal) {
  4682. next = this.input.charCodeAt(++this.pos);
  4683. if (next === 43 || next === 45) {
  4684. ++this.pos;
  4685. }
  4686. if (this.readInt(10) === null) {
  4687. this.raise(start2, "Invalid number");
  4688. }
  4689. }
  4690. if (isIdentifierStart2(this.fullCharCodeAtPos())) {
  4691. this.raise(this.pos, "Identifier directly after number");
  4692. }
  4693. var val = stringToNumber2(this.input.slice(start2, this.pos), octal);
  4694. return this.finishToken(types2.num, val);
  4695. };
  4696. pp$92.readCodePoint = function() {
  4697. var ch = this.input.charCodeAt(this.pos), code2;
  4698. if (ch === 123) {
  4699. if (this.options.ecmaVersion < 6) {
  4700. this.unexpected();
  4701. }
  4702. var codePos = ++this.pos;
  4703. code2 = this.readHexChar(this.input.indexOf("}", this.pos) - this.pos);
  4704. ++this.pos;
  4705. if (code2 > 1114111) {
  4706. this.invalidStringToken(codePos, "Code point out of bounds");
  4707. }
  4708. } else {
  4709. code2 = this.readHexChar(4);
  4710. }
  4711. return code2;
  4712. };
  4713. function codePointToString$1(code2) {
  4714. if (code2 <= 65535) {
  4715. return String.fromCharCode(code2);
  4716. }
  4717. code2 -= 65536;
  4718. return String.fromCharCode((code2 >> 10) + 55296, (code2 & 1023) + 56320);
  4719. }
  4720. pp$92.readString = function(quote) {
  4721. var out = "", chunkStart = ++this.pos;
  4722. for (; ; ) {
  4723. if (this.pos >= this.input.length) {
  4724. this.raise(this.start, "Unterminated string constant");
  4725. }
  4726. var ch = this.input.charCodeAt(this.pos);
  4727. if (ch === quote) {
  4728. break;
  4729. }
  4730. if (ch === 92) {
  4731. out += this.input.slice(chunkStart, this.pos);
  4732. out += this.readEscapedChar(false);
  4733. chunkStart = this.pos;
  4734. } else {
  4735. if (isNewLine2(ch, this.options.ecmaVersion >= 10)) {
  4736. this.raise(this.start, "Unterminated string constant");
  4737. }
  4738. ++this.pos;
  4739. }
  4740. }
  4741. out += this.input.slice(chunkStart, this.pos++);
  4742. return this.finishToken(types2.string, out);
  4743. };
  4744. var INVALID_TEMPLATE_ESCAPE_ERROR2 = {};
  4745. pp$92.tryReadTemplateToken = function() {
  4746. this.inTemplateElement = true;
  4747. try {
  4748. this.readTmplToken();
  4749. } catch (err) {
  4750. if (err === INVALID_TEMPLATE_ESCAPE_ERROR2) {
  4751. this.readInvalidTemplateToken();
  4752. } else {
  4753. throw err;
  4754. }
  4755. }
  4756. this.inTemplateElement = false;
  4757. };
  4758. pp$92.invalidStringToken = function(position3, message) {
  4759. if (this.inTemplateElement && this.options.ecmaVersion >= 9) {
  4760. throw INVALID_TEMPLATE_ESCAPE_ERROR2;
  4761. } else {
  4762. this.raise(position3, message);
  4763. }
  4764. };
  4765. pp$92.readTmplToken = function() {
  4766. var out = "", chunkStart = this.pos;
  4767. for (; ; ) {
  4768. if (this.pos >= this.input.length) {
  4769. this.raise(this.start, "Unterminated template");
  4770. }
  4771. var ch = this.input.charCodeAt(this.pos);
  4772. if (ch === 96 || ch === 36 && this.input.charCodeAt(this.pos + 1) === 123) {
  4773. if (this.pos === this.start && (this.type === types2.template || this.type === types2.invalidTemplate)) {
  4774. if (ch === 36) {
  4775. this.pos += 2;
  4776. return this.finishToken(types2.dollarBraceL);
  4777. } else {
  4778. ++this.pos;
  4779. return this.finishToken(types2.backQuote);
  4780. }
  4781. }
  4782. out += this.input.slice(chunkStart, this.pos);
  4783. return this.finishToken(types2.template, out);
  4784. }
  4785. if (ch === 92) {
  4786. out += this.input.slice(chunkStart, this.pos);
  4787. out += this.readEscapedChar(true);
  4788. chunkStart = this.pos;
  4789. } else if (isNewLine2(ch)) {
  4790. out += this.input.slice(chunkStart, this.pos);
  4791. ++this.pos;
  4792. switch (ch) {
  4793. case 13:
  4794. if (this.input.charCodeAt(this.pos) === 10) {
  4795. ++this.pos;
  4796. }
  4797. case 10:
  4798. out += "\n";
  4799. break;
  4800. default:
  4801. out += String.fromCharCode(ch);
  4802. break;
  4803. }
  4804. if (this.options.locations) {
  4805. ++this.curLine;
  4806. this.lineStart = this.pos;
  4807. }
  4808. chunkStart = this.pos;
  4809. } else {
  4810. ++this.pos;
  4811. }
  4812. }
  4813. };
  4814. pp$92.readInvalidTemplateToken = function() {
  4815. for (; this.pos < this.input.length; this.pos++) {
  4816. switch (this.input[this.pos]) {
  4817. case "\\":
  4818. ++this.pos;
  4819. break;
  4820. case "$":
  4821. if (this.input[this.pos + 1] !== "{") {
  4822. break;
  4823. }
  4824. case "`":
  4825. return this.finishToken(types2.invalidTemplate, this.input.slice(this.start, this.pos));
  4826. }
  4827. }
  4828. this.raise(this.start, "Unterminated template");
  4829. };
  4830. pp$92.readEscapedChar = function(inTemplate) {
  4831. var ch = this.input.charCodeAt(++this.pos);
  4832. ++this.pos;
  4833. switch (ch) {
  4834. case 110:
  4835. return "\n";
  4836. case 114:
  4837. return "\r";
  4838. case 120:
  4839. return String.fromCharCode(this.readHexChar(2));
  4840. case 117:
  4841. return codePointToString$1(this.readCodePoint());
  4842. case 116:
  4843. return " ";
  4844. case 98:
  4845. return "\b";
  4846. case 118:
  4847. return "\v";
  4848. case 102:
  4849. return "\f";
  4850. case 13:
  4851. if (this.input.charCodeAt(this.pos) === 10) {
  4852. ++this.pos;
  4853. }
  4854. case 10:
  4855. if (this.options.locations) {
  4856. this.lineStart = this.pos;
  4857. ++this.curLine;
  4858. }
  4859. return "";
  4860. case 56:
  4861. case 57:
  4862. if (inTemplate) {
  4863. var codePos = this.pos - 1;
  4864. this.invalidStringToken(
  4865. codePos,
  4866. "Invalid escape sequence in template string"
  4867. );
  4868. return null;
  4869. }
  4870. default:
  4871. if (ch >= 48 && ch <= 55) {
  4872. var octalStr = this.input.substr(this.pos - 1, 3).match(/^[0-7]+/)[0];
  4873. var octal = parseInt(octalStr, 8);
  4874. if (octal > 255) {
  4875. octalStr = octalStr.slice(0, -1);
  4876. octal = parseInt(octalStr, 8);
  4877. }
  4878. this.pos += octalStr.length - 1;
  4879. ch = this.input.charCodeAt(this.pos);
  4880. if ((octalStr !== "0" || ch === 56 || ch === 57) && (this.strict || inTemplate)) {
  4881. this.invalidStringToken(
  4882. this.pos - 1 - octalStr.length,
  4883. inTemplate ? "Octal literal in template string" : "Octal literal in strict mode"
  4884. );
  4885. }
  4886. return String.fromCharCode(octal);
  4887. }
  4888. if (isNewLine2(ch)) {
  4889. return "";
  4890. }
  4891. return String.fromCharCode(ch);
  4892. }
  4893. };
  4894. pp$92.readHexChar = function(len) {
  4895. var codePos = this.pos;
  4896. var n = this.readInt(16, len);
  4897. if (n === null) {
  4898. this.invalidStringToken(codePos, "Bad character escape sequence");
  4899. }
  4900. return n;
  4901. };
  4902. pp$92.readWord1 = function() {
  4903. this.containsEsc = false;
  4904. var word = "", first = true, chunkStart = this.pos;
  4905. var astral = this.options.ecmaVersion >= 6;
  4906. while (this.pos < this.input.length) {
  4907. var ch = this.fullCharCodeAtPos();
  4908. if (isIdentifierChar2(ch, astral)) {
  4909. this.pos += ch <= 65535 ? 1 : 2;
  4910. } else if (ch === 92) {
  4911. this.containsEsc = true;
  4912. word += this.input.slice(chunkStart, this.pos);
  4913. var escStart = this.pos;
  4914. if (this.input.charCodeAt(++this.pos) !== 117) {
  4915. this.invalidStringToken(this.pos, "Expecting Unicode escape sequence \\uXXXX");
  4916. }
  4917. ++this.pos;
  4918. var esc = this.readCodePoint();
  4919. if (!(first ? isIdentifierStart2 : isIdentifierChar2)(esc, astral)) {
  4920. this.invalidStringToken(escStart, "Invalid Unicode escape");
  4921. }
  4922. word += codePointToString$1(esc);
  4923. chunkStart = this.pos;
  4924. } else {
  4925. break;
  4926. }
  4927. first = false;
  4928. }
  4929. return word + this.input.slice(chunkStart, this.pos);
  4930. };
  4931. pp$92.readWord = function() {
  4932. var word = this.readWord1();
  4933. var type = types2.name;
  4934. if (this.keywords.test(word)) {
  4935. type = keywords$12[word];
  4936. }
  4937. return this.finishToken(type, word);
  4938. };
  4939. var version2 = "7.4.1";
  4940. Parser3.acorn = {
  4941. Parser: Parser3,
  4942. version: version2,
  4943. defaultOptions: defaultOptions2,
  4944. Position: Position3,
  4945. SourceLocation: SourceLocation3,
  4946. getLineInfo: getLineInfo2,
  4947. Node: Node3,
  4948. TokenType: TokenType3,
  4949. tokTypes: types2,
  4950. keywordTypes: keywords$12,
  4951. TokContext: TokContext3,
  4952. tokContexts: types$12,
  4953. isIdentifierChar: isIdentifierChar2,
  4954. isIdentifierStart: isIdentifierStart2,
  4955. Token: Token3,
  4956. isNewLine: isNewLine2,
  4957. lineBreak: lineBreak2,
  4958. lineBreakG: lineBreakG2,
  4959. nonASCIIwhitespace: nonASCIIwhitespace2
  4960. };
  4961. function parse4(input, options) {
  4962. return Parser3.parse(input, options);
  4963. }
  4964. function parseExpressionAt2(input, pos, options) {
  4965. return Parser3.parseExpressionAt(input, pos, options);
  4966. }
  4967. function tokenizer2(input, options) {
  4968. return Parser3.tokenizer(input, options);
  4969. }
  4970. exports3.Node = Node3;
  4971. exports3.Parser = Parser3;
  4972. exports3.Position = Position3;
  4973. exports3.SourceLocation = SourceLocation3;
  4974. exports3.TokContext = TokContext3;
  4975. exports3.Token = Token3;
  4976. exports3.TokenType = TokenType3;
  4977. exports3.defaultOptions = defaultOptions2;
  4978. exports3.getLineInfo = getLineInfo2;
  4979. exports3.isIdentifierChar = isIdentifierChar2;
  4980. exports3.isIdentifierStart = isIdentifierStart2;
  4981. exports3.isNewLine = isNewLine2;
  4982. exports3.keywordTypes = keywords$12;
  4983. exports3.lineBreak = lineBreak2;
  4984. exports3.lineBreakG = lineBreakG2;
  4985. exports3.nonASCIIwhitespace = nonASCIIwhitespace2;
  4986. exports3.parse = parse4;
  4987. exports3.parseExpressionAt = parseExpressionAt2;
  4988. exports3.tokContexts = types$12;
  4989. exports3.tokTypes = types2;
  4990. exports3.tokenizer = tokenizer2;
  4991. exports3.version = version2;
  4992. Object.defineProperty(exports3, "__esModule", { value: true });
  4993. });
  4994. }
  4995. });
  4996. // node_modules/micromark-extension-mdxjs/node_modules/acorn-jsx/index.js
  4997. var require_acorn_jsx = __commonJS({
  4998. "node_modules/micromark-extension-mdxjs/node_modules/acorn-jsx/index.js"(exports2, module2) {
  4999. "use strict";
  5000. var XHTMLEntities = require_xhtml();
  5001. var hexNumber = /^[\da-fA-F]+$/;
  5002. var decimalNumber = /^\d+$/;
  5003. var acornJsxMap = /* @__PURE__ */ new WeakMap();
  5004. function getJsxTokens(acorn) {
  5005. acorn = acorn.Parser.acorn || acorn;
  5006. let acornJsx2 = acornJsxMap.get(acorn);
  5007. if (!acornJsx2) {
  5008. const tt = acorn.tokTypes;
  5009. const TokContext3 = acorn.TokContext;
  5010. const TokenType3 = acorn.TokenType;
  5011. const tc_oTag = new TokContext3("<tag", false);
  5012. const tc_cTag = new TokContext3("</tag", false);
  5013. const tc_expr = new TokContext3("<tag>...</tag>", true, true);
  5014. const tokContexts = {
  5015. tc_oTag,
  5016. tc_cTag,
  5017. tc_expr
  5018. };
  5019. const tokTypes = {
  5020. jsxName: new TokenType3("jsxName"),
  5021. jsxText: new TokenType3("jsxText", { beforeExpr: true }),
  5022. jsxTagStart: new TokenType3("jsxTagStart", { startsExpr: true }),
  5023. jsxTagEnd: new TokenType3("jsxTagEnd")
  5024. };
  5025. tokTypes.jsxTagStart.updateContext = function() {
  5026. this.context.push(tc_expr);
  5027. this.context.push(tc_oTag);
  5028. this.exprAllowed = false;
  5029. };
  5030. tokTypes.jsxTagEnd.updateContext = function(prevType) {
  5031. let out = this.context.pop();
  5032. if (out === tc_oTag && prevType === tt.slash || out === tc_cTag) {
  5033. this.context.pop();
  5034. this.exprAllowed = this.curContext() === tc_expr;
  5035. } else {
  5036. this.exprAllowed = true;
  5037. }
  5038. };
  5039. acornJsx2 = { tokContexts, tokTypes };
  5040. acornJsxMap.set(acorn, acornJsx2);
  5041. }
  5042. return acornJsx2;
  5043. }
  5044. function getQualifiedJSXName(object) {
  5045. if (!object)
  5046. return object;
  5047. if (object.type === "JSXIdentifier")
  5048. return object.name;
  5049. if (object.type === "JSXNamespacedName")
  5050. return object.namespace.name + ":" + object.name.name;
  5051. if (object.type === "JSXMemberExpression")
  5052. return getQualifiedJSXName(object.object) + "." + getQualifiedJSXName(object.property);
  5053. }
  5054. module2.exports = function(options) {
  5055. options = options || {};
  5056. return function(Parser3) {
  5057. return plugin({
  5058. allowNamespaces: options.allowNamespaces !== false,
  5059. allowNamespacedObjects: !!options.allowNamespacedObjects
  5060. }, Parser3);
  5061. };
  5062. };
  5063. Object.defineProperty(module2.exports, "tokTypes", {
  5064. get: function get_tokTypes() {
  5065. return getJsxTokens(require_acorn()).tokTypes;
  5066. },
  5067. configurable: true,
  5068. enumerable: true
  5069. });
  5070. function plugin(options, Parser3) {
  5071. const acorn = Parser3.acorn || require_acorn();
  5072. const acornJsx2 = getJsxTokens(acorn);
  5073. const tt = acorn.tokTypes;
  5074. const tok = acornJsx2.tokTypes;
  5075. const tokContexts = acorn.tokContexts;
  5076. const tc_oTag = acornJsx2.tokContexts.tc_oTag;
  5077. const tc_cTag = acornJsx2.tokContexts.tc_cTag;
  5078. const tc_expr = acornJsx2.tokContexts.tc_expr;
  5079. const isNewLine2 = acorn.isNewLine;
  5080. const isIdentifierStart2 = acorn.isIdentifierStart;
  5081. const isIdentifierChar2 = acorn.isIdentifierChar;
  5082. return class extends Parser3 {
  5083. // Expose actual `tokTypes` and `tokContexts` to other plugins.
  5084. static get acornJsx() {
  5085. return acornJsx2;
  5086. }
  5087. // Reads inline JSX contents token.
  5088. jsx_readToken() {
  5089. let out = "", chunkStart = this.pos;
  5090. for (; ; ) {
  5091. if (this.pos >= this.input.length)
  5092. this.raise(this.start, "Unterminated JSX contents");
  5093. let ch = this.input.charCodeAt(this.pos);
  5094. switch (ch) {
  5095. case 60:
  5096. case 123:
  5097. if (this.pos === this.start) {
  5098. if (ch === 60 && this.exprAllowed) {
  5099. ++this.pos;
  5100. return this.finishToken(tok.jsxTagStart);
  5101. }
  5102. return this.getTokenFromCode(ch);
  5103. }
  5104. out += this.input.slice(chunkStart, this.pos);
  5105. return this.finishToken(tok.jsxText, out);
  5106. case 38:
  5107. out += this.input.slice(chunkStart, this.pos);
  5108. out += this.jsx_readEntity();
  5109. chunkStart = this.pos;
  5110. break;
  5111. case 62:
  5112. case 125:
  5113. this.raise(
  5114. this.pos,
  5115. "Unexpected token `" + this.input[this.pos] + "`. Did you mean `" + (ch === 62 ? "&gt;" : "&rbrace;") + '` or `{"' + this.input[this.pos] + '"}`?'
  5116. );
  5117. default:
  5118. if (isNewLine2(ch)) {
  5119. out += this.input.slice(chunkStart, this.pos);
  5120. out += this.jsx_readNewLine(true);
  5121. chunkStart = this.pos;
  5122. } else {
  5123. ++this.pos;
  5124. }
  5125. }
  5126. }
  5127. }
  5128. jsx_readNewLine(normalizeCRLF) {
  5129. let ch = this.input.charCodeAt(this.pos);
  5130. let out;
  5131. ++this.pos;
  5132. if (ch === 13 && this.input.charCodeAt(this.pos) === 10) {
  5133. ++this.pos;
  5134. out = normalizeCRLF ? "\n" : "\r\n";
  5135. } else {
  5136. out = String.fromCharCode(ch);
  5137. }
  5138. if (this.options.locations) {
  5139. ++this.curLine;
  5140. this.lineStart = this.pos;
  5141. }
  5142. return out;
  5143. }
  5144. jsx_readString(quote) {
  5145. let out = "", chunkStart = ++this.pos;
  5146. for (; ; ) {
  5147. if (this.pos >= this.input.length)
  5148. this.raise(this.start, "Unterminated string constant");
  5149. let ch = this.input.charCodeAt(this.pos);
  5150. if (ch === quote) break;
  5151. if (ch === 38) {
  5152. out += this.input.slice(chunkStart, this.pos);
  5153. out += this.jsx_readEntity();
  5154. chunkStart = this.pos;
  5155. } else if (isNewLine2(ch)) {
  5156. out += this.input.slice(chunkStart, this.pos);
  5157. out += this.jsx_readNewLine(false);
  5158. chunkStart = this.pos;
  5159. } else {
  5160. ++this.pos;
  5161. }
  5162. }
  5163. out += this.input.slice(chunkStart, this.pos++);
  5164. return this.finishToken(tt.string, out);
  5165. }
  5166. jsx_readEntity() {
  5167. let str = "", count = 0, entity;
  5168. let ch = this.input[this.pos];
  5169. if (ch !== "&")
  5170. this.raise(this.pos, "Entity must start with an ampersand");
  5171. let startPos = ++this.pos;
  5172. while (this.pos < this.input.length && count++ < 10) {
  5173. ch = this.input[this.pos++];
  5174. if (ch === ";") {
  5175. if (str[0] === "#") {
  5176. if (str[1] === "x") {
  5177. str = str.substr(2);
  5178. if (hexNumber.test(str))
  5179. entity = String.fromCharCode(parseInt(str, 16));
  5180. } else {
  5181. str = str.substr(1);
  5182. if (decimalNumber.test(str))
  5183. entity = String.fromCharCode(parseInt(str, 10));
  5184. }
  5185. } else {
  5186. entity = XHTMLEntities[str];
  5187. }
  5188. break;
  5189. }
  5190. str += ch;
  5191. }
  5192. if (!entity) {
  5193. this.pos = startPos;
  5194. return "&";
  5195. }
  5196. return entity;
  5197. }
  5198. // Read a JSX identifier (valid tag or attribute name).
  5199. //
  5200. // Optimized version since JSX identifiers can't contain
  5201. // escape characters and so can be read as single slice.
  5202. // Also assumes that first character was already checked
  5203. // by isIdentifierStart in readToken.
  5204. jsx_readWord() {
  5205. let ch, start2 = this.pos;
  5206. do {
  5207. ch = this.input.charCodeAt(++this.pos);
  5208. } while (isIdentifierChar2(ch) || ch === 45);
  5209. return this.finishToken(tok.jsxName, this.input.slice(start2, this.pos));
  5210. }
  5211. // Parse next token as JSX identifier
  5212. jsx_parseIdentifier() {
  5213. let node2 = this.startNode();
  5214. if (this.type === tok.jsxName)
  5215. node2.name = this.value;
  5216. else if (this.type.keyword)
  5217. node2.name = this.type.keyword;
  5218. else
  5219. this.unexpected();
  5220. this.next();
  5221. return this.finishNode(node2, "JSXIdentifier");
  5222. }
  5223. // Parse namespaced identifier.
  5224. jsx_parseNamespacedName() {
  5225. let startPos = this.start, startLoc = this.startLoc;
  5226. let name2 = this.jsx_parseIdentifier();
  5227. if (!options.allowNamespaces || !this.eat(tt.colon)) return name2;
  5228. var node2 = this.startNodeAt(startPos, startLoc);
  5229. node2.namespace = name2;
  5230. node2.name = this.jsx_parseIdentifier();
  5231. return this.finishNode(node2, "JSXNamespacedName");
  5232. }
  5233. // Parses element name in any form - namespaced, member
  5234. // or single identifier.
  5235. jsx_parseElementName() {
  5236. if (this.type === tok.jsxTagEnd) return "";
  5237. let startPos = this.start, startLoc = this.startLoc;
  5238. let node2 = this.jsx_parseNamespacedName();
  5239. if (this.type === tt.dot && node2.type === "JSXNamespacedName" && !options.allowNamespacedObjects) {
  5240. this.unexpected();
  5241. }
  5242. while (this.eat(tt.dot)) {
  5243. let newNode = this.startNodeAt(startPos, startLoc);
  5244. newNode.object = node2;
  5245. newNode.property = this.jsx_parseIdentifier();
  5246. node2 = this.finishNode(newNode, "JSXMemberExpression");
  5247. }
  5248. return node2;
  5249. }
  5250. // Parses any type of JSX attribute value.
  5251. jsx_parseAttributeValue() {
  5252. switch (this.type) {
  5253. case tt.braceL:
  5254. let node2 = this.jsx_parseExpressionContainer();
  5255. if (node2.expression.type === "JSXEmptyExpression")
  5256. this.raise(node2.start, "JSX attributes must only be assigned a non-empty expression");
  5257. return node2;
  5258. case tok.jsxTagStart:
  5259. case tt.string:
  5260. return this.parseExprAtom();
  5261. default:
  5262. this.raise(this.start, "JSX value should be either an expression or a quoted JSX text");
  5263. }
  5264. }
  5265. // JSXEmptyExpression is unique type since it doesn't actually parse anything,
  5266. // and so it should start at the end of last read token (left brace) and finish
  5267. // at the beginning of the next one (right brace).
  5268. jsx_parseEmptyExpression() {
  5269. let node2 = this.startNodeAt(this.lastTokEnd, this.lastTokEndLoc);
  5270. return this.finishNodeAt(node2, "JSXEmptyExpression", this.start, this.startLoc);
  5271. }
  5272. // Parses JSX expression enclosed into curly brackets.
  5273. jsx_parseExpressionContainer() {
  5274. let node2 = this.startNode();
  5275. this.next();
  5276. node2.expression = this.type === tt.braceR ? this.jsx_parseEmptyExpression() : this.parseExpression();
  5277. this.expect(tt.braceR);
  5278. return this.finishNode(node2, "JSXExpressionContainer");
  5279. }
  5280. // Parses following JSX attribute name-value pair.
  5281. jsx_parseAttribute() {
  5282. let node2 = this.startNode();
  5283. if (this.eat(tt.braceL)) {
  5284. this.expect(tt.ellipsis);
  5285. node2.argument = this.parseMaybeAssign();
  5286. this.expect(tt.braceR);
  5287. return this.finishNode(node2, "JSXSpreadAttribute");
  5288. }
  5289. node2.name = this.jsx_parseNamespacedName();
  5290. node2.value = this.eat(tt.eq) ? this.jsx_parseAttributeValue() : null;
  5291. return this.finishNode(node2, "JSXAttribute");
  5292. }
  5293. // Parses JSX opening tag starting after '<'.
  5294. jsx_parseOpeningElementAt(startPos, startLoc) {
  5295. let node2 = this.startNodeAt(startPos, startLoc);
  5296. node2.attributes = [];
  5297. let nodeName = this.jsx_parseElementName();
  5298. if (nodeName) node2.name = nodeName;
  5299. while (this.type !== tt.slash && this.type !== tok.jsxTagEnd)
  5300. node2.attributes.push(this.jsx_parseAttribute());
  5301. node2.selfClosing = this.eat(tt.slash);
  5302. this.expect(tok.jsxTagEnd);
  5303. return this.finishNode(node2, nodeName ? "JSXOpeningElement" : "JSXOpeningFragment");
  5304. }
  5305. // Parses JSX closing tag starting after '</'.
  5306. jsx_parseClosingElementAt(startPos, startLoc) {
  5307. let node2 = this.startNodeAt(startPos, startLoc);
  5308. let nodeName = this.jsx_parseElementName();
  5309. if (nodeName) node2.name = nodeName;
  5310. this.expect(tok.jsxTagEnd);
  5311. return this.finishNode(node2, nodeName ? "JSXClosingElement" : "JSXClosingFragment");
  5312. }
  5313. // Parses entire JSX element, including it's opening tag
  5314. // (starting after '<'), attributes, contents and closing tag.
  5315. jsx_parseElementAt(startPos, startLoc) {
  5316. let node2 = this.startNodeAt(startPos, startLoc);
  5317. let children = [];
  5318. let openingElement = this.jsx_parseOpeningElementAt(startPos, startLoc);
  5319. let closingElement = null;
  5320. if (!openingElement.selfClosing) {
  5321. contents: for (; ; ) {
  5322. switch (this.type) {
  5323. case tok.jsxTagStart:
  5324. startPos = this.start;
  5325. startLoc = this.startLoc;
  5326. this.next();
  5327. if (this.eat(tt.slash)) {
  5328. closingElement = this.jsx_parseClosingElementAt(startPos, startLoc);
  5329. break contents;
  5330. }
  5331. children.push(this.jsx_parseElementAt(startPos, startLoc));
  5332. break;
  5333. case tok.jsxText:
  5334. children.push(this.parseExprAtom());
  5335. break;
  5336. case tt.braceL:
  5337. children.push(this.jsx_parseExpressionContainer());
  5338. break;
  5339. default:
  5340. this.unexpected();
  5341. }
  5342. }
  5343. if (getQualifiedJSXName(closingElement.name) !== getQualifiedJSXName(openingElement.name)) {
  5344. this.raise(
  5345. closingElement.start,
  5346. "Expected corresponding JSX closing tag for <" + getQualifiedJSXName(openingElement.name) + ">"
  5347. );
  5348. }
  5349. }
  5350. let fragmentOrElement = openingElement.name ? "Element" : "Fragment";
  5351. node2["opening" + fragmentOrElement] = openingElement;
  5352. node2["closing" + fragmentOrElement] = closingElement;
  5353. node2.children = children;
  5354. if (this.type === tt.relational && this.value === "<") {
  5355. this.raise(this.start, "Adjacent JSX elements must be wrapped in an enclosing tag");
  5356. }
  5357. return this.finishNode(node2, "JSX" + fragmentOrElement);
  5358. }
  5359. // Parse JSX text
  5360. jsx_parseText() {
  5361. let node2 = this.parseLiteral(this.value);
  5362. node2.type = "JSXText";
  5363. return node2;
  5364. }
  5365. // Parses entire JSX element from current position.
  5366. jsx_parseElement() {
  5367. let startPos = this.start, startLoc = this.startLoc;
  5368. this.next();
  5369. return this.jsx_parseElementAt(startPos, startLoc);
  5370. }
  5371. parseExprAtom(refShortHandDefaultPos) {
  5372. if (this.type === tok.jsxText)
  5373. return this.jsx_parseText();
  5374. else if (this.type === tok.jsxTagStart)
  5375. return this.jsx_parseElement();
  5376. else
  5377. return super.parseExprAtom(refShortHandDefaultPos);
  5378. }
  5379. readToken(code2) {
  5380. let context = this.curContext();
  5381. if (context === tc_expr) return this.jsx_readToken();
  5382. if (context === tc_oTag || context === tc_cTag) {
  5383. if (isIdentifierStart2(code2)) return this.jsx_readWord();
  5384. if (code2 == 62) {
  5385. ++this.pos;
  5386. return this.finishToken(tok.jsxTagEnd);
  5387. }
  5388. if ((code2 === 34 || code2 === 39) && context == tc_oTag)
  5389. return this.jsx_readString(code2);
  5390. }
  5391. if (code2 === 60 && this.exprAllowed && this.input.charCodeAt(this.pos + 1) !== 33) {
  5392. ++this.pos;
  5393. return this.finishToken(tok.jsxTagStart);
  5394. }
  5395. return super.readToken(code2);
  5396. }
  5397. updateContext(prevType) {
  5398. if (this.type == tt.braceL) {
  5399. var curContext = this.curContext();
  5400. if (curContext == tc_oTag) this.context.push(tokContexts.b_expr);
  5401. else if (curContext == tc_expr) this.context.push(tokContexts.b_tmpl);
  5402. else super.updateContext(prevType);
  5403. this.exprAllowed = true;
  5404. } else if (this.type === tt.slash && prevType === tok.jsxTagStart) {
  5405. this.context.length -= 2;
  5406. this.context.push(tc_cTag);
  5407. this.exprAllowed = false;
  5408. } else {
  5409. return super.updateContext(prevType);
  5410. }
  5411. }
  5412. };
  5413. }
  5414. }
  5415. });
  5416. // node_modules/extend/index.js
  5417. var require_extend = __commonJS({
  5418. "node_modules/extend/index.js"(exports2, module2) {
  5419. "use strict";
  5420. var hasOwn2 = Object.prototype.hasOwnProperty;
  5421. var toStr = Object.prototype.toString;
  5422. var defineProperty = Object.defineProperty;
  5423. var gOPD = Object.getOwnPropertyDescriptor;
  5424. var isArray2 = function isArray3(arr) {
  5425. if (typeof Array.isArray === "function") {
  5426. return Array.isArray(arr);
  5427. }
  5428. return toStr.call(arr) === "[object Array]";
  5429. };
  5430. var isPlainObject2 = function isPlainObject3(obj) {
  5431. if (!obj || toStr.call(obj) !== "[object Object]") {
  5432. return false;
  5433. }
  5434. var hasOwnConstructor = hasOwn2.call(obj, "constructor");
  5435. var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn2.call(obj.constructor.prototype, "isPrototypeOf");
  5436. if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {
  5437. return false;
  5438. }
  5439. var key;
  5440. for (key in obj) {
  5441. }
  5442. return typeof key === "undefined" || hasOwn2.call(obj, key);
  5443. };
  5444. var setProperty = function setProperty2(target, options) {
  5445. if (defineProperty && options.name === "__proto__") {
  5446. defineProperty(target, options.name, {
  5447. enumerable: true,
  5448. configurable: true,
  5449. value: options.newValue,
  5450. writable: true
  5451. });
  5452. } else {
  5453. target[options.name] = options.newValue;
  5454. }
  5455. };
  5456. var getProperty = function getProperty2(obj, name2) {
  5457. if (name2 === "__proto__") {
  5458. if (!hasOwn2.call(obj, name2)) {
  5459. return void 0;
  5460. } else if (gOPD) {
  5461. return gOPD(obj, name2).value;
  5462. }
  5463. }
  5464. return obj[name2];
  5465. };
  5466. module2.exports = function extend3() {
  5467. var options, name2, src, copy, copyIsArray, clone;
  5468. var target = arguments[0];
  5469. var i = 1;
  5470. var length = arguments.length;
  5471. var deep = false;
  5472. if (typeof target === "boolean") {
  5473. deep = target;
  5474. target = arguments[1] || {};
  5475. i = 2;
  5476. }
  5477. if (target == null || typeof target !== "object" && typeof target !== "function") {
  5478. target = {};
  5479. }
  5480. for (; i < length; ++i) {
  5481. options = arguments[i];
  5482. if (options != null) {
  5483. for (name2 in options) {
  5484. src = getProperty(target, name2);
  5485. copy = getProperty(options, name2);
  5486. if (target !== copy) {
  5487. if (deep && copy && (isPlainObject2(copy) || (copyIsArray = isArray2(copy)))) {
  5488. if (copyIsArray) {
  5489. copyIsArray = false;
  5490. clone = src && isArray2(src) ? src : [];
  5491. } else {
  5492. clone = src && isPlainObject2(src) ? src : {};
  5493. }
  5494. setProperty(target, { name: name2, newValue: extend3(deep, clone, copy) });
  5495. } else if (typeof copy !== "undefined") {
  5496. setProperty(target, { name: name2, newValue: copy });
  5497. }
  5498. }
  5499. }
  5500. }
  5501. }
  5502. return target;
  5503. };
  5504. }
  5505. });
  5506. // node_modules/inline-style-parser/index.js
  5507. var require_inline_style_parser = __commonJS({
  5508. "node_modules/inline-style-parser/index.js"(exports2, module2) {
  5509. var COMMENT_REGEX = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;
  5510. var NEWLINE_REGEX = /\n/g;
  5511. var WHITESPACE_REGEX = /^\s*/;
  5512. var PROPERTY_REGEX = /^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/;
  5513. var COLON_REGEX = /^:\s*/;
  5514. var VALUE_REGEX = /^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/;
  5515. var SEMICOLON_REGEX = /^[;\s]*/;
  5516. var TRIM_REGEX = /^\s+|\s+$/g;
  5517. var NEWLINE = "\n";
  5518. var FORWARD_SLASH = "/";
  5519. var ASTERISK = "*";
  5520. var EMPTY_STRING = "";
  5521. var TYPE_COMMENT = "comment";
  5522. var TYPE_DECLARATION = "declaration";
  5523. module2.exports = function(style, options) {
  5524. if (typeof style !== "string") {
  5525. throw new TypeError("First argument must be a string");
  5526. }
  5527. if (!style) return [];
  5528. options = options || {};
  5529. var lineno = 1;
  5530. var column = 1;
  5531. function updatePosition(str) {
  5532. var lines = str.match(NEWLINE_REGEX);
  5533. if (lines) lineno += lines.length;
  5534. var i = str.lastIndexOf(NEWLINE);
  5535. column = ~i ? str.length - i : column + str.length;
  5536. }
  5537. function position3() {
  5538. var start2 = { line: lineno, column };
  5539. return function(node2) {
  5540. node2.position = new Position3(start2);
  5541. whitespace2();
  5542. return node2;
  5543. };
  5544. }
  5545. function Position3(start2) {
  5546. this.start = start2;
  5547. this.end = { line: lineno, column };
  5548. this.source = options.source;
  5549. }
  5550. Position3.prototype.content = style;
  5551. var errorsList = [];
  5552. function error(msg) {
  5553. var err = new Error(
  5554. options.source + ":" + lineno + ":" + column + ": " + msg
  5555. );
  5556. err.reason = msg;
  5557. err.filename = options.source;
  5558. err.line = lineno;
  5559. err.column = column;
  5560. err.source = style;
  5561. if (options.silent) {
  5562. errorsList.push(err);
  5563. } else {
  5564. throw err;
  5565. }
  5566. }
  5567. function match(re2) {
  5568. var m = re2.exec(style);
  5569. if (!m) return;
  5570. var str = m[0];
  5571. updatePosition(str);
  5572. style = style.slice(str.length);
  5573. return m;
  5574. }
  5575. function whitespace2() {
  5576. match(WHITESPACE_REGEX);
  5577. }
  5578. function comments(rules) {
  5579. var c;
  5580. rules = rules || [];
  5581. while (c = comment2()) {
  5582. if (c !== false) {
  5583. rules.push(c);
  5584. }
  5585. }
  5586. return rules;
  5587. }
  5588. function comment2() {
  5589. var pos = position3();
  5590. if (FORWARD_SLASH != style.charAt(0) || ASTERISK != style.charAt(1)) return;
  5591. var i = 2;
  5592. while (EMPTY_STRING != style.charAt(i) && (ASTERISK != style.charAt(i) || FORWARD_SLASH != style.charAt(i + 1))) {
  5593. ++i;
  5594. }
  5595. i += 2;
  5596. if (EMPTY_STRING === style.charAt(i - 1)) {
  5597. return error("End of comment missing");
  5598. }
  5599. var str = style.slice(2, i - 2);
  5600. column += 2;
  5601. updatePosition(str);
  5602. style = style.slice(i);
  5603. column += 2;
  5604. return pos({
  5605. type: TYPE_COMMENT,
  5606. comment: str
  5607. });
  5608. }
  5609. function declaration() {
  5610. var pos = position3();
  5611. var prop = match(PROPERTY_REGEX);
  5612. if (!prop) return;
  5613. comment2();
  5614. if (!match(COLON_REGEX)) return error("property missing ':'");
  5615. var val = match(VALUE_REGEX);
  5616. var ret = pos({
  5617. type: TYPE_DECLARATION,
  5618. property: trim(prop[0].replace(COMMENT_REGEX, EMPTY_STRING)),
  5619. value: val ? trim(val[0].replace(COMMENT_REGEX, EMPTY_STRING)) : EMPTY_STRING
  5620. });
  5621. match(SEMICOLON_REGEX);
  5622. return ret;
  5623. }
  5624. function declarations() {
  5625. var decls = [];
  5626. comments(decls);
  5627. var decl;
  5628. while (decl = declaration()) {
  5629. if (decl !== false) {
  5630. decls.push(decl);
  5631. comments(decls);
  5632. }
  5633. }
  5634. return decls;
  5635. }
  5636. whitespace2();
  5637. return declarations();
  5638. };
  5639. function trim(str) {
  5640. return str ? str.replace(TRIM_REGEX, EMPTY_STRING) : EMPTY_STRING;
  5641. }
  5642. }
  5643. });
  5644. // node_modules/hast-util-to-estree/node_modules/style-to-object/index.js
  5645. var require_style_to_object = __commonJS({
  5646. "node_modules/hast-util-to-estree/node_modules/style-to-object/index.js"(exports2, module2) {
  5647. var parse4 = require_inline_style_parser();
  5648. function StyleToObject2(style, iterator) {
  5649. var output = null;
  5650. if (!style || typeof style !== "string") {
  5651. return output;
  5652. }
  5653. var declaration;
  5654. var declarations = parse4(style);
  5655. var hasIterator = typeof iterator === "function";
  5656. var property;
  5657. var value;
  5658. for (var i = 0, len = declarations.length; i < len; i++) {
  5659. declaration = declarations[i];
  5660. property = declaration.property;
  5661. value = declaration.value;
  5662. if (hasIterator) {
  5663. iterator(property, value, declaration);
  5664. } else if (value) {
  5665. output || (output = {});
  5666. output[property] = value;
  5667. }
  5668. }
  5669. return output;
  5670. }
  5671. module2.exports = StyleToObject2;
  5672. module2.exports.default = StyleToObject2;
  5673. }
  5674. });
  5675. // mdx.js
  5676. var mdx_exports = {};
  5677. __export(mdx_exports, {
  5678. compile: () => compile,
  5679. compileSync: () => compileSync,
  5680. createProcessor: () => createProcessor,
  5681. evaluate: () => evaluate,
  5682. evaluateSync: () => evaluateSync,
  5683. nodeTypes: () => nodeTypes,
  5684. run: () => run,
  5685. runSync: () => runSync
  5686. });
  5687. module.exports = __toCommonJS(mdx_exports);
  5688. // node_modules/unist-util-stringify-position/lib/index.js
  5689. function stringifyPosition(value) {
  5690. if (!value || typeof value !== "object") {
  5691. return "";
  5692. }
  5693. if ("position" in value || "type" in value) {
  5694. return position(value.position);
  5695. }
  5696. if ("start" in value || "end" in value) {
  5697. return position(value);
  5698. }
  5699. if ("line" in value || "column" in value) {
  5700. return point(value);
  5701. }
  5702. return "";
  5703. }
  5704. function point(point4) {
  5705. return index(point4 && point4.line) + ":" + index(point4 && point4.column);
  5706. }
  5707. function position(pos) {
  5708. return point(pos && pos.start) + "-" + point(pos && pos.end);
  5709. }
  5710. function index(value) {
  5711. return value && typeof value === "number" ? value : 1;
  5712. }
  5713. // node_modules/vfile-message/lib/index.js
  5714. var VFileMessage = class extends Error {
  5715. /**
  5716. * Create a message for `reason`.
  5717. *
  5718. * > 🪦 **Note**: also has obsolete signatures.
  5719. *
  5720. * @overload
  5721. * @param {string} reason
  5722. * @param {Options | null | undefined} [options]
  5723. * @returns
  5724. *
  5725. * @overload
  5726. * @param {string} reason
  5727. * @param {Node | NodeLike | null | undefined} parent
  5728. * @param {string | null | undefined} [origin]
  5729. * @returns
  5730. *
  5731. * @overload
  5732. * @param {string} reason
  5733. * @param {Point | Position | null | undefined} place
  5734. * @param {string | null | undefined} [origin]
  5735. * @returns
  5736. *
  5737. * @overload
  5738. * @param {string} reason
  5739. * @param {string | null | undefined} [origin]
  5740. * @returns
  5741. *
  5742. * @overload
  5743. * @param {Error | VFileMessage} cause
  5744. * @param {Node | NodeLike | null | undefined} parent
  5745. * @param {string | null | undefined} [origin]
  5746. * @returns
  5747. *
  5748. * @overload
  5749. * @param {Error | VFileMessage} cause
  5750. * @param {Point | Position | null | undefined} place
  5751. * @param {string | null | undefined} [origin]
  5752. * @returns
  5753. *
  5754. * @overload
  5755. * @param {Error | VFileMessage} cause
  5756. * @param {string | null | undefined} [origin]
  5757. * @returns
  5758. *
  5759. * @param {Error | VFileMessage | string} causeOrReason
  5760. * Reason for message, should use markdown.
  5761. * @param {Node | NodeLike | Options | Point | Position | string | null | undefined} [optionsOrParentOrPlace]
  5762. * Configuration (optional).
  5763. * @param {string | null | undefined} [origin]
  5764. * Place in code where the message originates (example:
  5765. * `'my-package:my-rule'` or `'my-rule'`).
  5766. * @returns
  5767. * Instance of `VFileMessage`.
  5768. */
  5769. // eslint-disable-next-line complexity
  5770. constructor(causeOrReason, optionsOrParentOrPlace, origin) {
  5771. super();
  5772. if (typeof optionsOrParentOrPlace === "string") {
  5773. origin = optionsOrParentOrPlace;
  5774. optionsOrParentOrPlace = void 0;
  5775. }
  5776. let reason = "";
  5777. let options = {};
  5778. let legacyCause = false;
  5779. if (optionsOrParentOrPlace) {
  5780. if ("line" in optionsOrParentOrPlace && "column" in optionsOrParentOrPlace) {
  5781. options = { place: optionsOrParentOrPlace };
  5782. } else if ("start" in optionsOrParentOrPlace && "end" in optionsOrParentOrPlace) {
  5783. options = { place: optionsOrParentOrPlace };
  5784. } else if ("type" in optionsOrParentOrPlace) {
  5785. options = {
  5786. ancestors: [optionsOrParentOrPlace],
  5787. place: optionsOrParentOrPlace.position
  5788. };
  5789. } else {
  5790. options = { ...optionsOrParentOrPlace };
  5791. }
  5792. }
  5793. if (typeof causeOrReason === "string") {
  5794. reason = causeOrReason;
  5795. } else if (!options.cause && causeOrReason) {
  5796. legacyCause = true;
  5797. reason = causeOrReason.message;
  5798. options.cause = causeOrReason;
  5799. }
  5800. if (!options.ruleId && !options.source && typeof origin === "string") {
  5801. const index2 = origin.indexOf(":");
  5802. if (index2 === -1) {
  5803. options.ruleId = origin;
  5804. } else {
  5805. options.source = origin.slice(0, index2);
  5806. options.ruleId = origin.slice(index2 + 1);
  5807. }
  5808. }
  5809. if (!options.place && options.ancestors && options.ancestors) {
  5810. const parent = options.ancestors[options.ancestors.length - 1];
  5811. if (parent) {
  5812. options.place = parent.position;
  5813. }
  5814. }
  5815. const start2 = options.place && "start" in options.place ? options.place.start : options.place;
  5816. this.ancestors = options.ancestors || void 0;
  5817. this.cause = options.cause || void 0;
  5818. this.column = start2 ? start2.column : void 0;
  5819. this.fatal = void 0;
  5820. this.file;
  5821. this.message = reason;
  5822. this.line = start2 ? start2.line : void 0;
  5823. this.name = stringifyPosition(options.place) || "1:1";
  5824. this.place = options.place || void 0;
  5825. this.reason = this.message;
  5826. this.ruleId = options.ruleId || void 0;
  5827. this.source = options.source || void 0;
  5828. this.stack = legacyCause && options.cause && typeof options.cause.stack === "string" ? options.cause.stack : "";
  5829. this.actual;
  5830. this.expected;
  5831. this.note;
  5832. this.url;
  5833. }
  5834. };
  5835. VFileMessage.prototype.file = "";
  5836. VFileMessage.prototype.name = "";
  5837. VFileMessage.prototype.reason = "";
  5838. VFileMessage.prototype.message = "";
  5839. VFileMessage.prototype.stack = "";
  5840. VFileMessage.prototype.column = void 0;
  5841. VFileMessage.prototype.line = void 0;
  5842. VFileMessage.prototype.ancestors = void 0;
  5843. VFileMessage.prototype.cause = void 0;
  5844. VFileMessage.prototype.fatal = void 0;
  5845. VFileMessage.prototype.place = void 0;
  5846. VFileMessage.prototype.ruleId = void 0;
  5847. VFileMessage.prototype.source = void 0;
  5848. // node_modules/@mdx-js/mdx/node_modules/vfile/lib/minpath.js
  5849. // var import_node_path = __toESM(require("node:path"), 1);
  5850. // node_modules/@mdx-js/mdx/node_modules/vfile/lib/minproc.js
  5851. // var import_node_process = __toESM(require("node:process"), 1);
  5852. // node_modules/@mdx-js/mdx/node_modules/vfile/lib/minurl.js
  5853. // var URL = require("node:url");
  5854. // node_modules/@mdx-js/mdx/node_modules/vfile/lib/minurl.shared.js
  5855. function isUrl(fileUrlOrPath) {
  5856. return Boolean(
  5857. fileUrlOrPath !== null && typeof fileUrlOrPath === "object" && "href" in fileUrlOrPath && fileUrlOrPath.href && "protocol" in fileUrlOrPath && fileUrlOrPath.protocol && // @ts-expect-error: indexing is fine.
  5858. fileUrlOrPath.auth === void 0
  5859. );
  5860. }
  5861. // node_modules/@mdx-js/mdx/node_modules/vfile/lib/index.js
  5862. var order = (
  5863. /** @type {const} */
  5864. [
  5865. "history",
  5866. "path",
  5867. "basename",
  5868. "stem",
  5869. "extname",
  5870. "dirname"
  5871. ]
  5872. );
  5873. var VFile = class {
  5874. /**
  5875. * Create a new virtual file.
  5876. *
  5877. * `options` is treated as:
  5878. *
  5879. * * `string` or `Uint8Array` — `{value: options}`
  5880. * * `URL` — `{path: options}`
  5881. * * `VFile` — shallow copies its data over to the new file
  5882. * * `object` — all fields are shallow copied over to the new file
  5883. *
  5884. * Path related fields are set in the following order (least specific to
  5885. * most specific): `history`, `path`, `basename`, `stem`, `extname`,
  5886. * `dirname`.
  5887. *
  5888. * You cannot set `dirname` or `extname` without setting either `history`,
  5889. * `path`, `basename`, or `stem` too.
  5890. *
  5891. * @param {Compatible | null | undefined} [value]
  5892. * File value.
  5893. * @returns
  5894. * New instance.
  5895. */
  5896. constructor(value) {
  5897. let options;
  5898. if (!value) {
  5899. options = {};
  5900. } else if (isUrl(value)) {
  5901. options = { path: value };
  5902. } else if (typeof value === "string" || isUint8Array(value)) {
  5903. options = { value };
  5904. } else {
  5905. options = value;
  5906. }
  5907. this.cwd = PROCESS.cwd();
  5908. this.data = {};
  5909. this.history = [];
  5910. this.messages = [];
  5911. this.value;
  5912. this.map;
  5913. this.result;
  5914. this.stored;
  5915. let index2 = -1;
  5916. while (++index2 < order.length) {
  5917. const prop2 = order[index2];
  5918. if (prop2 in options && options[prop2] !== void 0 && options[prop2] !== null) {
  5919. this[prop2] = prop2 === "history" ? [...options[prop2]] : options[prop2];
  5920. }
  5921. }
  5922. let prop;
  5923. for (prop in options) {
  5924. if (!order.includes(prop)) {
  5925. this[prop] = options[prop];
  5926. }
  5927. }
  5928. }
  5929. /**
  5930. * Get the basename (including extname) (example: `'index.min.js'`).
  5931. *
  5932. * @returns {string | undefined}
  5933. * Basename.
  5934. */
  5935. get basename() {
  5936. return typeof this.path === "string" ? PATH.basename(this.path) : void 0;
  5937. }
  5938. /**
  5939. * Set basename (including extname) (`'index.min.js'`).
  5940. *
  5941. * Cannot contain path separators (`'/'` on unix, macOS, and browsers, `'\'`
  5942. * on windows).
  5943. * Cannot be nullified (use `file.path = file.dirname` instead).
  5944. *
  5945. * @param {string} basename
  5946. * Basename.
  5947. * @returns {undefined}
  5948. * Nothing.
  5949. */
  5950. set basename(basename) {
  5951. assertNonEmpty(basename, "basename");
  5952. assertPart(basename, "basename");
  5953. this.path = PATH.join(this.dirname || "", basename);
  5954. }
  5955. /**
  5956. * Get the parent path (example: `'~'`).
  5957. *
  5958. * @returns {string | undefined}
  5959. * Dirname.
  5960. */
  5961. get dirname() {
  5962. return typeof this.path === "string" ? PATH.dirname(this.path) : void 0;
  5963. }
  5964. /**
  5965. * Set the parent path (example: `'~'`).
  5966. *
  5967. * Cannot be set if there’s no `path` yet.
  5968. *
  5969. * @param {string | undefined} dirname
  5970. * Dirname.
  5971. * @returns {undefined}
  5972. * Nothing.
  5973. */
  5974. set dirname(dirname) {
  5975. assertPath(this.basename, "dirname");
  5976. this.path = PATH.join(dirname || "", this.basename);
  5977. }
  5978. /**
  5979. * Get the extname (including dot) (example: `'.js'`).
  5980. *
  5981. * @returns {string | undefined}
  5982. * Extname.
  5983. */
  5984. get extname() {
  5985. return typeof this.path === "string" ? PATH.extname(this.path) : void 0;
  5986. }
  5987. /**
  5988. * Set the extname (including dot) (example: `'.js'`).
  5989. *
  5990. * Cannot contain path separators (`'/'` on unix, macOS, and browsers, `'\'`
  5991. * on windows).
  5992. * Cannot be set if there’s no `path` yet.
  5993. *
  5994. * @param {string | undefined} extname
  5995. * Extname.
  5996. * @returns {undefined}
  5997. * Nothing.
  5998. */
  5999. set extname(extname) {
  6000. assertPart(extname, "extname");
  6001. assertPath(this.dirname, "extname");
  6002. if (extname) {
  6003. if (extname.codePointAt(0) !== 46) {
  6004. throw new Error("`extname` must start with `.`");
  6005. }
  6006. if (extname.includes(".", 1)) {
  6007. throw new Error("`extname` cannot contain multiple dots");
  6008. }
  6009. }
  6010. this.path = PATH.join(this.dirname, this.stem + (extname || ""));
  6011. }
  6012. /**
  6013. * Get the full path (example: `'~/index.min.js'`).
  6014. *
  6015. * @returns {string}
  6016. * Path.
  6017. */
  6018. get path() {
  6019. return this.history[this.history.length - 1];
  6020. }
  6021. /**
  6022. * Set the full path (example: `'~/index.min.js'`).
  6023. *
  6024. * Cannot be nullified.
  6025. * You can set a file URL (a `URL` object with a `file:` protocol) which will
  6026. * be turned into a path with `url.fileURLToPath`.
  6027. *
  6028. * @param {URL | string} path
  6029. * Path.
  6030. * @returns {undefined}
  6031. * Nothing.
  6032. */
  6033. set path(path) {
  6034. if (isUrl(path)) {
  6035. path = (0, URL.fileURLToPath)(path);
  6036. }
  6037. assertNonEmpty(path, "path");
  6038. if (this.path !== path) {
  6039. this.history.push(path);
  6040. }
  6041. }
  6042. /**
  6043. * Get the stem (basename w/o extname) (example: `'index.min'`).
  6044. *
  6045. * @returns {string | undefined}
  6046. * Stem.
  6047. */
  6048. get stem() {
  6049. return typeof this.path === "string" ? PATH.basename(this.path, this.extname) : void 0;
  6050. }
  6051. /**
  6052. * Set the stem (basename w/o extname) (example: `'index.min'`).
  6053. *
  6054. * Cannot contain path separators (`'/'` on unix, macOS, and browsers, `'\'`
  6055. * on windows).
  6056. * Cannot be nullified (use `file.path = file.dirname` instead).
  6057. *
  6058. * @param {string} stem
  6059. * Stem.
  6060. * @returns {undefined}
  6061. * Nothing.
  6062. */
  6063. set stem(stem) {
  6064. assertNonEmpty(stem, "stem");
  6065. assertPart(stem, "stem");
  6066. this.path = PATH.join(this.dirname || "", stem + (this.extname || ""));
  6067. }
  6068. // Normal prototypal methods.
  6069. /**
  6070. * Create a fatal message for `reason` associated with the file.
  6071. *
  6072. * The `fatal` field of the message is set to `true` (error; file not usable)
  6073. * and the `file` field is set to the current file path.
  6074. * The message is added to the `messages` field on `file`.
  6075. *
  6076. * > 🪦 **Note**: also has obsolete signatures.
  6077. *
  6078. * @overload
  6079. * @param {string} reason
  6080. * @param {MessageOptions | null | undefined} [options]
  6081. * @returns {never}
  6082. *
  6083. * @overload
  6084. * @param {string} reason
  6085. * @param {Node | NodeLike | null | undefined} parent
  6086. * @param {string | null | undefined} [origin]
  6087. * @returns {never}
  6088. *
  6089. * @overload
  6090. * @param {string} reason
  6091. * @param {Point | Position | null | undefined} place
  6092. * @param {string | null | undefined} [origin]
  6093. * @returns {never}
  6094. *
  6095. * @overload
  6096. * @param {string} reason
  6097. * @param {string | null | undefined} [origin]
  6098. * @returns {never}
  6099. *
  6100. * @overload
  6101. * @param {Error | VFileMessage} cause
  6102. * @param {Node | NodeLike | null | undefined} parent
  6103. * @param {string | null | undefined} [origin]
  6104. * @returns {never}
  6105. *
  6106. * @overload
  6107. * @param {Error | VFileMessage} cause
  6108. * @param {Point | Position | null | undefined} place
  6109. * @param {string | null | undefined} [origin]
  6110. * @returns {never}
  6111. *
  6112. * @overload
  6113. * @param {Error | VFileMessage} cause
  6114. * @param {string | null | undefined} [origin]
  6115. * @returns {never}
  6116. *
  6117. * @param {Error | VFileMessage | string} causeOrReason
  6118. * Reason for message, should use markdown.
  6119. * @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace]
  6120. * Configuration (optional).
  6121. * @param {string | null | undefined} [origin]
  6122. * Place in code where the message originates (example:
  6123. * `'my-package:my-rule'` or `'my-rule'`).
  6124. * @returns {never}
  6125. * Never.
  6126. * @throws {VFileMessage}
  6127. * Message.
  6128. */
  6129. fail(causeOrReason, optionsOrParentOrPlace, origin) {
  6130. const message = this.message(causeOrReason, optionsOrParentOrPlace, origin);
  6131. message.fatal = true;
  6132. throw message;
  6133. }
  6134. /**
  6135. * Create an info message for `reason` associated with the file.
  6136. *
  6137. * The `fatal` field of the message is set to `undefined` (info; change
  6138. * likely not needed) and the `file` field is set to the current file path.
  6139. * The message is added to the `messages` field on `file`.
  6140. *
  6141. * > 🪦 **Note**: also has obsolete signatures.
  6142. *
  6143. * @overload
  6144. * @param {string} reason
  6145. * @param {MessageOptions | null | undefined} [options]
  6146. * @returns {VFileMessage}
  6147. *
  6148. * @overload
  6149. * @param {string} reason
  6150. * @param {Node | NodeLike | null | undefined} parent
  6151. * @param {string | null | undefined} [origin]
  6152. * @returns {VFileMessage}
  6153. *
  6154. * @overload
  6155. * @param {string} reason
  6156. * @param {Point | Position | null | undefined} place
  6157. * @param {string | null | undefined} [origin]
  6158. * @returns {VFileMessage}
  6159. *
  6160. * @overload
  6161. * @param {string} reason
  6162. * @param {string | null | undefined} [origin]
  6163. * @returns {VFileMessage}
  6164. *
  6165. * @overload
  6166. * @param {Error | VFileMessage} cause
  6167. * @param {Node | NodeLike | null | undefined} parent
  6168. * @param {string | null | undefined} [origin]
  6169. * @returns {VFileMessage}
  6170. *
  6171. * @overload
  6172. * @param {Error | VFileMessage} cause
  6173. * @param {Point | Position | null | undefined} place
  6174. * @param {string | null | undefined} [origin]
  6175. * @returns {VFileMessage}
  6176. *
  6177. * @overload
  6178. * @param {Error | VFileMessage} cause
  6179. * @param {string | null | undefined} [origin]
  6180. * @returns {VFileMessage}
  6181. *
  6182. * @param {Error | VFileMessage | string} causeOrReason
  6183. * Reason for message, should use markdown.
  6184. * @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace]
  6185. * Configuration (optional).
  6186. * @param {string | null | undefined} [origin]
  6187. * Place in code where the message originates (example:
  6188. * `'my-package:my-rule'` or `'my-rule'`).
  6189. * @returns {VFileMessage}
  6190. * Message.
  6191. */
  6192. info(causeOrReason, optionsOrParentOrPlace, origin) {
  6193. const message = this.message(causeOrReason, optionsOrParentOrPlace, origin);
  6194. message.fatal = void 0;
  6195. return message;
  6196. }
  6197. /**
  6198. * Create a message for `reason` associated with the file.
  6199. *
  6200. * The `fatal` field of the message is set to `false` (warning; change may be
  6201. * needed) and the `file` field is set to the current file path.
  6202. * The message is added to the `messages` field on `file`.
  6203. *
  6204. * > 🪦 **Note**: also has obsolete signatures.
  6205. *
  6206. * @overload
  6207. * @param {string} reason
  6208. * @param {MessageOptions | null | undefined} [options]
  6209. * @returns {VFileMessage}
  6210. *
  6211. * @overload
  6212. * @param {string} reason
  6213. * @param {Node | NodeLike | null | undefined} parent
  6214. * @param {string | null | undefined} [origin]
  6215. * @returns {VFileMessage}
  6216. *
  6217. * @overload
  6218. * @param {string} reason
  6219. * @param {Point | Position | null | undefined} place
  6220. * @param {string | null | undefined} [origin]
  6221. * @returns {VFileMessage}
  6222. *
  6223. * @overload
  6224. * @param {string} reason
  6225. * @param {string | null | undefined} [origin]
  6226. * @returns {VFileMessage}
  6227. *
  6228. * @overload
  6229. * @param {Error | VFileMessage} cause
  6230. * @param {Node | NodeLike | null | undefined} parent
  6231. * @param {string | null | undefined} [origin]
  6232. * @returns {VFileMessage}
  6233. *
  6234. * @overload
  6235. * @param {Error | VFileMessage} cause
  6236. * @param {Point | Position | null | undefined} place
  6237. * @param {string | null | undefined} [origin]
  6238. * @returns {VFileMessage}
  6239. *
  6240. * @overload
  6241. * @param {Error | VFileMessage} cause
  6242. * @param {string | null | undefined} [origin]
  6243. * @returns {VFileMessage}
  6244. *
  6245. * @param {Error | VFileMessage | string} causeOrReason
  6246. * Reason for message, should use markdown.
  6247. * @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace]
  6248. * Configuration (optional).
  6249. * @param {string | null | undefined} [origin]
  6250. * Place in code where the message originates (example:
  6251. * `'my-package:my-rule'` or `'my-rule'`).
  6252. * @returns {VFileMessage}
  6253. * Message.
  6254. */
  6255. message(causeOrReason, optionsOrParentOrPlace, origin) {
  6256. const message = new VFileMessage(
  6257. // @ts-expect-error: the overloads are fine.
  6258. causeOrReason,
  6259. optionsOrParentOrPlace,
  6260. origin
  6261. );
  6262. if (this.path) {
  6263. message.name = this.path + ":" + message.name;
  6264. message.file = this.path;
  6265. }
  6266. message.fatal = false;
  6267. this.messages.push(message);
  6268. return message;
  6269. }
  6270. /**
  6271. * Serialize the file.
  6272. *
  6273. * > **Note**: which encodings are supported depends on the engine.
  6274. * > For info on Node.js, see:
  6275. * > <https://nodejs.org/api/util.html#whatwg-supported-encodings>.
  6276. *
  6277. * @param {string | null | undefined} [encoding='utf8']
  6278. * Character encoding to understand `value` as when it’s a `Uint8Array`
  6279. * (default: `'utf-8'`).
  6280. * @returns {string}
  6281. * Serialized file.
  6282. */
  6283. toString(encoding) {
  6284. if (this.value === void 0) {
  6285. return "";
  6286. }
  6287. if (typeof this.value === "string") {
  6288. return this.value;
  6289. }
  6290. const decoder = new TextDecoder(encoding || void 0);
  6291. return decoder.decode(this.value);
  6292. }
  6293. };
  6294. function assertPart(part, name2) {
  6295. if (part && part.includes(PATH.sep)) {
  6296. throw new Error(
  6297. "`" + name2 + "` cannot be a path: did not expect `" + PATH.sep + "`"
  6298. );
  6299. }
  6300. }
  6301. function assertNonEmpty(part, name2) {
  6302. if (!part) {
  6303. throw new Error("`" + name2 + "` cannot be empty");
  6304. }
  6305. }
  6306. function assertPath(path, name2) {
  6307. if (!path) {
  6308. throw new Error("Setting `" + name2 + "` requires `path` to be set too");
  6309. }
  6310. }
  6311. function isUint8Array(value) {
  6312. return Boolean(
  6313. value && typeof value === "object" && "byteLength" in value && "byteOffset" in value
  6314. );
  6315. }
  6316. // node_modules/markdown-extensions/index.js
  6317. var markdownExtension = [
  6318. "md",
  6319. "markdown",
  6320. "mdown",
  6321. "mkdn",
  6322. "mkd",
  6323. "mdwn",
  6324. "mkdown",
  6325. "ron"
  6326. ];
  6327. var markdown_extensions_default = markdownExtension;
  6328. // node_modules/@mdx-js/mdx/lib/util/extnames.js
  6329. var md = markdown_extensions_default.map(function(d) {
  6330. return "." + d;
  6331. });
  6332. // node_modules/@mdx-js/mdx/lib/util/resolve-file-and-options.js
  6333. function resolveFileAndOptions(vfileCompatible, options) {
  6334. const file = looksLikeAVFile(vfileCompatible) ? vfileCompatible : new VFile(vfileCompatible);
  6335. const { format, ...rest } = options || {};
  6336. return {
  6337. file,
  6338. options: {
  6339. format: format === "md" || format === "mdx" ? format : file.extname && (rest.mdExtensions || md).includes(file.extname) ? "md" : "mdx",
  6340. ...rest
  6341. }
  6342. };
  6343. }
  6344. function looksLikeAVFile(value) {
  6345. return Boolean(
  6346. value && typeof value === "object" && "message" in value && "messages" in value
  6347. );
  6348. }
  6349. // node_modules/devlop/lib/default.js
  6350. function ok() {
  6351. }
  6352. function unreachable() {
  6353. }
  6354. // node_modules/mdast-util-mdx-expression/lib/index.js
  6355. function mdxExpressionFromMarkdown() {
  6356. return {
  6357. enter: {
  6358. mdxFlowExpression: enterMdxFlowExpression,
  6359. mdxTextExpression: enterMdxTextExpression
  6360. },
  6361. exit: {
  6362. mdxFlowExpression: exitMdxExpression,
  6363. mdxFlowExpressionChunk: exitMdxExpressionData,
  6364. mdxTextExpression: exitMdxExpression,
  6365. mdxTextExpressionChunk: exitMdxExpressionData
  6366. }
  6367. };
  6368. }
  6369. function mdxExpressionToMarkdown() {
  6370. return {
  6371. handlers: {
  6372. mdxFlowExpression: handleMdxExpression,
  6373. mdxTextExpression: handleMdxExpression
  6374. },
  6375. unsafe: [
  6376. { character: "{", inConstruct: ["phrasing"] },
  6377. { atBreak: true, character: "{" }
  6378. ]
  6379. };
  6380. }
  6381. function enterMdxFlowExpression(token) {
  6382. this.enter({ type: "mdxFlowExpression", value: "" }, token);
  6383. this.buffer();
  6384. }
  6385. function enterMdxTextExpression(token) {
  6386. this.enter({ type: "mdxTextExpression", value: "" }, token);
  6387. this.buffer();
  6388. }
  6389. function exitMdxExpression(token) {
  6390. const value = this.resume();
  6391. const estree = token.estree;
  6392. const node2 = this.stack[this.stack.length - 1];
  6393. ok(node2.type === "mdxFlowExpression" || node2.type === "mdxTextExpression");
  6394. this.exit(token);
  6395. node2.value = value;
  6396. if (estree) {
  6397. node2.data = { estree };
  6398. }
  6399. }
  6400. function exitMdxExpressionData(token) {
  6401. this.config.enter.data.call(this, token);
  6402. this.config.exit.data.call(this, token);
  6403. }
  6404. function handleMdxExpression(node2) {
  6405. const value = node2.value || "";
  6406. return "{" + value + "}";
  6407. }
  6408. // node_modules/mdast-util-mdx-jsx/node_modules/ccount/index.js
  6409. function ccount(value, character) {
  6410. const source = String(value);
  6411. if (typeof character !== "string") {
  6412. throw new TypeError("Expected character");
  6413. }
  6414. let count = 0;
  6415. let index2 = source.indexOf(character);
  6416. while (index2 !== -1) {
  6417. count++;
  6418. index2 = source.indexOf(character, index2 + character.length);
  6419. }
  6420. return count;
  6421. }
  6422. // node_modules/character-entities-legacy/index.js
  6423. var characterEntitiesLegacy = [
  6424. "AElig",
  6425. "AMP",
  6426. "Aacute",
  6427. "Acirc",
  6428. "Agrave",
  6429. "Aring",
  6430. "Atilde",
  6431. "Auml",
  6432. "COPY",
  6433. "Ccedil",
  6434. "ETH",
  6435. "Eacute",
  6436. "Ecirc",
  6437. "Egrave",
  6438. "Euml",
  6439. "GT",
  6440. "Iacute",
  6441. "Icirc",
  6442. "Igrave",
  6443. "Iuml",
  6444. "LT",
  6445. "Ntilde",
  6446. "Oacute",
  6447. "Ocirc",
  6448. "Ograve",
  6449. "Oslash",
  6450. "Otilde",
  6451. "Ouml",
  6452. "QUOT",
  6453. "REG",
  6454. "THORN",
  6455. "Uacute",
  6456. "Ucirc",
  6457. "Ugrave",
  6458. "Uuml",
  6459. "Yacute",
  6460. "aacute",
  6461. "acirc",
  6462. "acute",
  6463. "aelig",
  6464. "agrave",
  6465. "amp",
  6466. "aring",
  6467. "atilde",
  6468. "auml",
  6469. "brvbar",
  6470. "ccedil",
  6471. "cedil",
  6472. "cent",
  6473. "copy",
  6474. "curren",
  6475. "deg",
  6476. "divide",
  6477. "eacute",
  6478. "ecirc",
  6479. "egrave",
  6480. "eth",
  6481. "euml",
  6482. "frac12",
  6483. "frac14",
  6484. "frac34",
  6485. "gt",
  6486. "iacute",
  6487. "icirc",
  6488. "iexcl",
  6489. "igrave",
  6490. "iquest",
  6491. "iuml",
  6492. "laquo",
  6493. "lt",
  6494. "macr",
  6495. "micro",
  6496. "middot",
  6497. "nbsp",
  6498. "not",
  6499. "ntilde",
  6500. "oacute",
  6501. "ocirc",
  6502. "ograve",
  6503. "ordf",
  6504. "ordm",
  6505. "oslash",
  6506. "otilde",
  6507. "ouml",
  6508. "para",
  6509. "plusmn",
  6510. "pound",
  6511. "quot",
  6512. "raquo",
  6513. "reg",
  6514. "sect",
  6515. "shy",
  6516. "sup1",
  6517. "sup2",
  6518. "sup3",
  6519. "szlig",
  6520. "thorn",
  6521. "times",
  6522. "uacute",
  6523. "ucirc",
  6524. "ugrave",
  6525. "uml",
  6526. "uuml",
  6527. "yacute",
  6528. "yen",
  6529. "yuml"
  6530. ];
  6531. // node_modules/mdast-util-mdx-jsx/node_modules/character-reference-invalid/index.js
  6532. var characterReferenceInvalid = {
  6533. 0: "\uFFFD",
  6534. 128: "\u20AC",
  6535. 130: "\u201A",
  6536. 131: "\u0192",
  6537. 132: "\u201E",
  6538. 133: "\u2026",
  6539. 134: "\u2020",
  6540. 135: "\u2021",
  6541. 136: "\u02C6",
  6542. 137: "\u2030",
  6543. 138: "\u0160",
  6544. 139: "\u2039",
  6545. 140: "\u0152",
  6546. 142: "\u017D",
  6547. 145: "\u2018",
  6548. 146: "\u2019",
  6549. 147: "\u201C",
  6550. 148: "\u201D",
  6551. 149: "\u2022",
  6552. 150: "\u2013",
  6553. 151: "\u2014",
  6554. 152: "\u02DC",
  6555. 153: "\u2122",
  6556. 154: "\u0161",
  6557. 155: "\u203A",
  6558. 156: "\u0153",
  6559. 158: "\u017E",
  6560. 159: "\u0178"
  6561. };
  6562. // node_modules/mdast-util-mdx-jsx/node_modules/is-decimal/index.js
  6563. function isDecimal(character) {
  6564. const code2 = typeof character === "string" ? character.charCodeAt(0) : character;
  6565. return code2 >= 48 && code2 <= 57;
  6566. }
  6567. // node_modules/mdast-util-mdx-jsx/node_modules/is-hexadecimal/index.js
  6568. function isHexadecimal(character) {
  6569. const code2 = typeof character === "string" ? character.charCodeAt(0) : character;
  6570. return code2 >= 97 && code2 <= 102 || code2 >= 65 && code2 <= 70 || code2 >= 48 && code2 <= 57;
  6571. }
  6572. // node_modules/mdast-util-mdx-jsx/node_modules/is-alphabetical/index.js
  6573. function isAlphabetical(character) {
  6574. const code2 = typeof character === "string" ? character.charCodeAt(0) : character;
  6575. return code2 >= 97 && code2 <= 122 || code2 >= 65 && code2 <= 90;
  6576. }
  6577. // node_modules/mdast-util-mdx-jsx/node_modules/is-alphanumerical/index.js
  6578. function isAlphanumerical(character) {
  6579. return isAlphabetical(character) || isDecimal(character);
  6580. }
  6581. // node_modules/character-entities/index.js
  6582. var characterEntities = {
  6583. AElig: "\xC6",
  6584. AMP: "&",
  6585. Aacute: "\xC1",
  6586. Abreve: "\u0102",
  6587. Acirc: "\xC2",
  6588. Acy: "\u0410",
  6589. Afr: "\u{1D504}",
  6590. Agrave: "\xC0",
  6591. Alpha: "\u0391",
  6592. Amacr: "\u0100",
  6593. And: "\u2A53",
  6594. Aogon: "\u0104",
  6595. Aopf: "\u{1D538}",
  6596. ApplyFunction: "\u2061",
  6597. Aring: "\xC5",
  6598. Ascr: "\u{1D49C}",
  6599. Assign: "\u2254",
  6600. Atilde: "\xC3",
  6601. Auml: "\xC4",
  6602. Backslash: "\u2216",
  6603. Barv: "\u2AE7",
  6604. Barwed: "\u2306",
  6605. Bcy: "\u0411",
  6606. Because: "\u2235",
  6607. Bernoullis: "\u212C",
  6608. Beta: "\u0392",
  6609. Bfr: "\u{1D505}",
  6610. Bopf: "\u{1D539}",
  6611. Breve: "\u02D8",
  6612. Bscr: "\u212C",
  6613. Bumpeq: "\u224E",
  6614. CHcy: "\u0427",
  6615. COPY: "\xA9",
  6616. Cacute: "\u0106",
  6617. Cap: "\u22D2",
  6618. CapitalDifferentialD: "\u2145",
  6619. Cayleys: "\u212D",
  6620. Ccaron: "\u010C",
  6621. Ccedil: "\xC7",
  6622. Ccirc: "\u0108",
  6623. Cconint: "\u2230",
  6624. Cdot: "\u010A",
  6625. Cedilla: "\xB8",
  6626. CenterDot: "\xB7",
  6627. Cfr: "\u212D",
  6628. Chi: "\u03A7",
  6629. CircleDot: "\u2299",
  6630. CircleMinus: "\u2296",
  6631. CirclePlus: "\u2295",
  6632. CircleTimes: "\u2297",
  6633. ClockwiseContourIntegral: "\u2232",
  6634. CloseCurlyDoubleQuote: "\u201D",
  6635. CloseCurlyQuote: "\u2019",
  6636. Colon: "\u2237",
  6637. Colone: "\u2A74",
  6638. Congruent: "\u2261",
  6639. Conint: "\u222F",
  6640. ContourIntegral: "\u222E",
  6641. Copf: "\u2102",
  6642. Coproduct: "\u2210",
  6643. CounterClockwiseContourIntegral: "\u2233",
  6644. Cross: "\u2A2F",
  6645. Cscr: "\u{1D49E}",
  6646. Cup: "\u22D3",
  6647. CupCap: "\u224D",
  6648. DD: "\u2145",
  6649. DDotrahd: "\u2911",
  6650. DJcy: "\u0402",
  6651. DScy: "\u0405",
  6652. DZcy: "\u040F",
  6653. Dagger: "\u2021",
  6654. Darr: "\u21A1",
  6655. Dashv: "\u2AE4",
  6656. Dcaron: "\u010E",
  6657. Dcy: "\u0414",
  6658. Del: "\u2207",
  6659. Delta: "\u0394",
  6660. Dfr: "\u{1D507}",
  6661. DiacriticalAcute: "\xB4",
  6662. DiacriticalDot: "\u02D9",
  6663. DiacriticalDoubleAcute: "\u02DD",
  6664. DiacriticalGrave: "`",
  6665. DiacriticalTilde: "\u02DC",
  6666. Diamond: "\u22C4",
  6667. DifferentialD: "\u2146",
  6668. Dopf: "\u{1D53B}",
  6669. Dot: "\xA8",
  6670. DotDot: "\u20DC",
  6671. DotEqual: "\u2250",
  6672. DoubleContourIntegral: "\u222F",
  6673. DoubleDot: "\xA8",
  6674. DoubleDownArrow: "\u21D3",
  6675. DoubleLeftArrow: "\u21D0",
  6676. DoubleLeftRightArrow: "\u21D4",
  6677. DoubleLeftTee: "\u2AE4",
  6678. DoubleLongLeftArrow: "\u27F8",
  6679. DoubleLongLeftRightArrow: "\u27FA",
  6680. DoubleLongRightArrow: "\u27F9",
  6681. DoubleRightArrow: "\u21D2",
  6682. DoubleRightTee: "\u22A8",
  6683. DoubleUpArrow: "\u21D1",
  6684. DoubleUpDownArrow: "\u21D5",
  6685. DoubleVerticalBar: "\u2225",
  6686. DownArrow: "\u2193",
  6687. DownArrowBar: "\u2913",
  6688. DownArrowUpArrow: "\u21F5",
  6689. DownBreve: "\u0311",
  6690. DownLeftRightVector: "\u2950",
  6691. DownLeftTeeVector: "\u295E",
  6692. DownLeftVector: "\u21BD",
  6693. DownLeftVectorBar: "\u2956",
  6694. DownRightTeeVector: "\u295F",
  6695. DownRightVector: "\u21C1",
  6696. DownRightVectorBar: "\u2957",
  6697. DownTee: "\u22A4",
  6698. DownTeeArrow: "\u21A7",
  6699. Downarrow: "\u21D3",
  6700. Dscr: "\u{1D49F}",
  6701. Dstrok: "\u0110",
  6702. ENG: "\u014A",
  6703. ETH: "\xD0",
  6704. Eacute: "\xC9",
  6705. Ecaron: "\u011A",
  6706. Ecirc: "\xCA",
  6707. Ecy: "\u042D",
  6708. Edot: "\u0116",
  6709. Efr: "\u{1D508}",
  6710. Egrave: "\xC8",
  6711. Element: "\u2208",
  6712. Emacr: "\u0112",
  6713. EmptySmallSquare: "\u25FB",
  6714. EmptyVerySmallSquare: "\u25AB",
  6715. Eogon: "\u0118",
  6716. Eopf: "\u{1D53C}",
  6717. Epsilon: "\u0395",
  6718. Equal: "\u2A75",
  6719. EqualTilde: "\u2242",
  6720. Equilibrium: "\u21CC",
  6721. Escr: "\u2130",
  6722. Esim: "\u2A73",
  6723. Eta: "\u0397",
  6724. Euml: "\xCB",
  6725. Exists: "\u2203",
  6726. ExponentialE: "\u2147",
  6727. Fcy: "\u0424",
  6728. Ffr: "\u{1D509}",
  6729. FilledSmallSquare: "\u25FC",
  6730. FilledVerySmallSquare: "\u25AA",
  6731. Fopf: "\u{1D53D}",
  6732. ForAll: "\u2200",
  6733. Fouriertrf: "\u2131",
  6734. Fscr: "\u2131",
  6735. GJcy: "\u0403",
  6736. GT: ">",
  6737. Gamma: "\u0393",
  6738. Gammad: "\u03DC",
  6739. Gbreve: "\u011E",
  6740. Gcedil: "\u0122",
  6741. Gcirc: "\u011C",
  6742. Gcy: "\u0413",
  6743. Gdot: "\u0120",
  6744. Gfr: "\u{1D50A}",
  6745. Gg: "\u22D9",
  6746. Gopf: "\u{1D53E}",
  6747. GreaterEqual: "\u2265",
  6748. GreaterEqualLess: "\u22DB",
  6749. GreaterFullEqual: "\u2267",
  6750. GreaterGreater: "\u2AA2",
  6751. GreaterLess: "\u2277",
  6752. GreaterSlantEqual: "\u2A7E",
  6753. GreaterTilde: "\u2273",
  6754. Gscr: "\u{1D4A2}",
  6755. Gt: "\u226B",
  6756. HARDcy: "\u042A",
  6757. Hacek: "\u02C7",
  6758. Hat: "^",
  6759. Hcirc: "\u0124",
  6760. Hfr: "\u210C",
  6761. HilbertSpace: "\u210B",
  6762. Hopf: "\u210D",
  6763. HorizontalLine: "\u2500",
  6764. Hscr: "\u210B",
  6765. Hstrok: "\u0126",
  6766. HumpDownHump: "\u224E",
  6767. HumpEqual: "\u224F",
  6768. IEcy: "\u0415",
  6769. IJlig: "\u0132",
  6770. IOcy: "\u0401",
  6771. Iacute: "\xCD",
  6772. Icirc: "\xCE",
  6773. Icy: "\u0418",
  6774. Idot: "\u0130",
  6775. Ifr: "\u2111",
  6776. Igrave: "\xCC",
  6777. Im: "\u2111",
  6778. Imacr: "\u012A",
  6779. ImaginaryI: "\u2148",
  6780. Implies: "\u21D2",
  6781. Int: "\u222C",
  6782. Integral: "\u222B",
  6783. Intersection: "\u22C2",
  6784. InvisibleComma: "\u2063",
  6785. InvisibleTimes: "\u2062",
  6786. Iogon: "\u012E",
  6787. Iopf: "\u{1D540}",
  6788. Iota: "\u0399",
  6789. Iscr: "\u2110",
  6790. Itilde: "\u0128",
  6791. Iukcy: "\u0406",
  6792. Iuml: "\xCF",
  6793. Jcirc: "\u0134",
  6794. Jcy: "\u0419",
  6795. Jfr: "\u{1D50D}",
  6796. Jopf: "\u{1D541}",
  6797. Jscr: "\u{1D4A5}",
  6798. Jsercy: "\u0408",
  6799. Jukcy: "\u0404",
  6800. KHcy: "\u0425",
  6801. KJcy: "\u040C",
  6802. Kappa: "\u039A",
  6803. Kcedil: "\u0136",
  6804. Kcy: "\u041A",
  6805. Kfr: "\u{1D50E}",
  6806. Kopf: "\u{1D542}",
  6807. Kscr: "\u{1D4A6}",
  6808. LJcy: "\u0409",
  6809. LT: "<",
  6810. Lacute: "\u0139",
  6811. Lambda: "\u039B",
  6812. Lang: "\u27EA",
  6813. Laplacetrf: "\u2112",
  6814. Larr: "\u219E",
  6815. Lcaron: "\u013D",
  6816. Lcedil: "\u013B",
  6817. Lcy: "\u041B",
  6818. LeftAngleBracket: "\u27E8",
  6819. LeftArrow: "\u2190",
  6820. LeftArrowBar: "\u21E4",
  6821. LeftArrowRightArrow: "\u21C6",
  6822. LeftCeiling: "\u2308",
  6823. LeftDoubleBracket: "\u27E6",
  6824. LeftDownTeeVector: "\u2961",
  6825. LeftDownVector: "\u21C3",
  6826. LeftDownVectorBar: "\u2959",
  6827. LeftFloor: "\u230A",
  6828. LeftRightArrow: "\u2194",
  6829. LeftRightVector: "\u294E",
  6830. LeftTee: "\u22A3",
  6831. LeftTeeArrow: "\u21A4",
  6832. LeftTeeVector: "\u295A",
  6833. LeftTriangle: "\u22B2",
  6834. LeftTriangleBar: "\u29CF",
  6835. LeftTriangleEqual: "\u22B4",
  6836. LeftUpDownVector: "\u2951",
  6837. LeftUpTeeVector: "\u2960",
  6838. LeftUpVector: "\u21BF",
  6839. LeftUpVectorBar: "\u2958",
  6840. LeftVector: "\u21BC",
  6841. LeftVectorBar: "\u2952",
  6842. Leftarrow: "\u21D0",
  6843. Leftrightarrow: "\u21D4",
  6844. LessEqualGreater: "\u22DA",
  6845. LessFullEqual: "\u2266",
  6846. LessGreater: "\u2276",
  6847. LessLess: "\u2AA1",
  6848. LessSlantEqual: "\u2A7D",
  6849. LessTilde: "\u2272",
  6850. Lfr: "\u{1D50F}",
  6851. Ll: "\u22D8",
  6852. Lleftarrow: "\u21DA",
  6853. Lmidot: "\u013F",
  6854. LongLeftArrow: "\u27F5",
  6855. LongLeftRightArrow: "\u27F7",
  6856. LongRightArrow: "\u27F6",
  6857. Longleftarrow: "\u27F8",
  6858. Longleftrightarrow: "\u27FA",
  6859. Longrightarrow: "\u27F9",
  6860. Lopf: "\u{1D543}",
  6861. LowerLeftArrow: "\u2199",
  6862. LowerRightArrow: "\u2198",
  6863. Lscr: "\u2112",
  6864. Lsh: "\u21B0",
  6865. Lstrok: "\u0141",
  6866. Lt: "\u226A",
  6867. Map: "\u2905",
  6868. Mcy: "\u041C",
  6869. MediumSpace: "\u205F",
  6870. Mellintrf: "\u2133",
  6871. Mfr: "\u{1D510}",
  6872. MinusPlus: "\u2213",
  6873. Mopf: "\u{1D544}",
  6874. Mscr: "\u2133",
  6875. Mu: "\u039C",
  6876. NJcy: "\u040A",
  6877. Nacute: "\u0143",
  6878. Ncaron: "\u0147",
  6879. Ncedil: "\u0145",
  6880. Ncy: "\u041D",
  6881. NegativeMediumSpace: "\u200B",
  6882. NegativeThickSpace: "\u200B",
  6883. NegativeThinSpace: "\u200B",
  6884. NegativeVeryThinSpace: "\u200B",
  6885. NestedGreaterGreater: "\u226B",
  6886. NestedLessLess: "\u226A",
  6887. NewLine: "\n",
  6888. Nfr: "\u{1D511}",
  6889. NoBreak: "\u2060",
  6890. NonBreakingSpace: "\xA0",
  6891. Nopf: "\u2115",
  6892. Not: "\u2AEC",
  6893. NotCongruent: "\u2262",
  6894. NotCupCap: "\u226D",
  6895. NotDoubleVerticalBar: "\u2226",
  6896. NotElement: "\u2209",
  6897. NotEqual: "\u2260",
  6898. NotEqualTilde: "\u2242\u0338",
  6899. NotExists: "\u2204",
  6900. NotGreater: "\u226F",
  6901. NotGreaterEqual: "\u2271",
  6902. NotGreaterFullEqual: "\u2267\u0338",
  6903. NotGreaterGreater: "\u226B\u0338",
  6904. NotGreaterLess: "\u2279",
  6905. NotGreaterSlantEqual: "\u2A7E\u0338",
  6906. NotGreaterTilde: "\u2275",
  6907. NotHumpDownHump: "\u224E\u0338",
  6908. NotHumpEqual: "\u224F\u0338",
  6909. NotLeftTriangle: "\u22EA",
  6910. NotLeftTriangleBar: "\u29CF\u0338",
  6911. NotLeftTriangleEqual: "\u22EC",
  6912. NotLess: "\u226E",
  6913. NotLessEqual: "\u2270",
  6914. NotLessGreater: "\u2278",
  6915. NotLessLess: "\u226A\u0338",
  6916. NotLessSlantEqual: "\u2A7D\u0338",
  6917. NotLessTilde: "\u2274",
  6918. NotNestedGreaterGreater: "\u2AA2\u0338",
  6919. NotNestedLessLess: "\u2AA1\u0338",
  6920. NotPrecedes: "\u2280",
  6921. NotPrecedesEqual: "\u2AAF\u0338",
  6922. NotPrecedesSlantEqual: "\u22E0",
  6923. NotReverseElement: "\u220C",
  6924. NotRightTriangle: "\u22EB",
  6925. NotRightTriangleBar: "\u29D0\u0338",
  6926. NotRightTriangleEqual: "\u22ED",
  6927. NotSquareSubset: "\u228F\u0338",
  6928. NotSquareSubsetEqual: "\u22E2",
  6929. NotSquareSuperset: "\u2290\u0338",
  6930. NotSquareSupersetEqual: "\u22E3",
  6931. NotSubset: "\u2282\u20D2",
  6932. NotSubsetEqual: "\u2288",
  6933. NotSucceeds: "\u2281",
  6934. NotSucceedsEqual: "\u2AB0\u0338",
  6935. NotSucceedsSlantEqual: "\u22E1",
  6936. NotSucceedsTilde: "\u227F\u0338",
  6937. NotSuperset: "\u2283\u20D2",
  6938. NotSupersetEqual: "\u2289",
  6939. NotTilde: "\u2241",
  6940. NotTildeEqual: "\u2244",
  6941. NotTildeFullEqual: "\u2247",
  6942. NotTildeTilde: "\u2249",
  6943. NotVerticalBar: "\u2224",
  6944. Nscr: "\u{1D4A9}",
  6945. Ntilde: "\xD1",
  6946. Nu: "\u039D",
  6947. OElig: "\u0152",
  6948. Oacute: "\xD3",
  6949. Ocirc: "\xD4",
  6950. Ocy: "\u041E",
  6951. Odblac: "\u0150",
  6952. Ofr: "\u{1D512}",
  6953. Ograve: "\xD2",
  6954. Omacr: "\u014C",
  6955. Omega: "\u03A9",
  6956. Omicron: "\u039F",
  6957. Oopf: "\u{1D546}",
  6958. OpenCurlyDoubleQuote: "\u201C",
  6959. OpenCurlyQuote: "\u2018",
  6960. Or: "\u2A54",
  6961. Oscr: "\u{1D4AA}",
  6962. Oslash: "\xD8",
  6963. Otilde: "\xD5",
  6964. Otimes: "\u2A37",
  6965. Ouml: "\xD6",
  6966. OverBar: "\u203E",
  6967. OverBrace: "\u23DE",
  6968. OverBracket: "\u23B4",
  6969. OverParenthesis: "\u23DC",
  6970. PartialD: "\u2202",
  6971. Pcy: "\u041F",
  6972. Pfr: "\u{1D513}",
  6973. Phi: "\u03A6",
  6974. Pi: "\u03A0",
  6975. PlusMinus: "\xB1",
  6976. Poincareplane: "\u210C",
  6977. Popf: "\u2119",
  6978. Pr: "\u2ABB",
  6979. Precedes: "\u227A",
  6980. PrecedesEqual: "\u2AAF",
  6981. PrecedesSlantEqual: "\u227C",
  6982. PrecedesTilde: "\u227E",
  6983. Prime: "\u2033",
  6984. Product: "\u220F",
  6985. Proportion: "\u2237",
  6986. Proportional: "\u221D",
  6987. Pscr: "\u{1D4AB}",
  6988. Psi: "\u03A8",
  6989. QUOT: '"',
  6990. Qfr: "\u{1D514}",
  6991. Qopf: "\u211A",
  6992. Qscr: "\u{1D4AC}",
  6993. RBarr: "\u2910",
  6994. REG: "\xAE",
  6995. Racute: "\u0154",
  6996. Rang: "\u27EB",
  6997. Rarr: "\u21A0",
  6998. Rarrtl: "\u2916",
  6999. Rcaron: "\u0158",
  7000. Rcedil: "\u0156",
  7001. Rcy: "\u0420",
  7002. Re: "\u211C",
  7003. ReverseElement: "\u220B",
  7004. ReverseEquilibrium: "\u21CB",
  7005. ReverseUpEquilibrium: "\u296F",
  7006. Rfr: "\u211C",
  7007. Rho: "\u03A1",
  7008. RightAngleBracket: "\u27E9",
  7009. RightArrow: "\u2192",
  7010. RightArrowBar: "\u21E5",
  7011. RightArrowLeftArrow: "\u21C4",
  7012. RightCeiling: "\u2309",
  7013. RightDoubleBracket: "\u27E7",
  7014. RightDownTeeVector: "\u295D",
  7015. RightDownVector: "\u21C2",
  7016. RightDownVectorBar: "\u2955",
  7017. RightFloor: "\u230B",
  7018. RightTee: "\u22A2",
  7019. RightTeeArrow: "\u21A6",
  7020. RightTeeVector: "\u295B",
  7021. RightTriangle: "\u22B3",
  7022. RightTriangleBar: "\u29D0",
  7023. RightTriangleEqual: "\u22B5",
  7024. RightUpDownVector: "\u294F",
  7025. RightUpTeeVector: "\u295C",
  7026. RightUpVector: "\u21BE",
  7027. RightUpVectorBar: "\u2954",
  7028. RightVector: "\u21C0",
  7029. RightVectorBar: "\u2953",
  7030. Rightarrow: "\u21D2",
  7031. Ropf: "\u211D",
  7032. RoundImplies: "\u2970",
  7033. Rrightarrow: "\u21DB",
  7034. Rscr: "\u211B",
  7035. Rsh: "\u21B1",
  7036. RuleDelayed: "\u29F4",
  7037. SHCHcy: "\u0429",
  7038. SHcy: "\u0428",
  7039. SOFTcy: "\u042C",
  7040. Sacute: "\u015A",
  7041. Sc: "\u2ABC",
  7042. Scaron: "\u0160",
  7043. Scedil: "\u015E",
  7044. Scirc: "\u015C",
  7045. Scy: "\u0421",
  7046. Sfr: "\u{1D516}",
  7047. ShortDownArrow: "\u2193",
  7048. ShortLeftArrow: "\u2190",
  7049. ShortRightArrow: "\u2192",
  7050. ShortUpArrow: "\u2191",
  7051. Sigma: "\u03A3",
  7052. SmallCircle: "\u2218",
  7053. Sopf: "\u{1D54A}",
  7054. Sqrt: "\u221A",
  7055. Square: "\u25A1",
  7056. SquareIntersection: "\u2293",
  7057. SquareSubset: "\u228F",
  7058. SquareSubsetEqual: "\u2291",
  7059. SquareSuperset: "\u2290",
  7060. SquareSupersetEqual: "\u2292",
  7061. SquareUnion: "\u2294",
  7062. Sscr: "\u{1D4AE}",
  7063. Star: "\u22C6",
  7064. Sub: "\u22D0",
  7065. Subset: "\u22D0",
  7066. SubsetEqual: "\u2286",
  7067. Succeeds: "\u227B",
  7068. SucceedsEqual: "\u2AB0",
  7069. SucceedsSlantEqual: "\u227D",
  7070. SucceedsTilde: "\u227F",
  7071. SuchThat: "\u220B",
  7072. Sum: "\u2211",
  7073. Sup: "\u22D1",
  7074. Superset: "\u2283",
  7075. SupersetEqual: "\u2287",
  7076. Supset: "\u22D1",
  7077. THORN: "\xDE",
  7078. TRADE: "\u2122",
  7079. TSHcy: "\u040B",
  7080. TScy: "\u0426",
  7081. Tab: " ",
  7082. Tau: "\u03A4",
  7083. Tcaron: "\u0164",
  7084. Tcedil: "\u0162",
  7085. Tcy: "\u0422",
  7086. Tfr: "\u{1D517}",
  7087. Therefore: "\u2234",
  7088. Theta: "\u0398",
  7089. ThickSpace: "\u205F\u200A",
  7090. ThinSpace: "\u2009",
  7091. Tilde: "\u223C",
  7092. TildeEqual: "\u2243",
  7093. TildeFullEqual: "\u2245",
  7094. TildeTilde: "\u2248",
  7095. Topf: "\u{1D54B}",
  7096. TripleDot: "\u20DB",
  7097. Tscr: "\u{1D4AF}",
  7098. Tstrok: "\u0166",
  7099. Uacute: "\xDA",
  7100. Uarr: "\u219F",
  7101. Uarrocir: "\u2949",
  7102. Ubrcy: "\u040E",
  7103. Ubreve: "\u016C",
  7104. Ucirc: "\xDB",
  7105. Ucy: "\u0423",
  7106. Udblac: "\u0170",
  7107. Ufr: "\u{1D518}",
  7108. Ugrave: "\xD9",
  7109. Umacr: "\u016A",
  7110. UnderBar: "_",
  7111. UnderBrace: "\u23DF",
  7112. UnderBracket: "\u23B5",
  7113. UnderParenthesis: "\u23DD",
  7114. Union: "\u22C3",
  7115. UnionPlus: "\u228E",
  7116. Uogon: "\u0172",
  7117. Uopf: "\u{1D54C}",
  7118. UpArrow: "\u2191",
  7119. UpArrowBar: "\u2912",
  7120. UpArrowDownArrow: "\u21C5",
  7121. UpDownArrow: "\u2195",
  7122. UpEquilibrium: "\u296E",
  7123. UpTee: "\u22A5",
  7124. UpTeeArrow: "\u21A5",
  7125. Uparrow: "\u21D1",
  7126. Updownarrow: "\u21D5",
  7127. UpperLeftArrow: "\u2196",
  7128. UpperRightArrow: "\u2197",
  7129. Upsi: "\u03D2",
  7130. Upsilon: "\u03A5",
  7131. Uring: "\u016E",
  7132. Uscr: "\u{1D4B0}",
  7133. Utilde: "\u0168",
  7134. Uuml: "\xDC",
  7135. VDash: "\u22AB",
  7136. Vbar: "\u2AEB",
  7137. Vcy: "\u0412",
  7138. Vdash: "\u22A9",
  7139. Vdashl: "\u2AE6",
  7140. Vee: "\u22C1",
  7141. Verbar: "\u2016",
  7142. Vert: "\u2016",
  7143. VerticalBar: "\u2223",
  7144. VerticalLine: "|",
  7145. VerticalSeparator: "\u2758",
  7146. VerticalTilde: "\u2240",
  7147. VeryThinSpace: "\u200A",
  7148. Vfr: "\u{1D519}",
  7149. Vopf: "\u{1D54D}",
  7150. Vscr: "\u{1D4B1}",
  7151. Vvdash: "\u22AA",
  7152. Wcirc: "\u0174",
  7153. Wedge: "\u22C0",
  7154. Wfr: "\u{1D51A}",
  7155. Wopf: "\u{1D54E}",
  7156. Wscr: "\u{1D4B2}",
  7157. Xfr: "\u{1D51B}",
  7158. Xi: "\u039E",
  7159. Xopf: "\u{1D54F}",
  7160. Xscr: "\u{1D4B3}",
  7161. YAcy: "\u042F",
  7162. YIcy: "\u0407",
  7163. YUcy: "\u042E",
  7164. Yacute: "\xDD",
  7165. Ycirc: "\u0176",
  7166. Ycy: "\u042B",
  7167. Yfr: "\u{1D51C}",
  7168. Yopf: "\u{1D550}",
  7169. Yscr: "\u{1D4B4}",
  7170. Yuml: "\u0178",
  7171. ZHcy: "\u0416",
  7172. Zacute: "\u0179",
  7173. Zcaron: "\u017D",
  7174. Zcy: "\u0417",
  7175. Zdot: "\u017B",
  7176. ZeroWidthSpace: "\u200B",
  7177. Zeta: "\u0396",
  7178. Zfr: "\u2128",
  7179. Zopf: "\u2124",
  7180. Zscr: "\u{1D4B5}",
  7181. aacute: "\xE1",
  7182. abreve: "\u0103",
  7183. ac: "\u223E",
  7184. acE: "\u223E\u0333",
  7185. acd: "\u223F",
  7186. acirc: "\xE2",
  7187. acute: "\xB4",
  7188. acy: "\u0430",
  7189. aelig: "\xE6",
  7190. af: "\u2061",
  7191. afr: "\u{1D51E}",
  7192. agrave: "\xE0",
  7193. alefsym: "\u2135",
  7194. aleph: "\u2135",
  7195. alpha: "\u03B1",
  7196. amacr: "\u0101",
  7197. amalg: "\u2A3F",
  7198. amp: "&",
  7199. and: "\u2227",
  7200. andand: "\u2A55",
  7201. andd: "\u2A5C",
  7202. andslope: "\u2A58",
  7203. andv: "\u2A5A",
  7204. ang: "\u2220",
  7205. ange: "\u29A4",
  7206. angle: "\u2220",
  7207. angmsd: "\u2221",
  7208. angmsdaa: "\u29A8",
  7209. angmsdab: "\u29A9",
  7210. angmsdac: "\u29AA",
  7211. angmsdad: "\u29AB",
  7212. angmsdae: "\u29AC",
  7213. angmsdaf: "\u29AD",
  7214. angmsdag: "\u29AE",
  7215. angmsdah: "\u29AF",
  7216. angrt: "\u221F",
  7217. angrtvb: "\u22BE",
  7218. angrtvbd: "\u299D",
  7219. angsph: "\u2222",
  7220. angst: "\xC5",
  7221. angzarr: "\u237C",
  7222. aogon: "\u0105",
  7223. aopf: "\u{1D552}",
  7224. ap: "\u2248",
  7225. apE: "\u2A70",
  7226. apacir: "\u2A6F",
  7227. ape: "\u224A",
  7228. apid: "\u224B",
  7229. apos: "'",
  7230. approx: "\u2248",
  7231. approxeq: "\u224A",
  7232. aring: "\xE5",
  7233. ascr: "\u{1D4B6}",
  7234. ast: "*",
  7235. asymp: "\u2248",
  7236. asympeq: "\u224D",
  7237. atilde: "\xE3",
  7238. auml: "\xE4",
  7239. awconint: "\u2233",
  7240. awint: "\u2A11",
  7241. bNot: "\u2AED",
  7242. backcong: "\u224C",
  7243. backepsilon: "\u03F6",
  7244. backprime: "\u2035",
  7245. backsim: "\u223D",
  7246. backsimeq: "\u22CD",
  7247. barvee: "\u22BD",
  7248. barwed: "\u2305",
  7249. barwedge: "\u2305",
  7250. bbrk: "\u23B5",
  7251. bbrktbrk: "\u23B6",
  7252. bcong: "\u224C",
  7253. bcy: "\u0431",
  7254. bdquo: "\u201E",
  7255. becaus: "\u2235",
  7256. because: "\u2235",
  7257. bemptyv: "\u29B0",
  7258. bepsi: "\u03F6",
  7259. bernou: "\u212C",
  7260. beta: "\u03B2",
  7261. beth: "\u2136",
  7262. between: "\u226C",
  7263. bfr: "\u{1D51F}",
  7264. bigcap: "\u22C2",
  7265. bigcirc: "\u25EF",
  7266. bigcup: "\u22C3",
  7267. bigodot: "\u2A00",
  7268. bigoplus: "\u2A01",
  7269. bigotimes: "\u2A02",
  7270. bigsqcup: "\u2A06",
  7271. bigstar: "\u2605",
  7272. bigtriangledown: "\u25BD",
  7273. bigtriangleup: "\u25B3",
  7274. biguplus: "\u2A04",
  7275. bigvee: "\u22C1",
  7276. bigwedge: "\u22C0",
  7277. bkarow: "\u290D",
  7278. blacklozenge: "\u29EB",
  7279. blacksquare: "\u25AA",
  7280. blacktriangle: "\u25B4",
  7281. blacktriangledown: "\u25BE",
  7282. blacktriangleleft: "\u25C2",
  7283. blacktriangleright: "\u25B8",
  7284. blank: "\u2423",
  7285. blk12: "\u2592",
  7286. blk14: "\u2591",
  7287. blk34: "\u2593",
  7288. block: "\u2588",
  7289. bne: "=\u20E5",
  7290. bnequiv: "\u2261\u20E5",
  7291. bnot: "\u2310",
  7292. bopf: "\u{1D553}",
  7293. bot: "\u22A5",
  7294. bottom: "\u22A5",
  7295. bowtie: "\u22C8",
  7296. boxDL: "\u2557",
  7297. boxDR: "\u2554",
  7298. boxDl: "\u2556",
  7299. boxDr: "\u2553",
  7300. boxH: "\u2550",
  7301. boxHD: "\u2566",
  7302. boxHU: "\u2569",
  7303. boxHd: "\u2564",
  7304. boxHu: "\u2567",
  7305. boxUL: "\u255D",
  7306. boxUR: "\u255A",
  7307. boxUl: "\u255C",
  7308. boxUr: "\u2559",
  7309. boxV: "\u2551",
  7310. boxVH: "\u256C",
  7311. boxVL: "\u2563",
  7312. boxVR: "\u2560",
  7313. boxVh: "\u256B",
  7314. boxVl: "\u2562",
  7315. boxVr: "\u255F",
  7316. boxbox: "\u29C9",
  7317. boxdL: "\u2555",
  7318. boxdR: "\u2552",
  7319. boxdl: "\u2510",
  7320. boxdr: "\u250C",
  7321. boxh: "\u2500",
  7322. boxhD: "\u2565",
  7323. boxhU: "\u2568",
  7324. boxhd: "\u252C",
  7325. boxhu: "\u2534",
  7326. boxminus: "\u229F",
  7327. boxplus: "\u229E",
  7328. boxtimes: "\u22A0",
  7329. boxuL: "\u255B",
  7330. boxuR: "\u2558",
  7331. boxul: "\u2518",
  7332. boxur: "\u2514",
  7333. boxv: "\u2502",
  7334. boxvH: "\u256A",
  7335. boxvL: "\u2561",
  7336. boxvR: "\u255E",
  7337. boxvh: "\u253C",
  7338. boxvl: "\u2524",
  7339. boxvr: "\u251C",
  7340. bprime: "\u2035",
  7341. breve: "\u02D8",
  7342. brvbar: "\xA6",
  7343. bscr: "\u{1D4B7}",
  7344. bsemi: "\u204F",
  7345. bsim: "\u223D",
  7346. bsime: "\u22CD",
  7347. bsol: "\\",
  7348. bsolb: "\u29C5",
  7349. bsolhsub: "\u27C8",
  7350. bull: "\u2022",
  7351. bullet: "\u2022",
  7352. bump: "\u224E",
  7353. bumpE: "\u2AAE",
  7354. bumpe: "\u224F",
  7355. bumpeq: "\u224F",
  7356. cacute: "\u0107",
  7357. cap: "\u2229",
  7358. capand: "\u2A44",
  7359. capbrcup: "\u2A49",
  7360. capcap: "\u2A4B",
  7361. capcup: "\u2A47",
  7362. capdot: "\u2A40",
  7363. caps: "\u2229\uFE00",
  7364. caret: "\u2041",
  7365. caron: "\u02C7",
  7366. ccaps: "\u2A4D",
  7367. ccaron: "\u010D",
  7368. ccedil: "\xE7",
  7369. ccirc: "\u0109",
  7370. ccups: "\u2A4C",
  7371. ccupssm: "\u2A50",
  7372. cdot: "\u010B",
  7373. cedil: "\xB8",
  7374. cemptyv: "\u29B2",
  7375. cent: "\xA2",
  7376. centerdot: "\xB7",
  7377. cfr: "\u{1D520}",
  7378. chcy: "\u0447",
  7379. check: "\u2713",
  7380. checkmark: "\u2713",
  7381. chi: "\u03C7",
  7382. cir: "\u25CB",
  7383. cirE: "\u29C3",
  7384. circ: "\u02C6",
  7385. circeq: "\u2257",
  7386. circlearrowleft: "\u21BA",
  7387. circlearrowright: "\u21BB",
  7388. circledR: "\xAE",
  7389. circledS: "\u24C8",
  7390. circledast: "\u229B",
  7391. circledcirc: "\u229A",
  7392. circleddash: "\u229D",
  7393. cire: "\u2257",
  7394. cirfnint: "\u2A10",
  7395. cirmid: "\u2AEF",
  7396. cirscir: "\u29C2",
  7397. clubs: "\u2663",
  7398. clubsuit: "\u2663",
  7399. colon: ":",
  7400. colone: "\u2254",
  7401. coloneq: "\u2254",
  7402. comma: ",",
  7403. commat: "@",
  7404. comp: "\u2201",
  7405. compfn: "\u2218",
  7406. complement: "\u2201",
  7407. complexes: "\u2102",
  7408. cong: "\u2245",
  7409. congdot: "\u2A6D",
  7410. conint: "\u222E",
  7411. copf: "\u{1D554}",
  7412. coprod: "\u2210",
  7413. copy: "\xA9",
  7414. copysr: "\u2117",
  7415. crarr: "\u21B5",
  7416. cross: "\u2717",
  7417. cscr: "\u{1D4B8}",
  7418. csub: "\u2ACF",
  7419. csube: "\u2AD1",
  7420. csup: "\u2AD0",
  7421. csupe: "\u2AD2",
  7422. ctdot: "\u22EF",
  7423. cudarrl: "\u2938",
  7424. cudarrr: "\u2935",
  7425. cuepr: "\u22DE",
  7426. cuesc: "\u22DF",
  7427. cularr: "\u21B6",
  7428. cularrp: "\u293D",
  7429. cup: "\u222A",
  7430. cupbrcap: "\u2A48",
  7431. cupcap: "\u2A46",
  7432. cupcup: "\u2A4A",
  7433. cupdot: "\u228D",
  7434. cupor: "\u2A45",
  7435. cups: "\u222A\uFE00",
  7436. curarr: "\u21B7",
  7437. curarrm: "\u293C",
  7438. curlyeqprec: "\u22DE",
  7439. curlyeqsucc: "\u22DF",
  7440. curlyvee: "\u22CE",
  7441. curlywedge: "\u22CF",
  7442. curren: "\xA4",
  7443. curvearrowleft: "\u21B6",
  7444. curvearrowright: "\u21B7",
  7445. cuvee: "\u22CE",
  7446. cuwed: "\u22CF",
  7447. cwconint: "\u2232",
  7448. cwint: "\u2231",
  7449. cylcty: "\u232D",
  7450. dArr: "\u21D3",
  7451. dHar: "\u2965",
  7452. dagger: "\u2020",
  7453. daleth: "\u2138",
  7454. darr: "\u2193",
  7455. dash: "\u2010",
  7456. dashv: "\u22A3",
  7457. dbkarow: "\u290F",
  7458. dblac: "\u02DD",
  7459. dcaron: "\u010F",
  7460. dcy: "\u0434",
  7461. dd: "\u2146",
  7462. ddagger: "\u2021",
  7463. ddarr: "\u21CA",
  7464. ddotseq: "\u2A77",
  7465. deg: "\xB0",
  7466. delta: "\u03B4",
  7467. demptyv: "\u29B1",
  7468. dfisht: "\u297F",
  7469. dfr: "\u{1D521}",
  7470. dharl: "\u21C3",
  7471. dharr: "\u21C2",
  7472. diam: "\u22C4",
  7473. diamond: "\u22C4",
  7474. diamondsuit: "\u2666",
  7475. diams: "\u2666",
  7476. die: "\xA8",
  7477. digamma: "\u03DD",
  7478. disin: "\u22F2",
  7479. div: "\xF7",
  7480. divide: "\xF7",
  7481. divideontimes: "\u22C7",
  7482. divonx: "\u22C7",
  7483. djcy: "\u0452",
  7484. dlcorn: "\u231E",
  7485. dlcrop: "\u230D",
  7486. dollar: "$",
  7487. dopf: "\u{1D555}",
  7488. dot: "\u02D9",
  7489. doteq: "\u2250",
  7490. doteqdot: "\u2251",
  7491. dotminus: "\u2238",
  7492. dotplus: "\u2214",
  7493. dotsquare: "\u22A1",
  7494. doublebarwedge: "\u2306",
  7495. downarrow: "\u2193",
  7496. downdownarrows: "\u21CA",
  7497. downharpoonleft: "\u21C3",
  7498. downharpoonright: "\u21C2",
  7499. drbkarow: "\u2910",
  7500. drcorn: "\u231F",
  7501. drcrop: "\u230C",
  7502. dscr: "\u{1D4B9}",
  7503. dscy: "\u0455",
  7504. dsol: "\u29F6",
  7505. dstrok: "\u0111",
  7506. dtdot: "\u22F1",
  7507. dtri: "\u25BF",
  7508. dtrif: "\u25BE",
  7509. duarr: "\u21F5",
  7510. duhar: "\u296F",
  7511. dwangle: "\u29A6",
  7512. dzcy: "\u045F",
  7513. dzigrarr: "\u27FF",
  7514. eDDot: "\u2A77",
  7515. eDot: "\u2251",
  7516. eacute: "\xE9",
  7517. easter: "\u2A6E",
  7518. ecaron: "\u011B",
  7519. ecir: "\u2256",
  7520. ecirc: "\xEA",
  7521. ecolon: "\u2255",
  7522. ecy: "\u044D",
  7523. edot: "\u0117",
  7524. ee: "\u2147",
  7525. efDot: "\u2252",
  7526. efr: "\u{1D522}",
  7527. eg: "\u2A9A",
  7528. egrave: "\xE8",
  7529. egs: "\u2A96",
  7530. egsdot: "\u2A98",
  7531. el: "\u2A99",
  7532. elinters: "\u23E7",
  7533. ell: "\u2113",
  7534. els: "\u2A95",
  7535. elsdot: "\u2A97",
  7536. emacr: "\u0113",
  7537. empty: "\u2205",
  7538. emptyset: "\u2205",
  7539. emptyv: "\u2205",
  7540. emsp13: "\u2004",
  7541. emsp14: "\u2005",
  7542. emsp: "\u2003",
  7543. eng: "\u014B",
  7544. ensp: "\u2002",
  7545. eogon: "\u0119",
  7546. eopf: "\u{1D556}",
  7547. epar: "\u22D5",
  7548. eparsl: "\u29E3",
  7549. eplus: "\u2A71",
  7550. epsi: "\u03B5",
  7551. epsilon: "\u03B5",
  7552. epsiv: "\u03F5",
  7553. eqcirc: "\u2256",
  7554. eqcolon: "\u2255",
  7555. eqsim: "\u2242",
  7556. eqslantgtr: "\u2A96",
  7557. eqslantless: "\u2A95",
  7558. equals: "=",
  7559. equest: "\u225F",
  7560. equiv: "\u2261",
  7561. equivDD: "\u2A78",
  7562. eqvparsl: "\u29E5",
  7563. erDot: "\u2253",
  7564. erarr: "\u2971",
  7565. escr: "\u212F",
  7566. esdot: "\u2250",
  7567. esim: "\u2242",
  7568. eta: "\u03B7",
  7569. eth: "\xF0",
  7570. euml: "\xEB",
  7571. euro: "\u20AC",
  7572. excl: "!",
  7573. exist: "\u2203",
  7574. expectation: "\u2130",
  7575. exponentiale: "\u2147",
  7576. fallingdotseq: "\u2252",
  7577. fcy: "\u0444",
  7578. female: "\u2640",
  7579. ffilig: "\uFB03",
  7580. fflig: "\uFB00",
  7581. ffllig: "\uFB04",
  7582. ffr: "\u{1D523}",
  7583. filig: "\uFB01",
  7584. fjlig: "fj",
  7585. flat: "\u266D",
  7586. fllig: "\uFB02",
  7587. fltns: "\u25B1",
  7588. fnof: "\u0192",
  7589. fopf: "\u{1D557}",
  7590. forall: "\u2200",
  7591. fork: "\u22D4",
  7592. forkv: "\u2AD9",
  7593. fpartint: "\u2A0D",
  7594. frac12: "\xBD",
  7595. frac13: "\u2153",
  7596. frac14: "\xBC",
  7597. frac15: "\u2155",
  7598. frac16: "\u2159",
  7599. frac18: "\u215B",
  7600. frac23: "\u2154",
  7601. frac25: "\u2156",
  7602. frac34: "\xBE",
  7603. frac35: "\u2157",
  7604. frac38: "\u215C",
  7605. frac45: "\u2158",
  7606. frac56: "\u215A",
  7607. frac58: "\u215D",
  7608. frac78: "\u215E",
  7609. frasl: "\u2044",
  7610. frown: "\u2322",
  7611. fscr: "\u{1D4BB}",
  7612. gE: "\u2267",
  7613. gEl: "\u2A8C",
  7614. gacute: "\u01F5",
  7615. gamma: "\u03B3",
  7616. gammad: "\u03DD",
  7617. gap: "\u2A86",
  7618. gbreve: "\u011F",
  7619. gcirc: "\u011D",
  7620. gcy: "\u0433",
  7621. gdot: "\u0121",
  7622. ge: "\u2265",
  7623. gel: "\u22DB",
  7624. geq: "\u2265",
  7625. geqq: "\u2267",
  7626. geqslant: "\u2A7E",
  7627. ges: "\u2A7E",
  7628. gescc: "\u2AA9",
  7629. gesdot: "\u2A80",
  7630. gesdoto: "\u2A82",
  7631. gesdotol: "\u2A84",
  7632. gesl: "\u22DB\uFE00",
  7633. gesles: "\u2A94",
  7634. gfr: "\u{1D524}",
  7635. gg: "\u226B",
  7636. ggg: "\u22D9",
  7637. gimel: "\u2137",
  7638. gjcy: "\u0453",
  7639. gl: "\u2277",
  7640. glE: "\u2A92",
  7641. gla: "\u2AA5",
  7642. glj: "\u2AA4",
  7643. gnE: "\u2269",
  7644. gnap: "\u2A8A",
  7645. gnapprox: "\u2A8A",
  7646. gne: "\u2A88",
  7647. gneq: "\u2A88",
  7648. gneqq: "\u2269",
  7649. gnsim: "\u22E7",
  7650. gopf: "\u{1D558}",
  7651. grave: "`",
  7652. gscr: "\u210A",
  7653. gsim: "\u2273",
  7654. gsime: "\u2A8E",
  7655. gsiml: "\u2A90",
  7656. gt: ">",
  7657. gtcc: "\u2AA7",
  7658. gtcir: "\u2A7A",
  7659. gtdot: "\u22D7",
  7660. gtlPar: "\u2995",
  7661. gtquest: "\u2A7C",
  7662. gtrapprox: "\u2A86",
  7663. gtrarr: "\u2978",
  7664. gtrdot: "\u22D7",
  7665. gtreqless: "\u22DB",
  7666. gtreqqless: "\u2A8C",
  7667. gtrless: "\u2277",
  7668. gtrsim: "\u2273",
  7669. gvertneqq: "\u2269\uFE00",
  7670. gvnE: "\u2269\uFE00",
  7671. hArr: "\u21D4",
  7672. hairsp: "\u200A",
  7673. half: "\xBD",
  7674. hamilt: "\u210B",
  7675. hardcy: "\u044A",
  7676. harr: "\u2194",
  7677. harrcir: "\u2948",
  7678. harrw: "\u21AD",
  7679. hbar: "\u210F",
  7680. hcirc: "\u0125",
  7681. hearts: "\u2665",
  7682. heartsuit: "\u2665",
  7683. hellip: "\u2026",
  7684. hercon: "\u22B9",
  7685. hfr: "\u{1D525}",
  7686. hksearow: "\u2925",
  7687. hkswarow: "\u2926",
  7688. hoarr: "\u21FF",
  7689. homtht: "\u223B",
  7690. hookleftarrow: "\u21A9",
  7691. hookrightarrow: "\u21AA",
  7692. hopf: "\u{1D559}",
  7693. horbar: "\u2015",
  7694. hscr: "\u{1D4BD}",
  7695. hslash: "\u210F",
  7696. hstrok: "\u0127",
  7697. hybull: "\u2043",
  7698. hyphen: "\u2010",
  7699. iacute: "\xED",
  7700. ic: "\u2063",
  7701. icirc: "\xEE",
  7702. icy: "\u0438",
  7703. iecy: "\u0435",
  7704. iexcl: "\xA1",
  7705. iff: "\u21D4",
  7706. ifr: "\u{1D526}",
  7707. igrave: "\xEC",
  7708. ii: "\u2148",
  7709. iiiint: "\u2A0C",
  7710. iiint: "\u222D",
  7711. iinfin: "\u29DC",
  7712. iiota: "\u2129",
  7713. ijlig: "\u0133",
  7714. imacr: "\u012B",
  7715. image: "\u2111",
  7716. imagline: "\u2110",
  7717. imagpart: "\u2111",
  7718. imath: "\u0131",
  7719. imof: "\u22B7",
  7720. imped: "\u01B5",
  7721. in: "\u2208",
  7722. incare: "\u2105",
  7723. infin: "\u221E",
  7724. infintie: "\u29DD",
  7725. inodot: "\u0131",
  7726. int: "\u222B",
  7727. intcal: "\u22BA",
  7728. integers: "\u2124",
  7729. intercal: "\u22BA",
  7730. intlarhk: "\u2A17",
  7731. intprod: "\u2A3C",
  7732. iocy: "\u0451",
  7733. iogon: "\u012F",
  7734. iopf: "\u{1D55A}",
  7735. iota: "\u03B9",
  7736. iprod: "\u2A3C",
  7737. iquest: "\xBF",
  7738. iscr: "\u{1D4BE}",
  7739. isin: "\u2208",
  7740. isinE: "\u22F9",
  7741. isindot: "\u22F5",
  7742. isins: "\u22F4",
  7743. isinsv: "\u22F3",
  7744. isinv: "\u2208",
  7745. it: "\u2062",
  7746. itilde: "\u0129",
  7747. iukcy: "\u0456",
  7748. iuml: "\xEF",
  7749. jcirc: "\u0135",
  7750. jcy: "\u0439",
  7751. jfr: "\u{1D527}",
  7752. jmath: "\u0237",
  7753. jopf: "\u{1D55B}",
  7754. jscr: "\u{1D4BF}",
  7755. jsercy: "\u0458",
  7756. jukcy: "\u0454",
  7757. kappa: "\u03BA",
  7758. kappav: "\u03F0",
  7759. kcedil: "\u0137",
  7760. kcy: "\u043A",
  7761. kfr: "\u{1D528}",
  7762. kgreen: "\u0138",
  7763. khcy: "\u0445",
  7764. kjcy: "\u045C",
  7765. kopf: "\u{1D55C}",
  7766. kscr: "\u{1D4C0}",
  7767. lAarr: "\u21DA",
  7768. lArr: "\u21D0",
  7769. lAtail: "\u291B",
  7770. lBarr: "\u290E",
  7771. lE: "\u2266",
  7772. lEg: "\u2A8B",
  7773. lHar: "\u2962",
  7774. lacute: "\u013A",
  7775. laemptyv: "\u29B4",
  7776. lagran: "\u2112",
  7777. lambda: "\u03BB",
  7778. lang: "\u27E8",
  7779. langd: "\u2991",
  7780. langle: "\u27E8",
  7781. lap: "\u2A85",
  7782. laquo: "\xAB",
  7783. larr: "\u2190",
  7784. larrb: "\u21E4",
  7785. larrbfs: "\u291F",
  7786. larrfs: "\u291D",
  7787. larrhk: "\u21A9",
  7788. larrlp: "\u21AB",
  7789. larrpl: "\u2939",
  7790. larrsim: "\u2973",
  7791. larrtl: "\u21A2",
  7792. lat: "\u2AAB",
  7793. latail: "\u2919",
  7794. late: "\u2AAD",
  7795. lates: "\u2AAD\uFE00",
  7796. lbarr: "\u290C",
  7797. lbbrk: "\u2772",
  7798. lbrace: "{",
  7799. lbrack: "[",
  7800. lbrke: "\u298B",
  7801. lbrksld: "\u298F",
  7802. lbrkslu: "\u298D",
  7803. lcaron: "\u013E",
  7804. lcedil: "\u013C",
  7805. lceil: "\u2308",
  7806. lcub: "{",
  7807. lcy: "\u043B",
  7808. ldca: "\u2936",
  7809. ldquo: "\u201C",
  7810. ldquor: "\u201E",
  7811. ldrdhar: "\u2967",
  7812. ldrushar: "\u294B",
  7813. ldsh: "\u21B2",
  7814. le: "\u2264",
  7815. leftarrow: "\u2190",
  7816. leftarrowtail: "\u21A2",
  7817. leftharpoondown: "\u21BD",
  7818. leftharpoonup: "\u21BC",
  7819. leftleftarrows: "\u21C7",
  7820. leftrightarrow: "\u2194",
  7821. leftrightarrows: "\u21C6",
  7822. leftrightharpoons: "\u21CB",
  7823. leftrightsquigarrow: "\u21AD",
  7824. leftthreetimes: "\u22CB",
  7825. leg: "\u22DA",
  7826. leq: "\u2264",
  7827. leqq: "\u2266",
  7828. leqslant: "\u2A7D",
  7829. les: "\u2A7D",
  7830. lescc: "\u2AA8",
  7831. lesdot: "\u2A7F",
  7832. lesdoto: "\u2A81",
  7833. lesdotor: "\u2A83",
  7834. lesg: "\u22DA\uFE00",
  7835. lesges: "\u2A93",
  7836. lessapprox: "\u2A85",
  7837. lessdot: "\u22D6",
  7838. lesseqgtr: "\u22DA",
  7839. lesseqqgtr: "\u2A8B",
  7840. lessgtr: "\u2276",
  7841. lesssim: "\u2272",
  7842. lfisht: "\u297C",
  7843. lfloor: "\u230A",
  7844. lfr: "\u{1D529}",
  7845. lg: "\u2276",
  7846. lgE: "\u2A91",
  7847. lhard: "\u21BD",
  7848. lharu: "\u21BC",
  7849. lharul: "\u296A",
  7850. lhblk: "\u2584",
  7851. ljcy: "\u0459",
  7852. ll: "\u226A",
  7853. llarr: "\u21C7",
  7854. llcorner: "\u231E",
  7855. llhard: "\u296B",
  7856. lltri: "\u25FA",
  7857. lmidot: "\u0140",
  7858. lmoust: "\u23B0",
  7859. lmoustache: "\u23B0",
  7860. lnE: "\u2268",
  7861. lnap: "\u2A89",
  7862. lnapprox: "\u2A89",
  7863. lne: "\u2A87",
  7864. lneq: "\u2A87",
  7865. lneqq: "\u2268",
  7866. lnsim: "\u22E6",
  7867. loang: "\u27EC",
  7868. loarr: "\u21FD",
  7869. lobrk: "\u27E6",
  7870. longleftarrow: "\u27F5",
  7871. longleftrightarrow: "\u27F7",
  7872. longmapsto: "\u27FC",
  7873. longrightarrow: "\u27F6",
  7874. looparrowleft: "\u21AB",
  7875. looparrowright: "\u21AC",
  7876. lopar: "\u2985",
  7877. lopf: "\u{1D55D}",
  7878. loplus: "\u2A2D",
  7879. lotimes: "\u2A34",
  7880. lowast: "\u2217",
  7881. lowbar: "_",
  7882. loz: "\u25CA",
  7883. lozenge: "\u25CA",
  7884. lozf: "\u29EB",
  7885. lpar: "(",
  7886. lparlt: "\u2993",
  7887. lrarr: "\u21C6",
  7888. lrcorner: "\u231F",
  7889. lrhar: "\u21CB",
  7890. lrhard: "\u296D",
  7891. lrm: "\u200E",
  7892. lrtri: "\u22BF",
  7893. lsaquo: "\u2039",
  7894. lscr: "\u{1D4C1}",
  7895. lsh: "\u21B0",
  7896. lsim: "\u2272",
  7897. lsime: "\u2A8D",
  7898. lsimg: "\u2A8F",
  7899. lsqb: "[",
  7900. lsquo: "\u2018",
  7901. lsquor: "\u201A",
  7902. lstrok: "\u0142",
  7903. lt: "<",
  7904. ltcc: "\u2AA6",
  7905. ltcir: "\u2A79",
  7906. ltdot: "\u22D6",
  7907. lthree: "\u22CB",
  7908. ltimes: "\u22C9",
  7909. ltlarr: "\u2976",
  7910. ltquest: "\u2A7B",
  7911. ltrPar: "\u2996",
  7912. ltri: "\u25C3",
  7913. ltrie: "\u22B4",
  7914. ltrif: "\u25C2",
  7915. lurdshar: "\u294A",
  7916. luruhar: "\u2966",
  7917. lvertneqq: "\u2268\uFE00",
  7918. lvnE: "\u2268\uFE00",
  7919. mDDot: "\u223A",
  7920. macr: "\xAF",
  7921. male: "\u2642",
  7922. malt: "\u2720",
  7923. maltese: "\u2720",
  7924. map: "\u21A6",
  7925. mapsto: "\u21A6",
  7926. mapstodown: "\u21A7",
  7927. mapstoleft: "\u21A4",
  7928. mapstoup: "\u21A5",
  7929. marker: "\u25AE",
  7930. mcomma: "\u2A29",
  7931. mcy: "\u043C",
  7932. mdash: "\u2014",
  7933. measuredangle: "\u2221",
  7934. mfr: "\u{1D52A}",
  7935. mho: "\u2127",
  7936. micro: "\xB5",
  7937. mid: "\u2223",
  7938. midast: "*",
  7939. midcir: "\u2AF0",
  7940. middot: "\xB7",
  7941. minus: "\u2212",
  7942. minusb: "\u229F",
  7943. minusd: "\u2238",
  7944. minusdu: "\u2A2A",
  7945. mlcp: "\u2ADB",
  7946. mldr: "\u2026",
  7947. mnplus: "\u2213",
  7948. models: "\u22A7",
  7949. mopf: "\u{1D55E}",
  7950. mp: "\u2213",
  7951. mscr: "\u{1D4C2}",
  7952. mstpos: "\u223E",
  7953. mu: "\u03BC",
  7954. multimap: "\u22B8",
  7955. mumap: "\u22B8",
  7956. nGg: "\u22D9\u0338",
  7957. nGt: "\u226B\u20D2",
  7958. nGtv: "\u226B\u0338",
  7959. nLeftarrow: "\u21CD",
  7960. nLeftrightarrow: "\u21CE",
  7961. nLl: "\u22D8\u0338",
  7962. nLt: "\u226A\u20D2",
  7963. nLtv: "\u226A\u0338",
  7964. nRightarrow: "\u21CF",
  7965. nVDash: "\u22AF",
  7966. nVdash: "\u22AE",
  7967. nabla: "\u2207",
  7968. nacute: "\u0144",
  7969. nang: "\u2220\u20D2",
  7970. nap: "\u2249",
  7971. napE: "\u2A70\u0338",
  7972. napid: "\u224B\u0338",
  7973. napos: "\u0149",
  7974. napprox: "\u2249",
  7975. natur: "\u266E",
  7976. natural: "\u266E",
  7977. naturals: "\u2115",
  7978. nbsp: "\xA0",
  7979. nbump: "\u224E\u0338",
  7980. nbumpe: "\u224F\u0338",
  7981. ncap: "\u2A43",
  7982. ncaron: "\u0148",
  7983. ncedil: "\u0146",
  7984. ncong: "\u2247",
  7985. ncongdot: "\u2A6D\u0338",
  7986. ncup: "\u2A42",
  7987. ncy: "\u043D",
  7988. ndash: "\u2013",
  7989. ne: "\u2260",
  7990. neArr: "\u21D7",
  7991. nearhk: "\u2924",
  7992. nearr: "\u2197",
  7993. nearrow: "\u2197",
  7994. nedot: "\u2250\u0338",
  7995. nequiv: "\u2262",
  7996. nesear: "\u2928",
  7997. nesim: "\u2242\u0338",
  7998. nexist: "\u2204",
  7999. nexists: "\u2204",
  8000. nfr: "\u{1D52B}",
  8001. ngE: "\u2267\u0338",
  8002. nge: "\u2271",
  8003. ngeq: "\u2271",
  8004. ngeqq: "\u2267\u0338",
  8005. ngeqslant: "\u2A7E\u0338",
  8006. nges: "\u2A7E\u0338",
  8007. ngsim: "\u2275",
  8008. ngt: "\u226F",
  8009. ngtr: "\u226F",
  8010. nhArr: "\u21CE",
  8011. nharr: "\u21AE",
  8012. nhpar: "\u2AF2",
  8013. ni: "\u220B",
  8014. nis: "\u22FC",
  8015. nisd: "\u22FA",
  8016. niv: "\u220B",
  8017. njcy: "\u045A",
  8018. nlArr: "\u21CD",
  8019. nlE: "\u2266\u0338",
  8020. nlarr: "\u219A",
  8021. nldr: "\u2025",
  8022. nle: "\u2270",
  8023. nleftarrow: "\u219A",
  8024. nleftrightarrow: "\u21AE",
  8025. nleq: "\u2270",
  8026. nleqq: "\u2266\u0338",
  8027. nleqslant: "\u2A7D\u0338",
  8028. nles: "\u2A7D\u0338",
  8029. nless: "\u226E",
  8030. nlsim: "\u2274",
  8031. nlt: "\u226E",
  8032. nltri: "\u22EA",
  8033. nltrie: "\u22EC",
  8034. nmid: "\u2224",
  8035. nopf: "\u{1D55F}",
  8036. not: "\xAC",
  8037. notin: "\u2209",
  8038. notinE: "\u22F9\u0338",
  8039. notindot: "\u22F5\u0338",
  8040. notinva: "\u2209",
  8041. notinvb: "\u22F7",
  8042. notinvc: "\u22F6",
  8043. notni: "\u220C",
  8044. notniva: "\u220C",
  8045. notnivb: "\u22FE",
  8046. notnivc: "\u22FD",
  8047. npar: "\u2226",
  8048. nparallel: "\u2226",
  8049. nparsl: "\u2AFD\u20E5",
  8050. npart: "\u2202\u0338",
  8051. npolint: "\u2A14",
  8052. npr: "\u2280",
  8053. nprcue: "\u22E0",
  8054. npre: "\u2AAF\u0338",
  8055. nprec: "\u2280",
  8056. npreceq: "\u2AAF\u0338",
  8057. nrArr: "\u21CF",
  8058. nrarr: "\u219B",
  8059. nrarrc: "\u2933\u0338",
  8060. nrarrw: "\u219D\u0338",
  8061. nrightarrow: "\u219B",
  8062. nrtri: "\u22EB",
  8063. nrtrie: "\u22ED",
  8064. nsc: "\u2281",
  8065. nsccue: "\u22E1",
  8066. nsce: "\u2AB0\u0338",
  8067. nscr: "\u{1D4C3}",
  8068. nshortmid: "\u2224",
  8069. nshortparallel: "\u2226",
  8070. nsim: "\u2241",
  8071. nsime: "\u2244",
  8072. nsimeq: "\u2244",
  8073. nsmid: "\u2224",
  8074. nspar: "\u2226",
  8075. nsqsube: "\u22E2",
  8076. nsqsupe: "\u22E3",
  8077. nsub: "\u2284",
  8078. nsubE: "\u2AC5\u0338",
  8079. nsube: "\u2288",
  8080. nsubset: "\u2282\u20D2",
  8081. nsubseteq: "\u2288",
  8082. nsubseteqq: "\u2AC5\u0338",
  8083. nsucc: "\u2281",
  8084. nsucceq: "\u2AB0\u0338",
  8085. nsup: "\u2285",
  8086. nsupE: "\u2AC6\u0338",
  8087. nsupe: "\u2289",
  8088. nsupset: "\u2283\u20D2",
  8089. nsupseteq: "\u2289",
  8090. nsupseteqq: "\u2AC6\u0338",
  8091. ntgl: "\u2279",
  8092. ntilde: "\xF1",
  8093. ntlg: "\u2278",
  8094. ntriangleleft: "\u22EA",
  8095. ntrianglelefteq: "\u22EC",
  8096. ntriangleright: "\u22EB",
  8097. ntrianglerighteq: "\u22ED",
  8098. nu: "\u03BD",
  8099. num: "#",
  8100. numero: "\u2116",
  8101. numsp: "\u2007",
  8102. nvDash: "\u22AD",
  8103. nvHarr: "\u2904",
  8104. nvap: "\u224D\u20D2",
  8105. nvdash: "\u22AC",
  8106. nvge: "\u2265\u20D2",
  8107. nvgt: ">\u20D2",
  8108. nvinfin: "\u29DE",
  8109. nvlArr: "\u2902",
  8110. nvle: "\u2264\u20D2",
  8111. nvlt: "<\u20D2",
  8112. nvltrie: "\u22B4\u20D2",
  8113. nvrArr: "\u2903",
  8114. nvrtrie: "\u22B5\u20D2",
  8115. nvsim: "\u223C\u20D2",
  8116. nwArr: "\u21D6",
  8117. nwarhk: "\u2923",
  8118. nwarr: "\u2196",
  8119. nwarrow: "\u2196",
  8120. nwnear: "\u2927",
  8121. oS: "\u24C8",
  8122. oacute: "\xF3",
  8123. oast: "\u229B",
  8124. ocir: "\u229A",
  8125. ocirc: "\xF4",
  8126. ocy: "\u043E",
  8127. odash: "\u229D",
  8128. odblac: "\u0151",
  8129. odiv: "\u2A38",
  8130. odot: "\u2299",
  8131. odsold: "\u29BC",
  8132. oelig: "\u0153",
  8133. ofcir: "\u29BF",
  8134. ofr: "\u{1D52C}",
  8135. ogon: "\u02DB",
  8136. ograve: "\xF2",
  8137. ogt: "\u29C1",
  8138. ohbar: "\u29B5",
  8139. ohm: "\u03A9",
  8140. oint: "\u222E",
  8141. olarr: "\u21BA",
  8142. olcir: "\u29BE",
  8143. olcross: "\u29BB",
  8144. oline: "\u203E",
  8145. olt: "\u29C0",
  8146. omacr: "\u014D",
  8147. omega: "\u03C9",
  8148. omicron: "\u03BF",
  8149. omid: "\u29B6",
  8150. ominus: "\u2296",
  8151. oopf: "\u{1D560}",
  8152. opar: "\u29B7",
  8153. operp: "\u29B9",
  8154. oplus: "\u2295",
  8155. or: "\u2228",
  8156. orarr: "\u21BB",
  8157. ord: "\u2A5D",
  8158. order: "\u2134",
  8159. orderof: "\u2134",
  8160. ordf: "\xAA",
  8161. ordm: "\xBA",
  8162. origof: "\u22B6",
  8163. oror: "\u2A56",
  8164. orslope: "\u2A57",
  8165. orv: "\u2A5B",
  8166. oscr: "\u2134",
  8167. oslash: "\xF8",
  8168. osol: "\u2298",
  8169. otilde: "\xF5",
  8170. otimes: "\u2297",
  8171. otimesas: "\u2A36",
  8172. ouml: "\xF6",
  8173. ovbar: "\u233D",
  8174. par: "\u2225",
  8175. para: "\xB6",
  8176. parallel: "\u2225",
  8177. parsim: "\u2AF3",
  8178. parsl: "\u2AFD",
  8179. part: "\u2202",
  8180. pcy: "\u043F",
  8181. percnt: "%",
  8182. period: ".",
  8183. permil: "\u2030",
  8184. perp: "\u22A5",
  8185. pertenk: "\u2031",
  8186. pfr: "\u{1D52D}",
  8187. phi: "\u03C6",
  8188. phiv: "\u03D5",
  8189. phmmat: "\u2133",
  8190. phone: "\u260E",
  8191. pi: "\u03C0",
  8192. pitchfork: "\u22D4",
  8193. piv: "\u03D6",
  8194. planck: "\u210F",
  8195. planckh: "\u210E",
  8196. plankv: "\u210F",
  8197. plus: "+",
  8198. plusacir: "\u2A23",
  8199. plusb: "\u229E",
  8200. pluscir: "\u2A22",
  8201. plusdo: "\u2214",
  8202. plusdu: "\u2A25",
  8203. pluse: "\u2A72",
  8204. plusmn: "\xB1",
  8205. plussim: "\u2A26",
  8206. plustwo: "\u2A27",
  8207. pm: "\xB1",
  8208. pointint: "\u2A15",
  8209. popf: "\u{1D561}",
  8210. pound: "\xA3",
  8211. pr: "\u227A",
  8212. prE: "\u2AB3",
  8213. prap: "\u2AB7",
  8214. prcue: "\u227C",
  8215. pre: "\u2AAF",
  8216. prec: "\u227A",
  8217. precapprox: "\u2AB7",
  8218. preccurlyeq: "\u227C",
  8219. preceq: "\u2AAF",
  8220. precnapprox: "\u2AB9",
  8221. precneqq: "\u2AB5",
  8222. precnsim: "\u22E8",
  8223. precsim: "\u227E",
  8224. prime: "\u2032",
  8225. primes: "\u2119",
  8226. prnE: "\u2AB5",
  8227. prnap: "\u2AB9",
  8228. prnsim: "\u22E8",
  8229. prod: "\u220F",
  8230. profalar: "\u232E",
  8231. profline: "\u2312",
  8232. profsurf: "\u2313",
  8233. prop: "\u221D",
  8234. propto: "\u221D",
  8235. prsim: "\u227E",
  8236. prurel: "\u22B0",
  8237. pscr: "\u{1D4C5}",
  8238. psi: "\u03C8",
  8239. puncsp: "\u2008",
  8240. qfr: "\u{1D52E}",
  8241. qint: "\u2A0C",
  8242. qopf: "\u{1D562}",
  8243. qprime: "\u2057",
  8244. qscr: "\u{1D4C6}",
  8245. quaternions: "\u210D",
  8246. quatint: "\u2A16",
  8247. quest: "?",
  8248. questeq: "\u225F",
  8249. quot: '"',
  8250. rAarr: "\u21DB",
  8251. rArr: "\u21D2",
  8252. rAtail: "\u291C",
  8253. rBarr: "\u290F",
  8254. rHar: "\u2964",
  8255. race: "\u223D\u0331",
  8256. racute: "\u0155",
  8257. radic: "\u221A",
  8258. raemptyv: "\u29B3",
  8259. rang: "\u27E9",
  8260. rangd: "\u2992",
  8261. range: "\u29A5",
  8262. rangle: "\u27E9",
  8263. raquo: "\xBB",
  8264. rarr: "\u2192",
  8265. rarrap: "\u2975",
  8266. rarrb: "\u21E5",
  8267. rarrbfs: "\u2920",
  8268. rarrc: "\u2933",
  8269. rarrfs: "\u291E",
  8270. rarrhk: "\u21AA",
  8271. rarrlp: "\u21AC",
  8272. rarrpl: "\u2945",
  8273. rarrsim: "\u2974",
  8274. rarrtl: "\u21A3",
  8275. rarrw: "\u219D",
  8276. ratail: "\u291A",
  8277. ratio: "\u2236",
  8278. rationals: "\u211A",
  8279. rbarr: "\u290D",
  8280. rbbrk: "\u2773",
  8281. rbrace: "}",
  8282. rbrack: "]",
  8283. rbrke: "\u298C",
  8284. rbrksld: "\u298E",
  8285. rbrkslu: "\u2990",
  8286. rcaron: "\u0159",
  8287. rcedil: "\u0157",
  8288. rceil: "\u2309",
  8289. rcub: "}",
  8290. rcy: "\u0440",
  8291. rdca: "\u2937",
  8292. rdldhar: "\u2969",
  8293. rdquo: "\u201D",
  8294. rdquor: "\u201D",
  8295. rdsh: "\u21B3",
  8296. real: "\u211C",
  8297. realine: "\u211B",
  8298. realpart: "\u211C",
  8299. reals: "\u211D",
  8300. rect: "\u25AD",
  8301. reg: "\xAE",
  8302. rfisht: "\u297D",
  8303. rfloor: "\u230B",
  8304. rfr: "\u{1D52F}",
  8305. rhard: "\u21C1",
  8306. rharu: "\u21C0",
  8307. rharul: "\u296C",
  8308. rho: "\u03C1",
  8309. rhov: "\u03F1",
  8310. rightarrow: "\u2192",
  8311. rightarrowtail: "\u21A3",
  8312. rightharpoondown: "\u21C1",
  8313. rightharpoonup: "\u21C0",
  8314. rightleftarrows: "\u21C4",
  8315. rightleftharpoons: "\u21CC",
  8316. rightrightarrows: "\u21C9",
  8317. rightsquigarrow: "\u219D",
  8318. rightthreetimes: "\u22CC",
  8319. ring: "\u02DA",
  8320. risingdotseq: "\u2253",
  8321. rlarr: "\u21C4",
  8322. rlhar: "\u21CC",
  8323. rlm: "\u200F",
  8324. rmoust: "\u23B1",
  8325. rmoustache: "\u23B1",
  8326. rnmid: "\u2AEE",
  8327. roang: "\u27ED",
  8328. roarr: "\u21FE",
  8329. robrk: "\u27E7",
  8330. ropar: "\u2986",
  8331. ropf: "\u{1D563}",
  8332. roplus: "\u2A2E",
  8333. rotimes: "\u2A35",
  8334. rpar: ")",
  8335. rpargt: "\u2994",
  8336. rppolint: "\u2A12",
  8337. rrarr: "\u21C9",
  8338. rsaquo: "\u203A",
  8339. rscr: "\u{1D4C7}",
  8340. rsh: "\u21B1",
  8341. rsqb: "]",
  8342. rsquo: "\u2019",
  8343. rsquor: "\u2019",
  8344. rthree: "\u22CC",
  8345. rtimes: "\u22CA",
  8346. rtri: "\u25B9",
  8347. rtrie: "\u22B5",
  8348. rtrif: "\u25B8",
  8349. rtriltri: "\u29CE",
  8350. ruluhar: "\u2968",
  8351. rx: "\u211E",
  8352. sacute: "\u015B",
  8353. sbquo: "\u201A",
  8354. sc: "\u227B",
  8355. scE: "\u2AB4",
  8356. scap: "\u2AB8",
  8357. scaron: "\u0161",
  8358. sccue: "\u227D",
  8359. sce: "\u2AB0",
  8360. scedil: "\u015F",
  8361. scirc: "\u015D",
  8362. scnE: "\u2AB6",
  8363. scnap: "\u2ABA",
  8364. scnsim: "\u22E9",
  8365. scpolint: "\u2A13",
  8366. scsim: "\u227F",
  8367. scy: "\u0441",
  8368. sdot: "\u22C5",
  8369. sdotb: "\u22A1",
  8370. sdote: "\u2A66",
  8371. seArr: "\u21D8",
  8372. searhk: "\u2925",
  8373. searr: "\u2198",
  8374. searrow: "\u2198",
  8375. sect: "\xA7",
  8376. semi: ";",
  8377. seswar: "\u2929",
  8378. setminus: "\u2216",
  8379. setmn: "\u2216",
  8380. sext: "\u2736",
  8381. sfr: "\u{1D530}",
  8382. sfrown: "\u2322",
  8383. sharp: "\u266F",
  8384. shchcy: "\u0449",
  8385. shcy: "\u0448",
  8386. shortmid: "\u2223",
  8387. shortparallel: "\u2225",
  8388. shy: "\xAD",
  8389. sigma: "\u03C3",
  8390. sigmaf: "\u03C2",
  8391. sigmav: "\u03C2",
  8392. sim: "\u223C",
  8393. simdot: "\u2A6A",
  8394. sime: "\u2243",
  8395. simeq: "\u2243",
  8396. simg: "\u2A9E",
  8397. simgE: "\u2AA0",
  8398. siml: "\u2A9D",
  8399. simlE: "\u2A9F",
  8400. simne: "\u2246",
  8401. simplus: "\u2A24",
  8402. simrarr: "\u2972",
  8403. slarr: "\u2190",
  8404. smallsetminus: "\u2216",
  8405. smashp: "\u2A33",
  8406. smeparsl: "\u29E4",
  8407. smid: "\u2223",
  8408. smile: "\u2323",
  8409. smt: "\u2AAA",
  8410. smte: "\u2AAC",
  8411. smtes: "\u2AAC\uFE00",
  8412. softcy: "\u044C",
  8413. sol: "/",
  8414. solb: "\u29C4",
  8415. solbar: "\u233F",
  8416. sopf: "\u{1D564}",
  8417. spades: "\u2660",
  8418. spadesuit: "\u2660",
  8419. spar: "\u2225",
  8420. sqcap: "\u2293",
  8421. sqcaps: "\u2293\uFE00",
  8422. sqcup: "\u2294",
  8423. sqcups: "\u2294\uFE00",
  8424. sqsub: "\u228F",
  8425. sqsube: "\u2291",
  8426. sqsubset: "\u228F",
  8427. sqsubseteq: "\u2291",
  8428. sqsup: "\u2290",
  8429. sqsupe: "\u2292",
  8430. sqsupset: "\u2290",
  8431. sqsupseteq: "\u2292",
  8432. squ: "\u25A1",
  8433. square: "\u25A1",
  8434. squarf: "\u25AA",
  8435. squf: "\u25AA",
  8436. srarr: "\u2192",
  8437. sscr: "\u{1D4C8}",
  8438. ssetmn: "\u2216",
  8439. ssmile: "\u2323",
  8440. sstarf: "\u22C6",
  8441. star: "\u2606",
  8442. starf: "\u2605",
  8443. straightepsilon: "\u03F5",
  8444. straightphi: "\u03D5",
  8445. strns: "\xAF",
  8446. sub: "\u2282",
  8447. subE: "\u2AC5",
  8448. subdot: "\u2ABD",
  8449. sube: "\u2286",
  8450. subedot: "\u2AC3",
  8451. submult: "\u2AC1",
  8452. subnE: "\u2ACB",
  8453. subne: "\u228A",
  8454. subplus: "\u2ABF",
  8455. subrarr: "\u2979",
  8456. subset: "\u2282",
  8457. subseteq: "\u2286",
  8458. subseteqq: "\u2AC5",
  8459. subsetneq: "\u228A",
  8460. subsetneqq: "\u2ACB",
  8461. subsim: "\u2AC7",
  8462. subsub: "\u2AD5",
  8463. subsup: "\u2AD3",
  8464. succ: "\u227B",
  8465. succapprox: "\u2AB8",
  8466. succcurlyeq: "\u227D",
  8467. succeq: "\u2AB0",
  8468. succnapprox: "\u2ABA",
  8469. succneqq: "\u2AB6",
  8470. succnsim: "\u22E9",
  8471. succsim: "\u227F",
  8472. sum: "\u2211",
  8473. sung: "\u266A",
  8474. sup1: "\xB9",
  8475. sup2: "\xB2",
  8476. sup3: "\xB3",
  8477. sup: "\u2283",
  8478. supE: "\u2AC6",
  8479. supdot: "\u2ABE",
  8480. supdsub: "\u2AD8",
  8481. supe: "\u2287",
  8482. supedot: "\u2AC4",
  8483. suphsol: "\u27C9",
  8484. suphsub: "\u2AD7",
  8485. suplarr: "\u297B",
  8486. supmult: "\u2AC2",
  8487. supnE: "\u2ACC",
  8488. supne: "\u228B",
  8489. supplus: "\u2AC0",
  8490. supset: "\u2283",
  8491. supseteq: "\u2287",
  8492. supseteqq: "\u2AC6",
  8493. supsetneq: "\u228B",
  8494. supsetneqq: "\u2ACC",
  8495. supsim: "\u2AC8",
  8496. supsub: "\u2AD4",
  8497. supsup: "\u2AD6",
  8498. swArr: "\u21D9",
  8499. swarhk: "\u2926",
  8500. swarr: "\u2199",
  8501. swarrow: "\u2199",
  8502. swnwar: "\u292A",
  8503. szlig: "\xDF",
  8504. target: "\u2316",
  8505. tau: "\u03C4",
  8506. tbrk: "\u23B4",
  8507. tcaron: "\u0165",
  8508. tcedil: "\u0163",
  8509. tcy: "\u0442",
  8510. tdot: "\u20DB",
  8511. telrec: "\u2315",
  8512. tfr: "\u{1D531}",
  8513. there4: "\u2234",
  8514. therefore: "\u2234",
  8515. theta: "\u03B8",
  8516. thetasym: "\u03D1",
  8517. thetav: "\u03D1",
  8518. thickapprox: "\u2248",
  8519. thicksim: "\u223C",
  8520. thinsp: "\u2009",
  8521. thkap: "\u2248",
  8522. thksim: "\u223C",
  8523. thorn: "\xFE",
  8524. tilde: "\u02DC",
  8525. times: "\xD7",
  8526. timesb: "\u22A0",
  8527. timesbar: "\u2A31",
  8528. timesd: "\u2A30",
  8529. tint: "\u222D",
  8530. toea: "\u2928",
  8531. top: "\u22A4",
  8532. topbot: "\u2336",
  8533. topcir: "\u2AF1",
  8534. topf: "\u{1D565}",
  8535. topfork: "\u2ADA",
  8536. tosa: "\u2929",
  8537. tprime: "\u2034",
  8538. trade: "\u2122",
  8539. triangle: "\u25B5",
  8540. triangledown: "\u25BF",
  8541. triangleleft: "\u25C3",
  8542. trianglelefteq: "\u22B4",
  8543. triangleq: "\u225C",
  8544. triangleright: "\u25B9",
  8545. trianglerighteq: "\u22B5",
  8546. tridot: "\u25EC",
  8547. trie: "\u225C",
  8548. triminus: "\u2A3A",
  8549. triplus: "\u2A39",
  8550. trisb: "\u29CD",
  8551. tritime: "\u2A3B",
  8552. trpezium: "\u23E2",
  8553. tscr: "\u{1D4C9}",
  8554. tscy: "\u0446",
  8555. tshcy: "\u045B",
  8556. tstrok: "\u0167",
  8557. twixt: "\u226C",
  8558. twoheadleftarrow: "\u219E",
  8559. twoheadrightarrow: "\u21A0",
  8560. uArr: "\u21D1",
  8561. uHar: "\u2963",
  8562. uacute: "\xFA",
  8563. uarr: "\u2191",
  8564. ubrcy: "\u045E",
  8565. ubreve: "\u016D",
  8566. ucirc: "\xFB",
  8567. ucy: "\u0443",
  8568. udarr: "\u21C5",
  8569. udblac: "\u0171",
  8570. udhar: "\u296E",
  8571. ufisht: "\u297E",
  8572. ufr: "\u{1D532}",
  8573. ugrave: "\xF9",
  8574. uharl: "\u21BF",
  8575. uharr: "\u21BE",
  8576. uhblk: "\u2580",
  8577. ulcorn: "\u231C",
  8578. ulcorner: "\u231C",
  8579. ulcrop: "\u230F",
  8580. ultri: "\u25F8",
  8581. umacr: "\u016B",
  8582. uml: "\xA8",
  8583. uogon: "\u0173",
  8584. uopf: "\u{1D566}",
  8585. uparrow: "\u2191",
  8586. updownarrow: "\u2195",
  8587. upharpoonleft: "\u21BF",
  8588. upharpoonright: "\u21BE",
  8589. uplus: "\u228E",
  8590. upsi: "\u03C5",
  8591. upsih: "\u03D2",
  8592. upsilon: "\u03C5",
  8593. upuparrows: "\u21C8",
  8594. urcorn: "\u231D",
  8595. urcorner: "\u231D",
  8596. urcrop: "\u230E",
  8597. uring: "\u016F",
  8598. urtri: "\u25F9",
  8599. uscr: "\u{1D4CA}",
  8600. utdot: "\u22F0",
  8601. utilde: "\u0169",
  8602. utri: "\u25B5",
  8603. utrif: "\u25B4",
  8604. uuarr: "\u21C8",
  8605. uuml: "\xFC",
  8606. uwangle: "\u29A7",
  8607. vArr: "\u21D5",
  8608. vBar: "\u2AE8",
  8609. vBarv: "\u2AE9",
  8610. vDash: "\u22A8",
  8611. vangrt: "\u299C",
  8612. varepsilon: "\u03F5",
  8613. varkappa: "\u03F0",
  8614. varnothing: "\u2205",
  8615. varphi: "\u03D5",
  8616. varpi: "\u03D6",
  8617. varpropto: "\u221D",
  8618. varr: "\u2195",
  8619. varrho: "\u03F1",
  8620. varsigma: "\u03C2",
  8621. varsubsetneq: "\u228A\uFE00",
  8622. varsubsetneqq: "\u2ACB\uFE00",
  8623. varsupsetneq: "\u228B\uFE00",
  8624. varsupsetneqq: "\u2ACC\uFE00",
  8625. vartheta: "\u03D1",
  8626. vartriangleleft: "\u22B2",
  8627. vartriangleright: "\u22B3",
  8628. vcy: "\u0432",
  8629. vdash: "\u22A2",
  8630. vee: "\u2228",
  8631. veebar: "\u22BB",
  8632. veeeq: "\u225A",
  8633. vellip: "\u22EE",
  8634. verbar: "|",
  8635. vert: "|",
  8636. vfr: "\u{1D533}",
  8637. vltri: "\u22B2",
  8638. vnsub: "\u2282\u20D2",
  8639. vnsup: "\u2283\u20D2",
  8640. vopf: "\u{1D567}",
  8641. vprop: "\u221D",
  8642. vrtri: "\u22B3",
  8643. vscr: "\u{1D4CB}",
  8644. vsubnE: "\u2ACB\uFE00",
  8645. vsubne: "\u228A\uFE00",
  8646. vsupnE: "\u2ACC\uFE00",
  8647. vsupne: "\u228B\uFE00",
  8648. vzigzag: "\u299A",
  8649. wcirc: "\u0175",
  8650. wedbar: "\u2A5F",
  8651. wedge: "\u2227",
  8652. wedgeq: "\u2259",
  8653. weierp: "\u2118",
  8654. wfr: "\u{1D534}",
  8655. wopf: "\u{1D568}",
  8656. wp: "\u2118",
  8657. wr: "\u2240",
  8658. wreath: "\u2240",
  8659. wscr: "\u{1D4CC}",
  8660. xcap: "\u22C2",
  8661. xcirc: "\u25EF",
  8662. xcup: "\u22C3",
  8663. xdtri: "\u25BD",
  8664. xfr: "\u{1D535}",
  8665. xhArr: "\u27FA",
  8666. xharr: "\u27F7",
  8667. xi: "\u03BE",
  8668. xlArr: "\u27F8",
  8669. xlarr: "\u27F5",
  8670. xmap: "\u27FC",
  8671. xnis: "\u22FB",
  8672. xodot: "\u2A00",
  8673. xopf: "\u{1D569}",
  8674. xoplus: "\u2A01",
  8675. xotime: "\u2A02",
  8676. xrArr: "\u27F9",
  8677. xrarr: "\u27F6",
  8678. xscr: "\u{1D4CD}",
  8679. xsqcup: "\u2A06",
  8680. xuplus: "\u2A04",
  8681. xutri: "\u25B3",
  8682. xvee: "\u22C1",
  8683. xwedge: "\u22C0",
  8684. yacute: "\xFD",
  8685. yacy: "\u044F",
  8686. ycirc: "\u0177",
  8687. ycy: "\u044B",
  8688. yen: "\xA5",
  8689. yfr: "\u{1D536}",
  8690. yicy: "\u0457",
  8691. yopf: "\u{1D56A}",
  8692. yscr: "\u{1D4CE}",
  8693. yucy: "\u044E",
  8694. yuml: "\xFF",
  8695. zacute: "\u017A",
  8696. zcaron: "\u017E",
  8697. zcy: "\u0437",
  8698. zdot: "\u017C",
  8699. zeetrf: "\u2128",
  8700. zeta: "\u03B6",
  8701. zfr: "\u{1D537}",
  8702. zhcy: "\u0436",
  8703. zigrarr: "\u21DD",
  8704. zopf: "\u{1D56B}",
  8705. zscr: "\u{1D4CF}",
  8706. zwj: "\u200D",
  8707. zwnj: "\u200C"
  8708. };
  8709. // node_modules/decode-named-character-reference/index.js
  8710. var own = {}.hasOwnProperty;
  8711. function decodeNamedCharacterReference(value) {
  8712. return own.call(characterEntities, value) ? characterEntities[value] : false;
  8713. }
  8714. // node_modules/mdast-util-mdx-jsx/node_modules/parse-entities/lib/index.js
  8715. var fromCharCode = String.fromCharCode;
  8716. var messages = [
  8717. "",
  8718. /* 1: Non terminated (named) */
  8719. "Named character references must be terminated by a semicolon",
  8720. /* 2: Non terminated (numeric) */
  8721. "Numeric character references must be terminated by a semicolon",
  8722. /* 3: Empty (named) */
  8723. "Named character references cannot be empty",
  8724. /* 4: Empty (numeric) */
  8725. "Numeric character references cannot be empty",
  8726. /* 5: Unknown (named) */
  8727. "Named character references must be known",
  8728. /* 6: Disallowed (numeric) */
  8729. "Numeric character references cannot be disallowed",
  8730. /* 7: Prohibited (numeric) */
  8731. "Numeric character references cannot be outside the permissible Unicode range"
  8732. ];
  8733. function parseEntities(value, options = {}) {
  8734. const additional = typeof options.additional === "string" ? options.additional.charCodeAt(0) : options.additional;
  8735. const result = [];
  8736. let index2 = 0;
  8737. let lines = -1;
  8738. let queue = "";
  8739. let point4;
  8740. let indent2;
  8741. if (options.position) {
  8742. if ("start" in options.position || "indent" in options.position) {
  8743. indent2 = options.position.indent;
  8744. point4 = options.position.start;
  8745. } else {
  8746. point4 = options.position;
  8747. }
  8748. }
  8749. let line = (point4 ? point4.line : 0) || 1;
  8750. let column = (point4 ? point4.column : 0) || 1;
  8751. let previous2 = now();
  8752. let character;
  8753. index2--;
  8754. while (++index2 <= value.length) {
  8755. if (character === 10) {
  8756. column = (indent2 ? indent2[lines] : 0) || 1;
  8757. }
  8758. character = value.charCodeAt(index2);
  8759. if (character === 38) {
  8760. const following = value.charCodeAt(index2 + 1);
  8761. if (following === 9 || following === 10 || following === 12 || following === 32 || following === 38 || following === 60 || Number.isNaN(following) || additional && following === additional) {
  8762. queue += fromCharCode(character);
  8763. column++;
  8764. continue;
  8765. }
  8766. const start2 = index2 + 1;
  8767. let begin = start2;
  8768. let end = start2;
  8769. let type;
  8770. if (following === 35) {
  8771. end = ++begin;
  8772. const following2 = value.charCodeAt(end);
  8773. if (following2 === 88 || following2 === 120) {
  8774. type = "hexadecimal";
  8775. end = ++begin;
  8776. } else {
  8777. type = "decimal";
  8778. }
  8779. } else {
  8780. type = "named";
  8781. }
  8782. let characterReferenceCharacters = "";
  8783. let characterReference2 = "";
  8784. let characters = "";
  8785. const test = type === "named" ? isAlphanumerical : type === "decimal" ? isDecimal : isHexadecimal;
  8786. end--;
  8787. while (++end <= value.length) {
  8788. const following2 = value.charCodeAt(end);
  8789. if (!test(following2)) {
  8790. break;
  8791. }
  8792. characters += fromCharCode(following2);
  8793. if (type === "named" && characterEntitiesLegacy.includes(characters)) {
  8794. characterReferenceCharacters = characters;
  8795. characterReference2 = decodeNamedCharacterReference(characters);
  8796. }
  8797. }
  8798. let terminated = value.charCodeAt(end) === 59;
  8799. if (terminated) {
  8800. end++;
  8801. const namedReference = type === "named" ? decodeNamedCharacterReference(characters) : false;
  8802. if (namedReference) {
  8803. characterReferenceCharacters = characters;
  8804. characterReference2 = namedReference;
  8805. }
  8806. }
  8807. let diff = 1 + end - start2;
  8808. let reference = "";
  8809. if (!terminated && options.nonTerminated === false) {
  8810. } else if (!characters) {
  8811. if (type !== "named") {
  8812. warning(4, diff);
  8813. }
  8814. } else if (type === "named") {
  8815. if (terminated && !characterReference2) {
  8816. warning(5, 1);
  8817. } else {
  8818. if (characterReferenceCharacters !== characters) {
  8819. end = begin + characterReferenceCharacters.length;
  8820. diff = 1 + end - begin;
  8821. terminated = false;
  8822. }
  8823. if (!terminated) {
  8824. const reason = characterReferenceCharacters ? 1 : 3;
  8825. if (options.attribute) {
  8826. const following2 = value.charCodeAt(end);
  8827. if (following2 === 61) {
  8828. warning(reason, diff);
  8829. characterReference2 = "";
  8830. } else if (isAlphanumerical(following2)) {
  8831. characterReference2 = "";
  8832. } else {
  8833. warning(reason, diff);
  8834. }
  8835. } else {
  8836. warning(reason, diff);
  8837. }
  8838. }
  8839. }
  8840. reference = characterReference2;
  8841. } else {
  8842. if (!terminated) {
  8843. warning(2, diff);
  8844. }
  8845. let referenceCode = Number.parseInt(
  8846. characters,
  8847. type === "hexadecimal" ? 16 : 10
  8848. );
  8849. if (prohibited(referenceCode)) {
  8850. warning(7, diff);
  8851. reference = fromCharCode(
  8852. 65533
  8853. /* `�` */
  8854. );
  8855. } else if (referenceCode in characterReferenceInvalid) {
  8856. warning(6, diff);
  8857. reference = characterReferenceInvalid[referenceCode];
  8858. } else {
  8859. let output = "";
  8860. if (disallowed(referenceCode)) {
  8861. warning(6, diff);
  8862. }
  8863. if (referenceCode > 65535) {
  8864. referenceCode -= 65536;
  8865. output += fromCharCode(referenceCode >>> (10 & 1023) | 55296);
  8866. referenceCode = 56320 | referenceCode & 1023;
  8867. }
  8868. reference = output + fromCharCode(referenceCode);
  8869. }
  8870. }
  8871. if (reference) {
  8872. flush();
  8873. previous2 = now();
  8874. index2 = end - 1;
  8875. column += end - start2 + 1;
  8876. result.push(reference);
  8877. const next = now();
  8878. next.offset++;
  8879. if (options.reference) {
  8880. options.reference.call(
  8881. options.referenceContext,
  8882. reference,
  8883. { start: previous2, end: next },
  8884. value.slice(start2 - 1, end)
  8885. );
  8886. }
  8887. previous2 = next;
  8888. } else {
  8889. characters = value.slice(start2 - 1, end);
  8890. queue += characters;
  8891. column += characters.length;
  8892. index2 = end - 1;
  8893. }
  8894. } else {
  8895. if (character === 10) {
  8896. line++;
  8897. lines++;
  8898. column = 0;
  8899. }
  8900. if (Number.isNaN(character)) {
  8901. flush();
  8902. } else {
  8903. queue += fromCharCode(character);
  8904. column++;
  8905. }
  8906. }
  8907. }
  8908. return result.join("");
  8909. function now() {
  8910. return {
  8911. line,
  8912. column,
  8913. offset: index2 + ((point4 ? point4.offset : 0) || 0)
  8914. };
  8915. }
  8916. function warning(code2, offset2) {
  8917. let position3;
  8918. if (options.warning) {
  8919. position3 = now();
  8920. position3.column += offset2;
  8921. position3.offset += offset2;
  8922. options.warning.call(
  8923. options.warningContext,
  8924. messages[code2],
  8925. position3,
  8926. code2
  8927. );
  8928. }
  8929. }
  8930. function flush() {
  8931. if (queue) {
  8932. result.push(queue);
  8933. if (options.text) {
  8934. options.text.call(options.textContext, queue, {
  8935. start: previous2,
  8936. end: now()
  8937. });
  8938. }
  8939. queue = "";
  8940. }
  8941. }
  8942. }
  8943. function prohibited(code2) {
  8944. return code2 >= 55296 && code2 <= 57343 || code2 > 1114111;
  8945. }
  8946. function disallowed(code2) {
  8947. return code2 >= 1 && code2 <= 8 || code2 === 11 || code2 >= 13 && code2 <= 31 || code2 >= 127 && code2 <= 159 || code2 >= 64976 && code2 <= 65007 || (code2 & 65535) === 65535 || (code2 & 65535) === 65534;
  8948. }
  8949. // node_modules/stringify-entities/lib/core.js
  8950. var defaultSubsetRegex = /["&'<>`]/g;
  8951. var surrogatePairsRegex = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
  8952. var controlCharactersRegex = (
  8953. // eslint-disable-next-line no-control-regex, unicorn/no-hex-escape
  8954. /[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g
  8955. );
  8956. var regexEscapeRegex = /[|\\{}()[\]^$+*?.]/g;
  8957. var subsetToRegexCache = /* @__PURE__ */ new WeakMap();
  8958. function core(value, options) {
  8959. value = value.replace(
  8960. options.subset ? charactersToExpressionCached(options.subset) : defaultSubsetRegex,
  8961. basic
  8962. );
  8963. if (options.subset || options.escapeOnly) {
  8964. return value;
  8965. }
  8966. return value.replace(surrogatePairsRegex, surrogate).replace(controlCharactersRegex, basic);
  8967. function surrogate(pair, index2, all3) {
  8968. return options.format(
  8969. (pair.charCodeAt(0) - 55296) * 1024 + pair.charCodeAt(1) - 56320 + 65536,
  8970. all3.charCodeAt(index2 + 2),
  8971. options
  8972. );
  8973. }
  8974. function basic(character, index2, all3) {
  8975. return options.format(
  8976. character.charCodeAt(0),
  8977. all3.charCodeAt(index2 + 1),
  8978. options
  8979. );
  8980. }
  8981. }
  8982. function charactersToExpressionCached(subset) {
  8983. let cached = subsetToRegexCache.get(subset);
  8984. if (!cached) {
  8985. cached = charactersToExpression(subset);
  8986. subsetToRegexCache.set(subset, cached);
  8987. }
  8988. return cached;
  8989. }
  8990. function charactersToExpression(subset) {
  8991. const groups = [];
  8992. let index2 = -1;
  8993. while (++index2 < subset.length) {
  8994. groups.push(subset[index2].replace(regexEscapeRegex, "\\$&"));
  8995. }
  8996. return new RegExp("(?:" + groups.join("|") + ")", "g");
  8997. }
  8998. // node_modules/stringify-entities/lib/util/format-basic.js
  8999. function formatBasic(code2) {
  9000. return "&#x" + code2.toString(16).toUpperCase() + ";";
  9001. }
  9002. // node_modules/stringify-entities/lib/index.js
  9003. function stringifyEntitiesLight(value, options) {
  9004. return core(value, Object.assign({ format: formatBasic }, options));
  9005. }
  9006. // node_modules/mdast-util-mdx-jsx/lib/index.js
  9007. var indent = " ";
  9008. function mdxJsxFromMarkdown() {
  9009. return {
  9010. canContainEols: ["mdxJsxTextElement"],
  9011. enter: {
  9012. mdxJsxFlowTag: enterMdxJsxTag,
  9013. mdxJsxFlowTagClosingMarker: enterMdxJsxTagClosingMarker,
  9014. mdxJsxFlowTagAttribute: enterMdxJsxTagAttribute,
  9015. mdxJsxFlowTagExpressionAttribute: enterMdxJsxTagExpressionAttribute,
  9016. mdxJsxFlowTagAttributeValueLiteral: buffer,
  9017. mdxJsxFlowTagAttributeValueExpression: buffer,
  9018. mdxJsxFlowTagSelfClosingMarker: enterMdxJsxTagSelfClosingMarker,
  9019. mdxJsxTextTag: enterMdxJsxTag,
  9020. mdxJsxTextTagClosingMarker: enterMdxJsxTagClosingMarker,
  9021. mdxJsxTextTagAttribute: enterMdxJsxTagAttribute,
  9022. mdxJsxTextTagExpressionAttribute: enterMdxJsxTagExpressionAttribute,
  9023. mdxJsxTextTagAttributeValueLiteral: buffer,
  9024. mdxJsxTextTagAttributeValueExpression: buffer,
  9025. mdxJsxTextTagSelfClosingMarker: enterMdxJsxTagSelfClosingMarker
  9026. },
  9027. exit: {
  9028. mdxJsxFlowTagClosingMarker: exitMdxJsxTagClosingMarker,
  9029. mdxJsxFlowTagNamePrimary: exitMdxJsxTagNamePrimary,
  9030. mdxJsxFlowTagNameMember: exitMdxJsxTagNameMember,
  9031. mdxJsxFlowTagNameLocal: exitMdxJsxTagNameLocal,
  9032. mdxJsxFlowTagExpressionAttribute: exitMdxJsxTagExpressionAttribute,
  9033. mdxJsxFlowTagExpressionAttributeValue: data2,
  9034. mdxJsxFlowTagAttributeNamePrimary: exitMdxJsxTagAttributeNamePrimary,
  9035. mdxJsxFlowTagAttributeNameLocal: exitMdxJsxTagAttributeNameLocal,
  9036. mdxJsxFlowTagAttributeValueLiteral: exitMdxJsxTagAttributeValueLiteral,
  9037. mdxJsxFlowTagAttributeValueLiteralValue: data2,
  9038. mdxJsxFlowTagAttributeValueExpression: exitMdxJsxTagAttributeValueExpression,
  9039. mdxJsxFlowTagAttributeValueExpressionValue: data2,
  9040. mdxJsxFlowTagSelfClosingMarker: exitMdxJsxTagSelfClosingMarker,
  9041. mdxJsxFlowTag: exitMdxJsxTag,
  9042. mdxJsxTextTagClosingMarker: exitMdxJsxTagClosingMarker,
  9043. mdxJsxTextTagNamePrimary: exitMdxJsxTagNamePrimary,
  9044. mdxJsxTextTagNameMember: exitMdxJsxTagNameMember,
  9045. mdxJsxTextTagNameLocal: exitMdxJsxTagNameLocal,
  9046. mdxJsxTextTagExpressionAttribute: exitMdxJsxTagExpressionAttribute,
  9047. mdxJsxTextTagExpressionAttributeValue: data2,
  9048. mdxJsxTextTagAttributeNamePrimary: exitMdxJsxTagAttributeNamePrimary,
  9049. mdxJsxTextTagAttributeNameLocal: exitMdxJsxTagAttributeNameLocal,
  9050. mdxJsxTextTagAttributeValueLiteral: exitMdxJsxTagAttributeValueLiteral,
  9051. mdxJsxTextTagAttributeValueLiteralValue: data2,
  9052. mdxJsxTextTagAttributeValueExpression: exitMdxJsxTagAttributeValueExpression,
  9053. mdxJsxTextTagAttributeValueExpressionValue: data2,
  9054. mdxJsxTextTagSelfClosingMarker: exitMdxJsxTagSelfClosingMarker,
  9055. mdxJsxTextTag: exitMdxJsxTag
  9056. }
  9057. };
  9058. function buffer() {
  9059. this.buffer();
  9060. }
  9061. function point4(d) {
  9062. return { line: d.line, column: d.column, offset: d.offset };
  9063. }
  9064. function data2(token) {
  9065. this.config.enter.data.call(this, token);
  9066. this.config.exit.data.call(this, token);
  9067. }
  9068. function enterMdxJsxTag(token) {
  9069. const tag = {
  9070. name: void 0,
  9071. attributes: [],
  9072. close: false,
  9073. selfClosing: false,
  9074. start: token.start,
  9075. end: token.end
  9076. };
  9077. if (!this.data.mdxJsxTagStack) this.data.mdxJsxTagStack = [];
  9078. this.data.mdxJsxTag = tag;
  9079. this.buffer();
  9080. }
  9081. function enterMdxJsxTagClosingMarker(token) {
  9082. const stack = this.data.mdxJsxTagStack;
  9083. ok(stack, "expected `mdxJsxTagStack`");
  9084. if (stack.length === 0) {
  9085. throw new VFileMessage(
  9086. "Unexpected closing slash `/` in tag, expected an open tag first",
  9087. { start: token.start, end: token.end },
  9088. "mdast-util-mdx-jsx:unexpected-closing-slash"
  9089. );
  9090. }
  9091. }
  9092. function enterMdxJsxTagAnyAttribute(token) {
  9093. const tag = this.data.mdxJsxTag;
  9094. ok(tag, "expected `mdxJsxTag`");
  9095. if (tag.close) {
  9096. throw new VFileMessage(
  9097. "Unexpected attribute in closing tag, expected the end of the tag",
  9098. { start: token.start, end: token.end },
  9099. "mdast-util-mdx-jsx:unexpected-attribute"
  9100. );
  9101. }
  9102. }
  9103. function enterMdxJsxTagSelfClosingMarker(token) {
  9104. const tag = this.data.mdxJsxTag;
  9105. ok(tag, "expected `mdxJsxTag`");
  9106. if (tag.close) {
  9107. throw new VFileMessage(
  9108. "Unexpected self-closing slash `/` in closing tag, expected the end of the tag",
  9109. { start: token.start, end: token.end },
  9110. "mdast-util-mdx-jsx:unexpected-self-closing-slash"
  9111. );
  9112. }
  9113. }
  9114. function exitMdxJsxTagClosingMarker() {
  9115. const tag = this.data.mdxJsxTag;
  9116. ok(tag, "expected `mdxJsxTag`");
  9117. tag.close = true;
  9118. }
  9119. function exitMdxJsxTagNamePrimary(token) {
  9120. const tag = this.data.mdxJsxTag;
  9121. ok(tag, "expected `mdxJsxTag`");
  9122. tag.name = this.sliceSerialize(token);
  9123. }
  9124. function exitMdxJsxTagNameMember(token) {
  9125. const tag = this.data.mdxJsxTag;
  9126. ok(tag, "expected `mdxJsxTag`");
  9127. tag.name += "." + this.sliceSerialize(token);
  9128. }
  9129. function exitMdxJsxTagNameLocal(token) {
  9130. const tag = this.data.mdxJsxTag;
  9131. ok(tag, "expected `mdxJsxTag`");
  9132. tag.name += ":" + this.sliceSerialize(token);
  9133. }
  9134. function enterMdxJsxTagAttribute(token) {
  9135. const tag = this.data.mdxJsxTag;
  9136. ok(tag, "expected `mdxJsxTag`");
  9137. enterMdxJsxTagAnyAttribute.call(this, token);
  9138. tag.attributes.push({
  9139. type: "mdxJsxAttribute",
  9140. name: "",
  9141. value: null,
  9142. position: {
  9143. start: point4(token.start),
  9144. // @ts-expect-error: `end` will be patched later.
  9145. end: void 0
  9146. }
  9147. });
  9148. }
  9149. function enterMdxJsxTagExpressionAttribute(token) {
  9150. const tag = this.data.mdxJsxTag;
  9151. ok(tag, "expected `mdxJsxTag`");
  9152. enterMdxJsxTagAnyAttribute.call(this, token);
  9153. tag.attributes.push({ type: "mdxJsxExpressionAttribute", value: "" });
  9154. this.buffer();
  9155. }
  9156. function exitMdxJsxTagExpressionAttribute(token) {
  9157. const tag = this.data.mdxJsxTag;
  9158. ok(tag, "expected `mdxJsxTag`");
  9159. const tail = tag.attributes[tag.attributes.length - 1];
  9160. ok(tail.type === "mdxJsxExpressionAttribute");
  9161. const estree = token.estree;
  9162. tail.value = this.resume();
  9163. if (estree) {
  9164. tail.data = { estree };
  9165. }
  9166. }
  9167. function exitMdxJsxTagAttributeNamePrimary(token) {
  9168. const tag = this.data.mdxJsxTag;
  9169. ok(tag, "expected `mdxJsxTag`");
  9170. const node2 = tag.attributes[tag.attributes.length - 1];
  9171. ok(node2.type === "mdxJsxAttribute");
  9172. node2.name = this.sliceSerialize(token);
  9173. ok(node2.position !== void 0);
  9174. node2.position.end = point4(token.end);
  9175. }
  9176. function exitMdxJsxTagAttributeNameLocal(token) {
  9177. const tag = this.data.mdxJsxTag;
  9178. ok(tag, "expected `mdxJsxTag`");
  9179. const node2 = tag.attributes[tag.attributes.length - 1];
  9180. ok(node2.type === "mdxJsxAttribute");
  9181. node2.name += ":" + this.sliceSerialize(token);
  9182. ok(node2.position !== void 0);
  9183. node2.position.end = point4(token.end);
  9184. }
  9185. function exitMdxJsxTagAttributeValueLiteral(token) {
  9186. const tag = this.data.mdxJsxTag;
  9187. ok(tag, "expected `mdxJsxTag`");
  9188. const node2 = tag.attributes[tag.attributes.length - 1];
  9189. node2.value = parseEntities(this.resume(), { nonTerminated: false });
  9190. ok(node2.position !== void 0);
  9191. node2.position.end = point4(token.end);
  9192. }
  9193. function exitMdxJsxTagAttributeValueExpression(token) {
  9194. const tag = this.data.mdxJsxTag;
  9195. ok(tag, "expected `mdxJsxTag`");
  9196. const tail = tag.attributes[tag.attributes.length - 1];
  9197. ok(tail.type === "mdxJsxAttribute");
  9198. const node2 = { type: "mdxJsxAttributeValueExpression", value: this.resume() };
  9199. const estree = token.estree;
  9200. if (estree) {
  9201. node2.data = { estree };
  9202. }
  9203. tail.value = node2;
  9204. ok(tail.position !== void 0);
  9205. tail.position.end = point4(token.end);
  9206. }
  9207. function exitMdxJsxTagSelfClosingMarker() {
  9208. const tag = this.data.mdxJsxTag;
  9209. ok(tag, "expected `mdxJsxTag`");
  9210. tag.selfClosing = true;
  9211. }
  9212. function exitMdxJsxTag(token) {
  9213. const tag = this.data.mdxJsxTag;
  9214. ok(tag, "expected `mdxJsxTag`");
  9215. const stack = this.data.mdxJsxTagStack;
  9216. ok(stack, "expected `mdxJsxTagStack`");
  9217. const tail = stack[stack.length - 1];
  9218. if (tag.close && tail.name !== tag.name) {
  9219. throw new VFileMessage(
  9220. "Unexpected closing tag `" + serializeAbbreviatedTag(tag) + "`, expected corresponding closing tag for `" + serializeAbbreviatedTag(tail) + "` (" + stringifyPosition(tail) + ")",
  9221. { start: token.start, end: token.end },
  9222. "mdast-util-mdx-jsx:end-tag-mismatch"
  9223. );
  9224. }
  9225. this.resume();
  9226. if (tag.close) {
  9227. stack.pop();
  9228. } else {
  9229. this.enter(
  9230. {
  9231. type: token.type === "mdxJsxTextTag" ? "mdxJsxTextElement" : "mdxJsxFlowElement",
  9232. name: tag.name || null,
  9233. attributes: tag.attributes,
  9234. children: []
  9235. },
  9236. token,
  9237. onErrorRightIsTag
  9238. );
  9239. }
  9240. if (tag.selfClosing || tag.close) {
  9241. this.exit(token, onErrorLeftIsTag);
  9242. } else {
  9243. stack.push(tag);
  9244. }
  9245. }
  9246. function onErrorRightIsTag(closing, open) {
  9247. const stack = this.data.mdxJsxTagStack;
  9248. ok(stack, "expected `mdxJsxTagStack`");
  9249. const tag = stack[stack.length - 1];
  9250. ok(tag, "expected `mdxJsxTag`");
  9251. const place = closing ? " before the end of `" + closing.type + "`" : "";
  9252. const position3 = closing ? { start: closing.start, end: closing.end } : void 0;
  9253. throw new VFileMessage(
  9254. "Expected a closing tag for `" + serializeAbbreviatedTag(tag) + "` (" + stringifyPosition({ start: open.start, end: open.end }) + ")" + place,
  9255. position3,
  9256. "mdast-util-mdx-jsx:end-tag-mismatch"
  9257. );
  9258. }
  9259. function onErrorLeftIsTag(a, b) {
  9260. const tag = this.data.mdxJsxTag;
  9261. ok(tag, "expected `mdxJsxTag`");
  9262. throw new VFileMessage(
  9263. "Expected the closing tag `" + serializeAbbreviatedTag(tag) + "` either after the end of `" + b.type + "` (" + stringifyPosition(b.end) + ") or another opening tag after the start of `" + b.type + "` (" + stringifyPosition(b.start) + ")",
  9264. { start: a.start, end: a.end },
  9265. "mdast-util-mdx-jsx:end-tag-mismatch"
  9266. );
  9267. }
  9268. function serializeAbbreviatedTag(tag) {
  9269. return "<" + (tag.close ? "/" : "") + (tag.name || "") + ">";
  9270. }
  9271. }
  9272. function mdxJsxToMarkdown(options) {
  9273. const options_ = options || {};
  9274. const quote = options_.quote || '"';
  9275. const quoteSmart = options_.quoteSmart || false;
  9276. const tightSelfClosing = options_.tightSelfClosing || false;
  9277. const printWidth = options_.printWidth || Number.POSITIVE_INFINITY;
  9278. const alternative = quote === '"' ? "'" : '"';
  9279. if (quote !== '"' && quote !== "'") {
  9280. throw new Error(
  9281. "Cannot serialize attribute values with `" + quote + "` for `options.quote`, expected `\"`, or `'`"
  9282. );
  9283. }
  9284. mdxElement.peek = peekElement;
  9285. return {
  9286. handlers: {
  9287. mdxJsxFlowElement: mdxElement,
  9288. mdxJsxTextElement: mdxElement
  9289. },
  9290. unsafe: [
  9291. { character: "<", inConstruct: ["phrasing"] },
  9292. { atBreak: true, character: "<" }
  9293. ],
  9294. // Always generate fenced code (never indented code).
  9295. fences: true,
  9296. // Always generate links with resources (never autolinks).
  9297. resourceLink: true
  9298. };
  9299. function mdxElement(node2, _, state, info) {
  9300. const flow3 = node2.type === "mdxJsxFlowElement";
  9301. const selfClosing = node2.name ? !node2.children || node2.children.length === 0 : false;
  9302. const depth = inferDepth(state);
  9303. const currentIndent = createIndent(depth);
  9304. const trackerOneLine = state.createTracker(info);
  9305. const trackerMultiLine = state.createTracker(info);
  9306. const serializedAttributes = [];
  9307. const prefix = (flow3 ? currentIndent : "") + "<" + (node2.name || "");
  9308. const exit2 = state.enter(node2.type);
  9309. trackerOneLine.move(prefix);
  9310. trackerMultiLine.move(prefix);
  9311. if (node2.attributes && node2.attributes.length > 0) {
  9312. if (!node2.name) {
  9313. throw new Error("Cannot serialize fragment w/ attributes");
  9314. }
  9315. let index2 = -1;
  9316. while (++index2 < node2.attributes.length) {
  9317. const attribute = node2.attributes[index2];
  9318. let result;
  9319. if (attribute.type === "mdxJsxExpressionAttribute") {
  9320. result = "{" + (attribute.value || "") + "}";
  9321. } else {
  9322. if (!attribute.name) {
  9323. throw new Error("Cannot serialize attribute w/o name");
  9324. }
  9325. const value2 = attribute.value;
  9326. const left = attribute.name;
  9327. let right = "";
  9328. if (value2 === null || value2 === void 0) {
  9329. } else if (typeof value2 === "object") {
  9330. right = "{" + (value2.value || "") + "}";
  9331. } else {
  9332. const appliedQuote = quoteSmart && ccount(value2, quote) > ccount(value2, alternative) ? alternative : quote;
  9333. right = appliedQuote + stringifyEntitiesLight(value2, { subset: [appliedQuote] }) + appliedQuote;
  9334. }
  9335. result = left + (right ? "=" : "") + right;
  9336. }
  9337. serializedAttributes.push(result);
  9338. }
  9339. }
  9340. let attributesOnTheirOwnLine = false;
  9341. const attributesOnOneLine = serializedAttributes.join(" ");
  9342. if (
  9343. // Block:
  9344. flow3 && // Including a line ending (expressions).
  9345. (/\r?\n|\r/.test(attributesOnOneLine) || // Current position (including `<tag`).
  9346. trackerOneLine.current().now.column + // -1 because columns, +1 for ` ` before attributes.
  9347. // Attributes joined by spaces.
  9348. attributesOnOneLine.length + // ` />`.
  9349. (selfClosing ? tightSelfClosing ? 2 : 3 : 1) > printWidth)
  9350. ) {
  9351. attributesOnTheirOwnLine = true;
  9352. }
  9353. let tracker = trackerOneLine;
  9354. let value = prefix;
  9355. if (attributesOnTheirOwnLine) {
  9356. tracker = trackerMultiLine;
  9357. let index2 = -1;
  9358. while (++index2 < serializedAttributes.length) {
  9359. serializedAttributes[index2] = currentIndent + indent + serializedAttributes[index2];
  9360. }
  9361. value += tracker.move(
  9362. "\n" + serializedAttributes.join("\n") + "\n" + currentIndent
  9363. );
  9364. } else if (attributesOnOneLine) {
  9365. value += tracker.move(" " + attributesOnOneLine);
  9366. }
  9367. if (selfClosing) {
  9368. value += tracker.move(
  9369. (tightSelfClosing || attributesOnTheirOwnLine ? "" : " ") + "/"
  9370. );
  9371. }
  9372. value += tracker.move(">");
  9373. if (node2.children && node2.children.length > 0) {
  9374. if (node2.type === "mdxJsxTextElement") {
  9375. value += tracker.move(
  9376. // @ts-expect-error: `containerPhrasing` is typed correctly, but TS
  9377. // generates *hardcoded* types, which means that our dynamically added
  9378. // directives are not present.
  9379. // At some point, TS should fix that, and `from-markdown` should be fine.
  9380. state.containerPhrasing(node2, {
  9381. ...tracker.current(),
  9382. before: ">",
  9383. after: "<"
  9384. })
  9385. );
  9386. } else {
  9387. tracker.shift(2);
  9388. value += tracker.move("\n");
  9389. value += tracker.move(containerFlow(node2, state, tracker.current()));
  9390. value += tracker.move("\n");
  9391. }
  9392. }
  9393. if (!selfClosing) {
  9394. value += tracker.move(
  9395. (flow3 ? currentIndent : "") + "</" + (node2.name || "") + ">"
  9396. );
  9397. }
  9398. exit2();
  9399. return value;
  9400. }
  9401. }
  9402. function containerFlow(parent, state, info) {
  9403. const indexStack = state.indexStack;
  9404. const children = parent.children;
  9405. const tracker = state.createTracker(info);
  9406. const currentIndent = createIndent(inferDepth(state));
  9407. const results = [];
  9408. let index2 = -1;
  9409. indexStack.push(-1);
  9410. while (++index2 < children.length) {
  9411. const child = children[index2];
  9412. indexStack[indexStack.length - 1] = index2;
  9413. const childInfo = { before: "\n", after: "\n", ...tracker.current() };
  9414. const result = state.handle(child, parent, state, childInfo);
  9415. const serializedChild = child.type === "mdxJsxFlowElement" ? result : state.indentLines(result, function(line, _, blank) {
  9416. return (blank ? "" : currentIndent) + line;
  9417. });
  9418. results.push(tracker.move(serializedChild));
  9419. if (child.type !== "list") {
  9420. state.bulletLastUsed = void 0;
  9421. }
  9422. if (index2 < children.length - 1) {
  9423. results.push(tracker.move("\n\n"));
  9424. }
  9425. }
  9426. indexStack.pop();
  9427. return results.join("");
  9428. }
  9429. function inferDepth(state) {
  9430. let depth = 0;
  9431. let index2 = state.stack.length;
  9432. while (--index2 > -1) {
  9433. const name2 = state.stack[index2];
  9434. if (name2 === "blockquote" || name2 === "listItem") break;
  9435. if (name2 === "mdxJsxFlowElement") depth++;
  9436. }
  9437. return depth;
  9438. }
  9439. function createIndent(depth) {
  9440. return indent.repeat(depth);
  9441. }
  9442. function peekElement() {
  9443. return "<";
  9444. }
  9445. // node_modules/mdast-util-mdxjs-esm/lib/index.js
  9446. function mdxjsEsmFromMarkdown() {
  9447. return {
  9448. enter: { mdxjsEsm: enterMdxjsEsm },
  9449. exit: { mdxjsEsm: exitMdxjsEsm, mdxjsEsmData: exitMdxjsEsmData }
  9450. };
  9451. }
  9452. function mdxjsEsmToMarkdown() {
  9453. return { handlers: { mdxjsEsm: handleMdxjsEsm } };
  9454. }
  9455. function enterMdxjsEsm(token) {
  9456. this.enter({ type: "mdxjsEsm", value: "" }, token);
  9457. this.buffer();
  9458. }
  9459. function exitMdxjsEsm(token) {
  9460. const value = this.resume();
  9461. const node2 = this.stack[this.stack.length - 1];
  9462. ok(node2.type === "mdxjsEsm");
  9463. this.exit(token);
  9464. const estree = token.estree;
  9465. node2.value = value;
  9466. if (estree) {
  9467. node2.data = { estree };
  9468. }
  9469. }
  9470. function exitMdxjsEsmData(token) {
  9471. this.config.enter.data.call(this, token);
  9472. this.config.exit.data.call(this, token);
  9473. }
  9474. function handleMdxjsEsm(node2) {
  9475. return node2.value || "";
  9476. }
  9477. // node_modules/mdast-util-mdx/lib/index.js
  9478. function mdxFromMarkdown() {
  9479. return [
  9480. mdxExpressionFromMarkdown(),
  9481. mdxJsxFromMarkdown(),
  9482. mdxjsEsmFromMarkdown()
  9483. ];
  9484. }
  9485. function mdxToMarkdown(options) {
  9486. return {
  9487. extensions: [
  9488. mdxExpressionToMarkdown(),
  9489. mdxJsxToMarkdown(options),
  9490. mdxjsEsmToMarkdown()
  9491. ]
  9492. };
  9493. }
  9494. // node_modules/micromark-extension-mdxjs/node_modules/acorn/dist/acorn.mjs
  9495. var 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, 81, 2, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 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, 10, 1, 2, 0, 49, 6, 4, 4, 14, 9, 5351, 0, 7, 14, 13835, 9, 87, 9, 39, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4706, 45, 3, 22, 543, 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, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 983, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];
  9496. var 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, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 68, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 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, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 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, 20, 1, 64, 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, 38, 6, 186, 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, 19, 72, 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, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 4026, 582, 8634, 568, 8, 30, 18, 78, 18, 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, 8936, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 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, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 757, 6, 2, 3, 2, 1, 2, 14, 2, 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, 42719, 33, 4153, 7, 221, 3, 5761, 15, 7472, 16, 621, 2467, 541, 1507, 4938, 6, 4191];
  9497. var nonASCIIidentifierChars = "\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\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\u0C3C\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\u0CF3\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-\u0ECE\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-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\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-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\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\uFF65";
  9498. var nonASCIIidentifierStartChars = "\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\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\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\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\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\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-\u1711\u171F-\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-\u1B4C\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-\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-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\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";
  9499. var reservedWords = {
  9500. 3: "abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",
  9501. 5: "class enum extends super const export import",
  9502. 6: "enum",
  9503. strict: "implements interface let package private protected public static yield",
  9504. strictBind: "eval arguments"
  9505. };
  9506. var ecma5AndLessKeywords = "break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this";
  9507. var keywords$1 = {
  9508. 5: ecma5AndLessKeywords,
  9509. "5module": ecma5AndLessKeywords + " export import",
  9510. 6: ecma5AndLessKeywords + " const class extends export import super"
  9511. };
  9512. var keywordRelationalOperator = /^in(stanceof)?$/;
  9513. var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]");
  9514. var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]");
  9515. function isInAstralSet(code2, set) {
  9516. var pos = 65536;
  9517. for (var i = 0; i < set.length; i += 2) {
  9518. pos += set[i];
  9519. if (pos > code2) {
  9520. return false;
  9521. }
  9522. pos += set[i + 1];
  9523. if (pos >= code2) {
  9524. return true;
  9525. }
  9526. }
  9527. return false;
  9528. }
  9529. function isIdentifierStart(code2, astral) {
  9530. if (code2 < 65) {
  9531. return code2 === 36;
  9532. }
  9533. if (code2 < 91) {
  9534. return true;
  9535. }
  9536. if (code2 < 97) {
  9537. return code2 === 95;
  9538. }
  9539. if (code2 < 123) {
  9540. return true;
  9541. }
  9542. if (code2 <= 65535) {
  9543. return code2 >= 170 && nonASCIIidentifierStart.test(String.fromCharCode(code2));
  9544. }
  9545. if (astral === false) {
  9546. return false;
  9547. }
  9548. return isInAstralSet(code2, astralIdentifierStartCodes);
  9549. }
  9550. function isIdentifierChar(code2, astral) {
  9551. if (code2 < 48) {
  9552. return code2 === 36;
  9553. }
  9554. if (code2 < 58) {
  9555. return true;
  9556. }
  9557. if (code2 < 65) {
  9558. return false;
  9559. }
  9560. if (code2 < 91) {
  9561. return true;
  9562. }
  9563. if (code2 < 97) {
  9564. return code2 === 95;
  9565. }
  9566. if (code2 < 123) {
  9567. return true;
  9568. }
  9569. if (code2 <= 65535) {
  9570. return code2 >= 170 && nonASCIIidentifier.test(String.fromCharCode(code2));
  9571. }
  9572. if (astral === false) {
  9573. return false;
  9574. }
  9575. return isInAstralSet(code2, astralIdentifierStartCodes) || isInAstralSet(code2, astralIdentifierCodes);
  9576. }
  9577. var TokenType = function TokenType2(label, conf) {
  9578. if (conf === void 0) conf = {};
  9579. this.label = label;
  9580. this.keyword = conf.keyword;
  9581. this.beforeExpr = !!conf.beforeExpr;
  9582. this.startsExpr = !!conf.startsExpr;
  9583. this.isLoop = !!conf.isLoop;
  9584. this.isAssign = !!conf.isAssign;
  9585. this.prefix = !!conf.prefix;
  9586. this.postfix = !!conf.postfix;
  9587. this.binop = conf.binop || null;
  9588. this.updateContext = null;
  9589. };
  9590. function binop(name2, prec) {
  9591. return new TokenType(name2, { beforeExpr: true, binop: prec });
  9592. }
  9593. var beforeExpr = { beforeExpr: true };
  9594. var startsExpr = { startsExpr: true };
  9595. var keywords = {};
  9596. function kw(name2, options) {
  9597. if (options === void 0) options = {};
  9598. options.keyword = name2;
  9599. return keywords[name2] = new TokenType(name2, options);
  9600. }
  9601. var types$1 = {
  9602. num: new TokenType("num", startsExpr),
  9603. regexp: new TokenType("regexp", startsExpr),
  9604. string: new TokenType("string", startsExpr),
  9605. name: new TokenType("name", startsExpr),
  9606. privateId: new TokenType("privateId", startsExpr),
  9607. eof: new TokenType("eof"),
  9608. // Punctuation token types.
  9609. bracketL: new TokenType("[", { beforeExpr: true, startsExpr: true }),
  9610. bracketR: new TokenType("]"),
  9611. braceL: new TokenType("{", { beforeExpr: true, startsExpr: true }),
  9612. braceR: new TokenType("}"),
  9613. parenL: new TokenType("(", { beforeExpr: true, startsExpr: true }),
  9614. parenR: new TokenType(")"),
  9615. comma: new TokenType(",", beforeExpr),
  9616. semi: new TokenType(";", beforeExpr),
  9617. colon: new TokenType(":", beforeExpr),
  9618. dot: new TokenType("."),
  9619. question: new TokenType("?", beforeExpr),
  9620. questionDot: new TokenType("?."),
  9621. arrow: new TokenType("=>", beforeExpr),
  9622. template: new TokenType("template"),
  9623. invalidTemplate: new TokenType("invalidTemplate"),
  9624. ellipsis: new TokenType("...", beforeExpr),
  9625. backQuote: new TokenType("`", startsExpr),
  9626. dollarBraceL: new TokenType("${", { beforeExpr: true, startsExpr: true }),
  9627. // Operators. These carry several kinds of properties to help the
  9628. // parser use them properly (the presence of these properties is
  9629. // what categorizes them as operators).
  9630. //
  9631. // `binop`, when present, specifies that this operator is a binary
  9632. // operator, and will refer to its precedence.
  9633. //
  9634. // `prefix` and `postfix` mark the operator as a prefix or postfix
  9635. // unary operator.
  9636. //
  9637. // `isAssign` marks all of `=`, `+=`, `-=` etcetera, which act as
  9638. // binary operators with a very low precedence, that should result
  9639. // in AssignmentExpression nodes.
  9640. eq: new TokenType("=", { beforeExpr: true, isAssign: true }),
  9641. assign: new TokenType("_=", { beforeExpr: true, isAssign: true }),
  9642. incDec: new TokenType("++/--", { prefix: true, postfix: true, startsExpr: true }),
  9643. prefix: new TokenType("!/~", { beforeExpr: true, prefix: true, startsExpr: true }),
  9644. logicalOR: binop("||", 1),
  9645. logicalAND: binop("&&", 2),
  9646. bitwiseOR: binop("|", 3),
  9647. bitwiseXOR: binop("^", 4),
  9648. bitwiseAND: binop("&", 5),
  9649. equality: binop("==/!=/===/!==", 6),
  9650. relational: binop("</>/<=/>=", 7),
  9651. bitShift: binop("<</>>/>>>", 8),
  9652. plusMin: new TokenType("+/-", { beforeExpr: true, binop: 9, prefix: true, startsExpr: true }),
  9653. modulo: binop("%", 10),
  9654. star: binop("*", 10),
  9655. slash: binop("/", 10),
  9656. starstar: new TokenType("**", { beforeExpr: true }),
  9657. coalesce: binop("??", 1),
  9658. // Keyword token types.
  9659. _break: kw("break"),
  9660. _case: kw("case", beforeExpr),
  9661. _catch: kw("catch"),
  9662. _continue: kw("continue"),
  9663. _debugger: kw("debugger"),
  9664. _default: kw("default", beforeExpr),
  9665. _do: kw("do", { isLoop: true, beforeExpr: true }),
  9666. _else: kw("else", beforeExpr),
  9667. _finally: kw("finally"),
  9668. _for: kw("for", { isLoop: true }),
  9669. _function: kw("function", startsExpr),
  9670. _if: kw("if"),
  9671. _return: kw("return", beforeExpr),
  9672. _switch: kw("switch"),
  9673. _throw: kw("throw", beforeExpr),
  9674. _try: kw("try"),
  9675. _var: kw("var"),
  9676. _const: kw("const"),
  9677. _while: kw("while", { isLoop: true }),
  9678. _with: kw("with"),
  9679. _new: kw("new", { beforeExpr: true, startsExpr: true }),
  9680. _this: kw("this", startsExpr),
  9681. _super: kw("super", startsExpr),
  9682. _class: kw("class", startsExpr),
  9683. _extends: kw("extends", beforeExpr),
  9684. _export: kw("export"),
  9685. _import: kw("import", startsExpr),
  9686. _null: kw("null", startsExpr),
  9687. _true: kw("true", startsExpr),
  9688. _false: kw("false", startsExpr),
  9689. _in: kw("in", { beforeExpr: true, binop: 7 }),
  9690. _instanceof: kw("instanceof", { beforeExpr: true, binop: 7 }),
  9691. _typeof: kw("typeof", { beforeExpr: true, prefix: true, startsExpr: true }),
  9692. _void: kw("void", { beforeExpr: true, prefix: true, startsExpr: true }),
  9693. _delete: kw("delete", { beforeExpr: true, prefix: true, startsExpr: true })
  9694. };
  9695. var lineBreak = /\r\n?|\n|\u2028|\u2029/;
  9696. var lineBreakG = new RegExp(lineBreak.source, "g");
  9697. function isNewLine(code2) {
  9698. return code2 === 10 || code2 === 13 || code2 === 8232 || code2 === 8233;
  9699. }
  9700. function nextLineBreak(code2, from, end) {
  9701. if (end === void 0) end = code2.length;
  9702. for (var i = from; i < end; i++) {
  9703. var next = code2.charCodeAt(i);
  9704. if (isNewLine(next)) {
  9705. return i < end - 1 && next === 13 && code2.charCodeAt(i + 1) === 10 ? i + 2 : i + 1;
  9706. }
  9707. }
  9708. return -1;
  9709. }
  9710. var nonASCIIwhitespace = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/;
  9711. var skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g;
  9712. var ref = Object.prototype;
  9713. var hasOwnProperty = ref.hasOwnProperty;
  9714. var toString = ref.toString;
  9715. var hasOwn = Object.hasOwn || function(obj, propName) {
  9716. return hasOwnProperty.call(obj, propName);
  9717. };
  9718. var isArray = Array.isArray || function(obj) {
  9719. return toString.call(obj) === "[object Array]";
  9720. };
  9721. var regexpCache = /* @__PURE__ */ Object.create(null);
  9722. function wordsRegexp(words) {
  9723. return regexpCache[words] || (regexpCache[words] = new RegExp("^(?:" + words.replace(/ /g, "|") + ")$"));
  9724. }
  9725. function codePointToString(code2) {
  9726. if (code2 <= 65535) {
  9727. return String.fromCharCode(code2);
  9728. }
  9729. code2 -= 65536;
  9730. return String.fromCharCode((code2 >> 10) + 55296, (code2 & 1023) + 56320);
  9731. }
  9732. var loneSurrogate = /(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/;
  9733. var Position = function Position2(line, col) {
  9734. this.line = line;
  9735. this.column = col;
  9736. };
  9737. Position.prototype.offset = function offset(n) {
  9738. return new Position(this.line, this.column + n);
  9739. };
  9740. var SourceLocation = function SourceLocation2(p, start2, end) {
  9741. this.start = start2;
  9742. this.end = end;
  9743. if (p.sourceFile !== null) {
  9744. this.source = p.sourceFile;
  9745. }
  9746. };
  9747. function getLineInfo(input, offset2) {
  9748. for (var line = 1, cur = 0; ; ) {
  9749. var nextBreak = nextLineBreak(input, cur, offset2);
  9750. if (nextBreak < 0) {
  9751. return new Position(line, offset2 - cur);
  9752. }
  9753. ++line;
  9754. cur = nextBreak;
  9755. }
  9756. }
  9757. var defaultOptions = {
  9758. // `ecmaVersion` indicates the ECMAScript version to parse. Must be
  9759. // either 3, 5, 6 (or 2015), 7 (2016), 8 (2017), 9 (2018), 10
  9760. // (2019), 11 (2020), 12 (2021), 13 (2022), 14 (2023), or `"latest"`
  9761. // (the latest version the library supports). This influences
  9762. // support for strict mode, the set of reserved words, and support
  9763. // for new syntax features.
  9764. ecmaVersion: null,
  9765. // `sourceType` indicates the mode the code should be parsed in.
  9766. // Can be either `"script"` or `"module"`. This influences global
  9767. // strict mode and parsing of `import` and `export` declarations.
  9768. sourceType: "script",
  9769. // `onInsertedSemicolon` can be a callback that will be called when
  9770. // a semicolon is automatically inserted. It will be passed the
  9771. // position of the inserted semicolon as an offset, and if
  9772. // `locations` is enabled, it is given the location as a `{line,
  9773. // column}` object as second argument.
  9774. onInsertedSemicolon: null,
  9775. // `onTrailingComma` is similar to `onInsertedSemicolon`, but for
  9776. // trailing commas.
  9777. onTrailingComma: null,
  9778. // By default, reserved words are only enforced if ecmaVersion >= 5.
  9779. // Set `allowReserved` to a boolean value to explicitly turn this on
  9780. // an off. When this option has the value "never", reserved words
  9781. // and keywords can also not be used as property names.
  9782. allowReserved: null,
  9783. // When enabled, a return at the top level is not considered an
  9784. // error.
  9785. allowReturnOutsideFunction: false,
  9786. // When enabled, import/export statements are not constrained to
  9787. // appearing at the top of the program, and an import.meta expression
  9788. // in a script isn't considered an error.
  9789. allowImportExportEverywhere: false,
  9790. // By default, await identifiers are allowed to appear at the top-level scope only if ecmaVersion >= 2022.
  9791. // When enabled, await identifiers are allowed to appear at the top-level scope,
  9792. // but they are still not allowed in non-async functions.
  9793. allowAwaitOutsideFunction: null,
  9794. // When enabled, super identifiers are not constrained to
  9795. // appearing in methods and do not raise an error when they appear elsewhere.
  9796. allowSuperOutsideMethod: null,
  9797. // When enabled, hashbang directive in the beginning of file is
  9798. // allowed and treated as a line comment. Enabled by default when
  9799. // `ecmaVersion` >= 2023.
  9800. allowHashBang: false,
  9801. // By default, the parser will verify that private properties are
  9802. // only used in places where they are valid and have been declared.
  9803. // Set this to false to turn such checks off.
  9804. checkPrivateFields: true,
  9805. // When `locations` is on, `loc` properties holding objects with
  9806. // `start` and `end` properties in `{line, column}` form (with
  9807. // line being 1-based and column 0-based) will be attached to the
  9808. // nodes.
  9809. locations: false,
  9810. // A function can be passed as `onToken` option, which will
  9811. // cause Acorn to call that function with object in the same
  9812. // format as tokens returned from `tokenizer().getToken()`. Note
  9813. // that you are not allowed to call the parser from the
  9814. // callback—that will corrupt its internal state.
  9815. onToken: null,
  9816. // A function can be passed as `onComment` option, which will
  9817. // cause Acorn to call that function with `(block, text, start,
  9818. // end)` parameters whenever a comment is skipped. `block` is a
  9819. // boolean indicating whether this is a block (`/* */`) comment,
  9820. // `text` is the content of the comment, and `start` and `end` are
  9821. // character offsets that denote the start and end of the comment.
  9822. // When the `locations` option is on, two more parameters are
  9823. // passed, the full `{line, column}` locations of the start and
  9824. // end of the comments. Note that you are not allowed to call the
  9825. // parser from the callback—that will corrupt its internal state.
  9826. // When this option has an array as value, objects representing the
  9827. // comments are pushed to it.
  9828. onComment: null,
  9829. // Nodes have their start and end characters offsets recorded in
  9830. // `start` and `end` properties (directly on the node, rather than
  9831. // the `loc` object, which holds line/column data. To also add a
  9832. // [semi-standardized][range] `range` property holding a `[start,
  9833. // end]` array with the same numbers, set the `ranges` option to
  9834. // `true`.
  9835. //
  9836. // [range]: https://bugzilla.mozilla.org/show_bug.cgi?id=745678
  9837. ranges: false,
  9838. // It is possible to parse multiple files into a single AST by
  9839. // passing the tree produced by parsing the first file as
  9840. // `program` option in subsequent parses. This will add the
  9841. // toplevel forms of the parsed file to the `Program` (top) node
  9842. // of an existing parse tree.
  9843. program: null,
  9844. // When `locations` is on, you can pass this to record the source
  9845. // file in every node's `loc` object.
  9846. sourceFile: null,
  9847. // This value, if given, is stored in every node, whether
  9848. // `locations` is on or off.
  9849. directSourceFile: null,
  9850. // When enabled, parenthesized expressions are represented by
  9851. // (non-standard) ParenthesizedExpression nodes
  9852. preserveParens: false
  9853. };
  9854. var warnedAboutEcmaVersion = false;
  9855. function getOptions(opts) {
  9856. var options = {};
  9857. for (var opt in defaultOptions) {
  9858. options[opt] = opts && hasOwn(opts, opt) ? opts[opt] : defaultOptions[opt];
  9859. }
  9860. if (options.ecmaVersion === "latest") {
  9861. options.ecmaVersion = 1e8;
  9862. } else if (options.ecmaVersion == null) {
  9863. if (!warnedAboutEcmaVersion && typeof console === "object" && console.warn) {
  9864. warnedAboutEcmaVersion = true;
  9865. console.warn("Since Acorn 8.0.0, options.ecmaVersion is required.\nDefaulting to 2020, but this will stop working in the future.");
  9866. }
  9867. options.ecmaVersion = 11;
  9868. } else if (options.ecmaVersion >= 2015) {
  9869. options.ecmaVersion -= 2009;
  9870. }
  9871. if (options.allowReserved == null) {
  9872. options.allowReserved = options.ecmaVersion < 5;
  9873. }
  9874. if (!opts || opts.allowHashBang == null) {
  9875. options.allowHashBang = options.ecmaVersion >= 14;
  9876. }
  9877. if (isArray(options.onToken)) {
  9878. var tokens = options.onToken;
  9879. options.onToken = function(token) {
  9880. return tokens.push(token);
  9881. };
  9882. }
  9883. if (isArray(options.onComment)) {
  9884. options.onComment = pushComment(options, options.onComment);
  9885. }
  9886. return options;
  9887. }
  9888. function pushComment(options, array) {
  9889. return function(block, text5, start2, end, startLoc, endLoc) {
  9890. var comment2 = {
  9891. type: block ? "Block" : "Line",
  9892. value: text5,
  9893. start: start2,
  9894. end
  9895. };
  9896. if (options.locations) {
  9897. comment2.loc = new SourceLocation(this, startLoc, endLoc);
  9898. }
  9899. if (options.ranges) {
  9900. comment2.range = [start2, end];
  9901. }
  9902. array.push(comment2);
  9903. };
  9904. }
  9905. var SCOPE_TOP = 1;
  9906. var SCOPE_FUNCTION = 2;
  9907. var SCOPE_ASYNC = 4;
  9908. var SCOPE_GENERATOR = 8;
  9909. var SCOPE_ARROW = 16;
  9910. var SCOPE_SIMPLE_CATCH = 32;
  9911. var SCOPE_SUPER = 64;
  9912. var SCOPE_DIRECT_SUPER = 128;
  9913. var SCOPE_CLASS_STATIC_BLOCK = 256;
  9914. var SCOPE_VAR = SCOPE_TOP | SCOPE_FUNCTION | SCOPE_CLASS_STATIC_BLOCK;
  9915. function functionFlags(async, generator) {
  9916. return SCOPE_FUNCTION | (async ? SCOPE_ASYNC : 0) | (generator ? SCOPE_GENERATOR : 0);
  9917. }
  9918. var BIND_NONE = 0;
  9919. var BIND_VAR = 1;
  9920. var BIND_LEXICAL = 2;
  9921. var BIND_FUNCTION = 3;
  9922. var BIND_SIMPLE_CATCH = 4;
  9923. var BIND_OUTSIDE = 5;
  9924. var Parser = function Parser2(options, input, startPos) {
  9925. this.options = options = getOptions(options);
  9926. this.sourceFile = options.sourceFile;
  9927. this.keywords = wordsRegexp(keywords$1[options.ecmaVersion >= 6 ? 6 : options.sourceType === "module" ? "5module" : 5]);
  9928. var reserved = "";
  9929. if (options.allowReserved !== true) {
  9930. reserved = reservedWords[options.ecmaVersion >= 6 ? 6 : options.ecmaVersion === 5 ? 5 : 3];
  9931. if (options.sourceType === "module") {
  9932. reserved += " await";
  9933. }
  9934. }
  9935. this.reservedWords = wordsRegexp(reserved);
  9936. var reservedStrict = (reserved ? reserved + " " : "") + reservedWords.strict;
  9937. this.reservedWordsStrict = wordsRegexp(reservedStrict);
  9938. this.reservedWordsStrictBind = wordsRegexp(reservedStrict + " " + reservedWords.strictBind);
  9939. this.input = String(input);
  9940. this.containsEsc = false;
  9941. if (startPos) {
  9942. this.pos = startPos;
  9943. this.lineStart = this.input.lastIndexOf("\n", startPos - 1) + 1;
  9944. this.curLine = this.input.slice(0, this.lineStart).split(lineBreak).length;
  9945. } else {
  9946. this.pos = this.lineStart = 0;
  9947. this.curLine = 1;
  9948. }
  9949. this.type = types$1.eof;
  9950. this.value = null;
  9951. this.start = this.end = this.pos;
  9952. this.startLoc = this.endLoc = this.curPosition();
  9953. this.lastTokEndLoc = this.lastTokStartLoc = null;
  9954. this.lastTokStart = this.lastTokEnd = this.pos;
  9955. this.context = this.initialContext();
  9956. this.exprAllowed = true;
  9957. this.inModule = options.sourceType === "module";
  9958. this.strict = this.inModule || this.strictDirective(this.pos);
  9959. this.potentialArrowAt = -1;
  9960. this.potentialArrowInForAwait = false;
  9961. this.yieldPos = this.awaitPos = this.awaitIdentPos = 0;
  9962. this.labels = [];
  9963. this.undefinedExports = /* @__PURE__ */ Object.create(null);
  9964. if (this.pos === 0 && options.allowHashBang && this.input.slice(0, 2) === "#!") {
  9965. this.skipLineComment(2);
  9966. }
  9967. this.scopeStack = [];
  9968. this.enterScope(SCOPE_TOP);
  9969. this.regexpState = null;
  9970. this.privateNameStack = [];
  9971. };
  9972. var prototypeAccessors = { inFunction: { configurable: true }, inGenerator: { configurable: true }, inAsync: { configurable: true }, canAwait: { configurable: true }, allowSuper: { configurable: true }, allowDirectSuper: { configurable: true }, treatFunctionsAsVar: { configurable: true }, allowNewDotTarget: { configurable: true }, inClassStaticBlock: { configurable: true } };
  9973. Parser.prototype.parse = function parse() {
  9974. var node2 = this.options.program || this.startNode();
  9975. this.nextToken();
  9976. return this.parseTopLevel(node2);
  9977. };
  9978. prototypeAccessors.inFunction.get = function() {
  9979. return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0;
  9980. };
  9981. prototypeAccessors.inGenerator.get = function() {
  9982. return (this.currentVarScope().flags & SCOPE_GENERATOR) > 0 && !this.currentVarScope().inClassFieldInit;
  9983. };
  9984. prototypeAccessors.inAsync.get = function() {
  9985. return (this.currentVarScope().flags & SCOPE_ASYNC) > 0 && !this.currentVarScope().inClassFieldInit;
  9986. };
  9987. prototypeAccessors.canAwait.get = function() {
  9988. for (var i = this.scopeStack.length - 1; i >= 0; i--) {
  9989. var scope = this.scopeStack[i];
  9990. if (scope.inClassFieldInit || scope.flags & SCOPE_CLASS_STATIC_BLOCK) {
  9991. return false;
  9992. }
  9993. if (scope.flags & SCOPE_FUNCTION) {
  9994. return (scope.flags & SCOPE_ASYNC) > 0;
  9995. }
  9996. }
  9997. return this.inModule && this.options.ecmaVersion >= 13 || this.options.allowAwaitOutsideFunction;
  9998. };
  9999. prototypeAccessors.allowSuper.get = function() {
  10000. var ref2 = this.currentThisScope();
  10001. var flags = ref2.flags;
  10002. var inClassFieldInit = ref2.inClassFieldInit;
  10003. return (flags & SCOPE_SUPER) > 0 || inClassFieldInit || this.options.allowSuperOutsideMethod;
  10004. };
  10005. prototypeAccessors.allowDirectSuper.get = function() {
  10006. return (this.currentThisScope().flags & SCOPE_DIRECT_SUPER) > 0;
  10007. };
  10008. prototypeAccessors.treatFunctionsAsVar.get = function() {
  10009. return this.treatFunctionsAsVarInScope(this.currentScope());
  10010. };
  10011. prototypeAccessors.allowNewDotTarget.get = function() {
  10012. var ref2 = this.currentThisScope();
  10013. var flags = ref2.flags;
  10014. var inClassFieldInit = ref2.inClassFieldInit;
  10015. return (flags & (SCOPE_FUNCTION | SCOPE_CLASS_STATIC_BLOCK)) > 0 || inClassFieldInit;
  10016. };
  10017. prototypeAccessors.inClassStaticBlock.get = function() {
  10018. return (this.currentVarScope().flags & SCOPE_CLASS_STATIC_BLOCK) > 0;
  10019. };
  10020. Parser.extend = function extend() {
  10021. var plugins = [], len = arguments.length;
  10022. while (len--) plugins[len] = arguments[len];
  10023. var cls = this;
  10024. for (var i = 0; i < plugins.length; i++) {
  10025. cls = plugins[i](cls);
  10026. }
  10027. return cls;
  10028. };
  10029. Parser.parse = function parse2(input, options) {
  10030. return new this(options, input).parse();
  10031. };
  10032. Parser.parseExpressionAt = function parseExpressionAt(input, pos, options) {
  10033. var parser = new this(options, input, pos);
  10034. parser.nextToken();
  10035. return parser.parseExpression();
  10036. };
  10037. Parser.tokenizer = function tokenizer(input, options) {
  10038. return new this(options, input);
  10039. };
  10040. Object.defineProperties(Parser.prototype, prototypeAccessors);
  10041. var pp$9 = Parser.prototype;
  10042. var literal = /^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;
  10043. pp$9.strictDirective = function(start2) {
  10044. if (this.options.ecmaVersion < 5) {
  10045. return false;
  10046. }
  10047. for (; ; ) {
  10048. skipWhiteSpace.lastIndex = start2;
  10049. start2 += skipWhiteSpace.exec(this.input)[0].length;
  10050. var match = literal.exec(this.input.slice(start2));
  10051. if (!match) {
  10052. return false;
  10053. }
  10054. if ((match[1] || match[2]) === "use strict") {
  10055. skipWhiteSpace.lastIndex = start2 + match[0].length;
  10056. var spaceAfter = skipWhiteSpace.exec(this.input), end = spaceAfter.index + spaceAfter[0].length;
  10057. var next = this.input.charAt(end);
  10058. return next === ";" || next === "}" || lineBreak.test(spaceAfter[0]) && !(/[(`.[+\-/*%<>=,?^&]/.test(next) || next === "!" && this.input.charAt(end + 1) === "=");
  10059. }
  10060. start2 += match[0].length;
  10061. skipWhiteSpace.lastIndex = start2;
  10062. start2 += skipWhiteSpace.exec(this.input)[0].length;
  10063. if (this.input[start2] === ";") {
  10064. start2++;
  10065. }
  10066. }
  10067. };
  10068. pp$9.eat = function(type) {
  10069. if (this.type === type) {
  10070. this.next();
  10071. return true;
  10072. } else {
  10073. return false;
  10074. }
  10075. };
  10076. pp$9.isContextual = function(name2) {
  10077. return this.type === types$1.name && this.value === name2 && !this.containsEsc;
  10078. };
  10079. pp$9.eatContextual = function(name2) {
  10080. if (!this.isContextual(name2)) {
  10081. return false;
  10082. }
  10083. this.next();
  10084. return true;
  10085. };
  10086. pp$9.expectContextual = function(name2) {
  10087. if (!this.eatContextual(name2)) {
  10088. this.unexpected();
  10089. }
  10090. };
  10091. pp$9.canInsertSemicolon = function() {
  10092. return this.type === types$1.eof || this.type === types$1.braceR || lineBreak.test(this.input.slice(this.lastTokEnd, this.start));
  10093. };
  10094. pp$9.insertSemicolon = function() {
  10095. if (this.canInsertSemicolon()) {
  10096. if (this.options.onInsertedSemicolon) {
  10097. this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc);
  10098. }
  10099. return true;
  10100. }
  10101. };
  10102. pp$9.semicolon = function() {
  10103. if (!this.eat(types$1.semi) && !this.insertSemicolon()) {
  10104. this.unexpected();
  10105. }
  10106. };
  10107. pp$9.afterTrailingComma = function(tokType, notNext) {
  10108. if (this.type === tokType) {
  10109. if (this.options.onTrailingComma) {
  10110. this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc);
  10111. }
  10112. if (!notNext) {
  10113. this.next();
  10114. }
  10115. return true;
  10116. }
  10117. };
  10118. pp$9.expect = function(type) {
  10119. this.eat(type) || this.unexpected();
  10120. };
  10121. pp$9.unexpected = function(pos) {
  10122. this.raise(pos != null ? pos : this.start, "Unexpected token");
  10123. };
  10124. var DestructuringErrors = function DestructuringErrors2() {
  10125. this.shorthandAssign = this.trailingComma = this.parenthesizedAssign = this.parenthesizedBind = this.doubleProto = -1;
  10126. };
  10127. pp$9.checkPatternErrors = function(refDestructuringErrors, isAssign) {
  10128. if (!refDestructuringErrors) {
  10129. return;
  10130. }
  10131. if (refDestructuringErrors.trailingComma > -1) {
  10132. this.raiseRecoverable(refDestructuringErrors.trailingComma, "Comma is not permitted after the rest element");
  10133. }
  10134. var parens = isAssign ? refDestructuringErrors.parenthesizedAssign : refDestructuringErrors.parenthesizedBind;
  10135. if (parens > -1) {
  10136. this.raiseRecoverable(parens, isAssign ? "Assigning to rvalue" : "Parenthesized pattern");
  10137. }
  10138. };
  10139. pp$9.checkExpressionErrors = function(refDestructuringErrors, andThrow) {
  10140. if (!refDestructuringErrors) {
  10141. return false;
  10142. }
  10143. var shorthandAssign = refDestructuringErrors.shorthandAssign;
  10144. var doubleProto = refDestructuringErrors.doubleProto;
  10145. if (!andThrow) {
  10146. return shorthandAssign >= 0 || doubleProto >= 0;
  10147. }
  10148. if (shorthandAssign >= 0) {
  10149. this.raise(shorthandAssign, "Shorthand property assignments are valid only in destructuring patterns");
  10150. }
  10151. if (doubleProto >= 0) {
  10152. this.raiseRecoverable(doubleProto, "Redefinition of __proto__ property");
  10153. }
  10154. };
  10155. pp$9.checkYieldAwaitInDefaultParams = function() {
  10156. if (this.yieldPos && (!this.awaitPos || this.yieldPos < this.awaitPos)) {
  10157. this.raise(this.yieldPos, "Yield expression cannot be a default value");
  10158. }
  10159. if (this.awaitPos) {
  10160. this.raise(this.awaitPos, "Await expression cannot be a default value");
  10161. }
  10162. };
  10163. pp$9.isSimpleAssignTarget = function(expr) {
  10164. if (expr.type === "ParenthesizedExpression") {
  10165. return this.isSimpleAssignTarget(expr.expression);
  10166. }
  10167. return expr.type === "Identifier" || expr.type === "MemberExpression";
  10168. };
  10169. var pp$8 = Parser.prototype;
  10170. pp$8.parseTopLevel = function(node2) {
  10171. var exports2 = /* @__PURE__ */ Object.create(null);
  10172. if (!node2.body) {
  10173. node2.body = [];
  10174. }
  10175. while (this.type !== types$1.eof) {
  10176. var stmt = this.parseStatement(null, true, exports2);
  10177. node2.body.push(stmt);
  10178. }
  10179. if (this.inModule) {
  10180. for (var i = 0, list3 = Object.keys(this.undefinedExports); i < list3.length; i += 1) {
  10181. var name2 = list3[i];
  10182. this.raiseRecoverable(this.undefinedExports[name2].start, "Export '" + name2 + "' is not defined");
  10183. }
  10184. }
  10185. this.adaptDirectivePrologue(node2.body);
  10186. this.next();
  10187. node2.sourceType = this.options.sourceType;
  10188. return this.finishNode(node2, "Program");
  10189. };
  10190. var loopLabel = { kind: "loop" };
  10191. var switchLabel = { kind: "switch" };
  10192. pp$8.isLet = function(context) {
  10193. if (this.options.ecmaVersion < 6 || !this.isContextual("let")) {
  10194. return false;
  10195. }
  10196. skipWhiteSpace.lastIndex = this.pos;
  10197. var skip = skipWhiteSpace.exec(this.input);
  10198. var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next);
  10199. if (nextCh === 91 || nextCh === 92) {
  10200. return true;
  10201. }
  10202. if (context) {
  10203. return false;
  10204. }
  10205. if (nextCh === 123 || nextCh > 55295 && nextCh < 56320) {
  10206. return true;
  10207. }
  10208. if (isIdentifierStart(nextCh, true)) {
  10209. var pos = next + 1;
  10210. while (isIdentifierChar(nextCh = this.input.charCodeAt(pos), true)) {
  10211. ++pos;
  10212. }
  10213. if (nextCh === 92 || nextCh > 55295 && nextCh < 56320) {
  10214. return true;
  10215. }
  10216. var ident = this.input.slice(next, pos);
  10217. if (!keywordRelationalOperator.test(ident)) {
  10218. return true;
  10219. }
  10220. }
  10221. return false;
  10222. };
  10223. pp$8.isAsyncFunction = function() {
  10224. if (this.options.ecmaVersion < 8 || !this.isContextual("async")) {
  10225. return false;
  10226. }
  10227. skipWhiteSpace.lastIndex = this.pos;
  10228. var skip = skipWhiteSpace.exec(this.input);
  10229. var next = this.pos + skip[0].length, after;
  10230. return !lineBreak.test(this.input.slice(this.pos, next)) && this.input.slice(next, next + 8) === "function" && (next + 8 === this.input.length || !(isIdentifierChar(after = this.input.charCodeAt(next + 8)) || after > 55295 && after < 56320));
  10231. };
  10232. pp$8.parseStatement = function(context, topLevel, exports2) {
  10233. var starttype = this.type, node2 = this.startNode(), kind;
  10234. if (this.isLet(context)) {
  10235. starttype = types$1._var;
  10236. kind = "let";
  10237. }
  10238. switch (starttype) {
  10239. case types$1._break:
  10240. case types$1._continue:
  10241. return this.parseBreakContinueStatement(node2, starttype.keyword);
  10242. case types$1._debugger:
  10243. return this.parseDebuggerStatement(node2);
  10244. case types$1._do:
  10245. return this.parseDoStatement(node2);
  10246. case types$1._for:
  10247. return this.parseForStatement(node2);
  10248. case types$1._function:
  10249. if (context && (this.strict || context !== "if" && context !== "label") && this.options.ecmaVersion >= 6) {
  10250. this.unexpected();
  10251. }
  10252. return this.parseFunctionStatement(node2, false, !context);
  10253. case types$1._class:
  10254. if (context) {
  10255. this.unexpected();
  10256. }
  10257. return this.parseClass(node2, true);
  10258. case types$1._if:
  10259. return this.parseIfStatement(node2);
  10260. case types$1._return:
  10261. return this.parseReturnStatement(node2);
  10262. case types$1._switch:
  10263. return this.parseSwitchStatement(node2);
  10264. case types$1._throw:
  10265. return this.parseThrowStatement(node2);
  10266. case types$1._try:
  10267. return this.parseTryStatement(node2);
  10268. case types$1._const:
  10269. case types$1._var:
  10270. kind = kind || this.value;
  10271. if (context && kind !== "var") {
  10272. this.unexpected();
  10273. }
  10274. return this.parseVarStatement(node2, kind);
  10275. case types$1._while:
  10276. return this.parseWhileStatement(node2);
  10277. case types$1._with:
  10278. return this.parseWithStatement(node2);
  10279. case types$1.braceL:
  10280. return this.parseBlock(true, node2);
  10281. case types$1.semi:
  10282. return this.parseEmptyStatement(node2);
  10283. case types$1._export:
  10284. case types$1._import:
  10285. if (this.options.ecmaVersion > 10 && starttype === types$1._import) {
  10286. skipWhiteSpace.lastIndex = this.pos;
  10287. var skip = skipWhiteSpace.exec(this.input);
  10288. var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next);
  10289. if (nextCh === 40 || nextCh === 46) {
  10290. return this.parseExpressionStatement(node2, this.parseExpression());
  10291. }
  10292. }
  10293. if (!this.options.allowImportExportEverywhere) {
  10294. if (!topLevel) {
  10295. this.raise(this.start, "'import' and 'export' may only appear at the top level");
  10296. }
  10297. if (!this.inModule) {
  10298. this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'");
  10299. }
  10300. }
  10301. return starttype === types$1._import ? this.parseImport(node2) : this.parseExport(node2, exports2);
  10302. default:
  10303. if (this.isAsyncFunction()) {
  10304. if (context) {
  10305. this.unexpected();
  10306. }
  10307. this.next();
  10308. return this.parseFunctionStatement(node2, true, !context);
  10309. }
  10310. var maybeName = this.value, expr = this.parseExpression();
  10311. if (starttype === types$1.name && expr.type === "Identifier" && this.eat(types$1.colon)) {
  10312. return this.parseLabeledStatement(node2, maybeName, expr, context);
  10313. } else {
  10314. return this.parseExpressionStatement(node2, expr);
  10315. }
  10316. }
  10317. };
  10318. pp$8.parseBreakContinueStatement = function(node2, keyword) {
  10319. var isBreak = keyword === "break";
  10320. this.next();
  10321. if (this.eat(types$1.semi) || this.insertSemicolon()) {
  10322. node2.label = null;
  10323. } else if (this.type !== types$1.name) {
  10324. this.unexpected();
  10325. } else {
  10326. node2.label = this.parseIdent();
  10327. this.semicolon();
  10328. }
  10329. var i = 0;
  10330. for (; i < this.labels.length; ++i) {
  10331. var lab = this.labels[i];
  10332. if (node2.label == null || lab.name === node2.label.name) {
  10333. if (lab.kind != null && (isBreak || lab.kind === "loop")) {
  10334. break;
  10335. }
  10336. if (node2.label && isBreak) {
  10337. break;
  10338. }
  10339. }
  10340. }
  10341. if (i === this.labels.length) {
  10342. this.raise(node2.start, "Unsyntactic " + keyword);
  10343. }
  10344. return this.finishNode(node2, isBreak ? "BreakStatement" : "ContinueStatement");
  10345. };
  10346. pp$8.parseDebuggerStatement = function(node2) {
  10347. this.next();
  10348. this.semicolon();
  10349. return this.finishNode(node2, "DebuggerStatement");
  10350. };
  10351. pp$8.parseDoStatement = function(node2) {
  10352. this.next();
  10353. this.labels.push(loopLabel);
  10354. node2.body = this.parseStatement("do");
  10355. this.labels.pop();
  10356. this.expect(types$1._while);
  10357. node2.test = this.parseParenExpression();
  10358. if (this.options.ecmaVersion >= 6) {
  10359. this.eat(types$1.semi);
  10360. } else {
  10361. this.semicolon();
  10362. }
  10363. return this.finishNode(node2, "DoWhileStatement");
  10364. };
  10365. pp$8.parseForStatement = function(node2) {
  10366. this.next();
  10367. var awaitAt = this.options.ecmaVersion >= 9 && this.canAwait && this.eatContextual("await") ? this.lastTokStart : -1;
  10368. this.labels.push(loopLabel);
  10369. this.enterScope(0);
  10370. this.expect(types$1.parenL);
  10371. if (this.type === types$1.semi) {
  10372. if (awaitAt > -1) {
  10373. this.unexpected(awaitAt);
  10374. }
  10375. return this.parseFor(node2, null);
  10376. }
  10377. var isLet = this.isLet();
  10378. if (this.type === types$1._var || this.type === types$1._const || isLet) {
  10379. var init$1 = this.startNode(), kind = isLet ? "let" : this.value;
  10380. this.next();
  10381. this.parseVar(init$1, true, kind);
  10382. this.finishNode(init$1, "VariableDeclaration");
  10383. if ((this.type === types$1._in || this.options.ecmaVersion >= 6 && this.isContextual("of")) && init$1.declarations.length === 1) {
  10384. if (this.options.ecmaVersion >= 9) {
  10385. if (this.type === types$1._in) {
  10386. if (awaitAt > -1) {
  10387. this.unexpected(awaitAt);
  10388. }
  10389. } else {
  10390. node2.await = awaitAt > -1;
  10391. }
  10392. }
  10393. return this.parseForIn(node2, init$1);
  10394. }
  10395. if (awaitAt > -1) {
  10396. this.unexpected(awaitAt);
  10397. }
  10398. return this.parseFor(node2, init$1);
  10399. }
  10400. var startsWithLet = this.isContextual("let"), isForOf = false;
  10401. var containsEsc = this.containsEsc;
  10402. var refDestructuringErrors = new DestructuringErrors();
  10403. var initPos = this.start;
  10404. var init = awaitAt > -1 ? this.parseExprSubscripts(refDestructuringErrors, "await") : this.parseExpression(true, refDestructuringErrors);
  10405. if (this.type === types$1._in || (isForOf = this.options.ecmaVersion >= 6 && this.isContextual("of"))) {
  10406. if (awaitAt > -1) {
  10407. if (this.type === types$1._in) {
  10408. this.unexpected(awaitAt);
  10409. }
  10410. node2.await = true;
  10411. } else if (isForOf && this.options.ecmaVersion >= 8) {
  10412. if (init.start === initPos && !containsEsc && init.type === "Identifier" && init.name === "async") {
  10413. this.unexpected();
  10414. } else if (this.options.ecmaVersion >= 9) {
  10415. node2.await = false;
  10416. }
  10417. }
  10418. if (startsWithLet && isForOf) {
  10419. this.raise(init.start, "The left-hand side of a for-of loop may not start with 'let'.");
  10420. }
  10421. this.toAssignable(init, false, refDestructuringErrors);
  10422. this.checkLValPattern(init);
  10423. return this.parseForIn(node2, init);
  10424. } else {
  10425. this.checkExpressionErrors(refDestructuringErrors, true);
  10426. }
  10427. if (awaitAt > -1) {
  10428. this.unexpected(awaitAt);
  10429. }
  10430. return this.parseFor(node2, init);
  10431. };
  10432. pp$8.parseFunctionStatement = function(node2, isAsync, declarationPosition) {
  10433. this.next();
  10434. return this.parseFunction(node2, FUNC_STATEMENT | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT), false, isAsync);
  10435. };
  10436. pp$8.parseIfStatement = function(node2) {
  10437. this.next();
  10438. node2.test = this.parseParenExpression();
  10439. node2.consequent = this.parseStatement("if");
  10440. node2.alternate = this.eat(types$1._else) ? this.parseStatement("if") : null;
  10441. return this.finishNode(node2, "IfStatement");
  10442. };
  10443. pp$8.parseReturnStatement = function(node2) {
  10444. if (!this.inFunction && !this.options.allowReturnOutsideFunction) {
  10445. this.raise(this.start, "'return' outside of function");
  10446. }
  10447. this.next();
  10448. if (this.eat(types$1.semi) || this.insertSemicolon()) {
  10449. node2.argument = null;
  10450. } else {
  10451. node2.argument = this.parseExpression();
  10452. this.semicolon();
  10453. }
  10454. return this.finishNode(node2, "ReturnStatement");
  10455. };
  10456. pp$8.parseSwitchStatement = function(node2) {
  10457. this.next();
  10458. node2.discriminant = this.parseParenExpression();
  10459. node2.cases = [];
  10460. this.expect(types$1.braceL);
  10461. this.labels.push(switchLabel);
  10462. this.enterScope(0);
  10463. var cur;
  10464. for (var sawDefault = false; this.type !== types$1.braceR; ) {
  10465. if (this.type === types$1._case || this.type === types$1._default) {
  10466. var isCase = this.type === types$1._case;
  10467. if (cur) {
  10468. this.finishNode(cur, "SwitchCase");
  10469. }
  10470. node2.cases.push(cur = this.startNode());
  10471. cur.consequent = [];
  10472. this.next();
  10473. if (isCase) {
  10474. cur.test = this.parseExpression();
  10475. } else {
  10476. if (sawDefault) {
  10477. this.raiseRecoverable(this.lastTokStart, "Multiple default clauses");
  10478. }
  10479. sawDefault = true;
  10480. cur.test = null;
  10481. }
  10482. this.expect(types$1.colon);
  10483. } else {
  10484. if (!cur) {
  10485. this.unexpected();
  10486. }
  10487. cur.consequent.push(this.parseStatement(null));
  10488. }
  10489. }
  10490. this.exitScope();
  10491. if (cur) {
  10492. this.finishNode(cur, "SwitchCase");
  10493. }
  10494. this.next();
  10495. this.labels.pop();
  10496. return this.finishNode(node2, "SwitchStatement");
  10497. };
  10498. pp$8.parseThrowStatement = function(node2) {
  10499. this.next();
  10500. if (lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) {
  10501. this.raise(this.lastTokEnd, "Illegal newline after throw");
  10502. }
  10503. node2.argument = this.parseExpression();
  10504. this.semicolon();
  10505. return this.finishNode(node2, "ThrowStatement");
  10506. };
  10507. var empty$1 = [];
  10508. pp$8.parseCatchClauseParam = function() {
  10509. var param = this.parseBindingAtom();
  10510. var simple = param.type === "Identifier";
  10511. this.enterScope(simple ? SCOPE_SIMPLE_CATCH : 0);
  10512. this.checkLValPattern(param, simple ? BIND_SIMPLE_CATCH : BIND_LEXICAL);
  10513. this.expect(types$1.parenR);
  10514. return param;
  10515. };
  10516. pp$8.parseTryStatement = function(node2) {
  10517. this.next();
  10518. node2.block = this.parseBlock();
  10519. node2.handler = null;
  10520. if (this.type === types$1._catch) {
  10521. var clause = this.startNode();
  10522. this.next();
  10523. if (this.eat(types$1.parenL)) {
  10524. clause.param = this.parseCatchClauseParam();
  10525. } else {
  10526. if (this.options.ecmaVersion < 10) {
  10527. this.unexpected();
  10528. }
  10529. clause.param = null;
  10530. this.enterScope(0);
  10531. }
  10532. clause.body = this.parseBlock(false);
  10533. this.exitScope();
  10534. node2.handler = this.finishNode(clause, "CatchClause");
  10535. }
  10536. node2.finalizer = this.eat(types$1._finally) ? this.parseBlock() : null;
  10537. if (!node2.handler && !node2.finalizer) {
  10538. this.raise(node2.start, "Missing catch or finally clause");
  10539. }
  10540. return this.finishNode(node2, "TryStatement");
  10541. };
  10542. pp$8.parseVarStatement = function(node2, kind, allowMissingInitializer) {
  10543. this.next();
  10544. this.parseVar(node2, false, kind, allowMissingInitializer);
  10545. this.semicolon();
  10546. return this.finishNode(node2, "VariableDeclaration");
  10547. };
  10548. pp$8.parseWhileStatement = function(node2) {
  10549. this.next();
  10550. node2.test = this.parseParenExpression();
  10551. this.labels.push(loopLabel);
  10552. node2.body = this.parseStatement("while");
  10553. this.labels.pop();
  10554. return this.finishNode(node2, "WhileStatement");
  10555. };
  10556. pp$8.parseWithStatement = function(node2) {
  10557. if (this.strict) {
  10558. this.raise(this.start, "'with' in strict mode");
  10559. }
  10560. this.next();
  10561. node2.object = this.parseParenExpression();
  10562. node2.body = this.parseStatement("with");
  10563. return this.finishNode(node2, "WithStatement");
  10564. };
  10565. pp$8.parseEmptyStatement = function(node2) {
  10566. this.next();
  10567. return this.finishNode(node2, "EmptyStatement");
  10568. };
  10569. pp$8.parseLabeledStatement = function(node2, maybeName, expr, context) {
  10570. for (var i$1 = 0, list3 = this.labels; i$1 < list3.length; i$1 += 1) {
  10571. var label = list3[i$1];
  10572. if (label.name === maybeName) {
  10573. this.raise(expr.start, "Label '" + maybeName + "' is already declared");
  10574. }
  10575. }
  10576. var kind = this.type.isLoop ? "loop" : this.type === types$1._switch ? "switch" : null;
  10577. for (var i = this.labels.length - 1; i >= 0; i--) {
  10578. var label$1 = this.labels[i];
  10579. if (label$1.statementStart === node2.start) {
  10580. label$1.statementStart = this.start;
  10581. label$1.kind = kind;
  10582. } else {
  10583. break;
  10584. }
  10585. }
  10586. this.labels.push({ name: maybeName, kind, statementStart: this.start });
  10587. node2.body = this.parseStatement(context ? context.indexOf("label") === -1 ? context + "label" : context : "label");
  10588. this.labels.pop();
  10589. node2.label = expr;
  10590. return this.finishNode(node2, "LabeledStatement");
  10591. };
  10592. pp$8.parseExpressionStatement = function(node2, expr) {
  10593. node2.expression = expr;
  10594. this.semicolon();
  10595. return this.finishNode(node2, "ExpressionStatement");
  10596. };
  10597. pp$8.parseBlock = function(createNewLexicalScope, node2, exitStrict) {
  10598. if (createNewLexicalScope === void 0) createNewLexicalScope = true;
  10599. if (node2 === void 0) node2 = this.startNode();
  10600. node2.body = [];
  10601. this.expect(types$1.braceL);
  10602. if (createNewLexicalScope) {
  10603. this.enterScope(0);
  10604. }
  10605. while (this.type !== types$1.braceR) {
  10606. var stmt = this.parseStatement(null);
  10607. node2.body.push(stmt);
  10608. }
  10609. if (exitStrict) {
  10610. this.strict = false;
  10611. }
  10612. this.next();
  10613. if (createNewLexicalScope) {
  10614. this.exitScope();
  10615. }
  10616. return this.finishNode(node2, "BlockStatement");
  10617. };
  10618. pp$8.parseFor = function(node2, init) {
  10619. node2.init = init;
  10620. this.expect(types$1.semi);
  10621. node2.test = this.type === types$1.semi ? null : this.parseExpression();
  10622. this.expect(types$1.semi);
  10623. node2.update = this.type === types$1.parenR ? null : this.parseExpression();
  10624. this.expect(types$1.parenR);
  10625. node2.body = this.parseStatement("for");
  10626. this.exitScope();
  10627. this.labels.pop();
  10628. return this.finishNode(node2, "ForStatement");
  10629. };
  10630. pp$8.parseForIn = function(node2, init) {
  10631. var isForIn = this.type === types$1._in;
  10632. this.next();
  10633. if (init.type === "VariableDeclaration" && init.declarations[0].init != null && (!isForIn || this.options.ecmaVersion < 8 || this.strict || init.kind !== "var" || init.declarations[0].id.type !== "Identifier")) {
  10634. this.raise(
  10635. init.start,
  10636. (isForIn ? "for-in" : "for-of") + " loop variable declaration may not have an initializer"
  10637. );
  10638. }
  10639. node2.left = init;
  10640. node2.right = isForIn ? this.parseExpression() : this.parseMaybeAssign();
  10641. this.expect(types$1.parenR);
  10642. node2.body = this.parseStatement("for");
  10643. this.exitScope();
  10644. this.labels.pop();
  10645. return this.finishNode(node2, isForIn ? "ForInStatement" : "ForOfStatement");
  10646. };
  10647. pp$8.parseVar = function(node2, isFor, kind, allowMissingInitializer) {
  10648. node2.declarations = [];
  10649. node2.kind = kind;
  10650. for (; ; ) {
  10651. var decl = this.startNode();
  10652. this.parseVarId(decl, kind);
  10653. if (this.eat(types$1.eq)) {
  10654. decl.init = this.parseMaybeAssign(isFor);
  10655. } else if (!allowMissingInitializer && kind === "const" && !(this.type === types$1._in || this.options.ecmaVersion >= 6 && this.isContextual("of"))) {
  10656. this.unexpected();
  10657. } else if (!allowMissingInitializer && decl.id.type !== "Identifier" && !(isFor && (this.type === types$1._in || this.isContextual("of")))) {
  10658. this.raise(this.lastTokEnd, "Complex binding patterns require an initialization value");
  10659. } else {
  10660. decl.init = null;
  10661. }
  10662. node2.declarations.push(this.finishNode(decl, "VariableDeclarator"));
  10663. if (!this.eat(types$1.comma)) {
  10664. break;
  10665. }
  10666. }
  10667. return node2;
  10668. };
  10669. pp$8.parseVarId = function(decl, kind) {
  10670. decl.id = this.parseBindingAtom();
  10671. this.checkLValPattern(decl.id, kind === "var" ? BIND_VAR : BIND_LEXICAL, false);
  10672. };
  10673. var FUNC_STATEMENT = 1;
  10674. var FUNC_HANGING_STATEMENT = 2;
  10675. var FUNC_NULLABLE_ID = 4;
  10676. pp$8.parseFunction = function(node2, statement, allowExpressionBody, isAsync, forInit) {
  10677. this.initFunction(node2);
  10678. if (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !isAsync) {
  10679. if (this.type === types$1.star && statement & FUNC_HANGING_STATEMENT) {
  10680. this.unexpected();
  10681. }
  10682. node2.generator = this.eat(types$1.star);
  10683. }
  10684. if (this.options.ecmaVersion >= 8) {
  10685. node2.async = !!isAsync;
  10686. }
  10687. if (statement & FUNC_STATEMENT) {
  10688. node2.id = statement & FUNC_NULLABLE_ID && this.type !== types$1.name ? null : this.parseIdent();
  10689. if (node2.id && !(statement & FUNC_HANGING_STATEMENT)) {
  10690. this.checkLValSimple(node2.id, this.strict || node2.generator || node2.async ? this.treatFunctionsAsVar ? BIND_VAR : BIND_LEXICAL : BIND_FUNCTION);
  10691. }
  10692. }
  10693. var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;
  10694. this.yieldPos = 0;
  10695. this.awaitPos = 0;
  10696. this.awaitIdentPos = 0;
  10697. this.enterScope(functionFlags(node2.async, node2.generator));
  10698. if (!(statement & FUNC_STATEMENT)) {
  10699. node2.id = this.type === types$1.name ? this.parseIdent() : null;
  10700. }
  10701. this.parseFunctionParams(node2);
  10702. this.parseFunctionBody(node2, allowExpressionBody, false, forInit);
  10703. this.yieldPos = oldYieldPos;
  10704. this.awaitPos = oldAwaitPos;
  10705. this.awaitIdentPos = oldAwaitIdentPos;
  10706. return this.finishNode(node2, statement & FUNC_STATEMENT ? "FunctionDeclaration" : "FunctionExpression");
  10707. };
  10708. pp$8.parseFunctionParams = function(node2) {
  10709. this.expect(types$1.parenL);
  10710. node2.params = this.parseBindingList(types$1.parenR, false, this.options.ecmaVersion >= 8);
  10711. this.checkYieldAwaitInDefaultParams();
  10712. };
  10713. pp$8.parseClass = function(node2, isStatement) {
  10714. this.next();
  10715. var oldStrict = this.strict;
  10716. this.strict = true;
  10717. this.parseClassId(node2, isStatement);
  10718. this.parseClassSuper(node2);
  10719. var privateNameMap = this.enterClassBody();
  10720. var classBody = this.startNode();
  10721. var hadConstructor = false;
  10722. classBody.body = [];
  10723. this.expect(types$1.braceL);
  10724. while (this.type !== types$1.braceR) {
  10725. var element2 = this.parseClassElement(node2.superClass !== null);
  10726. if (element2) {
  10727. classBody.body.push(element2);
  10728. if (element2.type === "MethodDefinition" && element2.kind === "constructor") {
  10729. if (hadConstructor) {
  10730. this.raiseRecoverable(element2.start, "Duplicate constructor in the same class");
  10731. }
  10732. hadConstructor = true;
  10733. } else if (element2.key && element2.key.type === "PrivateIdentifier" && isPrivateNameConflicted(privateNameMap, element2)) {
  10734. this.raiseRecoverable(element2.key.start, "Identifier '#" + element2.key.name + "' has already been declared");
  10735. }
  10736. }
  10737. }
  10738. this.strict = oldStrict;
  10739. this.next();
  10740. node2.body = this.finishNode(classBody, "ClassBody");
  10741. this.exitClassBody();
  10742. return this.finishNode(node2, isStatement ? "ClassDeclaration" : "ClassExpression");
  10743. };
  10744. pp$8.parseClassElement = function(constructorAllowsSuper) {
  10745. if (this.eat(types$1.semi)) {
  10746. return null;
  10747. }
  10748. var ecmaVersion = this.options.ecmaVersion;
  10749. var node2 = this.startNode();
  10750. var keyName = "";
  10751. var isGenerator = false;
  10752. var isAsync = false;
  10753. var kind = "method";
  10754. var isStatic = false;
  10755. if (this.eatContextual("static")) {
  10756. if (ecmaVersion >= 13 && this.eat(types$1.braceL)) {
  10757. this.parseClassStaticBlock(node2);
  10758. return node2;
  10759. }
  10760. if (this.isClassElementNameStart() || this.type === types$1.star) {
  10761. isStatic = true;
  10762. } else {
  10763. keyName = "static";
  10764. }
  10765. }
  10766. node2.static = isStatic;
  10767. if (!keyName && ecmaVersion >= 8 && this.eatContextual("async")) {
  10768. if ((this.isClassElementNameStart() || this.type === types$1.star) && !this.canInsertSemicolon()) {
  10769. isAsync = true;
  10770. } else {
  10771. keyName = "async";
  10772. }
  10773. }
  10774. if (!keyName && (ecmaVersion >= 9 || !isAsync) && this.eat(types$1.star)) {
  10775. isGenerator = true;
  10776. }
  10777. if (!keyName && !isAsync && !isGenerator) {
  10778. var lastValue = this.value;
  10779. if (this.eatContextual("get") || this.eatContextual("set")) {
  10780. if (this.isClassElementNameStart()) {
  10781. kind = lastValue;
  10782. } else {
  10783. keyName = lastValue;
  10784. }
  10785. }
  10786. }
  10787. if (keyName) {
  10788. node2.computed = false;
  10789. node2.key = this.startNodeAt(this.lastTokStart, this.lastTokStartLoc);
  10790. node2.key.name = keyName;
  10791. this.finishNode(node2.key, "Identifier");
  10792. } else {
  10793. this.parseClassElementName(node2);
  10794. }
  10795. if (ecmaVersion < 13 || this.type === types$1.parenL || kind !== "method" || isGenerator || isAsync) {
  10796. var isConstructor = !node2.static && checkKeyName(node2, "constructor");
  10797. var allowsDirectSuper = isConstructor && constructorAllowsSuper;
  10798. if (isConstructor && kind !== "method") {
  10799. this.raise(node2.key.start, "Constructor can't have get/set modifier");
  10800. }
  10801. node2.kind = isConstructor ? "constructor" : kind;
  10802. this.parseClassMethod(node2, isGenerator, isAsync, allowsDirectSuper);
  10803. } else {
  10804. this.parseClassField(node2);
  10805. }
  10806. return node2;
  10807. };
  10808. pp$8.isClassElementNameStart = function() {
  10809. return this.type === types$1.name || this.type === types$1.privateId || this.type === types$1.num || this.type === types$1.string || this.type === types$1.bracketL || this.type.keyword;
  10810. };
  10811. pp$8.parseClassElementName = function(element2) {
  10812. if (this.type === types$1.privateId) {
  10813. if (this.value === "constructor") {
  10814. this.raise(this.start, "Classes can't have an element named '#constructor'");
  10815. }
  10816. element2.computed = false;
  10817. element2.key = this.parsePrivateIdent();
  10818. } else {
  10819. this.parsePropertyName(element2);
  10820. }
  10821. };
  10822. pp$8.parseClassMethod = function(method, isGenerator, isAsync, allowsDirectSuper) {
  10823. var key = method.key;
  10824. if (method.kind === "constructor") {
  10825. if (isGenerator) {
  10826. this.raise(key.start, "Constructor can't be a generator");
  10827. }
  10828. if (isAsync) {
  10829. this.raise(key.start, "Constructor can't be an async method");
  10830. }
  10831. } else if (method.static && checkKeyName(method, "prototype")) {
  10832. this.raise(key.start, "Classes may not have a static property named prototype");
  10833. }
  10834. var value = method.value = this.parseMethod(isGenerator, isAsync, allowsDirectSuper);
  10835. if (method.kind === "get" && value.params.length !== 0) {
  10836. this.raiseRecoverable(value.start, "getter should have no params");
  10837. }
  10838. if (method.kind === "set" && value.params.length !== 1) {
  10839. this.raiseRecoverable(value.start, "setter should have exactly one param");
  10840. }
  10841. if (method.kind === "set" && value.params[0].type === "RestElement") {
  10842. this.raiseRecoverable(value.params[0].start, "Setter cannot use rest params");
  10843. }
  10844. return this.finishNode(method, "MethodDefinition");
  10845. };
  10846. pp$8.parseClassField = function(field) {
  10847. if (checkKeyName(field, "constructor")) {
  10848. this.raise(field.key.start, "Classes can't have a field named 'constructor'");
  10849. } else if (field.static && checkKeyName(field, "prototype")) {
  10850. this.raise(field.key.start, "Classes can't have a static field named 'prototype'");
  10851. }
  10852. if (this.eat(types$1.eq)) {
  10853. var scope = this.currentThisScope();
  10854. var inClassFieldInit = scope.inClassFieldInit;
  10855. scope.inClassFieldInit = true;
  10856. field.value = this.parseMaybeAssign();
  10857. scope.inClassFieldInit = inClassFieldInit;
  10858. } else {
  10859. field.value = null;
  10860. }
  10861. this.semicolon();
  10862. return this.finishNode(field, "PropertyDefinition");
  10863. };
  10864. pp$8.parseClassStaticBlock = function(node2) {
  10865. node2.body = [];
  10866. var oldLabels = this.labels;
  10867. this.labels = [];
  10868. this.enterScope(SCOPE_CLASS_STATIC_BLOCK | SCOPE_SUPER);
  10869. while (this.type !== types$1.braceR) {
  10870. var stmt = this.parseStatement(null);
  10871. node2.body.push(stmt);
  10872. }
  10873. this.next();
  10874. this.exitScope();
  10875. this.labels = oldLabels;
  10876. return this.finishNode(node2, "StaticBlock");
  10877. };
  10878. pp$8.parseClassId = function(node2, isStatement) {
  10879. if (this.type === types$1.name) {
  10880. node2.id = this.parseIdent();
  10881. if (isStatement) {
  10882. this.checkLValSimple(node2.id, BIND_LEXICAL, false);
  10883. }
  10884. } else {
  10885. if (isStatement === true) {
  10886. this.unexpected();
  10887. }
  10888. node2.id = null;
  10889. }
  10890. };
  10891. pp$8.parseClassSuper = function(node2) {
  10892. node2.superClass = this.eat(types$1._extends) ? this.parseExprSubscripts(null, false) : null;
  10893. };
  10894. pp$8.enterClassBody = function() {
  10895. var element2 = { declared: /* @__PURE__ */ Object.create(null), used: [] };
  10896. this.privateNameStack.push(element2);
  10897. return element2.declared;
  10898. };
  10899. pp$8.exitClassBody = function() {
  10900. var ref2 = this.privateNameStack.pop();
  10901. var declared = ref2.declared;
  10902. var used = ref2.used;
  10903. if (!this.options.checkPrivateFields) {
  10904. return;
  10905. }
  10906. var len = this.privateNameStack.length;
  10907. var parent = len === 0 ? null : this.privateNameStack[len - 1];
  10908. for (var i = 0; i < used.length; ++i) {
  10909. var id = used[i];
  10910. if (!hasOwn(declared, id.name)) {
  10911. if (parent) {
  10912. parent.used.push(id);
  10913. } else {
  10914. this.raiseRecoverable(id.start, "Private field '#" + id.name + "' must be declared in an enclosing class");
  10915. }
  10916. }
  10917. }
  10918. };
  10919. function isPrivateNameConflicted(privateNameMap, element2) {
  10920. var name2 = element2.key.name;
  10921. var curr = privateNameMap[name2];
  10922. var next = "true";
  10923. if (element2.type === "MethodDefinition" && (element2.kind === "get" || element2.kind === "set")) {
  10924. next = (element2.static ? "s" : "i") + element2.kind;
  10925. }
  10926. if (curr === "iget" && next === "iset" || curr === "iset" && next === "iget" || curr === "sget" && next === "sset" || curr === "sset" && next === "sget") {
  10927. privateNameMap[name2] = "true";
  10928. return false;
  10929. } else if (!curr) {
  10930. privateNameMap[name2] = next;
  10931. return false;
  10932. } else {
  10933. return true;
  10934. }
  10935. }
  10936. function checkKeyName(node2, name2) {
  10937. var computed = node2.computed;
  10938. var key = node2.key;
  10939. return !computed && (key.type === "Identifier" && key.name === name2 || key.type === "Literal" && key.value === name2);
  10940. }
  10941. pp$8.parseExportAllDeclaration = function(node2, exports2) {
  10942. if (this.options.ecmaVersion >= 11) {
  10943. if (this.eatContextual("as")) {
  10944. node2.exported = this.parseModuleExportName();
  10945. this.checkExport(exports2, node2.exported, this.lastTokStart);
  10946. } else {
  10947. node2.exported = null;
  10948. }
  10949. }
  10950. this.expectContextual("from");
  10951. if (this.type !== types$1.string) {
  10952. this.unexpected();
  10953. }
  10954. node2.source = this.parseExprAtom();
  10955. this.semicolon();
  10956. return this.finishNode(node2, "ExportAllDeclaration");
  10957. };
  10958. pp$8.parseExport = function(node2, exports2) {
  10959. this.next();
  10960. if (this.eat(types$1.star)) {
  10961. return this.parseExportAllDeclaration(node2, exports2);
  10962. }
  10963. if (this.eat(types$1._default)) {
  10964. this.checkExport(exports2, "default", this.lastTokStart);
  10965. node2.declaration = this.parseExportDefaultDeclaration();
  10966. return this.finishNode(node2, "ExportDefaultDeclaration");
  10967. }
  10968. if (this.shouldParseExportStatement()) {
  10969. node2.declaration = this.parseExportDeclaration(node2);
  10970. if (node2.declaration.type === "VariableDeclaration") {
  10971. this.checkVariableExport(exports2, node2.declaration.declarations);
  10972. } else {
  10973. this.checkExport(exports2, node2.declaration.id, node2.declaration.id.start);
  10974. }
  10975. node2.specifiers = [];
  10976. node2.source = null;
  10977. } else {
  10978. node2.declaration = null;
  10979. node2.specifiers = this.parseExportSpecifiers(exports2);
  10980. if (this.eatContextual("from")) {
  10981. if (this.type !== types$1.string) {
  10982. this.unexpected();
  10983. }
  10984. node2.source = this.parseExprAtom();
  10985. } else {
  10986. for (var i = 0, list3 = node2.specifiers; i < list3.length; i += 1) {
  10987. var spec = list3[i];
  10988. this.checkUnreserved(spec.local);
  10989. this.checkLocalExport(spec.local);
  10990. if (spec.local.type === "Literal") {
  10991. this.raise(spec.local.start, "A string literal cannot be used as an exported binding without `from`.");
  10992. }
  10993. }
  10994. node2.source = null;
  10995. }
  10996. this.semicolon();
  10997. }
  10998. return this.finishNode(node2, "ExportNamedDeclaration");
  10999. };
  11000. pp$8.parseExportDeclaration = function(node2) {
  11001. return this.parseStatement(null);
  11002. };
  11003. pp$8.parseExportDefaultDeclaration = function() {
  11004. var isAsync;
  11005. if (this.type === types$1._function || (isAsync = this.isAsyncFunction())) {
  11006. var fNode = this.startNode();
  11007. this.next();
  11008. if (isAsync) {
  11009. this.next();
  11010. }
  11011. return this.parseFunction(fNode, FUNC_STATEMENT | FUNC_NULLABLE_ID, false, isAsync);
  11012. } else if (this.type === types$1._class) {
  11013. var cNode = this.startNode();
  11014. return this.parseClass(cNode, "nullableID");
  11015. } else {
  11016. var declaration = this.parseMaybeAssign();
  11017. this.semicolon();
  11018. return declaration;
  11019. }
  11020. };
  11021. pp$8.checkExport = function(exports2, name2, pos) {
  11022. if (!exports2) {
  11023. return;
  11024. }
  11025. if (typeof name2 !== "string") {
  11026. name2 = name2.type === "Identifier" ? name2.name : name2.value;
  11027. }
  11028. if (hasOwn(exports2, name2)) {
  11029. this.raiseRecoverable(pos, "Duplicate export '" + name2 + "'");
  11030. }
  11031. exports2[name2] = true;
  11032. };
  11033. pp$8.checkPatternExport = function(exports2, pat) {
  11034. var type = pat.type;
  11035. if (type === "Identifier") {
  11036. this.checkExport(exports2, pat, pat.start);
  11037. } else if (type === "ObjectPattern") {
  11038. for (var i = 0, list3 = pat.properties; i < list3.length; i += 1) {
  11039. var prop = list3[i];
  11040. this.checkPatternExport(exports2, prop);
  11041. }
  11042. } else if (type === "ArrayPattern") {
  11043. for (var i$1 = 0, list$1 = pat.elements; i$1 < list$1.length; i$1 += 1) {
  11044. var elt = list$1[i$1];
  11045. if (elt) {
  11046. this.checkPatternExport(exports2, elt);
  11047. }
  11048. }
  11049. } else if (type === "Property") {
  11050. this.checkPatternExport(exports2, pat.value);
  11051. } else if (type === "AssignmentPattern") {
  11052. this.checkPatternExport(exports2, pat.left);
  11053. } else if (type === "RestElement") {
  11054. this.checkPatternExport(exports2, pat.argument);
  11055. }
  11056. };
  11057. pp$8.checkVariableExport = function(exports2, decls) {
  11058. if (!exports2) {
  11059. return;
  11060. }
  11061. for (var i = 0, list3 = decls; i < list3.length; i += 1) {
  11062. var decl = list3[i];
  11063. this.checkPatternExport(exports2, decl.id);
  11064. }
  11065. };
  11066. pp$8.shouldParseExportStatement = function() {
  11067. return this.type.keyword === "var" || this.type.keyword === "const" || this.type.keyword === "class" || this.type.keyword === "function" || this.isLet() || this.isAsyncFunction();
  11068. };
  11069. pp$8.parseExportSpecifier = function(exports2) {
  11070. var node2 = this.startNode();
  11071. node2.local = this.parseModuleExportName();
  11072. node2.exported = this.eatContextual("as") ? this.parseModuleExportName() : node2.local;
  11073. this.checkExport(
  11074. exports2,
  11075. node2.exported,
  11076. node2.exported.start
  11077. );
  11078. return this.finishNode(node2, "ExportSpecifier");
  11079. };
  11080. pp$8.parseExportSpecifiers = function(exports2) {
  11081. var nodes = [], first = true;
  11082. this.expect(types$1.braceL);
  11083. while (!this.eat(types$1.braceR)) {
  11084. if (!first) {
  11085. this.expect(types$1.comma);
  11086. if (this.afterTrailingComma(types$1.braceR)) {
  11087. break;
  11088. }
  11089. } else {
  11090. first = false;
  11091. }
  11092. nodes.push(this.parseExportSpecifier(exports2));
  11093. }
  11094. return nodes;
  11095. };
  11096. pp$8.parseImport = function(node2) {
  11097. this.next();
  11098. if (this.type === types$1.string) {
  11099. node2.specifiers = empty$1;
  11100. node2.source = this.parseExprAtom();
  11101. } else {
  11102. node2.specifiers = this.parseImportSpecifiers();
  11103. this.expectContextual("from");
  11104. node2.source = this.type === types$1.string ? this.parseExprAtom() : this.unexpected();
  11105. }
  11106. this.semicolon();
  11107. return this.finishNode(node2, "ImportDeclaration");
  11108. };
  11109. pp$8.parseImportSpecifier = function() {
  11110. var node2 = this.startNode();
  11111. node2.imported = this.parseModuleExportName();
  11112. if (this.eatContextual("as")) {
  11113. node2.local = this.parseIdent();
  11114. } else {
  11115. this.checkUnreserved(node2.imported);
  11116. node2.local = node2.imported;
  11117. }
  11118. this.checkLValSimple(node2.local, BIND_LEXICAL);
  11119. return this.finishNode(node2, "ImportSpecifier");
  11120. };
  11121. pp$8.parseImportDefaultSpecifier = function() {
  11122. var node2 = this.startNode();
  11123. node2.local = this.parseIdent();
  11124. this.checkLValSimple(node2.local, BIND_LEXICAL);
  11125. return this.finishNode(node2, "ImportDefaultSpecifier");
  11126. };
  11127. pp$8.parseImportNamespaceSpecifier = function() {
  11128. var node2 = this.startNode();
  11129. this.next();
  11130. this.expectContextual("as");
  11131. node2.local = this.parseIdent();
  11132. this.checkLValSimple(node2.local, BIND_LEXICAL);
  11133. return this.finishNode(node2, "ImportNamespaceSpecifier");
  11134. };
  11135. pp$8.parseImportSpecifiers = function() {
  11136. var nodes = [], first = true;
  11137. if (this.type === types$1.name) {
  11138. nodes.push(this.parseImportDefaultSpecifier());
  11139. if (!this.eat(types$1.comma)) {
  11140. return nodes;
  11141. }
  11142. }
  11143. if (this.type === types$1.star) {
  11144. nodes.push(this.parseImportNamespaceSpecifier());
  11145. return nodes;
  11146. }
  11147. this.expect(types$1.braceL);
  11148. while (!this.eat(types$1.braceR)) {
  11149. if (!first) {
  11150. this.expect(types$1.comma);
  11151. if (this.afterTrailingComma(types$1.braceR)) {
  11152. break;
  11153. }
  11154. } else {
  11155. first = false;
  11156. }
  11157. nodes.push(this.parseImportSpecifier());
  11158. }
  11159. return nodes;
  11160. };
  11161. pp$8.parseModuleExportName = function() {
  11162. if (this.options.ecmaVersion >= 13 && this.type === types$1.string) {
  11163. var stringLiteral = this.parseLiteral(this.value);
  11164. if (loneSurrogate.test(stringLiteral.value)) {
  11165. this.raise(stringLiteral.start, "An export name cannot include a lone surrogate.");
  11166. }
  11167. return stringLiteral;
  11168. }
  11169. return this.parseIdent(true);
  11170. };
  11171. pp$8.adaptDirectivePrologue = function(statements) {
  11172. for (var i = 0; i < statements.length && this.isDirectiveCandidate(statements[i]); ++i) {
  11173. statements[i].directive = statements[i].expression.raw.slice(1, -1);
  11174. }
  11175. };
  11176. pp$8.isDirectiveCandidate = function(statement) {
  11177. return this.options.ecmaVersion >= 5 && statement.type === "ExpressionStatement" && statement.expression.type === "Literal" && typeof statement.expression.value === "string" && // Reject parenthesized strings.
  11178. (this.input[statement.start] === '"' || this.input[statement.start] === "'");
  11179. };
  11180. var pp$7 = Parser.prototype;
  11181. pp$7.toAssignable = function(node2, isBinding, refDestructuringErrors) {
  11182. if (this.options.ecmaVersion >= 6 && node2) {
  11183. switch (node2.type) {
  11184. case "Identifier":
  11185. if (this.inAsync && node2.name === "await") {
  11186. this.raise(node2.start, "Cannot use 'await' as identifier inside an async function");
  11187. }
  11188. break;
  11189. case "ObjectPattern":
  11190. case "ArrayPattern":
  11191. case "AssignmentPattern":
  11192. case "RestElement":
  11193. break;
  11194. case "ObjectExpression":
  11195. node2.type = "ObjectPattern";
  11196. if (refDestructuringErrors) {
  11197. this.checkPatternErrors(refDestructuringErrors, true);
  11198. }
  11199. for (var i = 0, list3 = node2.properties; i < list3.length; i += 1) {
  11200. var prop = list3[i];
  11201. this.toAssignable(prop, isBinding);
  11202. if (prop.type === "RestElement" && (prop.argument.type === "ArrayPattern" || prop.argument.type === "ObjectPattern")) {
  11203. this.raise(prop.argument.start, "Unexpected token");
  11204. }
  11205. }
  11206. break;
  11207. case "Property":
  11208. if (node2.kind !== "init") {
  11209. this.raise(node2.key.start, "Object pattern can't contain getter or setter");
  11210. }
  11211. this.toAssignable(node2.value, isBinding);
  11212. break;
  11213. case "ArrayExpression":
  11214. node2.type = "ArrayPattern";
  11215. if (refDestructuringErrors) {
  11216. this.checkPatternErrors(refDestructuringErrors, true);
  11217. }
  11218. this.toAssignableList(node2.elements, isBinding);
  11219. break;
  11220. case "SpreadElement":
  11221. node2.type = "RestElement";
  11222. this.toAssignable(node2.argument, isBinding);
  11223. if (node2.argument.type === "AssignmentPattern") {
  11224. this.raise(node2.argument.start, "Rest elements cannot have a default value");
  11225. }
  11226. break;
  11227. case "AssignmentExpression":
  11228. if (node2.operator !== "=") {
  11229. this.raise(node2.left.end, "Only '=' operator can be used for specifying default value.");
  11230. }
  11231. node2.type = "AssignmentPattern";
  11232. delete node2.operator;
  11233. this.toAssignable(node2.left, isBinding);
  11234. break;
  11235. case "ParenthesizedExpression":
  11236. this.toAssignable(node2.expression, isBinding, refDestructuringErrors);
  11237. break;
  11238. case "ChainExpression":
  11239. this.raiseRecoverable(node2.start, "Optional chaining cannot appear in left-hand side");
  11240. break;
  11241. case "MemberExpression":
  11242. if (!isBinding) {
  11243. break;
  11244. }
  11245. default:
  11246. this.raise(node2.start, "Assigning to rvalue");
  11247. }
  11248. } else if (refDestructuringErrors) {
  11249. this.checkPatternErrors(refDestructuringErrors, true);
  11250. }
  11251. return node2;
  11252. };
  11253. pp$7.toAssignableList = function(exprList, isBinding) {
  11254. var end = exprList.length;
  11255. for (var i = 0; i < end; i++) {
  11256. var elt = exprList[i];
  11257. if (elt) {
  11258. this.toAssignable(elt, isBinding);
  11259. }
  11260. }
  11261. if (end) {
  11262. var last = exprList[end - 1];
  11263. if (this.options.ecmaVersion === 6 && isBinding && last && last.type === "RestElement" && last.argument.type !== "Identifier") {
  11264. this.unexpected(last.argument.start);
  11265. }
  11266. }
  11267. return exprList;
  11268. };
  11269. pp$7.parseSpread = function(refDestructuringErrors) {
  11270. var node2 = this.startNode();
  11271. this.next();
  11272. node2.argument = this.parseMaybeAssign(false, refDestructuringErrors);
  11273. return this.finishNode(node2, "SpreadElement");
  11274. };
  11275. pp$7.parseRestBinding = function() {
  11276. var node2 = this.startNode();
  11277. this.next();
  11278. if (this.options.ecmaVersion === 6 && this.type !== types$1.name) {
  11279. this.unexpected();
  11280. }
  11281. node2.argument = this.parseBindingAtom();
  11282. return this.finishNode(node2, "RestElement");
  11283. };
  11284. pp$7.parseBindingAtom = function() {
  11285. if (this.options.ecmaVersion >= 6) {
  11286. switch (this.type) {
  11287. case types$1.bracketL:
  11288. var node2 = this.startNode();
  11289. this.next();
  11290. node2.elements = this.parseBindingList(types$1.bracketR, true, true);
  11291. return this.finishNode(node2, "ArrayPattern");
  11292. case types$1.braceL:
  11293. return this.parseObj(true);
  11294. }
  11295. }
  11296. return this.parseIdent();
  11297. };
  11298. pp$7.parseBindingList = function(close, allowEmpty, allowTrailingComma, allowModifiers) {
  11299. var elts = [], first = true;
  11300. while (!this.eat(close)) {
  11301. if (first) {
  11302. first = false;
  11303. } else {
  11304. this.expect(types$1.comma);
  11305. }
  11306. if (allowEmpty && this.type === types$1.comma) {
  11307. elts.push(null);
  11308. } else if (allowTrailingComma && this.afterTrailingComma(close)) {
  11309. break;
  11310. } else if (this.type === types$1.ellipsis) {
  11311. var rest = this.parseRestBinding();
  11312. this.parseBindingListItem(rest);
  11313. elts.push(rest);
  11314. if (this.type === types$1.comma) {
  11315. this.raiseRecoverable(this.start, "Comma is not permitted after the rest element");
  11316. }
  11317. this.expect(close);
  11318. break;
  11319. } else {
  11320. elts.push(this.parseAssignableListItem(allowModifiers));
  11321. }
  11322. }
  11323. return elts;
  11324. };
  11325. pp$7.parseAssignableListItem = function(allowModifiers) {
  11326. var elem = this.parseMaybeDefault(this.start, this.startLoc);
  11327. this.parseBindingListItem(elem);
  11328. return elem;
  11329. };
  11330. pp$7.parseBindingListItem = function(param) {
  11331. return param;
  11332. };
  11333. pp$7.parseMaybeDefault = function(startPos, startLoc, left) {
  11334. left = left || this.parseBindingAtom();
  11335. if (this.options.ecmaVersion < 6 || !this.eat(types$1.eq)) {
  11336. return left;
  11337. }
  11338. var node2 = this.startNodeAt(startPos, startLoc);
  11339. node2.left = left;
  11340. node2.right = this.parseMaybeAssign();
  11341. return this.finishNode(node2, "AssignmentPattern");
  11342. };
  11343. pp$7.checkLValSimple = function(expr, bindingType, checkClashes) {
  11344. if (bindingType === void 0) bindingType = BIND_NONE;
  11345. var isBind = bindingType !== BIND_NONE;
  11346. switch (expr.type) {
  11347. case "Identifier":
  11348. if (this.strict && this.reservedWordsStrictBind.test(expr.name)) {
  11349. this.raiseRecoverable(expr.start, (isBind ? "Binding " : "Assigning to ") + expr.name + " in strict mode");
  11350. }
  11351. if (isBind) {
  11352. if (bindingType === BIND_LEXICAL && expr.name === "let") {
  11353. this.raiseRecoverable(expr.start, "let is disallowed as a lexically bound name");
  11354. }
  11355. if (checkClashes) {
  11356. if (hasOwn(checkClashes, expr.name)) {
  11357. this.raiseRecoverable(expr.start, "Argument name clash");
  11358. }
  11359. checkClashes[expr.name] = true;
  11360. }
  11361. if (bindingType !== BIND_OUTSIDE) {
  11362. this.declareName(expr.name, bindingType, expr.start);
  11363. }
  11364. }
  11365. break;
  11366. case "ChainExpression":
  11367. this.raiseRecoverable(expr.start, "Optional chaining cannot appear in left-hand side");
  11368. break;
  11369. case "MemberExpression":
  11370. if (isBind) {
  11371. this.raiseRecoverable(expr.start, "Binding member expression");
  11372. }
  11373. break;
  11374. case "ParenthesizedExpression":
  11375. if (isBind) {
  11376. this.raiseRecoverable(expr.start, "Binding parenthesized expression");
  11377. }
  11378. return this.checkLValSimple(expr.expression, bindingType, checkClashes);
  11379. default:
  11380. this.raise(expr.start, (isBind ? "Binding" : "Assigning to") + " rvalue");
  11381. }
  11382. };
  11383. pp$7.checkLValPattern = function(expr, bindingType, checkClashes) {
  11384. if (bindingType === void 0) bindingType = BIND_NONE;
  11385. switch (expr.type) {
  11386. case "ObjectPattern":
  11387. for (var i = 0, list3 = expr.properties; i < list3.length; i += 1) {
  11388. var prop = list3[i];
  11389. this.checkLValInnerPattern(prop, bindingType, checkClashes);
  11390. }
  11391. break;
  11392. case "ArrayPattern":
  11393. for (var i$1 = 0, list$1 = expr.elements; i$1 < list$1.length; i$1 += 1) {
  11394. var elem = list$1[i$1];
  11395. if (elem) {
  11396. this.checkLValInnerPattern(elem, bindingType, checkClashes);
  11397. }
  11398. }
  11399. break;
  11400. default:
  11401. this.checkLValSimple(expr, bindingType, checkClashes);
  11402. }
  11403. };
  11404. pp$7.checkLValInnerPattern = function(expr, bindingType, checkClashes) {
  11405. if (bindingType === void 0) bindingType = BIND_NONE;
  11406. switch (expr.type) {
  11407. case "Property":
  11408. this.checkLValInnerPattern(expr.value, bindingType, checkClashes);
  11409. break;
  11410. case "AssignmentPattern":
  11411. this.checkLValPattern(expr.left, bindingType, checkClashes);
  11412. break;
  11413. case "RestElement":
  11414. this.checkLValPattern(expr.argument, bindingType, checkClashes);
  11415. break;
  11416. default:
  11417. this.checkLValPattern(expr, bindingType, checkClashes);
  11418. }
  11419. };
  11420. var TokContext = function TokContext2(token, isExpr, preserveSpace, override, generator) {
  11421. this.token = token;
  11422. this.isExpr = !!isExpr;
  11423. this.preserveSpace = !!preserveSpace;
  11424. this.override = override;
  11425. this.generator = !!generator;
  11426. };
  11427. var types = {
  11428. b_stat: new TokContext("{", false),
  11429. b_expr: new TokContext("{", true),
  11430. b_tmpl: new TokContext("${", false),
  11431. p_stat: new TokContext("(", false),
  11432. p_expr: new TokContext("(", true),
  11433. q_tmpl: new TokContext("`", true, true, function(p) {
  11434. return p.tryReadTemplateToken();
  11435. }),
  11436. f_stat: new TokContext("function", false),
  11437. f_expr: new TokContext("function", true),
  11438. f_expr_gen: new TokContext("function", true, false, null, true),
  11439. f_gen: new TokContext("function", false, false, null, true)
  11440. };
  11441. var pp$6 = Parser.prototype;
  11442. pp$6.initialContext = function() {
  11443. return [types.b_stat];
  11444. };
  11445. pp$6.curContext = function() {
  11446. return this.context[this.context.length - 1];
  11447. };
  11448. pp$6.braceIsBlock = function(prevType) {
  11449. var parent = this.curContext();
  11450. if (parent === types.f_expr || parent === types.f_stat) {
  11451. return true;
  11452. }
  11453. if (prevType === types$1.colon && (parent === types.b_stat || parent === types.b_expr)) {
  11454. return !parent.isExpr;
  11455. }
  11456. if (prevType === types$1._return || prevType === types$1.name && this.exprAllowed) {
  11457. return lineBreak.test(this.input.slice(this.lastTokEnd, this.start));
  11458. }
  11459. if (prevType === types$1._else || prevType === types$1.semi || prevType === types$1.eof || prevType === types$1.parenR || prevType === types$1.arrow) {
  11460. return true;
  11461. }
  11462. if (prevType === types$1.braceL) {
  11463. return parent === types.b_stat;
  11464. }
  11465. if (prevType === types$1._var || prevType === types$1._const || prevType === types$1.name) {
  11466. return false;
  11467. }
  11468. return !this.exprAllowed;
  11469. };
  11470. pp$6.inGeneratorContext = function() {
  11471. for (var i = this.context.length - 1; i >= 1; i--) {
  11472. var context = this.context[i];
  11473. if (context.token === "function") {
  11474. return context.generator;
  11475. }
  11476. }
  11477. return false;
  11478. };
  11479. pp$6.updateContext = function(prevType) {
  11480. var update, type = this.type;
  11481. if (type.keyword && prevType === types$1.dot) {
  11482. this.exprAllowed = false;
  11483. } else if (update = type.updateContext) {
  11484. update.call(this, prevType);
  11485. } else {
  11486. this.exprAllowed = type.beforeExpr;
  11487. }
  11488. };
  11489. pp$6.overrideContext = function(tokenCtx) {
  11490. if (this.curContext() !== tokenCtx) {
  11491. this.context[this.context.length - 1] = tokenCtx;
  11492. }
  11493. };
  11494. types$1.parenR.updateContext = types$1.braceR.updateContext = function() {
  11495. if (this.context.length === 1) {
  11496. this.exprAllowed = true;
  11497. return;
  11498. }
  11499. var out = this.context.pop();
  11500. if (out === types.b_stat && this.curContext().token === "function") {
  11501. out = this.context.pop();
  11502. }
  11503. this.exprAllowed = !out.isExpr;
  11504. };
  11505. types$1.braceL.updateContext = function(prevType) {
  11506. this.context.push(this.braceIsBlock(prevType) ? types.b_stat : types.b_expr);
  11507. this.exprAllowed = true;
  11508. };
  11509. types$1.dollarBraceL.updateContext = function() {
  11510. this.context.push(types.b_tmpl);
  11511. this.exprAllowed = true;
  11512. };
  11513. types$1.parenL.updateContext = function(prevType) {
  11514. var statementParens = prevType === types$1._if || prevType === types$1._for || prevType === types$1._with || prevType === types$1._while;
  11515. this.context.push(statementParens ? types.p_stat : types.p_expr);
  11516. this.exprAllowed = true;
  11517. };
  11518. types$1.incDec.updateContext = function() {
  11519. };
  11520. types$1._function.updateContext = types$1._class.updateContext = function(prevType) {
  11521. if (prevType.beforeExpr && prevType !== types$1._else && !(prevType === types$1.semi && this.curContext() !== types.p_stat) && !(prevType === types$1._return && lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) && !((prevType === types$1.colon || prevType === types$1.braceL) && this.curContext() === types.b_stat)) {
  11522. this.context.push(types.f_expr);
  11523. } else {
  11524. this.context.push(types.f_stat);
  11525. }
  11526. this.exprAllowed = false;
  11527. };
  11528. types$1.colon.updateContext = function() {
  11529. if (this.curContext().token === "function") {
  11530. this.context.pop();
  11531. }
  11532. this.exprAllowed = true;
  11533. };
  11534. types$1.backQuote.updateContext = function() {
  11535. if (this.curContext() === types.q_tmpl) {
  11536. this.context.pop();
  11537. } else {
  11538. this.context.push(types.q_tmpl);
  11539. }
  11540. this.exprAllowed = false;
  11541. };
  11542. types$1.star.updateContext = function(prevType) {
  11543. if (prevType === types$1._function) {
  11544. var index2 = this.context.length - 1;
  11545. if (this.context[index2] === types.f_expr) {
  11546. this.context[index2] = types.f_expr_gen;
  11547. } else {
  11548. this.context[index2] = types.f_gen;
  11549. }
  11550. }
  11551. this.exprAllowed = true;
  11552. };
  11553. types$1.name.updateContext = function(prevType) {
  11554. var allowed = false;
  11555. if (this.options.ecmaVersion >= 6 && prevType !== types$1.dot) {
  11556. if (this.value === "of" && !this.exprAllowed || this.value === "yield" && this.inGeneratorContext()) {
  11557. allowed = true;
  11558. }
  11559. }
  11560. this.exprAllowed = allowed;
  11561. };
  11562. var pp$5 = Parser.prototype;
  11563. pp$5.checkPropClash = function(prop, propHash, refDestructuringErrors) {
  11564. if (this.options.ecmaVersion >= 9 && prop.type === "SpreadElement") {
  11565. return;
  11566. }
  11567. if (this.options.ecmaVersion >= 6 && (prop.computed || prop.method || prop.shorthand)) {
  11568. return;
  11569. }
  11570. var key = prop.key;
  11571. var name2;
  11572. switch (key.type) {
  11573. case "Identifier":
  11574. name2 = key.name;
  11575. break;
  11576. case "Literal":
  11577. name2 = String(key.value);
  11578. break;
  11579. default:
  11580. return;
  11581. }
  11582. var kind = prop.kind;
  11583. if (this.options.ecmaVersion >= 6) {
  11584. if (name2 === "__proto__" && kind === "init") {
  11585. if (propHash.proto) {
  11586. if (refDestructuringErrors) {
  11587. if (refDestructuringErrors.doubleProto < 0) {
  11588. refDestructuringErrors.doubleProto = key.start;
  11589. }
  11590. } else {
  11591. this.raiseRecoverable(key.start, "Redefinition of __proto__ property");
  11592. }
  11593. }
  11594. propHash.proto = true;
  11595. }
  11596. return;
  11597. }
  11598. name2 = "$" + name2;
  11599. var other = propHash[name2];
  11600. if (other) {
  11601. var redefinition;
  11602. if (kind === "init") {
  11603. redefinition = this.strict && other.init || other.get || other.set;
  11604. } else {
  11605. redefinition = other.init || other[kind];
  11606. }
  11607. if (redefinition) {
  11608. this.raiseRecoverable(key.start, "Redefinition of property");
  11609. }
  11610. } else {
  11611. other = propHash[name2] = {
  11612. init: false,
  11613. get: false,
  11614. set: false
  11615. };
  11616. }
  11617. other[kind] = true;
  11618. };
  11619. pp$5.parseExpression = function(forInit, refDestructuringErrors) {
  11620. var startPos = this.start, startLoc = this.startLoc;
  11621. var expr = this.parseMaybeAssign(forInit, refDestructuringErrors);
  11622. if (this.type === types$1.comma) {
  11623. var node2 = this.startNodeAt(startPos, startLoc);
  11624. node2.expressions = [expr];
  11625. while (this.eat(types$1.comma)) {
  11626. node2.expressions.push(this.parseMaybeAssign(forInit, refDestructuringErrors));
  11627. }
  11628. return this.finishNode(node2, "SequenceExpression");
  11629. }
  11630. return expr;
  11631. };
  11632. pp$5.parseMaybeAssign = function(forInit, refDestructuringErrors, afterLeftParse) {
  11633. if (this.isContextual("yield")) {
  11634. if (this.inGenerator) {
  11635. return this.parseYield(forInit);
  11636. } else {
  11637. this.exprAllowed = false;
  11638. }
  11639. }
  11640. var ownDestructuringErrors = false, oldParenAssign = -1, oldTrailingComma = -1, oldDoubleProto = -1;
  11641. if (refDestructuringErrors) {
  11642. oldParenAssign = refDestructuringErrors.parenthesizedAssign;
  11643. oldTrailingComma = refDestructuringErrors.trailingComma;
  11644. oldDoubleProto = refDestructuringErrors.doubleProto;
  11645. refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = -1;
  11646. } else {
  11647. refDestructuringErrors = new DestructuringErrors();
  11648. ownDestructuringErrors = true;
  11649. }
  11650. var startPos = this.start, startLoc = this.startLoc;
  11651. if (this.type === types$1.parenL || this.type === types$1.name) {
  11652. this.potentialArrowAt = this.start;
  11653. this.potentialArrowInForAwait = forInit === "await";
  11654. }
  11655. var left = this.parseMaybeConditional(forInit, refDestructuringErrors);
  11656. if (afterLeftParse) {
  11657. left = afterLeftParse.call(this, left, startPos, startLoc);
  11658. }
  11659. if (this.type.isAssign) {
  11660. var node2 = this.startNodeAt(startPos, startLoc);
  11661. node2.operator = this.value;
  11662. if (this.type === types$1.eq) {
  11663. left = this.toAssignable(left, false, refDestructuringErrors);
  11664. }
  11665. if (!ownDestructuringErrors) {
  11666. refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = refDestructuringErrors.doubleProto = -1;
  11667. }
  11668. if (refDestructuringErrors.shorthandAssign >= left.start) {
  11669. refDestructuringErrors.shorthandAssign = -1;
  11670. }
  11671. if (this.type === types$1.eq) {
  11672. this.checkLValPattern(left);
  11673. } else {
  11674. this.checkLValSimple(left);
  11675. }
  11676. node2.left = left;
  11677. this.next();
  11678. node2.right = this.parseMaybeAssign(forInit);
  11679. if (oldDoubleProto > -1) {
  11680. refDestructuringErrors.doubleProto = oldDoubleProto;
  11681. }
  11682. return this.finishNode(node2, "AssignmentExpression");
  11683. } else {
  11684. if (ownDestructuringErrors) {
  11685. this.checkExpressionErrors(refDestructuringErrors, true);
  11686. }
  11687. }
  11688. if (oldParenAssign > -1) {
  11689. refDestructuringErrors.parenthesizedAssign = oldParenAssign;
  11690. }
  11691. if (oldTrailingComma > -1) {
  11692. refDestructuringErrors.trailingComma = oldTrailingComma;
  11693. }
  11694. return left;
  11695. };
  11696. pp$5.parseMaybeConditional = function(forInit, refDestructuringErrors) {
  11697. var startPos = this.start, startLoc = this.startLoc;
  11698. var expr = this.parseExprOps(forInit, refDestructuringErrors);
  11699. if (this.checkExpressionErrors(refDestructuringErrors)) {
  11700. return expr;
  11701. }
  11702. if (this.eat(types$1.question)) {
  11703. var node2 = this.startNodeAt(startPos, startLoc);
  11704. node2.test = expr;
  11705. node2.consequent = this.parseMaybeAssign();
  11706. this.expect(types$1.colon);
  11707. node2.alternate = this.parseMaybeAssign(forInit);
  11708. return this.finishNode(node2, "ConditionalExpression");
  11709. }
  11710. return expr;
  11711. };
  11712. pp$5.parseExprOps = function(forInit, refDestructuringErrors) {
  11713. var startPos = this.start, startLoc = this.startLoc;
  11714. var expr = this.parseMaybeUnary(refDestructuringErrors, false, false, forInit);
  11715. if (this.checkExpressionErrors(refDestructuringErrors)) {
  11716. return expr;
  11717. }
  11718. return expr.start === startPos && expr.type === "ArrowFunctionExpression" ? expr : this.parseExprOp(expr, startPos, startLoc, -1, forInit);
  11719. };
  11720. pp$5.parseExprOp = function(left, leftStartPos, leftStartLoc, minPrec, forInit) {
  11721. var prec = this.type.binop;
  11722. if (prec != null && (!forInit || this.type !== types$1._in)) {
  11723. if (prec > minPrec) {
  11724. var logical = this.type === types$1.logicalOR || this.type === types$1.logicalAND;
  11725. var coalesce = this.type === types$1.coalesce;
  11726. if (coalesce) {
  11727. prec = types$1.logicalAND.binop;
  11728. }
  11729. var op = this.value;
  11730. this.next();
  11731. var startPos = this.start, startLoc = this.startLoc;
  11732. var right = this.parseExprOp(this.parseMaybeUnary(null, false, false, forInit), startPos, startLoc, prec, forInit);
  11733. var node2 = this.buildBinary(leftStartPos, leftStartLoc, left, right, op, logical || coalesce);
  11734. if (logical && this.type === types$1.coalesce || coalesce && (this.type === types$1.logicalOR || this.type === types$1.logicalAND)) {
  11735. this.raiseRecoverable(this.start, "Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses");
  11736. }
  11737. return this.parseExprOp(node2, leftStartPos, leftStartLoc, minPrec, forInit);
  11738. }
  11739. }
  11740. return left;
  11741. };
  11742. pp$5.buildBinary = function(startPos, startLoc, left, right, op, logical) {
  11743. if (right.type === "PrivateIdentifier") {
  11744. this.raise(right.start, "Private identifier can only be left side of binary expression");
  11745. }
  11746. var node2 = this.startNodeAt(startPos, startLoc);
  11747. node2.left = left;
  11748. node2.operator = op;
  11749. node2.right = right;
  11750. return this.finishNode(node2, logical ? "LogicalExpression" : "BinaryExpression");
  11751. };
  11752. pp$5.parseMaybeUnary = function(refDestructuringErrors, sawUnary, incDec, forInit) {
  11753. var startPos = this.start, startLoc = this.startLoc, expr;
  11754. if (this.isContextual("await") && this.canAwait) {
  11755. expr = this.parseAwait(forInit);
  11756. sawUnary = true;
  11757. } else if (this.type.prefix) {
  11758. var node2 = this.startNode(), update = this.type === types$1.incDec;
  11759. node2.operator = this.value;
  11760. node2.prefix = true;
  11761. this.next();
  11762. node2.argument = this.parseMaybeUnary(null, true, update, forInit);
  11763. this.checkExpressionErrors(refDestructuringErrors, true);
  11764. if (update) {
  11765. this.checkLValSimple(node2.argument);
  11766. } else if (this.strict && node2.operator === "delete" && isLocalVariableAccess(node2.argument)) {
  11767. this.raiseRecoverable(node2.start, "Deleting local variable in strict mode");
  11768. } else if (node2.operator === "delete" && isPrivateFieldAccess(node2.argument)) {
  11769. this.raiseRecoverable(node2.start, "Private fields can not be deleted");
  11770. } else {
  11771. sawUnary = true;
  11772. }
  11773. expr = this.finishNode(node2, update ? "UpdateExpression" : "UnaryExpression");
  11774. } else if (!sawUnary && this.type === types$1.privateId) {
  11775. if ((forInit || this.privateNameStack.length === 0) && this.options.checkPrivateFields) {
  11776. this.unexpected();
  11777. }
  11778. expr = this.parsePrivateIdent();
  11779. if (this.type !== types$1._in) {
  11780. this.unexpected();
  11781. }
  11782. } else {
  11783. expr = this.parseExprSubscripts(refDestructuringErrors, forInit);
  11784. if (this.checkExpressionErrors(refDestructuringErrors)) {
  11785. return expr;
  11786. }
  11787. while (this.type.postfix && !this.canInsertSemicolon()) {
  11788. var node$1 = this.startNodeAt(startPos, startLoc);
  11789. node$1.operator = this.value;
  11790. node$1.prefix = false;
  11791. node$1.argument = expr;
  11792. this.checkLValSimple(expr);
  11793. this.next();
  11794. expr = this.finishNode(node$1, "UpdateExpression");
  11795. }
  11796. }
  11797. if (!incDec && this.eat(types$1.starstar)) {
  11798. if (sawUnary) {
  11799. this.unexpected(this.lastTokStart);
  11800. } else {
  11801. return this.buildBinary(startPos, startLoc, expr, this.parseMaybeUnary(null, false, false, forInit), "**", false);
  11802. }
  11803. } else {
  11804. return expr;
  11805. }
  11806. };
  11807. function isLocalVariableAccess(node2) {
  11808. return node2.type === "Identifier" || node2.type === "ParenthesizedExpression" && isLocalVariableAccess(node2.expression);
  11809. }
  11810. function isPrivateFieldAccess(node2) {
  11811. return node2.type === "MemberExpression" && node2.property.type === "PrivateIdentifier" || node2.type === "ChainExpression" && isPrivateFieldAccess(node2.expression) || node2.type === "ParenthesizedExpression" && isPrivateFieldAccess(node2.expression);
  11812. }
  11813. pp$5.parseExprSubscripts = function(refDestructuringErrors, forInit) {
  11814. var startPos = this.start, startLoc = this.startLoc;
  11815. var expr = this.parseExprAtom(refDestructuringErrors, forInit);
  11816. if (expr.type === "ArrowFunctionExpression" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== ")") {
  11817. return expr;
  11818. }
  11819. var result = this.parseSubscripts(expr, startPos, startLoc, false, forInit);
  11820. if (refDestructuringErrors && result.type === "MemberExpression") {
  11821. if (refDestructuringErrors.parenthesizedAssign >= result.start) {
  11822. refDestructuringErrors.parenthesizedAssign = -1;
  11823. }
  11824. if (refDestructuringErrors.parenthesizedBind >= result.start) {
  11825. refDestructuringErrors.parenthesizedBind = -1;
  11826. }
  11827. if (refDestructuringErrors.trailingComma >= result.start) {
  11828. refDestructuringErrors.trailingComma = -1;
  11829. }
  11830. }
  11831. return result;
  11832. };
  11833. pp$5.parseSubscripts = function(base, startPos, startLoc, noCalls, forInit) {
  11834. var maybeAsyncArrow = this.options.ecmaVersion >= 8 && base.type === "Identifier" && base.name === "async" && this.lastTokEnd === base.end && !this.canInsertSemicolon() && base.end - base.start === 5 && this.potentialArrowAt === base.start;
  11835. var optionalChained = false;
  11836. while (true) {
  11837. var element2 = this.parseSubscript(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained, forInit);
  11838. if (element2.optional) {
  11839. optionalChained = true;
  11840. }
  11841. if (element2 === base || element2.type === "ArrowFunctionExpression") {
  11842. if (optionalChained) {
  11843. var chainNode = this.startNodeAt(startPos, startLoc);
  11844. chainNode.expression = element2;
  11845. element2 = this.finishNode(chainNode, "ChainExpression");
  11846. }
  11847. return element2;
  11848. }
  11849. base = element2;
  11850. }
  11851. };
  11852. pp$5.shouldParseAsyncArrow = function() {
  11853. return !this.canInsertSemicolon() && this.eat(types$1.arrow);
  11854. };
  11855. pp$5.parseSubscriptAsyncArrow = function(startPos, startLoc, exprList, forInit) {
  11856. return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, true, forInit);
  11857. };
  11858. pp$5.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained, forInit) {
  11859. var optionalSupported = this.options.ecmaVersion >= 11;
  11860. var optional = optionalSupported && this.eat(types$1.questionDot);
  11861. if (noCalls && optional) {
  11862. this.raise(this.lastTokStart, "Optional chaining cannot appear in the callee of new expressions");
  11863. }
  11864. var computed = this.eat(types$1.bracketL);
  11865. if (computed || optional && this.type !== types$1.parenL && this.type !== types$1.backQuote || this.eat(types$1.dot)) {
  11866. var node2 = this.startNodeAt(startPos, startLoc);
  11867. node2.object = base;
  11868. if (computed) {
  11869. node2.property = this.parseExpression();
  11870. this.expect(types$1.bracketR);
  11871. } else if (this.type === types$1.privateId && base.type !== "Super") {
  11872. node2.property = this.parsePrivateIdent();
  11873. } else {
  11874. node2.property = this.parseIdent(this.options.allowReserved !== "never");
  11875. }
  11876. node2.computed = !!computed;
  11877. if (optionalSupported) {
  11878. node2.optional = optional;
  11879. }
  11880. base = this.finishNode(node2, "MemberExpression");
  11881. } else if (!noCalls && this.eat(types$1.parenL)) {
  11882. var refDestructuringErrors = new DestructuringErrors(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;
  11883. this.yieldPos = 0;
  11884. this.awaitPos = 0;
  11885. this.awaitIdentPos = 0;
  11886. var exprList = this.parseExprList(types$1.parenR, this.options.ecmaVersion >= 8, false, refDestructuringErrors);
  11887. if (maybeAsyncArrow && !optional && this.shouldParseAsyncArrow()) {
  11888. this.checkPatternErrors(refDestructuringErrors, false);
  11889. this.checkYieldAwaitInDefaultParams();
  11890. if (this.awaitIdentPos > 0) {
  11891. this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function");
  11892. }
  11893. this.yieldPos = oldYieldPos;
  11894. this.awaitPos = oldAwaitPos;
  11895. this.awaitIdentPos = oldAwaitIdentPos;
  11896. return this.parseSubscriptAsyncArrow(startPos, startLoc, exprList, forInit);
  11897. }
  11898. this.checkExpressionErrors(refDestructuringErrors, true);
  11899. this.yieldPos = oldYieldPos || this.yieldPos;
  11900. this.awaitPos = oldAwaitPos || this.awaitPos;
  11901. this.awaitIdentPos = oldAwaitIdentPos || this.awaitIdentPos;
  11902. var node$1 = this.startNodeAt(startPos, startLoc);
  11903. node$1.callee = base;
  11904. node$1.arguments = exprList;
  11905. if (optionalSupported) {
  11906. node$1.optional = optional;
  11907. }
  11908. base = this.finishNode(node$1, "CallExpression");
  11909. } else if (this.type === types$1.backQuote) {
  11910. if (optional || optionalChained) {
  11911. this.raise(this.start, "Optional chaining cannot appear in the tag of tagged template expressions");
  11912. }
  11913. var node$2 = this.startNodeAt(startPos, startLoc);
  11914. node$2.tag = base;
  11915. node$2.quasi = this.parseTemplate({ isTagged: true });
  11916. base = this.finishNode(node$2, "TaggedTemplateExpression");
  11917. }
  11918. return base;
  11919. };
  11920. pp$5.parseExprAtom = function(refDestructuringErrors, forInit, forNew) {
  11921. if (this.type === types$1.slash) {
  11922. this.readRegexp();
  11923. }
  11924. var node2, canBeArrow = this.potentialArrowAt === this.start;
  11925. switch (this.type) {
  11926. case types$1._super:
  11927. if (!this.allowSuper) {
  11928. this.raise(this.start, "'super' keyword outside a method");
  11929. }
  11930. node2 = this.startNode();
  11931. this.next();
  11932. if (this.type === types$1.parenL && !this.allowDirectSuper) {
  11933. this.raise(node2.start, "super() call outside constructor of a subclass");
  11934. }
  11935. if (this.type !== types$1.dot && this.type !== types$1.bracketL && this.type !== types$1.parenL) {
  11936. this.unexpected();
  11937. }
  11938. return this.finishNode(node2, "Super");
  11939. case types$1._this:
  11940. node2 = this.startNode();
  11941. this.next();
  11942. return this.finishNode(node2, "ThisExpression");
  11943. case types$1.name:
  11944. var startPos = this.start, startLoc = this.startLoc, containsEsc = this.containsEsc;
  11945. var id = this.parseIdent(false);
  11946. if (this.options.ecmaVersion >= 8 && !containsEsc && id.name === "async" && !this.canInsertSemicolon() && this.eat(types$1._function)) {
  11947. this.overrideContext(types.f_expr);
  11948. return this.parseFunction(this.startNodeAt(startPos, startLoc), 0, false, true, forInit);
  11949. }
  11950. if (canBeArrow && !this.canInsertSemicolon()) {
  11951. if (this.eat(types$1.arrow)) {
  11952. return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], false, forInit);
  11953. }
  11954. if (this.options.ecmaVersion >= 8 && id.name === "async" && this.type === types$1.name && !containsEsc && (!this.potentialArrowInForAwait || this.value !== "of" || this.containsEsc)) {
  11955. id = this.parseIdent(false);
  11956. if (this.canInsertSemicolon() || !this.eat(types$1.arrow)) {
  11957. this.unexpected();
  11958. }
  11959. return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], true, forInit);
  11960. }
  11961. }
  11962. return id;
  11963. case types$1.regexp:
  11964. var value = this.value;
  11965. node2 = this.parseLiteral(value.value);
  11966. node2.regex = { pattern: value.pattern, flags: value.flags };
  11967. return node2;
  11968. case types$1.num:
  11969. case types$1.string:
  11970. return this.parseLiteral(this.value);
  11971. case types$1._null:
  11972. case types$1._true:
  11973. case types$1._false:
  11974. node2 = this.startNode();
  11975. node2.value = this.type === types$1._null ? null : this.type === types$1._true;
  11976. node2.raw = this.type.keyword;
  11977. this.next();
  11978. return this.finishNode(node2, "Literal");
  11979. case types$1.parenL:
  11980. var start2 = this.start, expr = this.parseParenAndDistinguishExpression(canBeArrow, forInit);
  11981. if (refDestructuringErrors) {
  11982. if (refDestructuringErrors.parenthesizedAssign < 0 && !this.isSimpleAssignTarget(expr)) {
  11983. refDestructuringErrors.parenthesizedAssign = start2;
  11984. }
  11985. if (refDestructuringErrors.parenthesizedBind < 0) {
  11986. refDestructuringErrors.parenthesizedBind = start2;
  11987. }
  11988. }
  11989. return expr;
  11990. case types$1.bracketL:
  11991. node2 = this.startNode();
  11992. this.next();
  11993. node2.elements = this.parseExprList(types$1.bracketR, true, true, refDestructuringErrors);
  11994. return this.finishNode(node2, "ArrayExpression");
  11995. case types$1.braceL:
  11996. this.overrideContext(types.b_expr);
  11997. return this.parseObj(false, refDestructuringErrors);
  11998. case types$1._function:
  11999. node2 = this.startNode();
  12000. this.next();
  12001. return this.parseFunction(node2, 0);
  12002. case types$1._class:
  12003. return this.parseClass(this.startNode(), false);
  12004. case types$1._new:
  12005. return this.parseNew();
  12006. case types$1.backQuote:
  12007. return this.parseTemplate();
  12008. case types$1._import:
  12009. if (this.options.ecmaVersion >= 11) {
  12010. return this.parseExprImport(forNew);
  12011. } else {
  12012. return this.unexpected();
  12013. }
  12014. default:
  12015. return this.parseExprAtomDefault();
  12016. }
  12017. };
  12018. pp$5.parseExprAtomDefault = function() {
  12019. this.unexpected();
  12020. };
  12021. pp$5.parseExprImport = function(forNew) {
  12022. var node2 = this.startNode();
  12023. if (this.containsEsc) {
  12024. this.raiseRecoverable(this.start, "Escape sequence in keyword import");
  12025. }
  12026. this.next();
  12027. if (this.type === types$1.parenL && !forNew) {
  12028. return this.parseDynamicImport(node2);
  12029. } else if (this.type === types$1.dot) {
  12030. var meta = this.startNodeAt(node2.start, node2.loc && node2.loc.start);
  12031. meta.name = "import";
  12032. node2.meta = this.finishNode(meta, "Identifier");
  12033. return this.parseImportMeta(node2);
  12034. } else {
  12035. this.unexpected();
  12036. }
  12037. };
  12038. pp$5.parseDynamicImport = function(node2) {
  12039. this.next();
  12040. node2.source = this.parseMaybeAssign();
  12041. if (!this.eat(types$1.parenR)) {
  12042. var errorPos = this.start;
  12043. if (this.eat(types$1.comma) && this.eat(types$1.parenR)) {
  12044. this.raiseRecoverable(errorPos, "Trailing comma is not allowed in import()");
  12045. } else {
  12046. this.unexpected(errorPos);
  12047. }
  12048. }
  12049. return this.finishNode(node2, "ImportExpression");
  12050. };
  12051. pp$5.parseImportMeta = function(node2) {
  12052. this.next();
  12053. var containsEsc = this.containsEsc;
  12054. node2.property = this.parseIdent(true);
  12055. if (node2.property.name !== "meta") {
  12056. this.raiseRecoverable(node2.property.start, "The only valid meta property for import is 'import.meta'");
  12057. }
  12058. if (containsEsc) {
  12059. this.raiseRecoverable(node2.start, "'import.meta' must not contain escaped characters");
  12060. }
  12061. if (this.options.sourceType !== "module" && !this.options.allowImportExportEverywhere) {
  12062. this.raiseRecoverable(node2.start, "Cannot use 'import.meta' outside a module");
  12063. }
  12064. return this.finishNode(node2, "MetaProperty");
  12065. };
  12066. pp$5.parseLiteral = function(value) {
  12067. var node2 = this.startNode();
  12068. node2.value = value;
  12069. node2.raw = this.input.slice(this.start, this.end);
  12070. if (node2.raw.charCodeAt(node2.raw.length - 1) === 110) {
  12071. node2.bigint = node2.raw.slice(0, -1).replace(/_/g, "");
  12072. }
  12073. this.next();
  12074. return this.finishNode(node2, "Literal");
  12075. };
  12076. pp$5.parseParenExpression = function() {
  12077. this.expect(types$1.parenL);
  12078. var val = this.parseExpression();
  12079. this.expect(types$1.parenR);
  12080. return val;
  12081. };
  12082. pp$5.shouldParseArrow = function(exprList) {
  12083. return !this.canInsertSemicolon();
  12084. };
  12085. pp$5.parseParenAndDistinguishExpression = function(canBeArrow, forInit) {
  12086. var startPos = this.start, startLoc = this.startLoc, val, allowTrailingComma = this.options.ecmaVersion >= 8;
  12087. if (this.options.ecmaVersion >= 6) {
  12088. this.next();
  12089. var innerStartPos = this.start, innerStartLoc = this.startLoc;
  12090. var exprList = [], first = true, lastIsComma = false;
  12091. var refDestructuringErrors = new DestructuringErrors(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, spreadStart;
  12092. this.yieldPos = 0;
  12093. this.awaitPos = 0;
  12094. while (this.type !== types$1.parenR) {
  12095. first ? first = false : this.expect(types$1.comma);
  12096. if (allowTrailingComma && this.afterTrailingComma(types$1.parenR, true)) {
  12097. lastIsComma = true;
  12098. break;
  12099. } else if (this.type === types$1.ellipsis) {
  12100. spreadStart = this.start;
  12101. exprList.push(this.parseParenItem(this.parseRestBinding()));
  12102. if (this.type === types$1.comma) {
  12103. this.raiseRecoverable(
  12104. this.start,
  12105. "Comma is not permitted after the rest element"
  12106. );
  12107. }
  12108. break;
  12109. } else {
  12110. exprList.push(this.parseMaybeAssign(false, refDestructuringErrors, this.parseParenItem));
  12111. }
  12112. }
  12113. var innerEndPos = this.lastTokEnd, innerEndLoc = this.lastTokEndLoc;
  12114. this.expect(types$1.parenR);
  12115. if (canBeArrow && this.shouldParseArrow(exprList) && this.eat(types$1.arrow)) {
  12116. this.checkPatternErrors(refDestructuringErrors, false);
  12117. this.checkYieldAwaitInDefaultParams();
  12118. this.yieldPos = oldYieldPos;
  12119. this.awaitPos = oldAwaitPos;
  12120. return this.parseParenArrowList(startPos, startLoc, exprList, forInit);
  12121. }
  12122. if (!exprList.length || lastIsComma) {
  12123. this.unexpected(this.lastTokStart);
  12124. }
  12125. if (spreadStart) {
  12126. this.unexpected(spreadStart);
  12127. }
  12128. this.checkExpressionErrors(refDestructuringErrors, true);
  12129. this.yieldPos = oldYieldPos || this.yieldPos;
  12130. this.awaitPos = oldAwaitPos || this.awaitPos;
  12131. if (exprList.length > 1) {
  12132. val = this.startNodeAt(innerStartPos, innerStartLoc);
  12133. val.expressions = exprList;
  12134. this.finishNodeAt(val, "SequenceExpression", innerEndPos, innerEndLoc);
  12135. } else {
  12136. val = exprList[0];
  12137. }
  12138. } else {
  12139. val = this.parseParenExpression();
  12140. }
  12141. if (this.options.preserveParens) {
  12142. var par = this.startNodeAt(startPos, startLoc);
  12143. par.expression = val;
  12144. return this.finishNode(par, "ParenthesizedExpression");
  12145. } else {
  12146. return val;
  12147. }
  12148. };
  12149. pp$5.parseParenItem = function(item) {
  12150. return item;
  12151. };
  12152. pp$5.parseParenArrowList = function(startPos, startLoc, exprList, forInit) {
  12153. return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, false, forInit);
  12154. };
  12155. var empty = [];
  12156. pp$5.parseNew = function() {
  12157. if (this.containsEsc) {
  12158. this.raiseRecoverable(this.start, "Escape sequence in keyword new");
  12159. }
  12160. var node2 = this.startNode();
  12161. this.next();
  12162. if (this.options.ecmaVersion >= 6 && this.type === types$1.dot) {
  12163. var meta = this.startNodeAt(node2.start, node2.loc && node2.loc.start);
  12164. meta.name = "new";
  12165. node2.meta = this.finishNode(meta, "Identifier");
  12166. this.next();
  12167. var containsEsc = this.containsEsc;
  12168. node2.property = this.parseIdent(true);
  12169. if (node2.property.name !== "target") {
  12170. this.raiseRecoverable(node2.property.start, "The only valid meta property for new is 'new.target'");
  12171. }
  12172. if (containsEsc) {
  12173. this.raiseRecoverable(node2.start, "'new.target' must not contain escaped characters");
  12174. }
  12175. if (!this.allowNewDotTarget) {
  12176. this.raiseRecoverable(node2.start, "'new.target' can only be used in functions and class static block");
  12177. }
  12178. return this.finishNode(node2, "MetaProperty");
  12179. }
  12180. var startPos = this.start, startLoc = this.startLoc;
  12181. node2.callee = this.parseSubscripts(this.parseExprAtom(null, false, true), startPos, startLoc, true, false);
  12182. if (this.eat(types$1.parenL)) {
  12183. node2.arguments = this.parseExprList(types$1.parenR, this.options.ecmaVersion >= 8, false);
  12184. } else {
  12185. node2.arguments = empty;
  12186. }
  12187. return this.finishNode(node2, "NewExpression");
  12188. };
  12189. pp$5.parseTemplateElement = function(ref2) {
  12190. var isTagged = ref2.isTagged;
  12191. var elem = this.startNode();
  12192. if (this.type === types$1.invalidTemplate) {
  12193. if (!isTagged) {
  12194. this.raiseRecoverable(this.start, "Bad escape sequence in untagged template literal");
  12195. }
  12196. elem.value = {
  12197. raw: this.value.replace(/\r\n?/g, "\n"),
  12198. cooked: null
  12199. };
  12200. } else {
  12201. elem.value = {
  12202. raw: this.input.slice(this.start, this.end).replace(/\r\n?/g, "\n"),
  12203. cooked: this.value
  12204. };
  12205. }
  12206. this.next();
  12207. elem.tail = this.type === types$1.backQuote;
  12208. return this.finishNode(elem, "TemplateElement");
  12209. };
  12210. pp$5.parseTemplate = function(ref2) {
  12211. if (ref2 === void 0) ref2 = {};
  12212. var isTagged = ref2.isTagged;
  12213. if (isTagged === void 0) isTagged = false;
  12214. var node2 = this.startNode();
  12215. this.next();
  12216. node2.expressions = [];
  12217. var curElt = this.parseTemplateElement({ isTagged });
  12218. node2.quasis = [curElt];
  12219. while (!curElt.tail) {
  12220. if (this.type === types$1.eof) {
  12221. this.raise(this.pos, "Unterminated template literal");
  12222. }
  12223. this.expect(types$1.dollarBraceL);
  12224. node2.expressions.push(this.parseExpression());
  12225. this.expect(types$1.braceR);
  12226. node2.quasis.push(curElt = this.parseTemplateElement({ isTagged }));
  12227. }
  12228. this.next();
  12229. return this.finishNode(node2, "TemplateLiteral");
  12230. };
  12231. pp$5.isAsyncProp = function(prop) {
  12232. return !prop.computed && prop.key.type === "Identifier" && prop.key.name === "async" && (this.type === types$1.name || this.type === types$1.num || this.type === types$1.string || this.type === types$1.bracketL || this.type.keyword || this.options.ecmaVersion >= 9 && this.type === types$1.star) && !lineBreak.test(this.input.slice(this.lastTokEnd, this.start));
  12233. };
  12234. pp$5.parseObj = function(isPattern, refDestructuringErrors) {
  12235. var node2 = this.startNode(), first = true, propHash = {};
  12236. node2.properties = [];
  12237. this.next();
  12238. while (!this.eat(types$1.braceR)) {
  12239. if (!first) {
  12240. this.expect(types$1.comma);
  12241. if (this.options.ecmaVersion >= 5 && this.afterTrailingComma(types$1.braceR)) {
  12242. break;
  12243. }
  12244. } else {
  12245. first = false;
  12246. }
  12247. var prop = this.parseProperty(isPattern, refDestructuringErrors);
  12248. if (!isPattern) {
  12249. this.checkPropClash(prop, propHash, refDestructuringErrors);
  12250. }
  12251. node2.properties.push(prop);
  12252. }
  12253. return this.finishNode(node2, isPattern ? "ObjectPattern" : "ObjectExpression");
  12254. };
  12255. pp$5.parseProperty = function(isPattern, refDestructuringErrors) {
  12256. var prop = this.startNode(), isGenerator, isAsync, startPos, startLoc;
  12257. if (this.options.ecmaVersion >= 9 && this.eat(types$1.ellipsis)) {
  12258. if (isPattern) {
  12259. prop.argument = this.parseIdent(false);
  12260. if (this.type === types$1.comma) {
  12261. this.raiseRecoverable(this.start, "Comma is not permitted after the rest element");
  12262. }
  12263. return this.finishNode(prop, "RestElement");
  12264. }
  12265. prop.argument = this.parseMaybeAssign(false, refDestructuringErrors);
  12266. if (this.type === types$1.comma && refDestructuringErrors && refDestructuringErrors.trailingComma < 0) {
  12267. refDestructuringErrors.trailingComma = this.start;
  12268. }
  12269. return this.finishNode(prop, "SpreadElement");
  12270. }
  12271. if (this.options.ecmaVersion >= 6) {
  12272. prop.method = false;
  12273. prop.shorthand = false;
  12274. if (isPattern || refDestructuringErrors) {
  12275. startPos = this.start;
  12276. startLoc = this.startLoc;
  12277. }
  12278. if (!isPattern) {
  12279. isGenerator = this.eat(types$1.star);
  12280. }
  12281. }
  12282. var containsEsc = this.containsEsc;
  12283. this.parsePropertyName(prop);
  12284. if (!isPattern && !containsEsc && this.options.ecmaVersion >= 8 && !isGenerator && this.isAsyncProp(prop)) {
  12285. isAsync = true;
  12286. isGenerator = this.options.ecmaVersion >= 9 && this.eat(types$1.star);
  12287. this.parsePropertyName(prop);
  12288. } else {
  12289. isAsync = false;
  12290. }
  12291. this.parsePropertyValue(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc);
  12292. return this.finishNode(prop, "Property");
  12293. };
  12294. pp$5.parseGetterSetter = function(prop) {
  12295. prop.kind = prop.key.name;
  12296. this.parsePropertyName(prop);
  12297. prop.value = this.parseMethod(false);
  12298. var paramCount = prop.kind === "get" ? 0 : 1;
  12299. if (prop.value.params.length !== paramCount) {
  12300. var start2 = prop.value.start;
  12301. if (prop.kind === "get") {
  12302. this.raiseRecoverable(start2, "getter should have no params");
  12303. } else {
  12304. this.raiseRecoverable(start2, "setter should have exactly one param");
  12305. }
  12306. } else {
  12307. if (prop.kind === "set" && prop.value.params[0].type === "RestElement") {
  12308. this.raiseRecoverable(prop.value.params[0].start, "Setter cannot use rest params");
  12309. }
  12310. }
  12311. };
  12312. pp$5.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc) {
  12313. if ((isGenerator || isAsync) && this.type === types$1.colon) {
  12314. this.unexpected();
  12315. }
  12316. if (this.eat(types$1.colon)) {
  12317. prop.value = isPattern ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(false, refDestructuringErrors);
  12318. prop.kind = "init";
  12319. } else if (this.options.ecmaVersion >= 6 && this.type === types$1.parenL) {
  12320. if (isPattern) {
  12321. this.unexpected();
  12322. }
  12323. prop.kind = "init";
  12324. prop.method = true;
  12325. prop.value = this.parseMethod(isGenerator, isAsync);
  12326. } else if (!isPattern && !containsEsc && this.options.ecmaVersion >= 5 && !prop.computed && prop.key.type === "Identifier" && (prop.key.name === "get" || prop.key.name === "set") && (this.type !== types$1.comma && this.type !== types$1.braceR && this.type !== types$1.eq)) {
  12327. if (isGenerator || isAsync) {
  12328. this.unexpected();
  12329. }
  12330. this.parseGetterSetter(prop);
  12331. } else if (this.options.ecmaVersion >= 6 && !prop.computed && prop.key.type === "Identifier") {
  12332. if (isGenerator || isAsync) {
  12333. this.unexpected();
  12334. }
  12335. this.checkUnreserved(prop.key);
  12336. if (prop.key.name === "await" && !this.awaitIdentPos) {
  12337. this.awaitIdentPos = startPos;
  12338. }
  12339. prop.kind = "init";
  12340. if (isPattern) {
  12341. prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key));
  12342. } else if (this.type === types$1.eq && refDestructuringErrors) {
  12343. if (refDestructuringErrors.shorthandAssign < 0) {
  12344. refDestructuringErrors.shorthandAssign = this.start;
  12345. }
  12346. prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key));
  12347. } else {
  12348. prop.value = this.copyNode(prop.key);
  12349. }
  12350. prop.shorthand = true;
  12351. } else {
  12352. this.unexpected();
  12353. }
  12354. };
  12355. pp$5.parsePropertyName = function(prop) {
  12356. if (this.options.ecmaVersion >= 6) {
  12357. if (this.eat(types$1.bracketL)) {
  12358. prop.computed = true;
  12359. prop.key = this.parseMaybeAssign();
  12360. this.expect(types$1.bracketR);
  12361. return prop.key;
  12362. } else {
  12363. prop.computed = false;
  12364. }
  12365. }
  12366. return prop.key = this.type === types$1.num || this.type === types$1.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never");
  12367. };
  12368. pp$5.initFunction = function(node2) {
  12369. node2.id = null;
  12370. if (this.options.ecmaVersion >= 6) {
  12371. node2.generator = node2.expression = false;
  12372. }
  12373. if (this.options.ecmaVersion >= 8) {
  12374. node2.async = false;
  12375. }
  12376. };
  12377. pp$5.parseMethod = function(isGenerator, isAsync, allowDirectSuper) {
  12378. var node2 = this.startNode(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;
  12379. this.initFunction(node2);
  12380. if (this.options.ecmaVersion >= 6) {
  12381. node2.generator = isGenerator;
  12382. }
  12383. if (this.options.ecmaVersion >= 8) {
  12384. node2.async = !!isAsync;
  12385. }
  12386. this.yieldPos = 0;
  12387. this.awaitPos = 0;
  12388. this.awaitIdentPos = 0;
  12389. this.enterScope(functionFlags(isAsync, node2.generator) | SCOPE_SUPER | (allowDirectSuper ? SCOPE_DIRECT_SUPER : 0));
  12390. this.expect(types$1.parenL);
  12391. node2.params = this.parseBindingList(types$1.parenR, false, this.options.ecmaVersion >= 8);
  12392. this.checkYieldAwaitInDefaultParams();
  12393. this.parseFunctionBody(node2, false, true, false);
  12394. this.yieldPos = oldYieldPos;
  12395. this.awaitPos = oldAwaitPos;
  12396. this.awaitIdentPos = oldAwaitIdentPos;
  12397. return this.finishNode(node2, "FunctionExpression");
  12398. };
  12399. pp$5.parseArrowExpression = function(node2, params, isAsync, forInit) {
  12400. var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;
  12401. this.enterScope(functionFlags(isAsync, false) | SCOPE_ARROW);
  12402. this.initFunction(node2);
  12403. if (this.options.ecmaVersion >= 8) {
  12404. node2.async = !!isAsync;
  12405. }
  12406. this.yieldPos = 0;
  12407. this.awaitPos = 0;
  12408. this.awaitIdentPos = 0;
  12409. node2.params = this.toAssignableList(params, true);
  12410. this.parseFunctionBody(node2, true, false, forInit);
  12411. this.yieldPos = oldYieldPos;
  12412. this.awaitPos = oldAwaitPos;
  12413. this.awaitIdentPos = oldAwaitIdentPos;
  12414. return this.finishNode(node2, "ArrowFunctionExpression");
  12415. };
  12416. pp$5.parseFunctionBody = function(node2, isArrowFunction, isMethod, forInit) {
  12417. var isExpression = isArrowFunction && this.type !== types$1.braceL;
  12418. var oldStrict = this.strict, useStrict = false;
  12419. if (isExpression) {
  12420. node2.body = this.parseMaybeAssign(forInit);
  12421. node2.expression = true;
  12422. this.checkParams(node2, false);
  12423. } else {
  12424. var nonSimple = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(node2.params);
  12425. if (!oldStrict || nonSimple) {
  12426. useStrict = this.strictDirective(this.end);
  12427. if (useStrict && nonSimple) {
  12428. this.raiseRecoverable(node2.start, "Illegal 'use strict' directive in function with non-simple parameter list");
  12429. }
  12430. }
  12431. var oldLabels = this.labels;
  12432. this.labels = [];
  12433. if (useStrict) {
  12434. this.strict = true;
  12435. }
  12436. this.checkParams(node2, !oldStrict && !useStrict && !isArrowFunction && !isMethod && this.isSimpleParamList(node2.params));
  12437. if (this.strict && node2.id) {
  12438. this.checkLValSimple(node2.id, BIND_OUTSIDE);
  12439. }
  12440. node2.body = this.parseBlock(false, void 0, useStrict && !oldStrict);
  12441. node2.expression = false;
  12442. this.adaptDirectivePrologue(node2.body.body);
  12443. this.labels = oldLabels;
  12444. }
  12445. this.exitScope();
  12446. };
  12447. pp$5.isSimpleParamList = function(params) {
  12448. for (var i = 0, list3 = params; i < list3.length; i += 1) {
  12449. var param = list3[i];
  12450. if (param.type !== "Identifier") {
  12451. return false;
  12452. }
  12453. }
  12454. return true;
  12455. };
  12456. pp$5.checkParams = function(node2, allowDuplicates) {
  12457. var nameHash = /* @__PURE__ */ Object.create(null);
  12458. for (var i = 0, list3 = node2.params; i < list3.length; i += 1) {
  12459. var param = list3[i];
  12460. this.checkLValInnerPattern(param, BIND_VAR, allowDuplicates ? null : nameHash);
  12461. }
  12462. };
  12463. pp$5.parseExprList = function(close, allowTrailingComma, allowEmpty, refDestructuringErrors) {
  12464. var elts = [], first = true;
  12465. while (!this.eat(close)) {
  12466. if (!first) {
  12467. this.expect(types$1.comma);
  12468. if (allowTrailingComma && this.afterTrailingComma(close)) {
  12469. break;
  12470. }
  12471. } else {
  12472. first = false;
  12473. }
  12474. var elt = void 0;
  12475. if (allowEmpty && this.type === types$1.comma) {
  12476. elt = null;
  12477. } else if (this.type === types$1.ellipsis) {
  12478. elt = this.parseSpread(refDestructuringErrors);
  12479. if (refDestructuringErrors && this.type === types$1.comma && refDestructuringErrors.trailingComma < 0) {
  12480. refDestructuringErrors.trailingComma = this.start;
  12481. }
  12482. } else {
  12483. elt = this.parseMaybeAssign(false, refDestructuringErrors);
  12484. }
  12485. elts.push(elt);
  12486. }
  12487. return elts;
  12488. };
  12489. pp$5.checkUnreserved = function(ref2) {
  12490. var start2 = ref2.start;
  12491. var end = ref2.end;
  12492. var name2 = ref2.name;
  12493. if (this.inGenerator && name2 === "yield") {
  12494. this.raiseRecoverable(start2, "Cannot use 'yield' as identifier inside a generator");
  12495. }
  12496. if (this.inAsync && name2 === "await") {
  12497. this.raiseRecoverable(start2, "Cannot use 'await' as identifier inside an async function");
  12498. }
  12499. if (this.currentThisScope().inClassFieldInit && name2 === "arguments") {
  12500. this.raiseRecoverable(start2, "Cannot use 'arguments' in class field initializer");
  12501. }
  12502. if (this.inClassStaticBlock && (name2 === "arguments" || name2 === "await")) {
  12503. this.raise(start2, "Cannot use " + name2 + " in class static initialization block");
  12504. }
  12505. if (this.keywords.test(name2)) {
  12506. this.raise(start2, "Unexpected keyword '" + name2 + "'");
  12507. }
  12508. if (this.options.ecmaVersion < 6 && this.input.slice(start2, end).indexOf("\\") !== -1) {
  12509. return;
  12510. }
  12511. var re2 = this.strict ? this.reservedWordsStrict : this.reservedWords;
  12512. if (re2.test(name2)) {
  12513. if (!this.inAsync && name2 === "await") {
  12514. this.raiseRecoverable(start2, "Cannot use keyword 'await' outside an async function");
  12515. }
  12516. this.raiseRecoverable(start2, "The keyword '" + name2 + "' is reserved");
  12517. }
  12518. };
  12519. pp$5.parseIdent = function(liberal) {
  12520. var node2 = this.parseIdentNode();
  12521. this.next(!!liberal);
  12522. this.finishNode(node2, "Identifier");
  12523. if (!liberal) {
  12524. this.checkUnreserved(node2);
  12525. if (node2.name === "await" && !this.awaitIdentPos) {
  12526. this.awaitIdentPos = node2.start;
  12527. }
  12528. }
  12529. return node2;
  12530. };
  12531. pp$5.parseIdentNode = function() {
  12532. var node2 = this.startNode();
  12533. if (this.type === types$1.name) {
  12534. node2.name = this.value;
  12535. } else if (this.type.keyword) {
  12536. node2.name = this.type.keyword;
  12537. if ((node2.name === "class" || node2.name === "function") && (this.lastTokEnd !== this.lastTokStart + 1 || this.input.charCodeAt(this.lastTokStart) !== 46)) {
  12538. this.context.pop();
  12539. }
  12540. this.type = types$1.name;
  12541. } else {
  12542. this.unexpected();
  12543. }
  12544. return node2;
  12545. };
  12546. pp$5.parsePrivateIdent = function() {
  12547. var node2 = this.startNode();
  12548. if (this.type === types$1.privateId) {
  12549. node2.name = this.value;
  12550. } else {
  12551. this.unexpected();
  12552. }
  12553. this.next();
  12554. this.finishNode(node2, "PrivateIdentifier");
  12555. if (this.options.checkPrivateFields) {
  12556. if (this.privateNameStack.length === 0) {
  12557. this.raise(node2.start, "Private field '#" + node2.name + "' must be declared in an enclosing class");
  12558. } else {
  12559. this.privateNameStack[this.privateNameStack.length - 1].used.push(node2);
  12560. }
  12561. }
  12562. return node2;
  12563. };
  12564. pp$5.parseYield = function(forInit) {
  12565. if (!this.yieldPos) {
  12566. this.yieldPos = this.start;
  12567. }
  12568. var node2 = this.startNode();
  12569. this.next();
  12570. if (this.type === types$1.semi || this.canInsertSemicolon() || this.type !== types$1.star && !this.type.startsExpr) {
  12571. node2.delegate = false;
  12572. node2.argument = null;
  12573. } else {
  12574. node2.delegate = this.eat(types$1.star);
  12575. node2.argument = this.parseMaybeAssign(forInit);
  12576. }
  12577. return this.finishNode(node2, "YieldExpression");
  12578. };
  12579. pp$5.parseAwait = function(forInit) {
  12580. if (!this.awaitPos) {
  12581. this.awaitPos = this.start;
  12582. }
  12583. var node2 = this.startNode();
  12584. this.next();
  12585. node2.argument = this.parseMaybeUnary(null, true, false, forInit);
  12586. return this.finishNode(node2, "AwaitExpression");
  12587. };
  12588. var pp$4 = Parser.prototype;
  12589. pp$4.raise = function(pos, message) {
  12590. var loc = getLineInfo(this.input, pos);
  12591. message += " (" + loc.line + ":" + loc.column + ")";
  12592. var err = new SyntaxError(message);
  12593. err.pos = pos;
  12594. err.loc = loc;
  12595. err.raisedAt = this.pos;
  12596. throw err;
  12597. };
  12598. pp$4.raiseRecoverable = pp$4.raise;
  12599. pp$4.curPosition = function() {
  12600. if (this.options.locations) {
  12601. return new Position(this.curLine, this.pos - this.lineStart);
  12602. }
  12603. };
  12604. var pp$3 = Parser.prototype;
  12605. var Scope = function Scope2(flags) {
  12606. this.flags = flags;
  12607. this.var = [];
  12608. this.lexical = [];
  12609. this.functions = [];
  12610. this.inClassFieldInit = false;
  12611. };
  12612. pp$3.enterScope = function(flags) {
  12613. this.scopeStack.push(new Scope(flags));
  12614. };
  12615. pp$3.exitScope = function() {
  12616. this.scopeStack.pop();
  12617. };
  12618. pp$3.treatFunctionsAsVarInScope = function(scope) {
  12619. return scope.flags & SCOPE_FUNCTION || !this.inModule && scope.flags & SCOPE_TOP;
  12620. };
  12621. pp$3.declareName = function(name2, bindingType, pos) {
  12622. var redeclared = false;
  12623. if (bindingType === BIND_LEXICAL) {
  12624. var scope = this.currentScope();
  12625. redeclared = scope.lexical.indexOf(name2) > -1 || scope.functions.indexOf(name2) > -1 || scope.var.indexOf(name2) > -1;
  12626. scope.lexical.push(name2);
  12627. if (this.inModule && scope.flags & SCOPE_TOP) {
  12628. delete this.undefinedExports[name2];
  12629. }
  12630. } else if (bindingType === BIND_SIMPLE_CATCH) {
  12631. var scope$1 = this.currentScope();
  12632. scope$1.lexical.push(name2);
  12633. } else if (bindingType === BIND_FUNCTION) {
  12634. var scope$2 = this.currentScope();
  12635. if (this.treatFunctionsAsVar) {
  12636. redeclared = scope$2.lexical.indexOf(name2) > -1;
  12637. } else {
  12638. redeclared = scope$2.lexical.indexOf(name2) > -1 || scope$2.var.indexOf(name2) > -1;
  12639. }
  12640. scope$2.functions.push(name2);
  12641. } else {
  12642. for (var i = this.scopeStack.length - 1; i >= 0; --i) {
  12643. var scope$3 = this.scopeStack[i];
  12644. if (scope$3.lexical.indexOf(name2) > -1 && !(scope$3.flags & SCOPE_SIMPLE_CATCH && scope$3.lexical[0] === name2) || !this.treatFunctionsAsVarInScope(scope$3) && scope$3.functions.indexOf(name2) > -1) {
  12645. redeclared = true;
  12646. break;
  12647. }
  12648. scope$3.var.push(name2);
  12649. if (this.inModule && scope$3.flags & SCOPE_TOP) {
  12650. delete this.undefinedExports[name2];
  12651. }
  12652. if (scope$3.flags & SCOPE_VAR) {
  12653. break;
  12654. }
  12655. }
  12656. }
  12657. if (redeclared) {
  12658. this.raiseRecoverable(pos, "Identifier '" + name2 + "' has already been declared");
  12659. }
  12660. };
  12661. pp$3.checkLocalExport = function(id) {
  12662. if (this.scopeStack[0].lexical.indexOf(id.name) === -1 && this.scopeStack[0].var.indexOf(id.name) === -1) {
  12663. this.undefinedExports[id.name] = id;
  12664. }
  12665. };
  12666. pp$3.currentScope = function() {
  12667. return this.scopeStack[this.scopeStack.length - 1];
  12668. };
  12669. pp$3.currentVarScope = function() {
  12670. for (var i = this.scopeStack.length - 1; ; i--) {
  12671. var scope = this.scopeStack[i];
  12672. if (scope.flags & SCOPE_VAR) {
  12673. return scope;
  12674. }
  12675. }
  12676. };
  12677. pp$3.currentThisScope = function() {
  12678. for (var i = this.scopeStack.length - 1; ; i--) {
  12679. var scope = this.scopeStack[i];
  12680. if (scope.flags & SCOPE_VAR && !(scope.flags & SCOPE_ARROW)) {
  12681. return scope;
  12682. }
  12683. }
  12684. };
  12685. var Node = function Node2(parser, pos, loc) {
  12686. this.type = "";
  12687. this.start = pos;
  12688. this.end = 0;
  12689. if (parser.options.locations) {
  12690. this.loc = new SourceLocation(parser, loc);
  12691. }
  12692. if (parser.options.directSourceFile) {
  12693. this.sourceFile = parser.options.directSourceFile;
  12694. }
  12695. if (parser.options.ranges) {
  12696. this.range = [pos, 0];
  12697. }
  12698. };
  12699. var pp$2 = Parser.prototype;
  12700. pp$2.startNode = function() {
  12701. return new Node(this, this.start, this.startLoc);
  12702. };
  12703. pp$2.startNodeAt = function(pos, loc) {
  12704. return new Node(this, pos, loc);
  12705. };
  12706. function finishNodeAt(node2, type, pos, loc) {
  12707. node2.type = type;
  12708. node2.end = pos;
  12709. if (this.options.locations) {
  12710. node2.loc.end = loc;
  12711. }
  12712. if (this.options.ranges) {
  12713. node2.range[1] = pos;
  12714. }
  12715. return node2;
  12716. }
  12717. pp$2.finishNode = function(node2, type) {
  12718. return finishNodeAt.call(this, node2, type, this.lastTokEnd, this.lastTokEndLoc);
  12719. };
  12720. pp$2.finishNodeAt = function(node2, type, pos, loc) {
  12721. return finishNodeAt.call(this, node2, type, pos, loc);
  12722. };
  12723. pp$2.copyNode = function(node2) {
  12724. var newNode = new Node(this, node2.start, this.startLoc);
  12725. for (var prop in node2) {
  12726. newNode[prop] = node2[prop];
  12727. }
  12728. return newNode;
  12729. };
  12730. var ecma9BinaryProperties = "ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS";
  12731. var ecma10BinaryProperties = ecma9BinaryProperties + " Extended_Pictographic";
  12732. var ecma11BinaryProperties = ecma10BinaryProperties;
  12733. var ecma12BinaryProperties = ecma11BinaryProperties + " EBase EComp EMod EPres ExtPict";
  12734. var ecma13BinaryProperties = ecma12BinaryProperties;
  12735. var ecma14BinaryProperties = ecma13BinaryProperties;
  12736. var unicodeBinaryProperties = {
  12737. 9: ecma9BinaryProperties,
  12738. 10: ecma10BinaryProperties,
  12739. 11: ecma11BinaryProperties,
  12740. 12: ecma12BinaryProperties,
  12741. 13: ecma13BinaryProperties,
  12742. 14: ecma14BinaryProperties
  12743. };
  12744. var ecma14BinaryPropertiesOfStrings = "Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji";
  12745. var unicodeBinaryPropertiesOfStrings = {
  12746. 9: "",
  12747. 10: "",
  12748. 11: "",
  12749. 12: "",
  12750. 13: "",
  12751. 14: ecma14BinaryPropertiesOfStrings
  12752. };
  12753. var unicodeGeneralCategoryValues = "Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu";
  12754. var ecma9ScriptValues = "Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb";
  12755. var ecma10ScriptValues = ecma9ScriptValues + " Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd";
  12756. var ecma11ScriptValues = ecma10ScriptValues + " Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho";
  12757. var ecma12ScriptValues = ecma11ScriptValues + " Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi";
  12758. var ecma13ScriptValues = ecma12ScriptValues + " Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith";
  12759. var ecma14ScriptValues = ecma13ScriptValues + " Hrkt Katakana_Or_Hiragana Kawi Nag_Mundari Nagm Unknown Zzzz";
  12760. var unicodeScriptValues = {
  12761. 9: ecma9ScriptValues,
  12762. 10: ecma10ScriptValues,
  12763. 11: ecma11ScriptValues,
  12764. 12: ecma12ScriptValues,
  12765. 13: ecma13ScriptValues,
  12766. 14: ecma14ScriptValues
  12767. };
  12768. var data = {};
  12769. function buildUnicodeData(ecmaVersion) {
  12770. var d = data[ecmaVersion] = {
  12771. binary: wordsRegexp(unicodeBinaryProperties[ecmaVersion] + " " + unicodeGeneralCategoryValues),
  12772. binaryOfStrings: wordsRegexp(unicodeBinaryPropertiesOfStrings[ecmaVersion]),
  12773. nonBinary: {
  12774. General_Category: wordsRegexp(unicodeGeneralCategoryValues),
  12775. Script: wordsRegexp(unicodeScriptValues[ecmaVersion])
  12776. }
  12777. };
  12778. d.nonBinary.Script_Extensions = d.nonBinary.Script;
  12779. d.nonBinary.gc = d.nonBinary.General_Category;
  12780. d.nonBinary.sc = d.nonBinary.Script;
  12781. d.nonBinary.scx = d.nonBinary.Script_Extensions;
  12782. }
  12783. var ecmaVersion;
  12784. var i;
  12785. var list3;
  12786. for (i = 0, list3 = [9, 10, 11, 12, 13, 14]; i < list3.length; i += 1) {
  12787. ecmaVersion = list3[i];
  12788. buildUnicodeData(ecmaVersion);
  12789. }
  12790. var pp$1 = Parser.prototype;
  12791. var BranchID = function BranchID2(parent, base) {
  12792. this.parent = parent;
  12793. this.base = base || this;
  12794. };
  12795. BranchID.prototype.separatedFrom = function separatedFrom(alt) {
  12796. for (var self2 = this; self2; self2 = self2.parent) {
  12797. for (var other = alt; other; other = other.parent) {
  12798. if (self2.base === other.base && self2 !== other) {
  12799. return true;
  12800. }
  12801. }
  12802. }
  12803. return false;
  12804. };
  12805. BranchID.prototype.sibling = function sibling() {
  12806. return new BranchID(this.parent, this.base);
  12807. };
  12808. var RegExpValidationState = function RegExpValidationState2(parser) {
  12809. this.parser = parser;
  12810. this.validFlags = "gim" + (parser.options.ecmaVersion >= 6 ? "uy" : "") + (parser.options.ecmaVersion >= 9 ? "s" : "") + (parser.options.ecmaVersion >= 13 ? "d" : "") + (parser.options.ecmaVersion >= 15 ? "v" : "");
  12811. this.unicodeProperties = data[parser.options.ecmaVersion >= 14 ? 14 : parser.options.ecmaVersion];
  12812. this.source = "";
  12813. this.flags = "";
  12814. this.start = 0;
  12815. this.switchU = false;
  12816. this.switchV = false;
  12817. this.switchN = false;
  12818. this.pos = 0;
  12819. this.lastIntValue = 0;
  12820. this.lastStringValue = "";
  12821. this.lastAssertionIsQuantifiable = false;
  12822. this.numCapturingParens = 0;
  12823. this.maxBackReference = 0;
  12824. this.groupNames = /* @__PURE__ */ Object.create(null);
  12825. this.backReferenceNames = [];
  12826. this.branchID = null;
  12827. };
  12828. RegExpValidationState.prototype.reset = function reset(start2, pattern, flags) {
  12829. var unicodeSets = flags.indexOf("v") !== -1;
  12830. var unicode = flags.indexOf("u") !== -1;
  12831. this.start = start2 | 0;
  12832. this.source = pattern + "";
  12833. this.flags = flags;
  12834. if (unicodeSets && this.parser.options.ecmaVersion >= 15) {
  12835. this.switchU = true;
  12836. this.switchV = true;
  12837. this.switchN = true;
  12838. } else {
  12839. this.switchU = unicode && this.parser.options.ecmaVersion >= 6;
  12840. this.switchV = false;
  12841. this.switchN = unicode && this.parser.options.ecmaVersion >= 9;
  12842. }
  12843. };
  12844. RegExpValidationState.prototype.raise = function raise(message) {
  12845. this.parser.raiseRecoverable(this.start, "Invalid regular expression: /" + this.source + "/: " + message);
  12846. };
  12847. RegExpValidationState.prototype.at = function at(i, forceU) {
  12848. if (forceU === void 0) forceU = false;
  12849. var s = this.source;
  12850. var l = s.length;
  12851. if (i >= l) {
  12852. return -1;
  12853. }
  12854. var c = s.charCodeAt(i);
  12855. if (!(forceU || this.switchU) || c <= 55295 || c >= 57344 || i + 1 >= l) {
  12856. return c;
  12857. }
  12858. var next = s.charCodeAt(i + 1);
  12859. return next >= 56320 && next <= 57343 ? (c << 10) + next - 56613888 : c;
  12860. };
  12861. RegExpValidationState.prototype.nextIndex = function nextIndex(i, forceU) {
  12862. if (forceU === void 0) forceU = false;
  12863. var s = this.source;
  12864. var l = s.length;
  12865. if (i >= l) {
  12866. return l;
  12867. }
  12868. var c = s.charCodeAt(i), next;
  12869. if (!(forceU || this.switchU) || c <= 55295 || c >= 57344 || i + 1 >= l || (next = s.charCodeAt(i + 1)) < 56320 || next > 57343) {
  12870. return i + 1;
  12871. }
  12872. return i + 2;
  12873. };
  12874. RegExpValidationState.prototype.current = function current(forceU) {
  12875. if (forceU === void 0) forceU = false;
  12876. return this.at(this.pos, forceU);
  12877. };
  12878. RegExpValidationState.prototype.lookahead = function lookahead(forceU) {
  12879. if (forceU === void 0) forceU = false;
  12880. return this.at(this.nextIndex(this.pos, forceU), forceU);
  12881. };
  12882. RegExpValidationState.prototype.advance = function advance(forceU) {
  12883. if (forceU === void 0) forceU = false;
  12884. this.pos = this.nextIndex(this.pos, forceU);
  12885. };
  12886. RegExpValidationState.prototype.eat = function eat(ch, forceU) {
  12887. if (forceU === void 0) forceU = false;
  12888. if (this.current(forceU) === ch) {
  12889. this.advance(forceU);
  12890. return true;
  12891. }
  12892. return false;
  12893. };
  12894. RegExpValidationState.prototype.eatChars = function eatChars(chs, forceU) {
  12895. if (forceU === void 0) forceU = false;
  12896. var pos = this.pos;
  12897. for (var i = 0, list3 = chs; i < list3.length; i += 1) {
  12898. var ch = list3[i];
  12899. var current2 = this.at(pos, forceU);
  12900. if (current2 === -1 || current2 !== ch) {
  12901. return false;
  12902. }
  12903. pos = this.nextIndex(pos, forceU);
  12904. }
  12905. this.pos = pos;
  12906. return true;
  12907. };
  12908. pp$1.validateRegExpFlags = function(state) {
  12909. var validFlags = state.validFlags;
  12910. var flags = state.flags;
  12911. var u = false;
  12912. var v = false;
  12913. for (var i = 0; i < flags.length; i++) {
  12914. var flag = flags.charAt(i);
  12915. if (validFlags.indexOf(flag) === -1) {
  12916. this.raise(state.start, "Invalid regular expression flag");
  12917. }
  12918. if (flags.indexOf(flag, i + 1) > -1) {
  12919. this.raise(state.start, "Duplicate regular expression flag");
  12920. }
  12921. if (flag === "u") {
  12922. u = true;
  12923. }
  12924. if (flag === "v") {
  12925. v = true;
  12926. }
  12927. }
  12928. if (this.options.ecmaVersion >= 15 && u && v) {
  12929. this.raise(state.start, "Invalid regular expression flag");
  12930. }
  12931. };
  12932. function hasProp(obj) {
  12933. for (var _ in obj) {
  12934. return true;
  12935. }
  12936. return false;
  12937. }
  12938. pp$1.validateRegExpPattern = function(state) {
  12939. this.regexp_pattern(state);
  12940. if (!state.switchN && this.options.ecmaVersion >= 9 && hasProp(state.groupNames)) {
  12941. state.switchN = true;
  12942. this.regexp_pattern(state);
  12943. }
  12944. };
  12945. pp$1.regexp_pattern = function(state) {
  12946. state.pos = 0;
  12947. state.lastIntValue = 0;
  12948. state.lastStringValue = "";
  12949. state.lastAssertionIsQuantifiable = false;
  12950. state.numCapturingParens = 0;
  12951. state.maxBackReference = 0;
  12952. state.groupNames = /* @__PURE__ */ Object.create(null);
  12953. state.backReferenceNames.length = 0;
  12954. state.branchID = null;
  12955. this.regexp_disjunction(state);
  12956. if (state.pos !== state.source.length) {
  12957. if (state.eat(
  12958. 41
  12959. /* ) */
  12960. )) {
  12961. state.raise("Unmatched ')'");
  12962. }
  12963. if (state.eat(
  12964. 93
  12965. /* ] */
  12966. ) || state.eat(
  12967. 125
  12968. /* } */
  12969. )) {
  12970. state.raise("Lone quantifier brackets");
  12971. }
  12972. }
  12973. if (state.maxBackReference > state.numCapturingParens) {
  12974. state.raise("Invalid escape");
  12975. }
  12976. for (var i = 0, list3 = state.backReferenceNames; i < list3.length; i += 1) {
  12977. var name2 = list3[i];
  12978. if (!state.groupNames[name2]) {
  12979. state.raise("Invalid named capture referenced");
  12980. }
  12981. }
  12982. };
  12983. pp$1.regexp_disjunction = function(state) {
  12984. var trackDisjunction = this.options.ecmaVersion >= 16;
  12985. if (trackDisjunction) {
  12986. state.branchID = new BranchID(state.branchID, null);
  12987. }
  12988. this.regexp_alternative(state);
  12989. while (state.eat(
  12990. 124
  12991. /* | */
  12992. )) {
  12993. if (trackDisjunction) {
  12994. state.branchID = state.branchID.sibling();
  12995. }
  12996. this.regexp_alternative(state);
  12997. }
  12998. if (trackDisjunction) {
  12999. state.branchID = state.branchID.parent;
  13000. }
  13001. if (this.regexp_eatQuantifier(state, true)) {
  13002. state.raise("Nothing to repeat");
  13003. }
  13004. if (state.eat(
  13005. 123
  13006. /* { */
  13007. )) {
  13008. state.raise("Lone quantifier brackets");
  13009. }
  13010. };
  13011. pp$1.regexp_alternative = function(state) {
  13012. while (state.pos < state.source.length && this.regexp_eatTerm(state)) {
  13013. }
  13014. };
  13015. pp$1.regexp_eatTerm = function(state) {
  13016. if (this.regexp_eatAssertion(state)) {
  13017. if (state.lastAssertionIsQuantifiable && this.regexp_eatQuantifier(state)) {
  13018. if (state.switchU) {
  13019. state.raise("Invalid quantifier");
  13020. }
  13021. }
  13022. return true;
  13023. }
  13024. if (state.switchU ? this.regexp_eatAtom(state) : this.regexp_eatExtendedAtom(state)) {
  13025. this.regexp_eatQuantifier(state);
  13026. return true;
  13027. }
  13028. return false;
  13029. };
  13030. pp$1.regexp_eatAssertion = function(state) {
  13031. var start2 = state.pos;
  13032. state.lastAssertionIsQuantifiable = false;
  13033. if (state.eat(
  13034. 94
  13035. /* ^ */
  13036. ) || state.eat(
  13037. 36
  13038. /* $ */
  13039. )) {
  13040. return true;
  13041. }
  13042. if (state.eat(
  13043. 92
  13044. /* \ */
  13045. )) {
  13046. if (state.eat(
  13047. 66
  13048. /* B */
  13049. ) || state.eat(
  13050. 98
  13051. /* b */
  13052. )) {
  13053. return true;
  13054. }
  13055. state.pos = start2;
  13056. }
  13057. if (state.eat(
  13058. 40
  13059. /* ( */
  13060. ) && state.eat(
  13061. 63
  13062. /* ? */
  13063. )) {
  13064. var lookbehind = false;
  13065. if (this.options.ecmaVersion >= 9) {
  13066. lookbehind = state.eat(
  13067. 60
  13068. /* < */
  13069. );
  13070. }
  13071. if (state.eat(
  13072. 61
  13073. /* = */
  13074. ) || state.eat(
  13075. 33
  13076. /* ! */
  13077. )) {
  13078. this.regexp_disjunction(state);
  13079. if (!state.eat(
  13080. 41
  13081. /* ) */
  13082. )) {
  13083. state.raise("Unterminated group");
  13084. }
  13085. state.lastAssertionIsQuantifiable = !lookbehind;
  13086. return true;
  13087. }
  13088. }
  13089. state.pos = start2;
  13090. return false;
  13091. };
  13092. pp$1.regexp_eatQuantifier = function(state, noError) {
  13093. if (noError === void 0) noError = false;
  13094. if (this.regexp_eatQuantifierPrefix(state, noError)) {
  13095. state.eat(
  13096. 63
  13097. /* ? */
  13098. );
  13099. return true;
  13100. }
  13101. return false;
  13102. };
  13103. pp$1.regexp_eatQuantifierPrefix = function(state, noError) {
  13104. return state.eat(
  13105. 42
  13106. /* * */
  13107. ) || state.eat(
  13108. 43
  13109. /* + */
  13110. ) || state.eat(
  13111. 63
  13112. /* ? */
  13113. ) || this.regexp_eatBracedQuantifier(state, noError);
  13114. };
  13115. pp$1.regexp_eatBracedQuantifier = function(state, noError) {
  13116. var start2 = state.pos;
  13117. if (state.eat(
  13118. 123
  13119. /* { */
  13120. )) {
  13121. var min = 0, max = -1;
  13122. if (this.regexp_eatDecimalDigits(state)) {
  13123. min = state.lastIntValue;
  13124. if (state.eat(
  13125. 44
  13126. /* , */
  13127. ) && this.regexp_eatDecimalDigits(state)) {
  13128. max = state.lastIntValue;
  13129. }
  13130. if (state.eat(
  13131. 125
  13132. /* } */
  13133. )) {
  13134. if (max !== -1 && max < min && !noError) {
  13135. state.raise("numbers out of order in {} quantifier");
  13136. }
  13137. return true;
  13138. }
  13139. }
  13140. if (state.switchU && !noError) {
  13141. state.raise("Incomplete quantifier");
  13142. }
  13143. state.pos = start2;
  13144. }
  13145. return false;
  13146. };
  13147. pp$1.regexp_eatAtom = function(state) {
  13148. return this.regexp_eatPatternCharacters(state) || state.eat(
  13149. 46
  13150. /* . */
  13151. ) || this.regexp_eatReverseSolidusAtomEscape(state) || this.regexp_eatCharacterClass(state) || this.regexp_eatUncapturingGroup(state) || this.regexp_eatCapturingGroup(state);
  13152. };
  13153. pp$1.regexp_eatReverseSolidusAtomEscape = function(state) {
  13154. var start2 = state.pos;
  13155. if (state.eat(
  13156. 92
  13157. /* \ */
  13158. )) {
  13159. if (this.regexp_eatAtomEscape(state)) {
  13160. return true;
  13161. }
  13162. state.pos = start2;
  13163. }
  13164. return false;
  13165. };
  13166. pp$1.regexp_eatUncapturingGroup = function(state) {
  13167. var start2 = state.pos;
  13168. if (state.eat(
  13169. 40
  13170. /* ( */
  13171. )) {
  13172. if (state.eat(
  13173. 63
  13174. /* ? */
  13175. ) && state.eat(
  13176. 58
  13177. /* : */
  13178. )) {
  13179. this.regexp_disjunction(state);
  13180. if (state.eat(
  13181. 41
  13182. /* ) */
  13183. )) {
  13184. return true;
  13185. }
  13186. state.raise("Unterminated group");
  13187. }
  13188. state.pos = start2;
  13189. }
  13190. return false;
  13191. };
  13192. pp$1.regexp_eatCapturingGroup = function(state) {
  13193. if (state.eat(
  13194. 40
  13195. /* ( */
  13196. )) {
  13197. if (this.options.ecmaVersion >= 9) {
  13198. this.regexp_groupSpecifier(state);
  13199. } else if (state.current() === 63) {
  13200. state.raise("Invalid group");
  13201. }
  13202. this.regexp_disjunction(state);
  13203. if (state.eat(
  13204. 41
  13205. /* ) */
  13206. )) {
  13207. state.numCapturingParens += 1;
  13208. return true;
  13209. }
  13210. state.raise("Unterminated group");
  13211. }
  13212. return false;
  13213. };
  13214. pp$1.regexp_eatExtendedAtom = function(state) {
  13215. return state.eat(
  13216. 46
  13217. /* . */
  13218. ) || this.regexp_eatReverseSolidusAtomEscape(state) || this.regexp_eatCharacterClass(state) || this.regexp_eatUncapturingGroup(state) || this.regexp_eatCapturingGroup(state) || this.regexp_eatInvalidBracedQuantifier(state) || this.regexp_eatExtendedPatternCharacter(state);
  13219. };
  13220. pp$1.regexp_eatInvalidBracedQuantifier = function(state) {
  13221. if (this.regexp_eatBracedQuantifier(state, true)) {
  13222. state.raise("Nothing to repeat");
  13223. }
  13224. return false;
  13225. };
  13226. pp$1.regexp_eatSyntaxCharacter = function(state) {
  13227. var ch = state.current();
  13228. if (isSyntaxCharacter(ch)) {
  13229. state.lastIntValue = ch;
  13230. state.advance();
  13231. return true;
  13232. }
  13233. return false;
  13234. };
  13235. function isSyntaxCharacter(ch) {
  13236. return ch === 36 || ch >= 40 && ch <= 43 || ch === 46 || ch === 63 || ch >= 91 && ch <= 94 || ch >= 123 && ch <= 125;
  13237. }
  13238. pp$1.regexp_eatPatternCharacters = function(state) {
  13239. var start2 = state.pos;
  13240. var ch = 0;
  13241. while ((ch = state.current()) !== -1 && !isSyntaxCharacter(ch)) {
  13242. state.advance();
  13243. }
  13244. return state.pos !== start2;
  13245. };
  13246. pp$1.regexp_eatExtendedPatternCharacter = function(state) {
  13247. var ch = state.current();
  13248. if (ch !== -1 && ch !== 36 && !(ch >= 40 && ch <= 43) && ch !== 46 && ch !== 63 && ch !== 91 && ch !== 94 && ch !== 124) {
  13249. state.advance();
  13250. return true;
  13251. }
  13252. return false;
  13253. };
  13254. pp$1.regexp_groupSpecifier = function(state) {
  13255. if (state.eat(
  13256. 63
  13257. /* ? */
  13258. )) {
  13259. if (!this.regexp_eatGroupName(state)) {
  13260. state.raise("Invalid group");
  13261. }
  13262. var trackDisjunction = this.options.ecmaVersion >= 16;
  13263. var known = state.groupNames[state.lastStringValue];
  13264. if (known) {
  13265. if (trackDisjunction) {
  13266. for (var i = 0, list3 = known; i < list3.length; i += 1) {
  13267. var altID = list3[i];
  13268. if (!altID.separatedFrom(state.branchID)) {
  13269. state.raise("Duplicate capture group name");
  13270. }
  13271. }
  13272. } else {
  13273. state.raise("Duplicate capture group name");
  13274. }
  13275. }
  13276. if (trackDisjunction) {
  13277. (known || (state.groupNames[state.lastStringValue] = [])).push(state.branchID);
  13278. } else {
  13279. state.groupNames[state.lastStringValue] = true;
  13280. }
  13281. }
  13282. };
  13283. pp$1.regexp_eatGroupName = function(state) {
  13284. state.lastStringValue = "";
  13285. if (state.eat(
  13286. 60
  13287. /* < */
  13288. )) {
  13289. if (this.regexp_eatRegExpIdentifierName(state) && state.eat(
  13290. 62
  13291. /* > */
  13292. )) {
  13293. return true;
  13294. }
  13295. state.raise("Invalid capture group name");
  13296. }
  13297. return false;
  13298. };
  13299. pp$1.regexp_eatRegExpIdentifierName = function(state) {
  13300. state.lastStringValue = "";
  13301. if (this.regexp_eatRegExpIdentifierStart(state)) {
  13302. state.lastStringValue += codePointToString(state.lastIntValue);
  13303. while (this.regexp_eatRegExpIdentifierPart(state)) {
  13304. state.lastStringValue += codePointToString(state.lastIntValue);
  13305. }
  13306. return true;
  13307. }
  13308. return false;
  13309. };
  13310. pp$1.regexp_eatRegExpIdentifierStart = function(state) {
  13311. var start2 = state.pos;
  13312. var forceU = this.options.ecmaVersion >= 11;
  13313. var ch = state.current(forceU);
  13314. state.advance(forceU);
  13315. if (ch === 92 && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) {
  13316. ch = state.lastIntValue;
  13317. }
  13318. if (isRegExpIdentifierStart(ch)) {
  13319. state.lastIntValue = ch;
  13320. return true;
  13321. }
  13322. state.pos = start2;
  13323. return false;
  13324. };
  13325. function isRegExpIdentifierStart(ch) {
  13326. return isIdentifierStart(ch, true) || ch === 36 || ch === 95;
  13327. }
  13328. pp$1.regexp_eatRegExpIdentifierPart = function(state) {
  13329. var start2 = state.pos;
  13330. var forceU = this.options.ecmaVersion >= 11;
  13331. var ch = state.current(forceU);
  13332. state.advance(forceU);
  13333. if (ch === 92 && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) {
  13334. ch = state.lastIntValue;
  13335. }
  13336. if (isRegExpIdentifierPart(ch)) {
  13337. state.lastIntValue = ch;
  13338. return true;
  13339. }
  13340. state.pos = start2;
  13341. return false;
  13342. };
  13343. function isRegExpIdentifierPart(ch) {
  13344. return isIdentifierChar(ch, true) || ch === 36 || ch === 95 || ch === 8204 || ch === 8205;
  13345. }
  13346. pp$1.regexp_eatAtomEscape = function(state) {
  13347. if (this.regexp_eatBackReference(state) || this.regexp_eatCharacterClassEscape(state) || this.regexp_eatCharacterEscape(state) || state.switchN && this.regexp_eatKGroupName(state)) {
  13348. return true;
  13349. }
  13350. if (state.switchU) {
  13351. if (state.current() === 99) {
  13352. state.raise("Invalid unicode escape");
  13353. }
  13354. state.raise("Invalid escape");
  13355. }
  13356. return false;
  13357. };
  13358. pp$1.regexp_eatBackReference = function(state) {
  13359. var start2 = state.pos;
  13360. if (this.regexp_eatDecimalEscape(state)) {
  13361. var n = state.lastIntValue;
  13362. if (state.switchU) {
  13363. if (n > state.maxBackReference) {
  13364. state.maxBackReference = n;
  13365. }
  13366. return true;
  13367. }
  13368. if (n <= state.numCapturingParens) {
  13369. return true;
  13370. }
  13371. state.pos = start2;
  13372. }
  13373. return false;
  13374. };
  13375. pp$1.regexp_eatKGroupName = function(state) {
  13376. if (state.eat(
  13377. 107
  13378. /* k */
  13379. )) {
  13380. if (this.regexp_eatGroupName(state)) {
  13381. state.backReferenceNames.push(state.lastStringValue);
  13382. return true;
  13383. }
  13384. state.raise("Invalid named reference");
  13385. }
  13386. return false;
  13387. };
  13388. pp$1.regexp_eatCharacterEscape = function(state) {
  13389. return this.regexp_eatControlEscape(state) || this.regexp_eatCControlLetter(state) || this.regexp_eatZero(state) || this.regexp_eatHexEscapeSequence(state) || this.regexp_eatRegExpUnicodeEscapeSequence(state, false) || !state.switchU && this.regexp_eatLegacyOctalEscapeSequence(state) || this.regexp_eatIdentityEscape(state);
  13390. };
  13391. pp$1.regexp_eatCControlLetter = function(state) {
  13392. var start2 = state.pos;
  13393. if (state.eat(
  13394. 99
  13395. /* c */
  13396. )) {
  13397. if (this.regexp_eatControlLetter(state)) {
  13398. return true;
  13399. }
  13400. state.pos = start2;
  13401. }
  13402. return false;
  13403. };
  13404. pp$1.regexp_eatZero = function(state) {
  13405. if (state.current() === 48 && !isDecimalDigit(state.lookahead())) {
  13406. state.lastIntValue = 0;
  13407. state.advance();
  13408. return true;
  13409. }
  13410. return false;
  13411. };
  13412. pp$1.regexp_eatControlEscape = function(state) {
  13413. var ch = state.current();
  13414. if (ch === 116) {
  13415. state.lastIntValue = 9;
  13416. state.advance();
  13417. return true;
  13418. }
  13419. if (ch === 110) {
  13420. state.lastIntValue = 10;
  13421. state.advance();
  13422. return true;
  13423. }
  13424. if (ch === 118) {
  13425. state.lastIntValue = 11;
  13426. state.advance();
  13427. return true;
  13428. }
  13429. if (ch === 102) {
  13430. state.lastIntValue = 12;
  13431. state.advance();
  13432. return true;
  13433. }
  13434. if (ch === 114) {
  13435. state.lastIntValue = 13;
  13436. state.advance();
  13437. return true;
  13438. }
  13439. return false;
  13440. };
  13441. pp$1.regexp_eatControlLetter = function(state) {
  13442. var ch = state.current();
  13443. if (isControlLetter(ch)) {
  13444. state.lastIntValue = ch % 32;
  13445. state.advance();
  13446. return true;
  13447. }
  13448. return false;
  13449. };
  13450. function isControlLetter(ch) {
  13451. return ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122;
  13452. }
  13453. pp$1.regexp_eatRegExpUnicodeEscapeSequence = function(state, forceU) {
  13454. if (forceU === void 0) forceU = false;
  13455. var start2 = state.pos;
  13456. var switchU = forceU || state.switchU;
  13457. if (state.eat(
  13458. 117
  13459. /* u */
  13460. )) {
  13461. if (this.regexp_eatFixedHexDigits(state, 4)) {
  13462. var lead = state.lastIntValue;
  13463. if (switchU && lead >= 55296 && lead <= 56319) {
  13464. var leadSurrogateEnd = state.pos;
  13465. if (state.eat(
  13466. 92
  13467. /* \ */
  13468. ) && state.eat(
  13469. 117
  13470. /* u */
  13471. ) && this.regexp_eatFixedHexDigits(state, 4)) {
  13472. var trail = state.lastIntValue;
  13473. if (trail >= 56320 && trail <= 57343) {
  13474. state.lastIntValue = (lead - 55296) * 1024 + (trail - 56320) + 65536;
  13475. return true;
  13476. }
  13477. }
  13478. state.pos = leadSurrogateEnd;
  13479. state.lastIntValue = lead;
  13480. }
  13481. return true;
  13482. }
  13483. if (switchU && state.eat(
  13484. 123
  13485. /* { */
  13486. ) && this.regexp_eatHexDigits(state) && state.eat(
  13487. 125
  13488. /* } */
  13489. ) && isValidUnicode(state.lastIntValue)) {
  13490. return true;
  13491. }
  13492. if (switchU) {
  13493. state.raise("Invalid unicode escape");
  13494. }
  13495. state.pos = start2;
  13496. }
  13497. return false;
  13498. };
  13499. function isValidUnicode(ch) {
  13500. return ch >= 0 && ch <= 1114111;
  13501. }
  13502. pp$1.regexp_eatIdentityEscape = function(state) {
  13503. if (state.switchU) {
  13504. if (this.regexp_eatSyntaxCharacter(state)) {
  13505. return true;
  13506. }
  13507. if (state.eat(
  13508. 47
  13509. /* / */
  13510. )) {
  13511. state.lastIntValue = 47;
  13512. return true;
  13513. }
  13514. return false;
  13515. }
  13516. var ch = state.current();
  13517. if (ch !== 99 && (!state.switchN || ch !== 107)) {
  13518. state.lastIntValue = ch;
  13519. state.advance();
  13520. return true;
  13521. }
  13522. return false;
  13523. };
  13524. pp$1.regexp_eatDecimalEscape = function(state) {
  13525. state.lastIntValue = 0;
  13526. var ch = state.current();
  13527. if (ch >= 49 && ch <= 57) {
  13528. do {
  13529. state.lastIntValue = 10 * state.lastIntValue + (ch - 48);
  13530. state.advance();
  13531. } while ((ch = state.current()) >= 48 && ch <= 57);
  13532. return true;
  13533. }
  13534. return false;
  13535. };
  13536. var CharSetNone = 0;
  13537. var CharSetOk = 1;
  13538. var CharSetString = 2;
  13539. pp$1.regexp_eatCharacterClassEscape = function(state) {
  13540. var ch = state.current();
  13541. if (isCharacterClassEscape(ch)) {
  13542. state.lastIntValue = -1;
  13543. state.advance();
  13544. return CharSetOk;
  13545. }
  13546. var negate = false;
  13547. if (state.switchU && this.options.ecmaVersion >= 9 && ((negate = ch === 80) || ch === 112)) {
  13548. state.lastIntValue = -1;
  13549. state.advance();
  13550. var result;
  13551. if (state.eat(
  13552. 123
  13553. /* { */
  13554. ) && (result = this.regexp_eatUnicodePropertyValueExpression(state)) && state.eat(
  13555. 125
  13556. /* } */
  13557. )) {
  13558. if (negate && result === CharSetString) {
  13559. state.raise("Invalid property name");
  13560. }
  13561. return result;
  13562. }
  13563. state.raise("Invalid property name");
  13564. }
  13565. return CharSetNone;
  13566. };
  13567. function isCharacterClassEscape(ch) {
  13568. return ch === 100 || ch === 68 || ch === 115 || ch === 83 || ch === 119 || ch === 87;
  13569. }
  13570. pp$1.regexp_eatUnicodePropertyValueExpression = function(state) {
  13571. var start2 = state.pos;
  13572. if (this.regexp_eatUnicodePropertyName(state) && state.eat(
  13573. 61
  13574. /* = */
  13575. )) {
  13576. var name2 = state.lastStringValue;
  13577. if (this.regexp_eatUnicodePropertyValue(state)) {
  13578. var value = state.lastStringValue;
  13579. this.regexp_validateUnicodePropertyNameAndValue(state, name2, value);
  13580. return CharSetOk;
  13581. }
  13582. }
  13583. state.pos = start2;
  13584. if (this.regexp_eatLoneUnicodePropertyNameOrValue(state)) {
  13585. var nameOrValue = state.lastStringValue;
  13586. return this.regexp_validateUnicodePropertyNameOrValue(state, nameOrValue);
  13587. }
  13588. return CharSetNone;
  13589. };
  13590. pp$1.regexp_validateUnicodePropertyNameAndValue = function(state, name2, value) {
  13591. if (!hasOwn(state.unicodeProperties.nonBinary, name2)) {
  13592. state.raise("Invalid property name");
  13593. }
  13594. if (!state.unicodeProperties.nonBinary[name2].test(value)) {
  13595. state.raise("Invalid property value");
  13596. }
  13597. };
  13598. pp$1.regexp_validateUnicodePropertyNameOrValue = function(state, nameOrValue) {
  13599. if (state.unicodeProperties.binary.test(nameOrValue)) {
  13600. return CharSetOk;
  13601. }
  13602. if (state.switchV && state.unicodeProperties.binaryOfStrings.test(nameOrValue)) {
  13603. return CharSetString;
  13604. }
  13605. state.raise("Invalid property name");
  13606. };
  13607. pp$1.regexp_eatUnicodePropertyName = function(state) {
  13608. var ch = 0;
  13609. state.lastStringValue = "";
  13610. while (isUnicodePropertyNameCharacter(ch = state.current())) {
  13611. state.lastStringValue += codePointToString(ch);
  13612. state.advance();
  13613. }
  13614. return state.lastStringValue !== "";
  13615. };
  13616. function isUnicodePropertyNameCharacter(ch) {
  13617. return isControlLetter(ch) || ch === 95;
  13618. }
  13619. pp$1.regexp_eatUnicodePropertyValue = function(state) {
  13620. var ch = 0;
  13621. state.lastStringValue = "";
  13622. while (isUnicodePropertyValueCharacter(ch = state.current())) {
  13623. state.lastStringValue += codePointToString(ch);
  13624. state.advance();
  13625. }
  13626. return state.lastStringValue !== "";
  13627. };
  13628. function isUnicodePropertyValueCharacter(ch) {
  13629. return isUnicodePropertyNameCharacter(ch) || isDecimalDigit(ch);
  13630. }
  13631. pp$1.regexp_eatLoneUnicodePropertyNameOrValue = function(state) {
  13632. return this.regexp_eatUnicodePropertyValue(state);
  13633. };
  13634. pp$1.regexp_eatCharacterClass = function(state) {
  13635. if (state.eat(
  13636. 91
  13637. /* [ */
  13638. )) {
  13639. var negate = state.eat(
  13640. 94
  13641. /* ^ */
  13642. );
  13643. var result = this.regexp_classContents(state);
  13644. if (!state.eat(
  13645. 93
  13646. /* ] */
  13647. )) {
  13648. state.raise("Unterminated character class");
  13649. }
  13650. if (negate && result === CharSetString) {
  13651. state.raise("Negated character class may contain strings");
  13652. }
  13653. return true;
  13654. }
  13655. return false;
  13656. };
  13657. pp$1.regexp_classContents = function(state) {
  13658. if (state.current() === 93) {
  13659. return CharSetOk;
  13660. }
  13661. if (state.switchV) {
  13662. return this.regexp_classSetExpression(state);
  13663. }
  13664. this.regexp_nonEmptyClassRanges(state);
  13665. return CharSetOk;
  13666. };
  13667. pp$1.regexp_nonEmptyClassRanges = function(state) {
  13668. while (this.regexp_eatClassAtom(state)) {
  13669. var left = state.lastIntValue;
  13670. if (state.eat(
  13671. 45
  13672. /* - */
  13673. ) && this.regexp_eatClassAtom(state)) {
  13674. var right = state.lastIntValue;
  13675. if (state.switchU && (left === -1 || right === -1)) {
  13676. state.raise("Invalid character class");
  13677. }
  13678. if (left !== -1 && right !== -1 && left > right) {
  13679. state.raise("Range out of order in character class");
  13680. }
  13681. }
  13682. }
  13683. };
  13684. pp$1.regexp_eatClassAtom = function(state) {
  13685. var start2 = state.pos;
  13686. if (state.eat(
  13687. 92
  13688. /* \ */
  13689. )) {
  13690. if (this.regexp_eatClassEscape(state)) {
  13691. return true;
  13692. }
  13693. if (state.switchU) {
  13694. var ch$1 = state.current();
  13695. if (ch$1 === 99 || isOctalDigit(ch$1)) {
  13696. state.raise("Invalid class escape");
  13697. }
  13698. state.raise("Invalid escape");
  13699. }
  13700. state.pos = start2;
  13701. }
  13702. var ch = state.current();
  13703. if (ch !== 93) {
  13704. state.lastIntValue = ch;
  13705. state.advance();
  13706. return true;
  13707. }
  13708. return false;
  13709. };
  13710. pp$1.regexp_eatClassEscape = function(state) {
  13711. var start2 = state.pos;
  13712. if (state.eat(
  13713. 98
  13714. /* b */
  13715. )) {
  13716. state.lastIntValue = 8;
  13717. return true;
  13718. }
  13719. if (state.switchU && state.eat(
  13720. 45
  13721. /* - */
  13722. )) {
  13723. state.lastIntValue = 45;
  13724. return true;
  13725. }
  13726. if (!state.switchU && state.eat(
  13727. 99
  13728. /* c */
  13729. )) {
  13730. if (this.regexp_eatClassControlLetter(state)) {
  13731. return true;
  13732. }
  13733. state.pos = start2;
  13734. }
  13735. return this.regexp_eatCharacterClassEscape(state) || this.regexp_eatCharacterEscape(state);
  13736. };
  13737. pp$1.regexp_classSetExpression = function(state) {
  13738. var result = CharSetOk, subResult;
  13739. if (this.regexp_eatClassSetRange(state)) ;
  13740. else if (subResult = this.regexp_eatClassSetOperand(state)) {
  13741. if (subResult === CharSetString) {
  13742. result = CharSetString;
  13743. }
  13744. var start2 = state.pos;
  13745. while (state.eatChars(
  13746. [38, 38]
  13747. /* && */
  13748. )) {
  13749. if (state.current() !== 38 && (subResult = this.regexp_eatClassSetOperand(state))) {
  13750. if (subResult !== CharSetString) {
  13751. result = CharSetOk;
  13752. }
  13753. continue;
  13754. }
  13755. state.raise("Invalid character in character class");
  13756. }
  13757. if (start2 !== state.pos) {
  13758. return result;
  13759. }
  13760. while (state.eatChars(
  13761. [45, 45]
  13762. /* -- */
  13763. )) {
  13764. if (this.regexp_eatClassSetOperand(state)) {
  13765. continue;
  13766. }
  13767. state.raise("Invalid character in character class");
  13768. }
  13769. if (start2 !== state.pos) {
  13770. return result;
  13771. }
  13772. } else {
  13773. state.raise("Invalid character in character class");
  13774. }
  13775. for (; ; ) {
  13776. if (this.regexp_eatClassSetRange(state)) {
  13777. continue;
  13778. }
  13779. subResult = this.regexp_eatClassSetOperand(state);
  13780. if (!subResult) {
  13781. return result;
  13782. }
  13783. if (subResult === CharSetString) {
  13784. result = CharSetString;
  13785. }
  13786. }
  13787. };
  13788. pp$1.regexp_eatClassSetRange = function(state) {
  13789. var start2 = state.pos;
  13790. if (this.regexp_eatClassSetCharacter(state)) {
  13791. var left = state.lastIntValue;
  13792. if (state.eat(
  13793. 45
  13794. /* - */
  13795. ) && this.regexp_eatClassSetCharacter(state)) {
  13796. var right = state.lastIntValue;
  13797. if (left !== -1 && right !== -1 && left > right) {
  13798. state.raise("Range out of order in character class");
  13799. }
  13800. return true;
  13801. }
  13802. state.pos = start2;
  13803. }
  13804. return false;
  13805. };
  13806. pp$1.regexp_eatClassSetOperand = function(state) {
  13807. if (this.regexp_eatClassSetCharacter(state)) {
  13808. return CharSetOk;
  13809. }
  13810. return this.regexp_eatClassStringDisjunction(state) || this.regexp_eatNestedClass(state);
  13811. };
  13812. pp$1.regexp_eatNestedClass = function(state) {
  13813. var start2 = state.pos;
  13814. if (state.eat(
  13815. 91
  13816. /* [ */
  13817. )) {
  13818. var negate = state.eat(
  13819. 94
  13820. /* ^ */
  13821. );
  13822. var result = this.regexp_classContents(state);
  13823. if (state.eat(
  13824. 93
  13825. /* ] */
  13826. )) {
  13827. if (negate && result === CharSetString) {
  13828. state.raise("Negated character class may contain strings");
  13829. }
  13830. return result;
  13831. }
  13832. state.pos = start2;
  13833. }
  13834. if (state.eat(
  13835. 92
  13836. /* \ */
  13837. )) {
  13838. var result$1 = this.regexp_eatCharacterClassEscape(state);
  13839. if (result$1) {
  13840. return result$1;
  13841. }
  13842. state.pos = start2;
  13843. }
  13844. return null;
  13845. };
  13846. pp$1.regexp_eatClassStringDisjunction = function(state) {
  13847. var start2 = state.pos;
  13848. if (state.eatChars(
  13849. [92, 113]
  13850. /* \q */
  13851. )) {
  13852. if (state.eat(
  13853. 123
  13854. /* { */
  13855. )) {
  13856. var result = this.regexp_classStringDisjunctionContents(state);
  13857. if (state.eat(
  13858. 125
  13859. /* } */
  13860. )) {
  13861. return result;
  13862. }
  13863. } else {
  13864. state.raise("Invalid escape");
  13865. }
  13866. state.pos = start2;
  13867. }
  13868. return null;
  13869. };
  13870. pp$1.regexp_classStringDisjunctionContents = function(state) {
  13871. var result = this.regexp_classString(state);
  13872. while (state.eat(
  13873. 124
  13874. /* | */
  13875. )) {
  13876. if (this.regexp_classString(state) === CharSetString) {
  13877. result = CharSetString;
  13878. }
  13879. }
  13880. return result;
  13881. };
  13882. pp$1.regexp_classString = function(state) {
  13883. var count = 0;
  13884. while (this.regexp_eatClassSetCharacter(state)) {
  13885. count++;
  13886. }
  13887. return count === 1 ? CharSetOk : CharSetString;
  13888. };
  13889. pp$1.regexp_eatClassSetCharacter = function(state) {
  13890. var start2 = state.pos;
  13891. if (state.eat(
  13892. 92
  13893. /* \ */
  13894. )) {
  13895. if (this.regexp_eatCharacterEscape(state) || this.regexp_eatClassSetReservedPunctuator(state)) {
  13896. return true;
  13897. }
  13898. if (state.eat(
  13899. 98
  13900. /* b */
  13901. )) {
  13902. state.lastIntValue = 8;
  13903. return true;
  13904. }
  13905. state.pos = start2;
  13906. return false;
  13907. }
  13908. var ch = state.current();
  13909. if (ch < 0 || ch === state.lookahead() && isClassSetReservedDoublePunctuatorCharacter(ch)) {
  13910. return false;
  13911. }
  13912. if (isClassSetSyntaxCharacter(ch)) {
  13913. return false;
  13914. }
  13915. state.advance();
  13916. state.lastIntValue = ch;
  13917. return true;
  13918. };
  13919. function isClassSetReservedDoublePunctuatorCharacter(ch) {
  13920. return ch === 33 || ch >= 35 && ch <= 38 || ch >= 42 && ch <= 44 || ch === 46 || ch >= 58 && ch <= 64 || ch === 94 || ch === 96 || ch === 126;
  13921. }
  13922. function isClassSetSyntaxCharacter(ch) {
  13923. return ch === 40 || ch === 41 || ch === 45 || ch === 47 || ch >= 91 && ch <= 93 || ch >= 123 && ch <= 125;
  13924. }
  13925. pp$1.regexp_eatClassSetReservedPunctuator = function(state) {
  13926. var ch = state.current();
  13927. if (isClassSetReservedPunctuator(ch)) {
  13928. state.lastIntValue = ch;
  13929. state.advance();
  13930. return true;
  13931. }
  13932. return false;
  13933. };
  13934. function isClassSetReservedPunctuator(ch) {
  13935. return ch === 33 || ch === 35 || ch === 37 || ch === 38 || ch === 44 || ch === 45 || ch >= 58 && ch <= 62 || ch === 64 || ch === 96 || ch === 126;
  13936. }
  13937. pp$1.regexp_eatClassControlLetter = function(state) {
  13938. var ch = state.current();
  13939. if (isDecimalDigit(ch) || ch === 95) {
  13940. state.lastIntValue = ch % 32;
  13941. state.advance();
  13942. return true;
  13943. }
  13944. return false;
  13945. };
  13946. pp$1.regexp_eatHexEscapeSequence = function(state) {
  13947. var start2 = state.pos;
  13948. if (state.eat(
  13949. 120
  13950. /* x */
  13951. )) {
  13952. if (this.regexp_eatFixedHexDigits(state, 2)) {
  13953. return true;
  13954. }
  13955. if (state.switchU) {
  13956. state.raise("Invalid escape");
  13957. }
  13958. state.pos = start2;
  13959. }
  13960. return false;
  13961. };
  13962. pp$1.regexp_eatDecimalDigits = function(state) {
  13963. var start2 = state.pos;
  13964. var ch = 0;
  13965. state.lastIntValue = 0;
  13966. while (isDecimalDigit(ch = state.current())) {
  13967. state.lastIntValue = 10 * state.lastIntValue + (ch - 48);
  13968. state.advance();
  13969. }
  13970. return state.pos !== start2;
  13971. };
  13972. function isDecimalDigit(ch) {
  13973. return ch >= 48 && ch <= 57;
  13974. }
  13975. pp$1.regexp_eatHexDigits = function(state) {
  13976. var start2 = state.pos;
  13977. var ch = 0;
  13978. state.lastIntValue = 0;
  13979. while (isHexDigit(ch = state.current())) {
  13980. state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch);
  13981. state.advance();
  13982. }
  13983. return state.pos !== start2;
  13984. };
  13985. function isHexDigit(ch) {
  13986. return ch >= 48 && ch <= 57 || ch >= 65 && ch <= 70 || ch >= 97 && ch <= 102;
  13987. }
  13988. function hexToInt(ch) {
  13989. if (ch >= 65 && ch <= 70) {
  13990. return 10 + (ch - 65);
  13991. }
  13992. if (ch >= 97 && ch <= 102) {
  13993. return 10 + (ch - 97);
  13994. }
  13995. return ch - 48;
  13996. }
  13997. pp$1.regexp_eatLegacyOctalEscapeSequence = function(state) {
  13998. if (this.regexp_eatOctalDigit(state)) {
  13999. var n1 = state.lastIntValue;
  14000. if (this.regexp_eatOctalDigit(state)) {
  14001. var n2 = state.lastIntValue;
  14002. if (n1 <= 3 && this.regexp_eatOctalDigit(state)) {
  14003. state.lastIntValue = n1 * 64 + n2 * 8 + state.lastIntValue;
  14004. } else {
  14005. state.lastIntValue = n1 * 8 + n2;
  14006. }
  14007. } else {
  14008. state.lastIntValue = n1;
  14009. }
  14010. return true;
  14011. }
  14012. return false;
  14013. };
  14014. pp$1.regexp_eatOctalDigit = function(state) {
  14015. var ch = state.current();
  14016. if (isOctalDigit(ch)) {
  14017. state.lastIntValue = ch - 48;
  14018. state.advance();
  14019. return true;
  14020. }
  14021. state.lastIntValue = 0;
  14022. return false;
  14023. };
  14024. function isOctalDigit(ch) {
  14025. return ch >= 48 && ch <= 55;
  14026. }
  14027. pp$1.regexp_eatFixedHexDigits = function(state, length) {
  14028. var start2 = state.pos;
  14029. state.lastIntValue = 0;
  14030. for (var i = 0; i < length; ++i) {
  14031. var ch = state.current();
  14032. if (!isHexDigit(ch)) {
  14033. state.pos = start2;
  14034. return false;
  14035. }
  14036. state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch);
  14037. state.advance();
  14038. }
  14039. return true;
  14040. };
  14041. var Token = function Token2(p) {
  14042. this.type = p.type;
  14043. this.value = p.value;
  14044. this.start = p.start;
  14045. this.end = p.end;
  14046. if (p.options.locations) {
  14047. this.loc = new SourceLocation(p, p.startLoc, p.endLoc);
  14048. }
  14049. if (p.options.ranges) {
  14050. this.range = [p.start, p.end];
  14051. }
  14052. };
  14053. var pp = Parser.prototype;
  14054. pp.next = function(ignoreEscapeSequenceInKeyword) {
  14055. if (!ignoreEscapeSequenceInKeyword && this.type.keyword && this.containsEsc) {
  14056. this.raiseRecoverable(this.start, "Escape sequence in keyword " + this.type.keyword);
  14057. }
  14058. if (this.options.onToken) {
  14059. this.options.onToken(new Token(this));
  14060. }
  14061. this.lastTokEnd = this.end;
  14062. this.lastTokStart = this.start;
  14063. this.lastTokEndLoc = this.endLoc;
  14064. this.lastTokStartLoc = this.startLoc;
  14065. this.nextToken();
  14066. };
  14067. pp.getToken = function() {
  14068. this.next();
  14069. return new Token(this);
  14070. };
  14071. if (typeof Symbol !== "undefined") {
  14072. pp[Symbol.iterator] = function() {
  14073. var this$1$1 = this;
  14074. return {
  14075. next: function() {
  14076. var token = this$1$1.getToken();
  14077. return {
  14078. done: token.type === types$1.eof,
  14079. value: token
  14080. };
  14081. }
  14082. };
  14083. };
  14084. }
  14085. pp.nextToken = function() {
  14086. var curContext = this.curContext();
  14087. if (!curContext || !curContext.preserveSpace) {
  14088. this.skipSpace();
  14089. }
  14090. this.start = this.pos;
  14091. if (this.options.locations) {
  14092. this.startLoc = this.curPosition();
  14093. }
  14094. if (this.pos >= this.input.length) {
  14095. return this.finishToken(types$1.eof);
  14096. }
  14097. if (curContext.override) {
  14098. return curContext.override(this);
  14099. } else {
  14100. this.readToken(this.fullCharCodeAtPos());
  14101. }
  14102. };
  14103. pp.readToken = function(code2) {
  14104. if (isIdentifierStart(code2, this.options.ecmaVersion >= 6) || code2 === 92) {
  14105. return this.readWord();
  14106. }
  14107. return this.getTokenFromCode(code2);
  14108. };
  14109. pp.fullCharCodeAtPos = function() {
  14110. var code2 = this.input.charCodeAt(this.pos);
  14111. if (code2 <= 55295 || code2 >= 56320) {
  14112. return code2;
  14113. }
  14114. var next = this.input.charCodeAt(this.pos + 1);
  14115. return next <= 56319 || next >= 57344 ? code2 : (code2 << 10) + next - 56613888;
  14116. };
  14117. pp.skipBlockComment = function() {
  14118. var startLoc = this.options.onComment && this.curPosition();
  14119. var start2 = this.pos, end = this.input.indexOf("*/", this.pos += 2);
  14120. if (end === -1) {
  14121. this.raise(this.pos - 2, "Unterminated comment");
  14122. }
  14123. this.pos = end + 2;
  14124. if (this.options.locations) {
  14125. for (var nextBreak = void 0, pos = start2; (nextBreak = nextLineBreak(this.input, pos, this.pos)) > -1; ) {
  14126. ++this.curLine;
  14127. pos = this.lineStart = nextBreak;
  14128. }
  14129. }
  14130. if (this.options.onComment) {
  14131. this.options.onComment(
  14132. true,
  14133. this.input.slice(start2 + 2, end),
  14134. start2,
  14135. this.pos,
  14136. startLoc,
  14137. this.curPosition()
  14138. );
  14139. }
  14140. };
  14141. pp.skipLineComment = function(startSkip) {
  14142. var start2 = this.pos;
  14143. var startLoc = this.options.onComment && this.curPosition();
  14144. var ch = this.input.charCodeAt(this.pos += startSkip);
  14145. while (this.pos < this.input.length && !isNewLine(ch)) {
  14146. ch = this.input.charCodeAt(++this.pos);
  14147. }
  14148. if (this.options.onComment) {
  14149. this.options.onComment(
  14150. false,
  14151. this.input.slice(start2 + startSkip, this.pos),
  14152. start2,
  14153. this.pos,
  14154. startLoc,
  14155. this.curPosition()
  14156. );
  14157. }
  14158. };
  14159. pp.skipSpace = function() {
  14160. loop: while (this.pos < this.input.length) {
  14161. var ch = this.input.charCodeAt(this.pos);
  14162. switch (ch) {
  14163. case 32:
  14164. case 160:
  14165. ++this.pos;
  14166. break;
  14167. case 13:
  14168. if (this.input.charCodeAt(this.pos + 1) === 10) {
  14169. ++this.pos;
  14170. }
  14171. case 10:
  14172. case 8232:
  14173. case 8233:
  14174. ++this.pos;
  14175. if (this.options.locations) {
  14176. ++this.curLine;
  14177. this.lineStart = this.pos;
  14178. }
  14179. break;
  14180. case 47:
  14181. switch (this.input.charCodeAt(this.pos + 1)) {
  14182. case 42:
  14183. this.skipBlockComment();
  14184. break;
  14185. case 47:
  14186. this.skipLineComment(2);
  14187. break;
  14188. default:
  14189. break loop;
  14190. }
  14191. break;
  14192. default:
  14193. if (ch > 8 && ch < 14 || ch >= 5760 && nonASCIIwhitespace.test(String.fromCharCode(ch))) {
  14194. ++this.pos;
  14195. } else {
  14196. break loop;
  14197. }
  14198. }
  14199. }
  14200. };
  14201. pp.finishToken = function(type, val) {
  14202. this.end = this.pos;
  14203. if (this.options.locations) {
  14204. this.endLoc = this.curPosition();
  14205. }
  14206. var prevType = this.type;
  14207. this.type = type;
  14208. this.value = val;
  14209. this.updateContext(prevType);
  14210. };
  14211. pp.readToken_dot = function() {
  14212. var next = this.input.charCodeAt(this.pos + 1);
  14213. if (next >= 48 && next <= 57) {
  14214. return this.readNumber(true);
  14215. }
  14216. var next2 = this.input.charCodeAt(this.pos + 2);
  14217. if (this.options.ecmaVersion >= 6 && next === 46 && next2 === 46) {
  14218. this.pos += 3;
  14219. return this.finishToken(types$1.ellipsis);
  14220. } else {
  14221. ++this.pos;
  14222. return this.finishToken(types$1.dot);
  14223. }
  14224. };
  14225. pp.readToken_slash = function() {
  14226. var next = this.input.charCodeAt(this.pos + 1);
  14227. if (this.exprAllowed) {
  14228. ++this.pos;
  14229. return this.readRegexp();
  14230. }
  14231. if (next === 61) {
  14232. return this.finishOp(types$1.assign, 2);
  14233. }
  14234. return this.finishOp(types$1.slash, 1);
  14235. };
  14236. pp.readToken_mult_modulo_exp = function(code2) {
  14237. var next = this.input.charCodeAt(this.pos + 1);
  14238. var size = 1;
  14239. var tokentype = code2 === 42 ? types$1.star : types$1.modulo;
  14240. if (this.options.ecmaVersion >= 7 && code2 === 42 && next === 42) {
  14241. ++size;
  14242. tokentype = types$1.starstar;
  14243. next = this.input.charCodeAt(this.pos + 2);
  14244. }
  14245. if (next === 61) {
  14246. return this.finishOp(types$1.assign, size + 1);
  14247. }
  14248. return this.finishOp(tokentype, size);
  14249. };
  14250. pp.readToken_pipe_amp = function(code2) {
  14251. var next = this.input.charCodeAt(this.pos + 1);
  14252. if (next === code2) {
  14253. if (this.options.ecmaVersion >= 12) {
  14254. var next2 = this.input.charCodeAt(this.pos + 2);
  14255. if (next2 === 61) {
  14256. return this.finishOp(types$1.assign, 3);
  14257. }
  14258. }
  14259. return this.finishOp(code2 === 124 ? types$1.logicalOR : types$1.logicalAND, 2);
  14260. }
  14261. if (next === 61) {
  14262. return this.finishOp(types$1.assign, 2);
  14263. }
  14264. return this.finishOp(code2 === 124 ? types$1.bitwiseOR : types$1.bitwiseAND, 1);
  14265. };
  14266. pp.readToken_caret = function() {
  14267. var next = this.input.charCodeAt(this.pos + 1);
  14268. if (next === 61) {
  14269. return this.finishOp(types$1.assign, 2);
  14270. }
  14271. return this.finishOp(types$1.bitwiseXOR, 1);
  14272. };
  14273. pp.readToken_plus_min = function(code2) {
  14274. var next = this.input.charCodeAt(this.pos + 1);
  14275. if (next === code2) {
  14276. if (next === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 && (this.lastTokEnd === 0 || lineBreak.test(this.input.slice(this.lastTokEnd, this.pos)))) {
  14277. this.skipLineComment(3);
  14278. this.skipSpace();
  14279. return this.nextToken();
  14280. }
  14281. return this.finishOp(types$1.incDec, 2);
  14282. }
  14283. if (next === 61) {
  14284. return this.finishOp(types$1.assign, 2);
  14285. }
  14286. return this.finishOp(types$1.plusMin, 1);
  14287. };
  14288. pp.readToken_lt_gt = function(code2) {
  14289. var next = this.input.charCodeAt(this.pos + 1);
  14290. var size = 1;
  14291. if (next === code2) {
  14292. size = code2 === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2;
  14293. if (this.input.charCodeAt(this.pos + size) === 61) {
  14294. return this.finishOp(types$1.assign, size + 1);
  14295. }
  14296. return this.finishOp(types$1.bitShift, size);
  14297. }
  14298. if (next === 33 && code2 === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 && this.input.charCodeAt(this.pos + 3) === 45) {
  14299. this.skipLineComment(4);
  14300. this.skipSpace();
  14301. return this.nextToken();
  14302. }
  14303. if (next === 61) {
  14304. size = 2;
  14305. }
  14306. return this.finishOp(types$1.relational, size);
  14307. };
  14308. pp.readToken_eq_excl = function(code2) {
  14309. var next = this.input.charCodeAt(this.pos + 1);
  14310. if (next === 61) {
  14311. return this.finishOp(types$1.equality, this.input.charCodeAt(this.pos + 2) === 61 ? 3 : 2);
  14312. }
  14313. if (code2 === 61 && next === 62 && this.options.ecmaVersion >= 6) {
  14314. this.pos += 2;
  14315. return this.finishToken(types$1.arrow);
  14316. }
  14317. return this.finishOp(code2 === 61 ? types$1.eq : types$1.prefix, 1);
  14318. };
  14319. pp.readToken_question = function() {
  14320. var ecmaVersion = this.options.ecmaVersion;
  14321. if (ecmaVersion >= 11) {
  14322. var next = this.input.charCodeAt(this.pos + 1);
  14323. if (next === 46) {
  14324. var next2 = this.input.charCodeAt(this.pos + 2);
  14325. if (next2 < 48 || next2 > 57) {
  14326. return this.finishOp(types$1.questionDot, 2);
  14327. }
  14328. }
  14329. if (next === 63) {
  14330. if (ecmaVersion >= 12) {
  14331. var next2$1 = this.input.charCodeAt(this.pos + 2);
  14332. if (next2$1 === 61) {
  14333. return this.finishOp(types$1.assign, 3);
  14334. }
  14335. }
  14336. return this.finishOp(types$1.coalesce, 2);
  14337. }
  14338. }
  14339. return this.finishOp(types$1.question, 1);
  14340. };
  14341. pp.readToken_numberSign = function() {
  14342. var ecmaVersion = this.options.ecmaVersion;
  14343. var code2 = 35;
  14344. if (ecmaVersion >= 13) {
  14345. ++this.pos;
  14346. code2 = this.fullCharCodeAtPos();
  14347. if (isIdentifierStart(code2, true) || code2 === 92) {
  14348. return this.finishToken(types$1.privateId, this.readWord1());
  14349. }
  14350. }
  14351. this.raise(this.pos, "Unexpected character '" + codePointToString(code2) + "'");
  14352. };
  14353. pp.getTokenFromCode = function(code2) {
  14354. switch (code2) {
  14355. case 46:
  14356. return this.readToken_dot();
  14357. case 40:
  14358. ++this.pos;
  14359. return this.finishToken(types$1.parenL);
  14360. case 41:
  14361. ++this.pos;
  14362. return this.finishToken(types$1.parenR);
  14363. case 59:
  14364. ++this.pos;
  14365. return this.finishToken(types$1.semi);
  14366. case 44:
  14367. ++this.pos;
  14368. return this.finishToken(types$1.comma);
  14369. case 91:
  14370. ++this.pos;
  14371. return this.finishToken(types$1.bracketL);
  14372. case 93:
  14373. ++this.pos;
  14374. return this.finishToken(types$1.bracketR);
  14375. case 123:
  14376. ++this.pos;
  14377. return this.finishToken(types$1.braceL);
  14378. case 125:
  14379. ++this.pos;
  14380. return this.finishToken(types$1.braceR);
  14381. case 58:
  14382. ++this.pos;
  14383. return this.finishToken(types$1.colon);
  14384. case 96:
  14385. if (this.options.ecmaVersion < 6) {
  14386. break;
  14387. }
  14388. ++this.pos;
  14389. return this.finishToken(types$1.backQuote);
  14390. case 48:
  14391. var next = this.input.charCodeAt(this.pos + 1);
  14392. if (next === 120 || next === 88) {
  14393. return this.readRadixNumber(16);
  14394. }
  14395. if (this.options.ecmaVersion >= 6) {
  14396. if (next === 111 || next === 79) {
  14397. return this.readRadixNumber(8);
  14398. }
  14399. if (next === 98 || next === 66) {
  14400. return this.readRadixNumber(2);
  14401. }
  14402. }
  14403. case 49:
  14404. case 50:
  14405. case 51:
  14406. case 52:
  14407. case 53:
  14408. case 54:
  14409. case 55:
  14410. case 56:
  14411. case 57:
  14412. return this.readNumber(false);
  14413. case 34:
  14414. case 39:
  14415. return this.readString(code2);
  14416. case 47:
  14417. return this.readToken_slash();
  14418. case 37:
  14419. case 42:
  14420. return this.readToken_mult_modulo_exp(code2);
  14421. case 124:
  14422. case 38:
  14423. return this.readToken_pipe_amp(code2);
  14424. case 94:
  14425. return this.readToken_caret();
  14426. case 43:
  14427. case 45:
  14428. return this.readToken_plus_min(code2);
  14429. case 60:
  14430. case 62:
  14431. return this.readToken_lt_gt(code2);
  14432. case 61:
  14433. case 33:
  14434. return this.readToken_eq_excl(code2);
  14435. case 63:
  14436. return this.readToken_question();
  14437. case 126:
  14438. return this.finishOp(types$1.prefix, 1);
  14439. case 35:
  14440. return this.readToken_numberSign();
  14441. }
  14442. this.raise(this.pos, "Unexpected character '" + codePointToString(code2) + "'");
  14443. };
  14444. pp.finishOp = function(type, size) {
  14445. var str = this.input.slice(this.pos, this.pos + size);
  14446. this.pos += size;
  14447. return this.finishToken(type, str);
  14448. };
  14449. pp.readRegexp = function() {
  14450. var escaped, inClass, start2 = this.pos;
  14451. for (; ; ) {
  14452. if (this.pos >= this.input.length) {
  14453. this.raise(start2, "Unterminated regular expression");
  14454. }
  14455. var ch = this.input.charAt(this.pos);
  14456. if (lineBreak.test(ch)) {
  14457. this.raise(start2, "Unterminated regular expression");
  14458. }
  14459. if (!escaped) {
  14460. if (ch === "[") {
  14461. inClass = true;
  14462. } else if (ch === "]" && inClass) {
  14463. inClass = false;
  14464. } else if (ch === "/" && !inClass) {
  14465. break;
  14466. }
  14467. escaped = ch === "\\";
  14468. } else {
  14469. escaped = false;
  14470. }
  14471. ++this.pos;
  14472. }
  14473. var pattern = this.input.slice(start2, this.pos);
  14474. ++this.pos;
  14475. var flagsStart = this.pos;
  14476. var flags = this.readWord1();
  14477. if (this.containsEsc) {
  14478. this.unexpected(flagsStart);
  14479. }
  14480. var state = this.regexpState || (this.regexpState = new RegExpValidationState(this));
  14481. state.reset(start2, pattern, flags);
  14482. this.validateRegExpFlags(state);
  14483. this.validateRegExpPattern(state);
  14484. var value = null;
  14485. try {
  14486. value = new RegExp(pattern, flags);
  14487. } catch (e) {
  14488. }
  14489. return this.finishToken(types$1.regexp, { pattern, flags, value });
  14490. };
  14491. pp.readInt = function(radix, len, maybeLegacyOctalNumericLiteral) {
  14492. var allowSeparators = this.options.ecmaVersion >= 12 && len === void 0;
  14493. var isLegacyOctalNumericLiteral = maybeLegacyOctalNumericLiteral && this.input.charCodeAt(this.pos) === 48;
  14494. var start2 = this.pos, total = 0, lastCode = 0;
  14495. for (var i = 0, e = len == null ? Infinity : len; i < e; ++i, ++this.pos) {
  14496. var code2 = this.input.charCodeAt(this.pos), val = void 0;
  14497. if (allowSeparators && code2 === 95) {
  14498. if (isLegacyOctalNumericLiteral) {
  14499. this.raiseRecoverable(this.pos, "Numeric separator is not allowed in legacy octal numeric literals");
  14500. }
  14501. if (lastCode === 95) {
  14502. this.raiseRecoverable(this.pos, "Numeric separator must be exactly one underscore");
  14503. }
  14504. if (i === 0) {
  14505. this.raiseRecoverable(this.pos, "Numeric separator is not allowed at the first of digits");
  14506. }
  14507. lastCode = code2;
  14508. continue;
  14509. }
  14510. if (code2 >= 97) {
  14511. val = code2 - 97 + 10;
  14512. } else if (code2 >= 65) {
  14513. val = code2 - 65 + 10;
  14514. } else if (code2 >= 48 && code2 <= 57) {
  14515. val = code2 - 48;
  14516. } else {
  14517. val = Infinity;
  14518. }
  14519. if (val >= radix) {
  14520. break;
  14521. }
  14522. lastCode = code2;
  14523. total = total * radix + val;
  14524. }
  14525. if (allowSeparators && lastCode === 95) {
  14526. this.raiseRecoverable(this.pos - 1, "Numeric separator is not allowed at the last of digits");
  14527. }
  14528. if (this.pos === start2 || len != null && this.pos - start2 !== len) {
  14529. return null;
  14530. }
  14531. return total;
  14532. };
  14533. function stringToNumber(str, isLegacyOctalNumericLiteral) {
  14534. if (isLegacyOctalNumericLiteral) {
  14535. return parseInt(str, 8);
  14536. }
  14537. return parseFloat(str.replace(/_/g, ""));
  14538. }
  14539. function stringToBigInt(str) {
  14540. if (typeof BigInt !== "function") {
  14541. return null;
  14542. }
  14543. return BigInt(str.replace(/_/g, ""));
  14544. }
  14545. pp.readRadixNumber = function(radix) {
  14546. var start2 = this.pos;
  14547. this.pos += 2;
  14548. var val = this.readInt(radix);
  14549. if (val == null) {
  14550. this.raise(this.start + 2, "Expected number in radix " + radix);
  14551. }
  14552. if (this.options.ecmaVersion >= 11 && this.input.charCodeAt(this.pos) === 110) {
  14553. val = stringToBigInt(this.input.slice(start2, this.pos));
  14554. ++this.pos;
  14555. } else if (isIdentifierStart(this.fullCharCodeAtPos())) {
  14556. this.raise(this.pos, "Identifier directly after number");
  14557. }
  14558. return this.finishToken(types$1.num, val);
  14559. };
  14560. pp.readNumber = function(startsWithDot) {
  14561. var start2 = this.pos;
  14562. if (!startsWithDot && this.readInt(10, void 0, true) === null) {
  14563. this.raise(start2, "Invalid number");
  14564. }
  14565. var octal = this.pos - start2 >= 2 && this.input.charCodeAt(start2) === 48;
  14566. if (octal && this.strict) {
  14567. this.raise(start2, "Invalid number");
  14568. }
  14569. var next = this.input.charCodeAt(this.pos);
  14570. if (!octal && !startsWithDot && this.options.ecmaVersion >= 11 && next === 110) {
  14571. var val$1 = stringToBigInt(this.input.slice(start2, this.pos));
  14572. ++this.pos;
  14573. if (isIdentifierStart(this.fullCharCodeAtPos())) {
  14574. this.raise(this.pos, "Identifier directly after number");
  14575. }
  14576. return this.finishToken(types$1.num, val$1);
  14577. }
  14578. if (octal && /[89]/.test(this.input.slice(start2, this.pos))) {
  14579. octal = false;
  14580. }
  14581. if (next === 46 && !octal) {
  14582. ++this.pos;
  14583. this.readInt(10);
  14584. next = this.input.charCodeAt(this.pos);
  14585. }
  14586. if ((next === 69 || next === 101) && !octal) {
  14587. next = this.input.charCodeAt(++this.pos);
  14588. if (next === 43 || next === 45) {
  14589. ++this.pos;
  14590. }
  14591. if (this.readInt(10) === null) {
  14592. this.raise(start2, "Invalid number");
  14593. }
  14594. }
  14595. if (isIdentifierStart(this.fullCharCodeAtPos())) {
  14596. this.raise(this.pos, "Identifier directly after number");
  14597. }
  14598. var val = stringToNumber(this.input.slice(start2, this.pos), octal);
  14599. return this.finishToken(types$1.num, val);
  14600. };
  14601. pp.readCodePoint = function() {
  14602. var ch = this.input.charCodeAt(this.pos), code2;
  14603. if (ch === 123) {
  14604. if (this.options.ecmaVersion < 6) {
  14605. this.unexpected();
  14606. }
  14607. var codePos = ++this.pos;
  14608. code2 = this.readHexChar(this.input.indexOf("}", this.pos) - this.pos);
  14609. ++this.pos;
  14610. if (code2 > 1114111) {
  14611. this.invalidStringToken(codePos, "Code point out of bounds");
  14612. }
  14613. } else {
  14614. code2 = this.readHexChar(4);
  14615. }
  14616. return code2;
  14617. };
  14618. pp.readString = function(quote) {
  14619. var out = "", chunkStart = ++this.pos;
  14620. for (; ; ) {
  14621. if (this.pos >= this.input.length) {
  14622. this.raise(this.start, "Unterminated string constant");
  14623. }
  14624. var ch = this.input.charCodeAt(this.pos);
  14625. if (ch === quote) {
  14626. break;
  14627. }
  14628. if (ch === 92) {
  14629. out += this.input.slice(chunkStart, this.pos);
  14630. out += this.readEscapedChar(false);
  14631. chunkStart = this.pos;
  14632. } else if (ch === 8232 || ch === 8233) {
  14633. if (this.options.ecmaVersion < 10) {
  14634. this.raise(this.start, "Unterminated string constant");
  14635. }
  14636. ++this.pos;
  14637. if (this.options.locations) {
  14638. this.curLine++;
  14639. this.lineStart = this.pos;
  14640. }
  14641. } else {
  14642. if (isNewLine(ch)) {
  14643. this.raise(this.start, "Unterminated string constant");
  14644. }
  14645. ++this.pos;
  14646. }
  14647. }
  14648. out += this.input.slice(chunkStart, this.pos++);
  14649. return this.finishToken(types$1.string, out);
  14650. };
  14651. var INVALID_TEMPLATE_ESCAPE_ERROR = {};
  14652. pp.tryReadTemplateToken = function() {
  14653. this.inTemplateElement = true;
  14654. try {
  14655. this.readTmplToken();
  14656. } catch (err) {
  14657. if (err === INVALID_TEMPLATE_ESCAPE_ERROR) {
  14658. this.readInvalidTemplateToken();
  14659. } else {
  14660. throw err;
  14661. }
  14662. }
  14663. this.inTemplateElement = false;
  14664. };
  14665. pp.invalidStringToken = function(position3, message) {
  14666. if (this.inTemplateElement && this.options.ecmaVersion >= 9) {
  14667. throw INVALID_TEMPLATE_ESCAPE_ERROR;
  14668. } else {
  14669. this.raise(position3, message);
  14670. }
  14671. };
  14672. pp.readTmplToken = function() {
  14673. var out = "", chunkStart = this.pos;
  14674. for (; ; ) {
  14675. if (this.pos >= this.input.length) {
  14676. this.raise(this.start, "Unterminated template");
  14677. }
  14678. var ch = this.input.charCodeAt(this.pos);
  14679. if (ch === 96 || ch === 36 && this.input.charCodeAt(this.pos + 1) === 123) {
  14680. if (this.pos === this.start && (this.type === types$1.template || this.type === types$1.invalidTemplate)) {
  14681. if (ch === 36) {
  14682. this.pos += 2;
  14683. return this.finishToken(types$1.dollarBraceL);
  14684. } else {
  14685. ++this.pos;
  14686. return this.finishToken(types$1.backQuote);
  14687. }
  14688. }
  14689. out += this.input.slice(chunkStart, this.pos);
  14690. return this.finishToken(types$1.template, out);
  14691. }
  14692. if (ch === 92) {
  14693. out += this.input.slice(chunkStart, this.pos);
  14694. out += this.readEscapedChar(true);
  14695. chunkStart = this.pos;
  14696. } else if (isNewLine(ch)) {
  14697. out += this.input.slice(chunkStart, this.pos);
  14698. ++this.pos;
  14699. switch (ch) {
  14700. case 13:
  14701. if (this.input.charCodeAt(this.pos) === 10) {
  14702. ++this.pos;
  14703. }
  14704. case 10:
  14705. out += "\n";
  14706. break;
  14707. default:
  14708. out += String.fromCharCode(ch);
  14709. break;
  14710. }
  14711. if (this.options.locations) {
  14712. ++this.curLine;
  14713. this.lineStart = this.pos;
  14714. }
  14715. chunkStart = this.pos;
  14716. } else {
  14717. ++this.pos;
  14718. }
  14719. }
  14720. };
  14721. pp.readInvalidTemplateToken = function() {
  14722. for (; this.pos < this.input.length; this.pos++) {
  14723. switch (this.input[this.pos]) {
  14724. case "\\":
  14725. ++this.pos;
  14726. break;
  14727. case "$":
  14728. if (this.input[this.pos + 1] !== "{") {
  14729. break;
  14730. }
  14731. case "`":
  14732. return this.finishToken(types$1.invalidTemplate, this.input.slice(this.start, this.pos));
  14733. case "\r":
  14734. if (this.input[this.pos + 1] === "\n") {
  14735. ++this.pos;
  14736. }
  14737. case "\n":
  14738. case "\u2028":
  14739. case "\u2029":
  14740. ++this.curLine;
  14741. this.lineStart = this.pos + 1;
  14742. break;
  14743. }
  14744. }
  14745. this.raise(this.start, "Unterminated template");
  14746. };
  14747. pp.readEscapedChar = function(inTemplate) {
  14748. var ch = this.input.charCodeAt(++this.pos);
  14749. ++this.pos;
  14750. switch (ch) {
  14751. case 110:
  14752. return "\n";
  14753. case 114:
  14754. return "\r";
  14755. case 120:
  14756. return String.fromCharCode(this.readHexChar(2));
  14757. case 117:
  14758. return codePointToString(this.readCodePoint());
  14759. case 116:
  14760. return " ";
  14761. case 98:
  14762. return "\b";
  14763. case 118:
  14764. return "\v";
  14765. case 102:
  14766. return "\f";
  14767. case 13:
  14768. if (this.input.charCodeAt(this.pos) === 10) {
  14769. ++this.pos;
  14770. }
  14771. case 10:
  14772. if (this.options.locations) {
  14773. this.lineStart = this.pos;
  14774. ++this.curLine;
  14775. }
  14776. return "";
  14777. case 56:
  14778. case 57:
  14779. if (this.strict) {
  14780. this.invalidStringToken(
  14781. this.pos - 1,
  14782. "Invalid escape sequence"
  14783. );
  14784. }
  14785. if (inTemplate) {
  14786. var codePos = this.pos - 1;
  14787. this.invalidStringToken(
  14788. codePos,
  14789. "Invalid escape sequence in template string"
  14790. );
  14791. }
  14792. default:
  14793. if (ch >= 48 && ch <= 55) {
  14794. var octalStr = this.input.substr(this.pos - 1, 3).match(/^[0-7]+/)[0];
  14795. var octal = parseInt(octalStr, 8);
  14796. if (octal > 255) {
  14797. octalStr = octalStr.slice(0, -1);
  14798. octal = parseInt(octalStr, 8);
  14799. }
  14800. this.pos += octalStr.length - 1;
  14801. ch = this.input.charCodeAt(this.pos);
  14802. if ((octalStr !== "0" || ch === 56 || ch === 57) && (this.strict || inTemplate)) {
  14803. this.invalidStringToken(
  14804. this.pos - 1 - octalStr.length,
  14805. inTemplate ? "Octal literal in template string" : "Octal literal in strict mode"
  14806. );
  14807. }
  14808. return String.fromCharCode(octal);
  14809. }
  14810. if (isNewLine(ch)) {
  14811. if (this.options.locations) {
  14812. this.lineStart = this.pos;
  14813. ++this.curLine;
  14814. }
  14815. return "";
  14816. }
  14817. return String.fromCharCode(ch);
  14818. }
  14819. };
  14820. pp.readHexChar = function(len) {
  14821. var codePos = this.pos;
  14822. var n = this.readInt(16, len);
  14823. if (n === null) {
  14824. this.invalidStringToken(codePos, "Bad character escape sequence");
  14825. }
  14826. return n;
  14827. };
  14828. pp.readWord1 = function() {
  14829. this.containsEsc = false;
  14830. var word = "", first = true, chunkStart = this.pos;
  14831. var astral = this.options.ecmaVersion >= 6;
  14832. while (this.pos < this.input.length) {
  14833. var ch = this.fullCharCodeAtPos();
  14834. if (isIdentifierChar(ch, astral)) {
  14835. this.pos += ch <= 65535 ? 1 : 2;
  14836. } else if (ch === 92) {
  14837. this.containsEsc = true;
  14838. word += this.input.slice(chunkStart, this.pos);
  14839. var escStart = this.pos;
  14840. if (this.input.charCodeAt(++this.pos) !== 117) {
  14841. this.invalidStringToken(this.pos, "Expecting Unicode escape sequence \\uXXXX");
  14842. }
  14843. ++this.pos;
  14844. var esc = this.readCodePoint();
  14845. if (!(first ? isIdentifierStart : isIdentifierChar)(esc, astral)) {
  14846. this.invalidStringToken(escStart, "Invalid Unicode escape");
  14847. }
  14848. word += codePointToString(esc);
  14849. chunkStart = this.pos;
  14850. } else {
  14851. break;
  14852. }
  14853. first = false;
  14854. }
  14855. return word + this.input.slice(chunkStart, this.pos);
  14856. };
  14857. pp.readWord = function() {
  14858. var word = this.readWord1();
  14859. var type = types$1.name;
  14860. if (this.keywords.test(word)) {
  14861. type = keywords[word];
  14862. }
  14863. return this.finishToken(type, word);
  14864. };
  14865. var version = "8.12.1";
  14866. Parser.acorn = {
  14867. Parser,
  14868. version,
  14869. defaultOptions,
  14870. Position,
  14871. SourceLocation,
  14872. getLineInfo,
  14873. Node,
  14874. TokenType,
  14875. tokTypes: types$1,
  14876. keywordTypes: keywords,
  14877. TokContext,
  14878. tokContexts: types,
  14879. isIdentifierChar,
  14880. isIdentifierStart,
  14881. Token,
  14882. isNewLine,
  14883. lineBreak,
  14884. lineBreakG,
  14885. nonASCIIwhitespace
  14886. };
  14887. // node_modules/micromark-extension-mdxjs/index.js
  14888. var import_acorn_jsx = __toESM(require_acorn_jsx(), 1);
  14889. // node_modules/micromark-util-character/index.js
  14890. var asciiAlpha = regexCheck(/[A-Za-z]/);
  14891. var asciiAlphanumeric = regexCheck(/[\dA-Za-z]/);
  14892. var asciiAtext = regexCheck(/[#-'*+\--9=?A-Z^-~]/);
  14893. function asciiControl(code2) {
  14894. return (
  14895. // Special whitespace codes (which have negative values), C0 and Control
  14896. // character DEL
  14897. code2 !== null && (code2 < 32 || code2 === 127)
  14898. );
  14899. }
  14900. var asciiDigit = regexCheck(/\d/);
  14901. var asciiHexDigit = regexCheck(/[\dA-Fa-f]/);
  14902. var asciiPunctuation = regexCheck(/[!-/:-@[-`{-~]/);
  14903. function markdownLineEnding(code2) {
  14904. return code2 !== null && code2 < -2;
  14905. }
  14906. function markdownLineEndingOrSpace(code2) {
  14907. return code2 !== null && (code2 < 0 || code2 === 32);
  14908. }
  14909. function markdownSpace(code2) {
  14910. return code2 === -2 || code2 === -1 || code2 === 32;
  14911. }
  14912. var unicodePunctuation = regexCheck(/\p{P}|\p{S}/u);
  14913. var unicodeWhitespace = regexCheck(/\s/);
  14914. function regexCheck(regex2) {
  14915. return check;
  14916. function check(code2) {
  14917. return code2 !== null && code2 > -1 && regex2.test(String.fromCharCode(code2));
  14918. }
  14919. }
  14920. // node_modules/estree-util-visit/lib/color.node.js
  14921. function color(d) {
  14922. return "\x1B[33m" + d + "\x1B[39m";
  14923. }
  14924. // node_modules/estree-util-visit/lib/index.js
  14925. var own2 = {}.hasOwnProperty;
  14926. var CONTINUE = Symbol("continue");
  14927. var EXIT = Symbol("exit");
  14928. var SKIP = Symbol("skip");
  14929. function visit(tree, visitor) {
  14930. let enter;
  14931. let leave;
  14932. if (typeof visitor === "function") {
  14933. enter = visitor;
  14934. } else if (visitor && typeof visitor === "object") {
  14935. if (visitor.enter) enter = visitor.enter;
  14936. if (visitor.leave) leave = visitor.leave;
  14937. }
  14938. build(tree, void 0, void 0, [])();
  14939. function build(node2, key, index2, parents) {
  14940. if (nodelike(node2)) {
  14941. visit4.displayName = "node (" + color(node2.type) + ")";
  14942. }
  14943. return visit4;
  14944. function visit4() {
  14945. const result = enter ? toResult(enter(node2, key, index2, parents)) : [];
  14946. if (result[0] === EXIT) {
  14947. return result;
  14948. }
  14949. if (result[0] !== SKIP) {
  14950. let cKey;
  14951. for (cKey in node2) {
  14952. if (own2.call(node2, cKey) && node2[cKey] && typeof node2[cKey] === "object" && // @ts-expect-error: custom esast extension.
  14953. cKey !== "data" && // @ts-expect-error: custom esast extension.
  14954. cKey !== "position") {
  14955. const grandparents = parents.concat(node2);
  14956. const value = node2[cKey];
  14957. if (Array.isArray(value)) {
  14958. const nodes = (
  14959. /** @type {Array<unknown>} */
  14960. value
  14961. );
  14962. let cIndex = 0;
  14963. while (cIndex > -1 && cIndex < nodes.length) {
  14964. const subvalue = nodes[cIndex];
  14965. if (nodelike(subvalue)) {
  14966. const subresult = build(
  14967. subvalue,
  14968. cKey,
  14969. cIndex,
  14970. grandparents
  14971. )();
  14972. if (subresult[0] === EXIT) return subresult;
  14973. cIndex = typeof subresult[1] === "number" ? subresult[1] : cIndex + 1;
  14974. } else {
  14975. cIndex++;
  14976. }
  14977. }
  14978. } else if (nodelike(value)) {
  14979. const subresult = build(value, cKey, void 0, grandparents)();
  14980. if (subresult[0] === EXIT) return subresult;
  14981. }
  14982. }
  14983. }
  14984. }
  14985. return leave ? toResult(leave(node2, key, index2, parents)) : result;
  14986. }
  14987. }
  14988. }
  14989. function toResult(value) {
  14990. if (Array.isArray(value)) {
  14991. return value;
  14992. }
  14993. if (typeof value === "number") {
  14994. return [CONTINUE, value];
  14995. }
  14996. return [value];
  14997. }
  14998. function nodelike(value) {
  14999. return Boolean(
  15000. value && typeof value === "object" && "type" in value && typeof value.type === "string" && value.type.length > 0
  15001. );
  15002. }
  15003. // node_modules/micromark-util-events-to-acorn/index.js
  15004. function eventsToAcorn(events, options) {
  15005. const prefix = options.prefix || "";
  15006. const suffix = options.suffix || "";
  15007. const acornOptions = Object.assign({}, options.acornOptions);
  15008. const comments = [];
  15009. const tokens = [];
  15010. const onComment = acornOptions.onComment;
  15011. const onToken = acornOptions.onToken;
  15012. let swallow = false;
  15013. let estree;
  15014. let exception;
  15015. const acornConfig = Object.assign({}, acornOptions, {
  15016. onComment: comments,
  15017. preserveParens: true
  15018. });
  15019. if (onToken) {
  15020. acornConfig.onToken = tokens;
  15021. }
  15022. const collection = collect(events, options.tokenTypes);
  15023. const source = collection.value;
  15024. const value = prefix + source + suffix;
  15025. const isEmptyExpression = options.expression && empty2(source);
  15026. if (isEmptyExpression && !options.allowEmpty) {
  15027. throw new VFileMessage("Unexpected empty expression", {
  15028. place: parseOffsetToUnistPoint(0),
  15029. ruleId: "unexpected-empty-expression",
  15030. source: "micromark-extension-mdx-expression"
  15031. });
  15032. }
  15033. try {
  15034. estree = options.expression && !isEmptyExpression ? options.acorn.parseExpressionAt(value, 0, acornConfig) : options.acorn.parse(value, acornConfig);
  15035. } catch (error_) {
  15036. const error = (
  15037. /** @type {AcornError} */
  15038. error_
  15039. );
  15040. const point4 = parseOffsetToUnistPoint(error.pos);
  15041. error.message = String(error.message).replace(/ \(\d+:\d+\)$/, "");
  15042. error.pos = point4.offset;
  15043. error.loc = {
  15044. line: point4.line,
  15045. column: point4.column - 1
  15046. };
  15047. exception = error;
  15048. swallow = error.raisedAt >= prefix.length + source.length || // Broken comments are raised at their start, not their end.
  15049. error.message === "Unterminated comment";
  15050. }
  15051. if (estree && options.expression && !isEmptyExpression) {
  15052. if (empty2(value.slice(estree.end, value.length - suffix.length))) {
  15053. estree = {
  15054. type: "Program",
  15055. start: 0,
  15056. end: prefix.length + source.length,
  15057. // @ts-expect-error: It’s good.
  15058. body: [{
  15059. type: "ExpressionStatement",
  15060. expression: estree,
  15061. start: 0,
  15062. end: prefix.length + source.length
  15063. }],
  15064. sourceType: "module",
  15065. comments: []
  15066. };
  15067. } else {
  15068. const point4 = parseOffsetToUnistPoint(estree.end);
  15069. const error = (
  15070. /** @type {AcornError} */
  15071. new Error("Unexpected content after expression")
  15072. );
  15073. error.pos = point4.offset;
  15074. error.loc = {
  15075. line: point4.line,
  15076. column: point4.column - 1
  15077. };
  15078. exception = error;
  15079. estree = void 0;
  15080. }
  15081. }
  15082. if (estree) {
  15083. estree.comments = comments;
  15084. visit(estree, function(esnode, field, index2, parents) {
  15085. let context = (
  15086. /** @type {AcornNode | Array<AcornNode>} */
  15087. parents[parents.length - 1]
  15088. );
  15089. let prop = field;
  15090. if (esnode.type === "ParenthesizedExpression" && context && prop) {
  15091. if (typeof index2 === "number") {
  15092. context = context[prop];
  15093. prop = index2;
  15094. }
  15095. context[prop] = esnode.expression;
  15096. }
  15097. fixPosition(esnode);
  15098. });
  15099. if (Array.isArray(onComment)) {
  15100. onComment.push(...comments);
  15101. } else if (typeof onComment === "function") {
  15102. for (const comment2 of comments) {
  15103. onComment(comment2.type === "Block", comment2.value, comment2.start, comment2.end, comment2.loc.start, comment2.loc.end);
  15104. }
  15105. }
  15106. for (const token of tokens) {
  15107. if (token.end <= prefix.length || token.start - prefix.length >= source.length) {
  15108. continue;
  15109. }
  15110. fixPosition(token);
  15111. if (Array.isArray(onToken)) {
  15112. onToken.push(token);
  15113. } else {
  15114. onToken(token);
  15115. }
  15116. }
  15117. }
  15118. return {
  15119. estree,
  15120. error: exception,
  15121. swallow
  15122. };
  15123. function fixPosition(nodeOrToken) {
  15124. const pointStart2 = parseOffsetToUnistPoint(nodeOrToken.start);
  15125. const pointEnd2 = parseOffsetToUnistPoint(nodeOrToken.end);
  15126. nodeOrToken.start = pointStart2.offset;
  15127. nodeOrToken.end = pointEnd2.offset;
  15128. nodeOrToken.loc = {
  15129. start: {
  15130. line: pointStart2.line,
  15131. column: pointStart2.column - 1,
  15132. offset: pointStart2.offset
  15133. },
  15134. end: {
  15135. line: pointEnd2.line,
  15136. column: pointEnd2.column - 1,
  15137. offset: pointEnd2.offset
  15138. }
  15139. };
  15140. nodeOrToken.range = [nodeOrToken.start, nodeOrToken.end];
  15141. }
  15142. function parseOffsetToUnistPoint(acornOffset) {
  15143. let sourceOffset = acornOffset - prefix.length;
  15144. if (sourceOffset < 0) {
  15145. sourceOffset = 0;
  15146. } else if (sourceOffset > source.length) {
  15147. sourceOffset = source.length;
  15148. }
  15149. let point4 = relativeToPoint(collection.stops, sourceOffset);
  15150. if (!point4) {
  15151. point4 = {
  15152. line: options.start.line,
  15153. column: options.start.column,
  15154. offset: options.start.offset
  15155. };
  15156. }
  15157. return point4;
  15158. }
  15159. }
  15160. function empty2(value) {
  15161. return /^\s*$/.test(value.replace(/\/\*[\s\S]*?\*\//g, "").replace(/\/\/[^\r\n]*(\r\n|\n|\r)/g, ""));
  15162. }
  15163. function collect(events, tokenTypes) {
  15164. const result = {
  15165. value: "",
  15166. stops: []
  15167. };
  15168. let index2 = -1;
  15169. while (++index2 < events.length) {
  15170. const event = events[index2];
  15171. if (event[0] === "enter") {
  15172. const type = event[1].type;
  15173. if (type === "lineEnding" || tokenTypes.includes(type)) {
  15174. const chunks = event[2].sliceStream(event[1]);
  15175. while (chunks.length > 0 && chunks[0] === -1) {
  15176. chunks.shift();
  15177. }
  15178. const value = serializeChunks(chunks);
  15179. result.stops.push([result.value.length, event[1].start]);
  15180. result.value += value;
  15181. result.stops.push([result.value.length, event[1].end]);
  15182. }
  15183. }
  15184. }
  15185. return result;
  15186. }
  15187. function relativeToPoint(stops, relative) {
  15188. let index2 = 0;
  15189. while (index2 < stops.length && stops[index2][0] <= relative) {
  15190. index2 += 1;
  15191. }
  15192. if (index2 === 0) {
  15193. return void 0;
  15194. }
  15195. const [stopRelative, stopAbsolute] = stops[index2 - 1];
  15196. const rest = relative - stopRelative;
  15197. return {
  15198. line: stopAbsolute.line,
  15199. column: stopAbsolute.column + rest,
  15200. offset: stopAbsolute.offset + rest
  15201. };
  15202. }
  15203. function serializeChunks(chunks) {
  15204. let index2 = -1;
  15205. const result = [];
  15206. let atTab;
  15207. while (++index2 < chunks.length) {
  15208. const chunk = chunks[index2];
  15209. let value;
  15210. if (typeof chunk === "string") {
  15211. value = chunk;
  15212. } else switch (chunk) {
  15213. case -5: {
  15214. value = "\r";
  15215. break;
  15216. }
  15217. case -4: {
  15218. value = "\n";
  15219. break;
  15220. }
  15221. case -3: {
  15222. value = "\r\n";
  15223. break;
  15224. }
  15225. case -2: {
  15226. value = " ";
  15227. break;
  15228. }
  15229. case -1: {
  15230. if (atTab) continue;
  15231. value = " ";
  15232. break;
  15233. }
  15234. default: {
  15235. value = String.fromCharCode(chunk);
  15236. }
  15237. }
  15238. atTab = chunk === -2;
  15239. result.push(value);
  15240. }
  15241. return result.join("");
  15242. }
  15243. // node_modules/unist-util-position-from-estree/lib/index.js
  15244. function positionFromEstree(node2) {
  15245. const nodeLike = node2 || {};
  15246. const loc = nodeLike.loc || {};
  15247. const range = nodeLike.range || [void 0, void 0];
  15248. const start2 = pointOrUndefined(loc.start, range[0] || nodeLike.start);
  15249. const end = pointOrUndefined(loc.end, range[1] || nodeLike.end);
  15250. if (start2 && end) {
  15251. return { start: start2, end };
  15252. }
  15253. }
  15254. function pointOrUndefined(estreePoint, estreeOffset) {
  15255. if (estreePoint && typeof estreePoint === "object") {
  15256. const line = "line" in estreePoint ? numberOrUndefined(estreePoint.line) : void 0;
  15257. const column = "column" in estreePoint ? numberOrUndefined(estreePoint.column) : void 0;
  15258. if (line && column !== void 0) {
  15259. return {
  15260. line,
  15261. column: column + 1,
  15262. offset: numberOrUndefined(estreeOffset)
  15263. };
  15264. }
  15265. }
  15266. }
  15267. function numberOrUndefined(value) {
  15268. return typeof value === "number" && value > -1 ? value : void 0;
  15269. }
  15270. // node_modules/micromark-factory-mdx-expression/index.js
  15271. var trouble = "https://github.com/micromark/micromark-extension-mdx-expression/tree/main/packages/micromark-extension-mdx-expression";
  15272. var unexpectedEofHash = "#unexpected-end-of-file-in-expression-expected-a-corresponding-closing-brace-for-";
  15273. var unexpectedLazyHash = "#unexpected-lazy-line-in-expression-in-container-expected-line-to-be-prefixed";
  15274. var nonSpreadHash = "#unexpected-type-in-code-expected-an-object-spread-spread";
  15275. var spreadExtraHash = "#unexpected-extra-content-in-spread-only-a-single-spread-is-supported";
  15276. var acornHash = "#could-not-parse-expression-with-acorn";
  15277. function factoryMdxExpression(effects, ok4, type, markerType, chunkType, acorn, acornOptions, addResult, spread, allowEmpty, allowLazy) {
  15278. const self2 = this;
  15279. const eventStart = this.events.length + 3;
  15280. let size = 0;
  15281. let pointStart2;
  15282. let lastCrash;
  15283. return start2;
  15284. function start2(code2) {
  15285. effects.enter(type);
  15286. effects.enter(markerType);
  15287. effects.consume(code2);
  15288. effects.exit(markerType);
  15289. pointStart2 = self2.now();
  15290. return before;
  15291. }
  15292. function before(code2) {
  15293. if (code2 === null) {
  15294. if (lastCrash) throw lastCrash;
  15295. const error = new VFileMessage(
  15296. "Unexpected end of file in expression, expected a corresponding closing brace for `{`",
  15297. {
  15298. place: self2.now(),
  15299. ruleId: "unexpected-eof",
  15300. source: "micromark-extension-mdx-expression"
  15301. }
  15302. );
  15303. error.url = trouble + unexpectedEofHash;
  15304. throw error;
  15305. }
  15306. if (markdownLineEnding(code2)) {
  15307. effects.enter("lineEnding");
  15308. effects.consume(code2);
  15309. effects.exit("lineEnding");
  15310. return eolAfter;
  15311. }
  15312. if (code2 === 125 && size === 0) {
  15313. const next = acorn ? mdxExpressionParse.call(
  15314. self2,
  15315. acorn,
  15316. acornOptions,
  15317. chunkType,
  15318. eventStart,
  15319. pointStart2,
  15320. allowEmpty || false,
  15321. spread || false
  15322. ) : {
  15323. type: "ok",
  15324. estree: void 0
  15325. };
  15326. if (next.type === "ok") {
  15327. effects.enter(markerType);
  15328. effects.consume(code2);
  15329. effects.exit(markerType);
  15330. const token = effects.exit(type);
  15331. if (addResult && next.estree) {
  15332. Object.assign(token, {
  15333. estree: next.estree
  15334. });
  15335. }
  15336. return ok4;
  15337. }
  15338. lastCrash = next.message;
  15339. effects.enter(chunkType);
  15340. effects.consume(code2);
  15341. return inside;
  15342. }
  15343. effects.enter(chunkType);
  15344. return inside(code2);
  15345. }
  15346. function inside(code2) {
  15347. if (code2 === 125 && size === 0 || code2 === null || markdownLineEnding(code2)) {
  15348. effects.exit(chunkType);
  15349. return before(code2);
  15350. }
  15351. if (code2 === 123 && !acorn) {
  15352. size += 1;
  15353. } else if (code2 === 125) {
  15354. size -= 1;
  15355. }
  15356. effects.consume(code2);
  15357. return inside;
  15358. }
  15359. function eolAfter(code2) {
  15360. const now = self2.now();
  15361. if (now.line !== pointStart2.line && !allowLazy && self2.parser.lazy[now.line]) {
  15362. const error = new VFileMessage(
  15363. "Unexpected lazy line in expression in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc",
  15364. {
  15365. place: self2.now(),
  15366. ruleId: "unexpected-lazy",
  15367. source: "micromark-extension-mdx-expression"
  15368. }
  15369. );
  15370. error.url = trouble + unexpectedLazyHash;
  15371. throw error;
  15372. }
  15373. return before(code2);
  15374. }
  15375. }
  15376. function mdxExpressionParse(acorn, acornOptions, chunkType, eventStart, pointStart2, allowEmpty, spread) {
  15377. const result = eventsToAcorn(this.events.slice(eventStart), {
  15378. acorn,
  15379. tokenTypes: [chunkType],
  15380. acornOptions,
  15381. start: pointStart2,
  15382. expression: true,
  15383. allowEmpty,
  15384. prefix: spread ? "({" : "",
  15385. suffix: spread ? "})" : ""
  15386. });
  15387. const estree = result.estree;
  15388. if (spread && estree) {
  15389. const head = estree.body[0];
  15390. if (head.type !== "ExpressionStatement" || head.expression.type !== "ObjectExpression") {
  15391. const place = positionFromEstree(head);
  15392. const error = new VFileMessage(
  15393. "Unexpected `" + head.type + "` in code: expected an object spread (`{...spread}`)",
  15394. {
  15395. place: place.start,
  15396. ruleId: "non-spread",
  15397. source: "micromark-extension-mdx-expression"
  15398. }
  15399. );
  15400. error.url = trouble + nonSpreadHash;
  15401. throw error;
  15402. }
  15403. if (head.expression.properties[1]) {
  15404. const place = positionFromEstree(head.expression.properties[1]);
  15405. const error = new VFileMessage(
  15406. "Unexpected extra content in spread: only a single spread is supported",
  15407. {
  15408. place: place.start,
  15409. ruleId: "spread-extra",
  15410. source: "micromark-extension-mdx-expression"
  15411. }
  15412. );
  15413. error.url = trouble + spreadExtraHash;
  15414. throw error;
  15415. }
  15416. if (head.expression.properties[0] && head.expression.properties[0].type !== "SpreadElement") {
  15417. const place = positionFromEstree(head.expression.properties[0]);
  15418. const error = new VFileMessage(
  15419. "Unexpected `" + head.expression.properties[0].type + "` in code: only spread elements are supported",
  15420. {
  15421. place: place.start,
  15422. ruleId: "non-spread",
  15423. source: "micromark-extension-mdx-expression"
  15424. }
  15425. );
  15426. error.url = trouble + nonSpreadHash;
  15427. throw error;
  15428. }
  15429. }
  15430. if (result.error) {
  15431. const error = new VFileMessage("Could not parse expression with acorn", {
  15432. cause: result.error,
  15433. place: {
  15434. line: result.error.loc.line,
  15435. column: result.error.loc.column + 1,
  15436. offset: result.error.pos
  15437. },
  15438. ruleId: "acorn",
  15439. source: "micromark-extension-mdx-expression"
  15440. });
  15441. error.url = trouble + acornHash;
  15442. return {
  15443. type: "nok",
  15444. message: error
  15445. };
  15446. }
  15447. return {
  15448. type: "ok",
  15449. estree
  15450. };
  15451. }
  15452. // node_modules/micromark-factory-space/index.js
  15453. function factorySpace(effects, ok4, type, max) {
  15454. const limit = max ? max - 1 : Number.POSITIVE_INFINITY;
  15455. let size = 0;
  15456. return start2;
  15457. function start2(code2) {
  15458. if (markdownSpace(code2)) {
  15459. effects.enter(type);
  15460. return prefix(code2);
  15461. }
  15462. return ok4(code2);
  15463. }
  15464. function prefix(code2) {
  15465. if (markdownSpace(code2) && size++ < limit) {
  15466. effects.consume(code2);
  15467. return prefix;
  15468. }
  15469. effects.exit(type);
  15470. return ok4(code2);
  15471. }
  15472. }
  15473. // node_modules/micromark-extension-mdx-expression/lib/syntax.js
  15474. function mdxExpression(options) {
  15475. const options_ = options || {};
  15476. const addResult = options_.addResult;
  15477. const acorn = options_.acorn;
  15478. const spread = options_.spread;
  15479. let allowEmpty = options_.allowEmpty;
  15480. let acornOptions;
  15481. if (allowEmpty === null || allowEmpty === void 0) {
  15482. allowEmpty = true;
  15483. }
  15484. if (acorn) {
  15485. if (!acorn.parseExpressionAt) {
  15486. throw new Error("Expected a proper `acorn` instance passed in as `options.acorn`");
  15487. }
  15488. acornOptions = Object.assign({
  15489. ecmaVersion: 2024,
  15490. sourceType: "module"
  15491. }, options_.acornOptions);
  15492. } else if (options_.acornOptions || options_.addResult) {
  15493. throw new Error("Expected an `acorn` instance passed in as `options.acorn`");
  15494. }
  15495. return {
  15496. flow: {
  15497. [123]: {
  15498. name: "mdxFlowExpression",
  15499. tokenize: tokenizeFlowExpression,
  15500. concrete: true
  15501. }
  15502. },
  15503. text: {
  15504. [123]: {
  15505. name: "mdxTextExpression",
  15506. tokenize: tokenizeTextExpression
  15507. }
  15508. }
  15509. };
  15510. function tokenizeFlowExpression(effects, ok4, nok) {
  15511. const self2 = this;
  15512. return start2;
  15513. function start2(code2) {
  15514. return before(code2);
  15515. }
  15516. function before(code2) {
  15517. return factoryMdxExpression.call(self2, effects, after, "mdxFlowExpression", "mdxFlowExpressionMarker", "mdxFlowExpressionChunk", acorn, acornOptions, addResult, spread, allowEmpty)(code2);
  15518. }
  15519. function after(code2) {
  15520. return markdownSpace(code2) ? factorySpace(effects, end, "whitespace")(code2) : end(code2);
  15521. }
  15522. function end(code2) {
  15523. const lessThanValue = self2.parser.constructs.flow[60];
  15524. const constructs2 = Array.isArray(lessThanValue) ? lessThanValue : (
  15525. /* c8 ignore next 3 -- always a list when normalized. */
  15526. lessThanValue ? [lessThanValue] : []
  15527. );
  15528. const jsxTag = constructs2.find(function(d) {
  15529. return d.name === "mdxJsxFlowTag";
  15530. });
  15531. if (code2 === 60 && jsxTag) {
  15532. return effects.attempt(jsxTag, end, nok)(code2);
  15533. }
  15534. return code2 === null || markdownLineEnding(code2) ? ok4(code2) : nok(code2);
  15535. }
  15536. }
  15537. function tokenizeTextExpression(effects, ok4) {
  15538. const self2 = this;
  15539. return start2;
  15540. function start2(code2) {
  15541. return factoryMdxExpression.call(self2, effects, ok4, "mdxTextExpression", "mdxTextExpressionMarker", "mdxTextExpressionChunk", acorn, acornOptions, addResult, spread, allowEmpty, true)(code2);
  15542. }
  15543. }
  15544. }
  15545. // node_modules/estree-util-is-identifier-name/lib/index.js
  15546. var startRe = /[$_\p{ID_Start}]/u;
  15547. var contRe = /[$_\u{200C}\u{200D}\p{ID_Continue}]/u;
  15548. var contReJsx = /[-$_\u{200C}\u{200D}\p{ID_Continue}]/u;
  15549. var nameRe = /^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u;
  15550. var nameReJsx = /^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u;
  15551. var emptyOptions = {};
  15552. function start(code2) {
  15553. return code2 ? startRe.test(String.fromCodePoint(code2)) : false;
  15554. }
  15555. function cont(code2, options) {
  15556. const settings = options || emptyOptions;
  15557. const re2 = settings.jsx ? contReJsx : contRe;
  15558. return code2 ? re2.test(String.fromCodePoint(code2)) : false;
  15559. }
  15560. function name(name2, options) {
  15561. const settings = options || emptyOptions;
  15562. const re2 = settings.jsx ? nameReJsx : nameRe;
  15563. return re2.test(name2);
  15564. }
  15565. // node_modules/micromark-extension-mdx-jsx/lib/factory-tag.js
  15566. var trouble2 = "https://github.com/micromark/micromark-extension-mdx-jsx";
  15567. function factoryTag(effects, ok4, nok, acorn, acornOptions, addResult, allowLazy, tagType, tagMarkerType, tagClosingMarkerType, tagSelfClosingMarker, tagNameType, tagNamePrimaryType, tagNameMemberMarkerType, tagNameMemberType, tagNamePrefixMarkerType, tagNameLocalType, tagExpressionAttributeType, tagExpressionAttributeMarkerType, tagExpressionAttributeValueType, tagAttributeType, tagAttributeNameType, tagAttributeNamePrimaryType, tagAttributeNamePrefixMarkerType, tagAttributeNameLocalType, tagAttributeInitializerMarkerType, tagAttributeValueLiteralType, tagAttributeValueLiteralMarkerType, tagAttributeValueLiteralValueType, tagAttributeValueExpressionType, tagAttributeValueExpressionMarkerType, tagAttributeValueExpressionValueType) {
  15568. const self2 = this;
  15569. let returnState;
  15570. let marker;
  15571. return start2;
  15572. function start2(code2) {
  15573. effects.enter(tagType);
  15574. effects.enter(tagMarkerType);
  15575. effects.consume(code2);
  15576. effects.exit(tagMarkerType);
  15577. return startAfter;
  15578. }
  15579. function startAfter(code2) {
  15580. if (markdownLineEndingOrSpace(code2)) {
  15581. return nok(code2);
  15582. }
  15583. returnState = nameBefore;
  15584. return esWhitespaceStart(code2);
  15585. }
  15586. function nameBefore(code2) {
  15587. if (code2 === 47) {
  15588. effects.enter(tagClosingMarkerType);
  15589. effects.consume(code2);
  15590. effects.exit(tagClosingMarkerType);
  15591. returnState = closingTagNameBefore;
  15592. return esWhitespaceStart;
  15593. }
  15594. if (code2 === 62) {
  15595. return tagEnd(code2);
  15596. }
  15597. if (code2 !== null && code2 >= 0 && start(code2)) {
  15598. effects.enter(tagNameType);
  15599. effects.enter(tagNamePrimaryType);
  15600. effects.consume(code2);
  15601. return primaryName;
  15602. }
  15603. crash(code2, "before name", "a character that can start a name, such as a letter, `$`, or `_`" + (code2 === 33 ? " (note: to create a comment in MDX, use `{/* text */}`)" : ""));
  15604. }
  15605. function closingTagNameBefore(code2) {
  15606. if (code2 === 62) {
  15607. return tagEnd(code2);
  15608. }
  15609. if (code2 !== null && code2 >= 0 && start(code2)) {
  15610. effects.enter(tagNameType);
  15611. effects.enter(tagNamePrimaryType);
  15612. effects.consume(code2);
  15613. return primaryName;
  15614. }
  15615. crash(code2, "before name", "a character that can start a name, such as a letter, `$`, or `_`" + (code2 === 42 || code2 === 47 ? " (note: JS comments in JSX tags are not supported in MDX)" : ""));
  15616. }
  15617. function primaryName(code2) {
  15618. if (code2 !== null && code2 >= 0 && cont(code2, {
  15619. jsx: true
  15620. })) {
  15621. effects.consume(code2);
  15622. return primaryName;
  15623. }
  15624. if (code2 === 46 || code2 === 47 || code2 === 58 || code2 === 62 || code2 === 123 || markdownLineEndingOrSpace(code2) || unicodeWhitespace(code2)) {
  15625. effects.exit(tagNamePrimaryType);
  15626. returnState = primaryNameAfter;
  15627. return esWhitespaceStart(code2);
  15628. }
  15629. crash(code2, "in name", "a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag" + (code2 === 64 ? " (note: to create a link in MDX, use `[text](url)`)" : ""));
  15630. }
  15631. function primaryNameAfter(code2) {
  15632. if (code2 === 46) {
  15633. effects.enter(tagNameMemberMarkerType);
  15634. effects.consume(code2);
  15635. effects.exit(tagNameMemberMarkerType);
  15636. returnState = memberNameBefore;
  15637. return esWhitespaceStart;
  15638. }
  15639. if (code2 === 58) {
  15640. effects.enter(tagNamePrefixMarkerType);
  15641. effects.consume(code2);
  15642. effects.exit(tagNamePrefixMarkerType);
  15643. returnState = localNameBefore;
  15644. return esWhitespaceStart;
  15645. }
  15646. if (code2 === 47 || code2 === 62 || code2 === 123 || code2 !== null && code2 >= 0 && start(code2)) {
  15647. effects.exit(tagNameType);
  15648. return attributeBefore(code2);
  15649. }
  15650. crash(code2, "after name", "a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag");
  15651. }
  15652. function memberNameBefore(code2) {
  15653. if (code2 !== null && code2 >= 0 && start(code2)) {
  15654. effects.enter(tagNameMemberType);
  15655. effects.consume(code2);
  15656. return memberName;
  15657. }
  15658. crash(code2, "before member name", "a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag");
  15659. }
  15660. function memberName(code2) {
  15661. if (code2 !== null && code2 >= 0 && cont(code2, {
  15662. jsx: true
  15663. })) {
  15664. effects.consume(code2);
  15665. return memberName;
  15666. }
  15667. if (code2 === 46 || code2 === 47 || code2 === 62 || code2 === 123 || markdownLineEndingOrSpace(code2) || unicodeWhitespace(code2)) {
  15668. effects.exit(tagNameMemberType);
  15669. returnState = memberNameAfter;
  15670. return esWhitespaceStart(code2);
  15671. }
  15672. crash(code2, "in member name", "a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag" + (code2 === 64 ? " (note: to create a link in MDX, use `[text](url)`)" : ""));
  15673. }
  15674. function memberNameAfter(code2) {
  15675. if (code2 === 46) {
  15676. effects.enter(tagNameMemberMarkerType);
  15677. effects.consume(code2);
  15678. effects.exit(tagNameMemberMarkerType);
  15679. returnState = memberNameBefore;
  15680. return esWhitespaceStart;
  15681. }
  15682. if (code2 === 47 || code2 === 62 || code2 === 123 || code2 !== null && code2 >= 0 && start(code2)) {
  15683. effects.exit(tagNameType);
  15684. return attributeBefore(code2);
  15685. }
  15686. crash(code2, "after member name", "a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag");
  15687. }
  15688. function localNameBefore(code2) {
  15689. if (code2 !== null && code2 >= 0 && start(code2)) {
  15690. effects.enter(tagNameLocalType);
  15691. effects.consume(code2);
  15692. return localName;
  15693. }
  15694. crash(code2, "before local name", "a character that can start a name, such as a letter, `$`, or `_`" + (code2 === 43 || code2 !== null && code2 > 46 && code2 < 58 ? " (note: to create a link in MDX, use `[text](url)`)" : ""));
  15695. }
  15696. function localName(code2) {
  15697. if (code2 !== null && code2 >= 0 && cont(code2, {
  15698. jsx: true
  15699. })) {
  15700. effects.consume(code2);
  15701. return localName;
  15702. }
  15703. if (code2 === 47 || code2 === 62 || code2 === 123 || markdownLineEndingOrSpace(code2) || unicodeWhitespace(code2)) {
  15704. effects.exit(tagNameLocalType);
  15705. returnState = localNameAfter;
  15706. return esWhitespaceStart(code2);
  15707. }
  15708. crash(code2, "in local name", "a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag");
  15709. }
  15710. function localNameAfter(code2) {
  15711. if (code2 === 47 || code2 === 62 || code2 === 123 || code2 !== null && code2 >= 0 && start(code2)) {
  15712. effects.exit(tagNameType);
  15713. return attributeBefore(code2);
  15714. }
  15715. crash(code2, "after local name", "a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag");
  15716. }
  15717. function attributeBefore(code2) {
  15718. if (code2 === 47) {
  15719. effects.enter(tagSelfClosingMarker);
  15720. effects.consume(code2);
  15721. effects.exit(tagSelfClosingMarker);
  15722. returnState = selfClosing;
  15723. return esWhitespaceStart;
  15724. }
  15725. if (code2 === 62) {
  15726. return tagEnd(code2);
  15727. }
  15728. if (code2 === 123) {
  15729. return factoryMdxExpression.call(self2, effects, attributeExpressionAfter, tagExpressionAttributeType, tagExpressionAttributeMarkerType, tagExpressionAttributeValueType, acorn, acornOptions, addResult, true, false, allowLazy)(code2);
  15730. }
  15731. if (code2 !== null && code2 >= 0 && start(code2)) {
  15732. effects.enter(tagAttributeType);
  15733. effects.enter(tagAttributeNameType);
  15734. effects.enter(tagAttributeNamePrimaryType);
  15735. effects.consume(code2);
  15736. return attributePrimaryName;
  15737. }
  15738. crash(code2, "before attribute name", "a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag");
  15739. }
  15740. function attributeExpressionAfter(code2) {
  15741. returnState = attributeBefore;
  15742. return esWhitespaceStart(code2);
  15743. }
  15744. function attributePrimaryName(code2) {
  15745. if (code2 !== null && code2 >= 0 && cont(code2, {
  15746. jsx: true
  15747. })) {
  15748. effects.consume(code2);
  15749. return attributePrimaryName;
  15750. }
  15751. if (code2 === 47 || code2 === 58 || code2 === 61 || code2 === 62 || code2 === 123 || markdownLineEndingOrSpace(code2) || unicodeWhitespace(code2)) {
  15752. effects.exit(tagAttributeNamePrimaryType);
  15753. returnState = attributePrimaryNameAfter;
  15754. return esWhitespaceStart(code2);
  15755. }
  15756. crash(code2, "in attribute name", "an attribute name character such as letters, digits, `$`, or `_`; `=` to initialize a value; whitespace before attributes; or the end of the tag");
  15757. }
  15758. function attributePrimaryNameAfter(code2) {
  15759. if (code2 === 58) {
  15760. effects.enter(tagAttributeNamePrefixMarkerType);
  15761. effects.consume(code2);
  15762. effects.exit(tagAttributeNamePrefixMarkerType);
  15763. returnState = attributeLocalNameBefore;
  15764. return esWhitespaceStart;
  15765. }
  15766. if (code2 === 61) {
  15767. effects.exit(tagAttributeNameType);
  15768. effects.enter(tagAttributeInitializerMarkerType);
  15769. effects.consume(code2);
  15770. effects.exit(tagAttributeInitializerMarkerType);
  15771. returnState = attributeValueBefore;
  15772. return esWhitespaceStart;
  15773. }
  15774. if (code2 === 47 || code2 === 62 || code2 === 123 || markdownLineEndingOrSpace(code2) || unicodeWhitespace(code2) || code2 !== null && code2 >= 0 && start(code2)) {
  15775. effects.exit(tagAttributeNameType);
  15776. effects.exit(tagAttributeType);
  15777. returnState = attributeBefore;
  15778. return esWhitespaceStart(code2);
  15779. }
  15780. crash(code2, "after attribute name", "a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag");
  15781. }
  15782. function attributeLocalNameBefore(code2) {
  15783. if (code2 !== null && code2 >= 0 && start(code2)) {
  15784. effects.enter(tagAttributeNameLocalType);
  15785. effects.consume(code2);
  15786. return attributeLocalName;
  15787. }
  15788. crash(code2, "before local attribute name", "a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag");
  15789. }
  15790. function attributeLocalName(code2) {
  15791. if (code2 !== null && code2 >= 0 && cont(code2, {
  15792. jsx: true
  15793. })) {
  15794. effects.consume(code2);
  15795. return attributeLocalName;
  15796. }
  15797. if (code2 === 47 || code2 === 61 || code2 === 62 || code2 === 123 || markdownLineEndingOrSpace(code2) || unicodeWhitespace(code2)) {
  15798. effects.exit(tagAttributeNameLocalType);
  15799. effects.exit(tagAttributeNameType);
  15800. returnState = attributeLocalNameAfter;
  15801. return esWhitespaceStart(code2);
  15802. }
  15803. crash(code2, "in local attribute name", "an attribute name character such as letters, digits, `$`, or `_`; `=` to initialize a value; whitespace before attributes; or the end of the tag");
  15804. }
  15805. function attributeLocalNameAfter(code2) {
  15806. if (code2 === 61) {
  15807. effects.enter(tagAttributeInitializerMarkerType);
  15808. effects.consume(code2);
  15809. effects.exit(tagAttributeInitializerMarkerType);
  15810. returnState = attributeValueBefore;
  15811. return esWhitespaceStart;
  15812. }
  15813. if (code2 === 47 || code2 === 62 || code2 === 123 || code2 !== null && code2 >= 0 && start(code2)) {
  15814. effects.exit(tagAttributeType);
  15815. return attributeBefore(code2);
  15816. }
  15817. crash(code2, "after local attribute name", "a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag");
  15818. }
  15819. function attributeValueBefore(code2) {
  15820. if (code2 === 34 || code2 === 39) {
  15821. effects.enter(tagAttributeValueLiteralType);
  15822. effects.enter(tagAttributeValueLiteralMarkerType);
  15823. effects.consume(code2);
  15824. effects.exit(tagAttributeValueLiteralMarkerType);
  15825. marker = code2;
  15826. return attributeValueQuotedStart;
  15827. }
  15828. if (code2 === 123) {
  15829. return factoryMdxExpression.call(self2, effects, attributeValueExpressionAfter, tagAttributeValueExpressionType, tagAttributeValueExpressionMarkerType, tagAttributeValueExpressionValueType, acorn, acornOptions, addResult, false, false, allowLazy)(code2);
  15830. }
  15831. crash(code2, "before attribute value", "a character that can start an attribute value, such as `\"`, `'`, or `{`" + (code2 === 60 ? " (note: to use an element or fragment as a prop value in MDX, use `{<element />}`)" : ""));
  15832. }
  15833. function attributeValueExpressionAfter(code2) {
  15834. effects.exit(tagAttributeType);
  15835. returnState = attributeBefore;
  15836. return esWhitespaceStart(code2);
  15837. }
  15838. function attributeValueQuotedStart(code2) {
  15839. if (code2 === null) {
  15840. crash(code2, "in attribute value", "a corresponding closing quote `" + String.fromCodePoint(marker) + "`");
  15841. }
  15842. if (code2 === marker) {
  15843. effects.enter(tagAttributeValueLiteralMarkerType);
  15844. effects.consume(code2);
  15845. effects.exit(tagAttributeValueLiteralMarkerType);
  15846. effects.exit(tagAttributeValueLiteralType);
  15847. effects.exit(tagAttributeType);
  15848. marker = void 0;
  15849. returnState = attributeBefore;
  15850. return esWhitespaceStart;
  15851. }
  15852. if (markdownLineEnding(code2)) {
  15853. returnState = attributeValueQuotedStart;
  15854. return esWhitespaceStart(code2);
  15855. }
  15856. effects.enter(tagAttributeValueLiteralValueType);
  15857. return attributeValueQuoted(code2);
  15858. }
  15859. function attributeValueQuoted(code2) {
  15860. if (code2 === null || code2 === marker || markdownLineEnding(code2)) {
  15861. effects.exit(tagAttributeValueLiteralValueType);
  15862. return attributeValueQuotedStart(code2);
  15863. }
  15864. effects.consume(code2);
  15865. return attributeValueQuoted;
  15866. }
  15867. function selfClosing(code2) {
  15868. if (code2 === 62) {
  15869. return tagEnd(code2);
  15870. }
  15871. crash(code2, "after self-closing slash", "`>` to end the tag" + (code2 === 42 || code2 === 47 ? " (note: JS comments in JSX tags are not supported in MDX)" : ""));
  15872. }
  15873. function tagEnd(code2) {
  15874. effects.enter(tagMarkerType);
  15875. effects.consume(code2);
  15876. effects.exit(tagMarkerType);
  15877. effects.exit(tagType);
  15878. return ok4;
  15879. }
  15880. function esWhitespaceStart(code2) {
  15881. if (markdownLineEnding(code2)) {
  15882. effects.enter("lineEnding");
  15883. effects.consume(code2);
  15884. effects.exit("lineEnding");
  15885. return esWhitespaceEolAfter;
  15886. }
  15887. if (markdownSpace(code2) || unicodeWhitespace(code2)) {
  15888. effects.enter("esWhitespace");
  15889. return esWhitespaceInside(code2);
  15890. }
  15891. return returnState(code2);
  15892. }
  15893. function esWhitespaceInside(code2) {
  15894. if (markdownLineEnding(code2)) {
  15895. effects.exit("esWhitespace");
  15896. return esWhitespaceStart(code2);
  15897. }
  15898. if (markdownSpace(code2) || unicodeWhitespace(code2)) {
  15899. effects.consume(code2);
  15900. return esWhitespaceInside;
  15901. }
  15902. effects.exit("esWhitespace");
  15903. return returnState(code2);
  15904. }
  15905. function esWhitespaceEolAfter(code2) {
  15906. if (!allowLazy && self2.parser.lazy[self2.now().line]) {
  15907. const error = new VFileMessage("Unexpected lazy line in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc", self2.now(), "micromark-extension-mdx-jsx:unexpected-lazy");
  15908. error.url = trouble2 + "#unexpected-lazy-line-in-container-expected-line-to-be";
  15909. throw error;
  15910. }
  15911. return esWhitespaceStart(code2);
  15912. }
  15913. function crash(code2, at2, expect) {
  15914. const error = new VFileMessage("Unexpected " + (code2 === null ? "end of file" : "character `" + (code2 === 96 ? "` ` `" : String.fromCodePoint(code2)) + "` (" + serializeCharCode(code2) + ")") + " " + at2 + ", expected " + expect, self2.now(), "micromark-extension-mdx-jsx:unexpected-" + (code2 === null ? "eof" : "character"));
  15915. error.url = trouble2 + (code2 === null ? "#unexpected-end-of-file-at-expected-expect" : "#unexpected-character-at-expected-expect");
  15916. throw error;
  15917. }
  15918. }
  15919. function serializeCharCode(code2) {
  15920. return "U+" + code2.toString(16).toUpperCase().padStart(4, "0");
  15921. }
  15922. // node_modules/micromark-extension-mdx-jsx/lib/jsx-text.js
  15923. function jsxText(acorn, options) {
  15924. return {
  15925. name: "mdxJsxTextTag",
  15926. tokenize: tokenizeJsxText
  15927. };
  15928. function tokenizeJsxText(effects, ok4, nok) {
  15929. return factoryTag.call(this, effects, ok4, nok, acorn, options.acornOptions, options.addResult, true, "mdxJsxTextTag", "mdxJsxTextTagMarker", "mdxJsxTextTagClosingMarker", "mdxJsxTextTagSelfClosingMarker", "mdxJsxTextTagName", "mdxJsxTextTagNamePrimary", "mdxJsxTextTagNameMemberMarker", "mdxJsxTextTagNameMember", "mdxJsxTextTagNamePrefixMarker", "mdxJsxTextTagNameLocal", "mdxJsxTextTagExpressionAttribute", "mdxJsxTextTagExpressionAttributeMarker", "mdxJsxTextTagExpressionAttributeValue", "mdxJsxTextTagAttribute", "mdxJsxTextTagAttributeName", "mdxJsxTextTagAttributeNamePrimary", "mdxJsxTextTagAttributeNamePrefixMarker", "mdxJsxTextTagAttributeNameLocal", "mdxJsxTextTagAttributeInitializerMarker", "mdxJsxTextTagAttributeValueLiteral", "mdxJsxTextTagAttributeValueLiteralMarker", "mdxJsxTextTagAttributeValueLiteralValue", "mdxJsxTextTagAttributeValueExpression", "mdxJsxTextTagAttributeValueExpressionMarker", "mdxJsxTextTagAttributeValueExpressionValue");
  15930. }
  15931. }
  15932. // node_modules/micromark-extension-mdx-jsx/lib/jsx-flow.js
  15933. function jsxFlow(acorn, options) {
  15934. return {
  15935. name: "mdxJsxFlowTag",
  15936. tokenize: tokenizeJsxFlow,
  15937. concrete: true
  15938. };
  15939. function tokenizeJsxFlow(effects, ok4, nok) {
  15940. const self2 = this;
  15941. return start2;
  15942. function start2(code2) {
  15943. return before(code2);
  15944. }
  15945. function before(code2) {
  15946. return factoryTag.call(self2, effects, after, nok, acorn, options.acornOptions, options.addResult, false, "mdxJsxFlowTag", "mdxJsxFlowTagMarker", "mdxJsxFlowTagClosingMarker", "mdxJsxFlowTagSelfClosingMarker", "mdxJsxFlowTagName", "mdxJsxFlowTagNamePrimary", "mdxJsxFlowTagNameMemberMarker", "mdxJsxFlowTagNameMember", "mdxJsxFlowTagNamePrefixMarker", "mdxJsxFlowTagNameLocal", "mdxJsxFlowTagExpressionAttribute", "mdxJsxFlowTagExpressionAttributeMarker", "mdxJsxFlowTagExpressionAttributeValue", "mdxJsxFlowTagAttribute", "mdxJsxFlowTagAttributeName", "mdxJsxFlowTagAttributeNamePrimary", "mdxJsxFlowTagAttributeNamePrefixMarker", "mdxJsxFlowTagAttributeNameLocal", "mdxJsxFlowTagAttributeInitializerMarker", "mdxJsxFlowTagAttributeValueLiteral", "mdxJsxFlowTagAttributeValueLiteralMarker", "mdxJsxFlowTagAttributeValueLiteralValue", "mdxJsxFlowTagAttributeValueExpression", "mdxJsxFlowTagAttributeValueExpressionMarker", "mdxJsxFlowTagAttributeValueExpressionValue")(code2);
  15947. }
  15948. function after(code2) {
  15949. return markdownSpace(code2) ? factorySpace(effects, end, "whitespace")(code2) : end(code2);
  15950. }
  15951. function end(code2) {
  15952. const leftBraceValue = self2.parser.constructs.flow[123];
  15953. const constructs2 = Array.isArray(leftBraceValue) ? leftBraceValue : leftBraceValue ? [leftBraceValue] : [];
  15954. const expression = constructs2.find((d) => d.name === "mdxFlowExpression");
  15955. return code2 === 60 ? (
  15956. // We can’t just say: fine. Lines of blocks have to be parsed until an eol/eof.
  15957. start2(code2)
  15958. ) : code2 === 123 && expression ? effects.attempt(expression, end, nok)(code2) : code2 === null || markdownLineEnding(code2) ? ok4(code2) : nok(code2);
  15959. }
  15960. }
  15961. }
  15962. // node_modules/micromark-extension-mdx-jsx/lib/syntax.js
  15963. function mdxJsx(options) {
  15964. const settings = options || {};
  15965. const acorn = settings.acorn;
  15966. let acornOptions;
  15967. if (acorn) {
  15968. if (!acorn.parse || !acorn.parseExpressionAt) {
  15969. throw new Error("Expected a proper `acorn` instance passed in as `options.acorn`");
  15970. }
  15971. acornOptions = Object.assign({
  15972. ecmaVersion: 2024,
  15973. sourceType: "module"
  15974. }, settings.acornOptions, {
  15975. locations: true
  15976. });
  15977. } else if (settings.acornOptions || settings.addResult) {
  15978. throw new Error("Expected an `acorn` instance passed in as `options.acorn`");
  15979. }
  15980. return {
  15981. flow: {
  15982. [60]: jsxFlow(acorn || void 0, {
  15983. acornOptions,
  15984. addResult: settings.addResult || void 0
  15985. })
  15986. },
  15987. text: {
  15988. [60]: jsxText(acorn || void 0, {
  15989. acornOptions,
  15990. addResult: settings.addResult || void 0
  15991. })
  15992. }
  15993. };
  15994. }
  15995. // node_modules/micromark-extension-mdx-md/index.js
  15996. function mdxMd() {
  15997. return {
  15998. disable: { null: ["autolink", "codeIndented", "htmlFlow", "htmlText"] }
  15999. };
  16000. }
  16001. // node_modules/micromark-util-chunked/index.js
  16002. function splice(list3, start2, remove, items) {
  16003. const end = list3.length;
  16004. let chunkStart = 0;
  16005. let parameters;
  16006. if (start2 < 0) {
  16007. start2 = -start2 > end ? 0 : end + start2;
  16008. } else {
  16009. start2 = start2 > end ? end : start2;
  16010. }
  16011. remove = remove > 0 ? remove : 0;
  16012. if (items.length < 1e4) {
  16013. parameters = Array.from(items);
  16014. parameters.unshift(start2, remove);
  16015. list3.splice(...parameters);
  16016. } else {
  16017. if (remove) list3.splice(start2, remove);
  16018. while (chunkStart < items.length) {
  16019. parameters = items.slice(chunkStart, chunkStart + 1e4);
  16020. parameters.unshift(start2, 0);
  16021. list3.splice(...parameters);
  16022. chunkStart += 1e4;
  16023. start2 += 1e4;
  16024. }
  16025. }
  16026. }
  16027. function push(list3, items) {
  16028. if (list3.length > 0) {
  16029. splice(list3, list3.length, 0, items);
  16030. return list3;
  16031. }
  16032. return items;
  16033. }
  16034. // node_modules/micromark-util-classify-character/index.js
  16035. function classifyCharacter(code2) {
  16036. if (code2 === null || markdownLineEndingOrSpace(code2) || unicodeWhitespace(code2)) {
  16037. return 1;
  16038. }
  16039. if (unicodePunctuation(code2)) {
  16040. return 2;
  16041. }
  16042. }
  16043. // node_modules/micromark-util-resolve-all/index.js
  16044. function resolveAll(constructs2, events, context) {
  16045. const called = [];
  16046. let index2 = -1;
  16047. while (++index2 < constructs2.length) {
  16048. const resolve = constructs2[index2].resolveAll;
  16049. if (resolve && !called.includes(resolve)) {
  16050. events = resolve(events, context);
  16051. called.push(resolve);
  16052. }
  16053. }
  16054. return events;
  16055. }
  16056. // node_modules/micromark-core-commonmark/lib/attention.js
  16057. var attention = {
  16058. name: "attention",
  16059. tokenize: tokenizeAttention,
  16060. resolveAll: resolveAllAttention
  16061. };
  16062. function resolveAllAttention(events, context) {
  16063. let index2 = -1;
  16064. let open;
  16065. let group;
  16066. let text5;
  16067. let openingSequence;
  16068. let closingSequence;
  16069. let use;
  16070. let nextEvents;
  16071. let offset2;
  16072. while (++index2 < events.length) {
  16073. if (events[index2][0] === "enter" && events[index2][1].type === "attentionSequence" && events[index2][1]._close) {
  16074. open = index2;
  16075. while (open--) {
  16076. if (events[open][0] === "exit" && events[open][1].type === "attentionSequence" && events[open][1]._open && // If the markers are the same:
  16077. context.sliceSerialize(events[open][1]).charCodeAt(0) === context.sliceSerialize(events[index2][1]).charCodeAt(0)) {
  16078. if ((events[open][1]._close || events[index2][1]._open) && (events[index2][1].end.offset - events[index2][1].start.offset) % 3 && !((events[open][1].end.offset - events[open][1].start.offset + events[index2][1].end.offset - events[index2][1].start.offset) % 3)) {
  16079. continue;
  16080. }
  16081. use = events[open][1].end.offset - events[open][1].start.offset > 1 && events[index2][1].end.offset - events[index2][1].start.offset > 1 ? 2 : 1;
  16082. const start2 = Object.assign({}, events[open][1].end);
  16083. const end = Object.assign({}, events[index2][1].start);
  16084. movePoint(start2, -use);
  16085. movePoint(end, use);
  16086. openingSequence = {
  16087. type: use > 1 ? "strongSequence" : "emphasisSequence",
  16088. start: start2,
  16089. end: Object.assign({}, events[open][1].end)
  16090. };
  16091. closingSequence = {
  16092. type: use > 1 ? "strongSequence" : "emphasisSequence",
  16093. start: Object.assign({}, events[index2][1].start),
  16094. end
  16095. };
  16096. text5 = {
  16097. type: use > 1 ? "strongText" : "emphasisText",
  16098. start: Object.assign({}, events[open][1].end),
  16099. end: Object.assign({}, events[index2][1].start)
  16100. };
  16101. group = {
  16102. type: use > 1 ? "strong" : "emphasis",
  16103. start: Object.assign({}, openingSequence.start),
  16104. end: Object.assign({}, closingSequence.end)
  16105. };
  16106. events[open][1].end = Object.assign({}, openingSequence.start);
  16107. events[index2][1].start = Object.assign({}, closingSequence.end);
  16108. nextEvents = [];
  16109. if (events[open][1].end.offset - events[open][1].start.offset) {
  16110. nextEvents = push(nextEvents, [["enter", events[open][1], context], ["exit", events[open][1], context]]);
  16111. }
  16112. nextEvents = push(nextEvents, [["enter", group, context], ["enter", openingSequence, context], ["exit", openingSequence, context], ["enter", text5, context]]);
  16113. nextEvents = push(nextEvents, resolveAll(context.parser.constructs.insideSpan.null, events.slice(open + 1, index2), context));
  16114. nextEvents = push(nextEvents, [["exit", text5, context], ["enter", closingSequence, context], ["exit", closingSequence, context], ["exit", group, context]]);
  16115. if (events[index2][1].end.offset - events[index2][1].start.offset) {
  16116. offset2 = 2;
  16117. nextEvents = push(nextEvents, [["enter", events[index2][1], context], ["exit", events[index2][1], context]]);
  16118. } else {
  16119. offset2 = 0;
  16120. }
  16121. splice(events, open - 1, index2 - open + 3, nextEvents);
  16122. index2 = open + nextEvents.length - offset2 - 2;
  16123. break;
  16124. }
  16125. }
  16126. }
  16127. }
  16128. index2 = -1;
  16129. while (++index2 < events.length) {
  16130. if (events[index2][1].type === "attentionSequence") {
  16131. events[index2][1].type = "data";
  16132. }
  16133. }
  16134. return events;
  16135. }
  16136. function tokenizeAttention(effects, ok4) {
  16137. const attentionMarkers2 = this.parser.constructs.attentionMarkers.null;
  16138. const previous2 = this.previous;
  16139. const before = classifyCharacter(previous2);
  16140. let marker;
  16141. return start2;
  16142. function start2(code2) {
  16143. marker = code2;
  16144. effects.enter("attentionSequence");
  16145. return inside(code2);
  16146. }
  16147. function inside(code2) {
  16148. if (code2 === marker) {
  16149. effects.consume(code2);
  16150. return inside;
  16151. }
  16152. const token = effects.exit("attentionSequence");
  16153. const after = classifyCharacter(code2);
  16154. const open = !after || after === 2 && before || attentionMarkers2.includes(code2);
  16155. const close = !before || before === 2 && after || attentionMarkers2.includes(previous2);
  16156. token._open = Boolean(marker === 42 ? open : open && (before || !close));
  16157. token._close = Boolean(marker === 42 ? close : close && (after || !open));
  16158. return ok4(code2);
  16159. }
  16160. }
  16161. function movePoint(point4, offset2) {
  16162. point4.column += offset2;
  16163. point4.offset += offset2;
  16164. point4._bufferIndex += offset2;
  16165. }
  16166. // node_modules/micromark-core-commonmark/lib/autolink.js
  16167. var autolink = {
  16168. name: "autolink",
  16169. tokenize: tokenizeAutolink
  16170. };
  16171. function tokenizeAutolink(effects, ok4, nok) {
  16172. let size = 0;
  16173. return start2;
  16174. function start2(code2) {
  16175. effects.enter("autolink");
  16176. effects.enter("autolinkMarker");
  16177. effects.consume(code2);
  16178. effects.exit("autolinkMarker");
  16179. effects.enter("autolinkProtocol");
  16180. return open;
  16181. }
  16182. function open(code2) {
  16183. if (asciiAlpha(code2)) {
  16184. effects.consume(code2);
  16185. return schemeOrEmailAtext;
  16186. }
  16187. if (code2 === 64) {
  16188. return nok(code2);
  16189. }
  16190. return emailAtext(code2);
  16191. }
  16192. function schemeOrEmailAtext(code2) {
  16193. if (code2 === 43 || code2 === 45 || code2 === 46 || asciiAlphanumeric(code2)) {
  16194. size = 1;
  16195. return schemeInsideOrEmailAtext(code2);
  16196. }
  16197. return emailAtext(code2);
  16198. }
  16199. function schemeInsideOrEmailAtext(code2) {
  16200. if (code2 === 58) {
  16201. effects.consume(code2);
  16202. size = 0;
  16203. return urlInside;
  16204. }
  16205. if ((code2 === 43 || code2 === 45 || code2 === 46 || asciiAlphanumeric(code2)) && size++ < 32) {
  16206. effects.consume(code2);
  16207. return schemeInsideOrEmailAtext;
  16208. }
  16209. size = 0;
  16210. return emailAtext(code2);
  16211. }
  16212. function urlInside(code2) {
  16213. if (code2 === 62) {
  16214. effects.exit("autolinkProtocol");
  16215. effects.enter("autolinkMarker");
  16216. effects.consume(code2);
  16217. effects.exit("autolinkMarker");
  16218. effects.exit("autolink");
  16219. return ok4;
  16220. }
  16221. if (code2 === null || code2 === 32 || code2 === 60 || asciiControl(code2)) {
  16222. return nok(code2);
  16223. }
  16224. effects.consume(code2);
  16225. return urlInside;
  16226. }
  16227. function emailAtext(code2) {
  16228. if (code2 === 64) {
  16229. effects.consume(code2);
  16230. return emailAtSignOrDot;
  16231. }
  16232. if (asciiAtext(code2)) {
  16233. effects.consume(code2);
  16234. return emailAtext;
  16235. }
  16236. return nok(code2);
  16237. }
  16238. function emailAtSignOrDot(code2) {
  16239. return asciiAlphanumeric(code2) ? emailLabel(code2) : nok(code2);
  16240. }
  16241. function emailLabel(code2) {
  16242. if (code2 === 46) {
  16243. effects.consume(code2);
  16244. size = 0;
  16245. return emailAtSignOrDot;
  16246. }
  16247. if (code2 === 62) {
  16248. effects.exit("autolinkProtocol").type = "autolinkEmail";
  16249. effects.enter("autolinkMarker");
  16250. effects.consume(code2);
  16251. effects.exit("autolinkMarker");
  16252. effects.exit("autolink");
  16253. return ok4;
  16254. }
  16255. return emailValue(code2);
  16256. }
  16257. function emailValue(code2) {
  16258. if ((code2 === 45 || asciiAlphanumeric(code2)) && size++ < 63) {
  16259. const next = code2 === 45 ? emailValue : emailLabel;
  16260. effects.consume(code2);
  16261. return next;
  16262. }
  16263. return nok(code2);
  16264. }
  16265. }
  16266. // node_modules/micromark-core-commonmark/lib/blank-line.js
  16267. var blankLine = {
  16268. tokenize: tokenizeBlankLine,
  16269. partial: true
  16270. };
  16271. function tokenizeBlankLine(effects, ok4, nok) {
  16272. return start2;
  16273. function start2(code2) {
  16274. return markdownSpace(code2) ? factorySpace(effects, after, "linePrefix")(code2) : after(code2);
  16275. }
  16276. function after(code2) {
  16277. return code2 === null || markdownLineEnding(code2) ? ok4(code2) : nok(code2);
  16278. }
  16279. }
  16280. // node_modules/micromark-core-commonmark/lib/block-quote.js
  16281. var blockQuote = {
  16282. name: "blockQuote",
  16283. tokenize: tokenizeBlockQuoteStart,
  16284. continuation: {
  16285. tokenize: tokenizeBlockQuoteContinuation
  16286. },
  16287. exit
  16288. };
  16289. function tokenizeBlockQuoteStart(effects, ok4, nok) {
  16290. const self2 = this;
  16291. return start2;
  16292. function start2(code2) {
  16293. if (code2 === 62) {
  16294. const state = self2.containerState;
  16295. if (!state.open) {
  16296. effects.enter("blockQuote", {
  16297. _container: true
  16298. });
  16299. state.open = true;
  16300. }
  16301. effects.enter("blockQuotePrefix");
  16302. effects.enter("blockQuoteMarker");
  16303. effects.consume(code2);
  16304. effects.exit("blockQuoteMarker");
  16305. return after;
  16306. }
  16307. return nok(code2);
  16308. }
  16309. function after(code2) {
  16310. if (markdownSpace(code2)) {
  16311. effects.enter("blockQuotePrefixWhitespace");
  16312. effects.consume(code2);
  16313. effects.exit("blockQuotePrefixWhitespace");
  16314. effects.exit("blockQuotePrefix");
  16315. return ok4;
  16316. }
  16317. effects.exit("blockQuotePrefix");
  16318. return ok4(code2);
  16319. }
  16320. }
  16321. function tokenizeBlockQuoteContinuation(effects, ok4, nok) {
  16322. const self2 = this;
  16323. return contStart;
  16324. function contStart(code2) {
  16325. if (markdownSpace(code2)) {
  16326. return factorySpace(effects, contBefore, "linePrefix", self2.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(code2);
  16327. }
  16328. return contBefore(code2);
  16329. }
  16330. function contBefore(code2) {
  16331. return effects.attempt(blockQuote, ok4, nok)(code2);
  16332. }
  16333. }
  16334. function exit(effects) {
  16335. effects.exit("blockQuote");
  16336. }
  16337. // node_modules/micromark-core-commonmark/lib/character-escape.js
  16338. var characterEscape = {
  16339. name: "characterEscape",
  16340. tokenize: tokenizeCharacterEscape
  16341. };
  16342. function tokenizeCharacterEscape(effects, ok4, nok) {
  16343. return start2;
  16344. function start2(code2) {
  16345. effects.enter("characterEscape");
  16346. effects.enter("escapeMarker");
  16347. effects.consume(code2);
  16348. effects.exit("escapeMarker");
  16349. return inside;
  16350. }
  16351. function inside(code2) {
  16352. if (asciiPunctuation(code2)) {
  16353. effects.enter("characterEscapeValue");
  16354. effects.consume(code2);
  16355. effects.exit("characterEscapeValue");
  16356. effects.exit("characterEscape");
  16357. return ok4;
  16358. }
  16359. return nok(code2);
  16360. }
  16361. }
  16362. // node_modules/micromark-core-commonmark/lib/character-reference.js
  16363. var characterReference = {
  16364. name: "characterReference",
  16365. tokenize: tokenizeCharacterReference
  16366. };
  16367. function tokenizeCharacterReference(effects, ok4, nok) {
  16368. const self2 = this;
  16369. let size = 0;
  16370. let max;
  16371. let test;
  16372. return start2;
  16373. function start2(code2) {
  16374. effects.enter("characterReference");
  16375. effects.enter("characterReferenceMarker");
  16376. effects.consume(code2);
  16377. effects.exit("characterReferenceMarker");
  16378. return open;
  16379. }
  16380. function open(code2) {
  16381. if (code2 === 35) {
  16382. effects.enter("characterReferenceMarkerNumeric");
  16383. effects.consume(code2);
  16384. effects.exit("characterReferenceMarkerNumeric");
  16385. return numeric;
  16386. }
  16387. effects.enter("characterReferenceValue");
  16388. max = 31;
  16389. test = asciiAlphanumeric;
  16390. return value(code2);
  16391. }
  16392. function numeric(code2) {
  16393. if (code2 === 88 || code2 === 120) {
  16394. effects.enter("characterReferenceMarkerHexadecimal");
  16395. effects.consume(code2);
  16396. effects.exit("characterReferenceMarkerHexadecimal");
  16397. effects.enter("characterReferenceValue");
  16398. max = 6;
  16399. test = asciiHexDigit;
  16400. return value;
  16401. }
  16402. effects.enter("characterReferenceValue");
  16403. max = 7;
  16404. test = asciiDigit;
  16405. return value(code2);
  16406. }
  16407. function value(code2) {
  16408. if (code2 === 59 && size) {
  16409. const token = effects.exit("characterReferenceValue");
  16410. if (test === asciiAlphanumeric && !decodeNamedCharacterReference(self2.sliceSerialize(token))) {
  16411. return nok(code2);
  16412. }
  16413. effects.enter("characterReferenceMarker");
  16414. effects.consume(code2);
  16415. effects.exit("characterReferenceMarker");
  16416. effects.exit("characterReference");
  16417. return ok4;
  16418. }
  16419. if (test(code2) && size++ < max) {
  16420. effects.consume(code2);
  16421. return value;
  16422. }
  16423. return nok(code2);
  16424. }
  16425. }
  16426. // node_modules/micromark-core-commonmark/lib/code-fenced.js
  16427. var nonLazyContinuation = {
  16428. tokenize: tokenizeNonLazyContinuation,
  16429. partial: true
  16430. };
  16431. var codeFenced = {
  16432. name: "codeFenced",
  16433. tokenize: tokenizeCodeFenced,
  16434. concrete: true
  16435. };
  16436. function tokenizeCodeFenced(effects, ok4, nok) {
  16437. const self2 = this;
  16438. const closeStart = {
  16439. tokenize: tokenizeCloseStart,
  16440. partial: true
  16441. };
  16442. let initialPrefix = 0;
  16443. let sizeOpen = 0;
  16444. let marker;
  16445. return start2;
  16446. function start2(code2) {
  16447. return beforeSequenceOpen(code2);
  16448. }
  16449. function beforeSequenceOpen(code2) {
  16450. const tail = self2.events[self2.events.length - 1];
  16451. initialPrefix = tail && tail[1].type === "linePrefix" ? tail[2].sliceSerialize(tail[1], true).length : 0;
  16452. marker = code2;
  16453. effects.enter("codeFenced");
  16454. effects.enter("codeFencedFence");
  16455. effects.enter("codeFencedFenceSequence");
  16456. return sequenceOpen(code2);
  16457. }
  16458. function sequenceOpen(code2) {
  16459. if (code2 === marker) {
  16460. sizeOpen++;
  16461. effects.consume(code2);
  16462. return sequenceOpen;
  16463. }
  16464. if (sizeOpen < 3) {
  16465. return nok(code2);
  16466. }
  16467. effects.exit("codeFencedFenceSequence");
  16468. return markdownSpace(code2) ? factorySpace(effects, infoBefore, "whitespace")(code2) : infoBefore(code2);
  16469. }
  16470. function infoBefore(code2) {
  16471. if (code2 === null || markdownLineEnding(code2)) {
  16472. effects.exit("codeFencedFence");
  16473. return self2.interrupt ? ok4(code2) : effects.check(nonLazyContinuation, atNonLazyBreak, after)(code2);
  16474. }
  16475. effects.enter("codeFencedFenceInfo");
  16476. effects.enter("chunkString", {
  16477. contentType: "string"
  16478. });
  16479. return info(code2);
  16480. }
  16481. function info(code2) {
  16482. if (code2 === null || markdownLineEnding(code2)) {
  16483. effects.exit("chunkString");
  16484. effects.exit("codeFencedFenceInfo");
  16485. return infoBefore(code2);
  16486. }
  16487. if (markdownSpace(code2)) {
  16488. effects.exit("chunkString");
  16489. effects.exit("codeFencedFenceInfo");
  16490. return factorySpace(effects, metaBefore, "whitespace")(code2);
  16491. }
  16492. if (code2 === 96 && code2 === marker) {
  16493. return nok(code2);
  16494. }
  16495. effects.consume(code2);
  16496. return info;
  16497. }
  16498. function metaBefore(code2) {
  16499. if (code2 === null || markdownLineEnding(code2)) {
  16500. return infoBefore(code2);
  16501. }
  16502. effects.enter("codeFencedFenceMeta");
  16503. effects.enter("chunkString", {
  16504. contentType: "string"
  16505. });
  16506. return meta(code2);
  16507. }
  16508. function meta(code2) {
  16509. if (code2 === null || markdownLineEnding(code2)) {
  16510. effects.exit("chunkString");
  16511. effects.exit("codeFencedFenceMeta");
  16512. return infoBefore(code2);
  16513. }
  16514. if (code2 === 96 && code2 === marker) {
  16515. return nok(code2);
  16516. }
  16517. effects.consume(code2);
  16518. return meta;
  16519. }
  16520. function atNonLazyBreak(code2) {
  16521. return effects.attempt(closeStart, after, contentBefore)(code2);
  16522. }
  16523. function contentBefore(code2) {
  16524. effects.enter("lineEnding");
  16525. effects.consume(code2);
  16526. effects.exit("lineEnding");
  16527. return contentStart;
  16528. }
  16529. function contentStart(code2) {
  16530. return initialPrefix > 0 && markdownSpace(code2) ? factorySpace(effects, beforeContentChunk, "linePrefix", initialPrefix + 1)(code2) : beforeContentChunk(code2);
  16531. }
  16532. function beforeContentChunk(code2) {
  16533. if (code2 === null || markdownLineEnding(code2)) {
  16534. return effects.check(nonLazyContinuation, atNonLazyBreak, after)(code2);
  16535. }
  16536. effects.enter("codeFlowValue");
  16537. return contentChunk(code2);
  16538. }
  16539. function contentChunk(code2) {
  16540. if (code2 === null || markdownLineEnding(code2)) {
  16541. effects.exit("codeFlowValue");
  16542. return beforeContentChunk(code2);
  16543. }
  16544. effects.consume(code2);
  16545. return contentChunk;
  16546. }
  16547. function after(code2) {
  16548. effects.exit("codeFenced");
  16549. return ok4(code2);
  16550. }
  16551. function tokenizeCloseStart(effects2, ok5, nok2) {
  16552. let size = 0;
  16553. return startBefore;
  16554. function startBefore(code2) {
  16555. effects2.enter("lineEnding");
  16556. effects2.consume(code2);
  16557. effects2.exit("lineEnding");
  16558. return start3;
  16559. }
  16560. function start3(code2) {
  16561. effects2.enter("codeFencedFence");
  16562. return markdownSpace(code2) ? factorySpace(effects2, beforeSequenceClose, "linePrefix", self2.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(code2) : beforeSequenceClose(code2);
  16563. }
  16564. function beforeSequenceClose(code2) {
  16565. if (code2 === marker) {
  16566. effects2.enter("codeFencedFenceSequence");
  16567. return sequenceClose(code2);
  16568. }
  16569. return nok2(code2);
  16570. }
  16571. function sequenceClose(code2) {
  16572. if (code2 === marker) {
  16573. size++;
  16574. effects2.consume(code2);
  16575. return sequenceClose;
  16576. }
  16577. if (size >= sizeOpen) {
  16578. effects2.exit("codeFencedFenceSequence");
  16579. return markdownSpace(code2) ? factorySpace(effects2, sequenceCloseAfter, "whitespace")(code2) : sequenceCloseAfter(code2);
  16580. }
  16581. return nok2(code2);
  16582. }
  16583. function sequenceCloseAfter(code2) {
  16584. if (code2 === null || markdownLineEnding(code2)) {
  16585. effects2.exit("codeFencedFence");
  16586. return ok5(code2);
  16587. }
  16588. return nok2(code2);
  16589. }
  16590. }
  16591. }
  16592. function tokenizeNonLazyContinuation(effects, ok4, nok) {
  16593. const self2 = this;
  16594. return start2;
  16595. function start2(code2) {
  16596. if (code2 === null) {
  16597. return nok(code2);
  16598. }
  16599. effects.enter("lineEnding");
  16600. effects.consume(code2);
  16601. effects.exit("lineEnding");
  16602. return lineStart;
  16603. }
  16604. function lineStart(code2) {
  16605. return self2.parser.lazy[self2.now().line] ? nok(code2) : ok4(code2);
  16606. }
  16607. }
  16608. // node_modules/micromark-core-commonmark/lib/code-indented.js
  16609. var codeIndented = {
  16610. name: "codeIndented",
  16611. tokenize: tokenizeCodeIndented
  16612. };
  16613. var furtherStart = {
  16614. tokenize: tokenizeFurtherStart,
  16615. partial: true
  16616. };
  16617. function tokenizeCodeIndented(effects, ok4, nok) {
  16618. const self2 = this;
  16619. return start2;
  16620. function start2(code2) {
  16621. effects.enter("codeIndented");
  16622. return factorySpace(effects, afterPrefix, "linePrefix", 4 + 1)(code2);
  16623. }
  16624. function afterPrefix(code2) {
  16625. const tail = self2.events[self2.events.length - 1];
  16626. return tail && tail[1].type === "linePrefix" && tail[2].sliceSerialize(tail[1], true).length >= 4 ? atBreak(code2) : nok(code2);
  16627. }
  16628. function atBreak(code2) {
  16629. if (code2 === null) {
  16630. return after(code2);
  16631. }
  16632. if (markdownLineEnding(code2)) {
  16633. return effects.attempt(furtherStart, atBreak, after)(code2);
  16634. }
  16635. effects.enter("codeFlowValue");
  16636. return inside(code2);
  16637. }
  16638. function inside(code2) {
  16639. if (code2 === null || markdownLineEnding(code2)) {
  16640. effects.exit("codeFlowValue");
  16641. return atBreak(code2);
  16642. }
  16643. effects.consume(code2);
  16644. return inside;
  16645. }
  16646. function after(code2) {
  16647. effects.exit("codeIndented");
  16648. return ok4(code2);
  16649. }
  16650. }
  16651. function tokenizeFurtherStart(effects, ok4, nok) {
  16652. const self2 = this;
  16653. return furtherStart2;
  16654. function furtherStart2(code2) {
  16655. if (self2.parser.lazy[self2.now().line]) {
  16656. return nok(code2);
  16657. }
  16658. if (markdownLineEnding(code2)) {
  16659. effects.enter("lineEnding");
  16660. effects.consume(code2);
  16661. effects.exit("lineEnding");
  16662. return furtherStart2;
  16663. }
  16664. return factorySpace(effects, afterPrefix, "linePrefix", 4 + 1)(code2);
  16665. }
  16666. function afterPrefix(code2) {
  16667. const tail = self2.events[self2.events.length - 1];
  16668. return tail && tail[1].type === "linePrefix" && tail[2].sliceSerialize(tail[1], true).length >= 4 ? ok4(code2) : markdownLineEnding(code2) ? furtherStart2(code2) : nok(code2);
  16669. }
  16670. }
  16671. // node_modules/micromark-core-commonmark/lib/code-text.js
  16672. var codeText = {
  16673. name: "codeText",
  16674. tokenize: tokenizeCodeText,
  16675. resolve: resolveCodeText,
  16676. previous
  16677. };
  16678. function resolveCodeText(events) {
  16679. let tailExitIndex = events.length - 4;
  16680. let headEnterIndex = 3;
  16681. let index2;
  16682. let enter;
  16683. if ((events[headEnterIndex][1].type === "lineEnding" || events[headEnterIndex][1].type === "space") && (events[tailExitIndex][1].type === "lineEnding" || events[tailExitIndex][1].type === "space")) {
  16684. index2 = headEnterIndex;
  16685. while (++index2 < tailExitIndex) {
  16686. if (events[index2][1].type === "codeTextData") {
  16687. events[headEnterIndex][1].type = "codeTextPadding";
  16688. events[tailExitIndex][1].type = "codeTextPadding";
  16689. headEnterIndex += 2;
  16690. tailExitIndex -= 2;
  16691. break;
  16692. }
  16693. }
  16694. }
  16695. index2 = headEnterIndex - 1;
  16696. tailExitIndex++;
  16697. while (++index2 <= tailExitIndex) {
  16698. if (enter === void 0) {
  16699. if (index2 !== tailExitIndex && events[index2][1].type !== "lineEnding") {
  16700. enter = index2;
  16701. }
  16702. } else if (index2 === tailExitIndex || events[index2][1].type === "lineEnding") {
  16703. events[enter][1].type = "codeTextData";
  16704. if (index2 !== enter + 2) {
  16705. events[enter][1].end = events[index2 - 1][1].end;
  16706. events.splice(enter + 2, index2 - enter - 2);
  16707. tailExitIndex -= index2 - enter - 2;
  16708. index2 = enter + 2;
  16709. }
  16710. enter = void 0;
  16711. }
  16712. }
  16713. return events;
  16714. }
  16715. function previous(code2) {
  16716. return code2 !== 96 || this.events[this.events.length - 1][1].type === "characterEscape";
  16717. }
  16718. function tokenizeCodeText(effects, ok4, nok) {
  16719. const self2 = this;
  16720. let sizeOpen = 0;
  16721. let size;
  16722. let token;
  16723. return start2;
  16724. function start2(code2) {
  16725. effects.enter("codeText");
  16726. effects.enter("codeTextSequence");
  16727. return sequenceOpen(code2);
  16728. }
  16729. function sequenceOpen(code2) {
  16730. if (code2 === 96) {
  16731. effects.consume(code2);
  16732. sizeOpen++;
  16733. return sequenceOpen;
  16734. }
  16735. effects.exit("codeTextSequence");
  16736. return between(code2);
  16737. }
  16738. function between(code2) {
  16739. if (code2 === null) {
  16740. return nok(code2);
  16741. }
  16742. if (code2 === 32) {
  16743. effects.enter("space");
  16744. effects.consume(code2);
  16745. effects.exit("space");
  16746. return between;
  16747. }
  16748. if (code2 === 96) {
  16749. token = effects.enter("codeTextSequence");
  16750. size = 0;
  16751. return sequenceClose(code2);
  16752. }
  16753. if (markdownLineEnding(code2)) {
  16754. effects.enter("lineEnding");
  16755. effects.consume(code2);
  16756. effects.exit("lineEnding");
  16757. return between;
  16758. }
  16759. effects.enter("codeTextData");
  16760. return data2(code2);
  16761. }
  16762. function data2(code2) {
  16763. if (code2 === null || code2 === 32 || code2 === 96 || markdownLineEnding(code2)) {
  16764. effects.exit("codeTextData");
  16765. return between(code2);
  16766. }
  16767. effects.consume(code2);
  16768. return data2;
  16769. }
  16770. function sequenceClose(code2) {
  16771. if (code2 === 96) {
  16772. effects.consume(code2);
  16773. size++;
  16774. return sequenceClose;
  16775. }
  16776. if (size === sizeOpen) {
  16777. effects.exit("codeTextSequence");
  16778. effects.exit("codeText");
  16779. return ok4(code2);
  16780. }
  16781. token.type = "codeTextData";
  16782. return data2(code2);
  16783. }
  16784. }
  16785. // node_modules/micromark-util-subtokenize/lib/splice-buffer.js
  16786. var SpliceBuffer = class {
  16787. /**
  16788. * @param {ReadonlyArray<T> | null | undefined} [initial]
  16789. * Initial items (optional).
  16790. * @returns
  16791. * Splice buffer.
  16792. */
  16793. constructor(initial) {
  16794. this.left = initial ? [...initial] : [];
  16795. this.right = [];
  16796. }
  16797. /**
  16798. * Array access;
  16799. * does not move the cursor.
  16800. *
  16801. * @param {number} index
  16802. * Index.
  16803. * @return {T}
  16804. * Item.
  16805. */
  16806. get(index2) {
  16807. if (index2 < 0 || index2 >= this.left.length + this.right.length) {
  16808. throw new RangeError("Cannot access index `" + index2 + "` in a splice buffer of size `" + (this.left.length + this.right.length) + "`");
  16809. }
  16810. if (index2 < this.left.length) return this.left[index2];
  16811. return this.right[this.right.length - index2 + this.left.length - 1];
  16812. }
  16813. /**
  16814. * The length of the splice buffer, one greater than the largest index in the
  16815. * array.
  16816. */
  16817. get length() {
  16818. return this.left.length + this.right.length;
  16819. }
  16820. /**
  16821. * Remove and return `list[0]`;
  16822. * moves the cursor to `0`.
  16823. *
  16824. * @returns {T | undefined}
  16825. * Item, optional.
  16826. */
  16827. shift() {
  16828. this.setCursor(0);
  16829. return this.right.pop();
  16830. }
  16831. /**
  16832. * Slice the buffer to get an array;
  16833. * does not move the cursor.
  16834. *
  16835. * @param {number} start
  16836. * Start.
  16837. * @param {number | null | undefined} [end]
  16838. * End (optional).
  16839. * @returns {Array<T>}
  16840. * Array of items.
  16841. */
  16842. slice(start2, end) {
  16843. const stop = end === null || end === void 0 ? Number.POSITIVE_INFINITY : end;
  16844. if (stop < this.left.length) {
  16845. return this.left.slice(start2, stop);
  16846. }
  16847. if (start2 > this.left.length) {
  16848. return this.right.slice(this.right.length - stop + this.left.length, this.right.length - start2 + this.left.length).reverse();
  16849. }
  16850. return this.left.slice(start2).concat(this.right.slice(this.right.length - stop + this.left.length).reverse());
  16851. }
  16852. /**
  16853. * Mimics the behavior of Array.prototype.splice() except for the change of
  16854. * interface necessary to avoid segfaults when patching in very large arrays.
  16855. *
  16856. * This operation moves cursor is moved to `start` and results in the cursor
  16857. * placed after any inserted items.
  16858. *
  16859. * @param {number} start
  16860. * Start;
  16861. * zero-based index at which to start changing the array;
  16862. * negative numbers count backwards from the end of the array and values
  16863. * that are out-of bounds are clamped to the appropriate end of the array.
  16864. * @param {number | null | undefined} [deleteCount=0]
  16865. * Delete count (default: `0`);
  16866. * maximum number of elements to delete, starting from start.
  16867. * @param {Array<T> | null | undefined} [items=[]]
  16868. * Items to include in place of the deleted items (default: `[]`).
  16869. * @return {Array<T>}
  16870. * Any removed items.
  16871. */
  16872. splice(start2, deleteCount, items) {
  16873. const count = deleteCount || 0;
  16874. this.setCursor(Math.trunc(start2));
  16875. const removed = this.right.splice(this.right.length - count, Number.POSITIVE_INFINITY);
  16876. if (items) chunkedPush(this.left, items);
  16877. return removed.reverse();
  16878. }
  16879. /**
  16880. * Remove and return the highest-numbered item in the array, so
  16881. * `list[list.length - 1]`;
  16882. * Moves the cursor to `length`.
  16883. *
  16884. * @returns {T | undefined}
  16885. * Item, optional.
  16886. */
  16887. pop() {
  16888. this.setCursor(Number.POSITIVE_INFINITY);
  16889. return this.left.pop();
  16890. }
  16891. /**
  16892. * Inserts a single item to the high-numbered side of the array;
  16893. * moves the cursor to `length`.
  16894. *
  16895. * @param {T} item
  16896. * Item.
  16897. * @returns {undefined}
  16898. * Nothing.
  16899. */
  16900. push(item) {
  16901. this.setCursor(Number.POSITIVE_INFINITY);
  16902. this.left.push(item);
  16903. }
  16904. /**
  16905. * Inserts many items to the high-numbered side of the array.
  16906. * Moves the cursor to `length`.
  16907. *
  16908. * @param {Array<T>} items
  16909. * Items.
  16910. * @returns {undefined}
  16911. * Nothing.
  16912. */
  16913. pushMany(items) {
  16914. this.setCursor(Number.POSITIVE_INFINITY);
  16915. chunkedPush(this.left, items);
  16916. }
  16917. /**
  16918. * Inserts a single item to the low-numbered side of the array;
  16919. * Moves the cursor to `0`.
  16920. *
  16921. * @param {T} item
  16922. * Item.
  16923. * @returns {undefined}
  16924. * Nothing.
  16925. */
  16926. unshift(item) {
  16927. this.setCursor(0);
  16928. this.right.push(item);
  16929. }
  16930. /**
  16931. * Inserts many items to the low-numbered side of the array;
  16932. * moves the cursor to `0`.
  16933. *
  16934. * @param {Array<T>} items
  16935. * Items.
  16936. * @returns {undefined}
  16937. * Nothing.
  16938. */
  16939. unshiftMany(items) {
  16940. this.setCursor(0);
  16941. chunkedPush(this.right, items.reverse());
  16942. }
  16943. /**
  16944. * Move the cursor to a specific position in the array. Requires
  16945. * time proportional to the distance moved.
  16946. *
  16947. * If `n < 0`, the cursor will end up at the beginning.
  16948. * If `n > length`, the cursor will end up at the end.
  16949. *
  16950. * @param {number} n
  16951. * Position.
  16952. * @return {undefined}
  16953. * Nothing.
  16954. */
  16955. setCursor(n) {
  16956. if (n === this.left.length || n > this.left.length && this.right.length === 0 || n < 0 && this.left.length === 0) return;
  16957. if (n < this.left.length) {
  16958. const removed = this.left.splice(n, Number.POSITIVE_INFINITY);
  16959. chunkedPush(this.right, removed.reverse());
  16960. } else {
  16961. const removed = this.right.splice(this.left.length + this.right.length - n, Number.POSITIVE_INFINITY);
  16962. chunkedPush(this.left, removed.reverse());
  16963. }
  16964. }
  16965. };
  16966. function chunkedPush(list3, right) {
  16967. let chunkStart = 0;
  16968. if (right.length < 1e4) {
  16969. list3.push(...right);
  16970. } else {
  16971. while (chunkStart < right.length) {
  16972. list3.push(...right.slice(chunkStart, chunkStart + 1e4));
  16973. chunkStart += 1e4;
  16974. }
  16975. }
  16976. }
  16977. // node_modules/micromark-util-subtokenize/index.js
  16978. function subtokenize(eventsArray) {
  16979. const jumps = {};
  16980. let index2 = -1;
  16981. let event;
  16982. let lineIndex;
  16983. let otherIndex;
  16984. let otherEvent;
  16985. let parameters;
  16986. let subevents;
  16987. let more;
  16988. const events = new SpliceBuffer(eventsArray);
  16989. while (++index2 < events.length) {
  16990. while (index2 in jumps) {
  16991. index2 = jumps[index2];
  16992. }
  16993. event = events.get(index2);
  16994. if (index2 && event[1].type === "chunkFlow" && events.get(index2 - 1)[1].type === "listItemPrefix") {
  16995. subevents = event[1]._tokenizer.events;
  16996. otherIndex = 0;
  16997. if (otherIndex < subevents.length && subevents[otherIndex][1].type === "lineEndingBlank") {
  16998. otherIndex += 2;
  16999. }
  17000. if (otherIndex < subevents.length && subevents[otherIndex][1].type === "content") {
  17001. while (++otherIndex < subevents.length) {
  17002. if (subevents[otherIndex][1].type === "content") {
  17003. break;
  17004. }
  17005. if (subevents[otherIndex][1].type === "chunkText") {
  17006. subevents[otherIndex][1]._isInFirstContentOfListItem = true;
  17007. otherIndex++;
  17008. }
  17009. }
  17010. }
  17011. }
  17012. if (event[0] === "enter") {
  17013. if (event[1].contentType) {
  17014. Object.assign(jumps, subcontent(events, index2));
  17015. index2 = jumps[index2];
  17016. more = true;
  17017. }
  17018. } else if (event[1]._container) {
  17019. otherIndex = index2;
  17020. lineIndex = void 0;
  17021. while (otherIndex--) {
  17022. otherEvent = events.get(otherIndex);
  17023. if (otherEvent[1].type === "lineEnding" || otherEvent[1].type === "lineEndingBlank") {
  17024. if (otherEvent[0] === "enter") {
  17025. if (lineIndex) {
  17026. events.get(lineIndex)[1].type = "lineEndingBlank";
  17027. }
  17028. otherEvent[1].type = "lineEnding";
  17029. lineIndex = otherIndex;
  17030. }
  17031. } else {
  17032. break;
  17033. }
  17034. }
  17035. if (lineIndex) {
  17036. event[1].end = Object.assign({}, events.get(lineIndex)[1].start);
  17037. parameters = events.slice(lineIndex, index2);
  17038. parameters.unshift(event);
  17039. events.splice(lineIndex, index2 - lineIndex + 1, parameters);
  17040. }
  17041. }
  17042. }
  17043. splice(eventsArray, 0, Number.POSITIVE_INFINITY, events.slice(0));
  17044. return !more;
  17045. }
  17046. function subcontent(events, eventIndex) {
  17047. const token = events.get(eventIndex)[1];
  17048. const context = events.get(eventIndex)[2];
  17049. let startPosition = eventIndex - 1;
  17050. const startPositions = [];
  17051. const tokenizer2 = token._tokenizer || context.parser[token.contentType](token.start);
  17052. const childEvents = tokenizer2.events;
  17053. const jumps = [];
  17054. const gaps = {};
  17055. let stream;
  17056. let previous2;
  17057. let index2 = -1;
  17058. let current2 = token;
  17059. let adjust = 0;
  17060. let start2 = 0;
  17061. const breaks = [start2];
  17062. while (current2) {
  17063. while (events.get(++startPosition)[1] !== current2) {
  17064. }
  17065. startPositions.push(startPosition);
  17066. if (!current2._tokenizer) {
  17067. stream = context.sliceStream(current2);
  17068. if (!current2.next) {
  17069. stream.push(null);
  17070. }
  17071. if (previous2) {
  17072. tokenizer2.defineSkip(current2.start);
  17073. }
  17074. if (current2._isInFirstContentOfListItem) {
  17075. tokenizer2._gfmTasklistFirstContentOfListItem = true;
  17076. }
  17077. tokenizer2.write(stream);
  17078. if (current2._isInFirstContentOfListItem) {
  17079. tokenizer2._gfmTasklistFirstContentOfListItem = void 0;
  17080. }
  17081. }
  17082. previous2 = current2;
  17083. current2 = current2.next;
  17084. }
  17085. current2 = token;
  17086. while (++index2 < childEvents.length) {
  17087. if (
  17088. // Find a void token that includes a break.
  17089. childEvents[index2][0] === "exit" && childEvents[index2 - 1][0] === "enter" && childEvents[index2][1].type === childEvents[index2 - 1][1].type && childEvents[index2][1].start.line !== childEvents[index2][1].end.line
  17090. ) {
  17091. start2 = index2 + 1;
  17092. breaks.push(start2);
  17093. current2._tokenizer = void 0;
  17094. current2.previous = void 0;
  17095. current2 = current2.next;
  17096. }
  17097. }
  17098. tokenizer2.events = [];
  17099. if (current2) {
  17100. current2._tokenizer = void 0;
  17101. current2.previous = void 0;
  17102. } else {
  17103. breaks.pop();
  17104. }
  17105. index2 = breaks.length;
  17106. while (index2--) {
  17107. const slice2 = childEvents.slice(breaks[index2], breaks[index2 + 1]);
  17108. const start3 = startPositions.pop();
  17109. jumps.push([start3, start3 + slice2.length - 1]);
  17110. events.splice(start3, 2, slice2);
  17111. }
  17112. jumps.reverse();
  17113. index2 = -1;
  17114. while (++index2 < jumps.length) {
  17115. gaps[adjust + jumps[index2][0]] = adjust + jumps[index2][1];
  17116. adjust += jumps[index2][1] - jumps[index2][0] - 1;
  17117. }
  17118. return gaps;
  17119. }
  17120. // node_modules/micromark-core-commonmark/lib/content.js
  17121. var content = {
  17122. tokenize: tokenizeContent,
  17123. resolve: resolveContent
  17124. };
  17125. var continuationConstruct = {
  17126. tokenize: tokenizeContinuation,
  17127. partial: true
  17128. };
  17129. function resolveContent(events) {
  17130. subtokenize(events);
  17131. return events;
  17132. }
  17133. function tokenizeContent(effects, ok4) {
  17134. let previous2;
  17135. return chunkStart;
  17136. function chunkStart(code2) {
  17137. effects.enter("content");
  17138. previous2 = effects.enter("chunkContent", {
  17139. contentType: "content"
  17140. });
  17141. return chunkInside(code2);
  17142. }
  17143. function chunkInside(code2) {
  17144. if (code2 === null) {
  17145. return contentEnd(code2);
  17146. }
  17147. if (markdownLineEnding(code2)) {
  17148. return effects.check(continuationConstruct, contentContinue, contentEnd)(code2);
  17149. }
  17150. effects.consume(code2);
  17151. return chunkInside;
  17152. }
  17153. function contentEnd(code2) {
  17154. effects.exit("chunkContent");
  17155. effects.exit("content");
  17156. return ok4(code2);
  17157. }
  17158. function contentContinue(code2) {
  17159. effects.consume(code2);
  17160. effects.exit("chunkContent");
  17161. previous2.next = effects.enter("chunkContent", {
  17162. contentType: "content",
  17163. previous: previous2
  17164. });
  17165. previous2 = previous2.next;
  17166. return chunkInside;
  17167. }
  17168. }
  17169. function tokenizeContinuation(effects, ok4, nok) {
  17170. const self2 = this;
  17171. return startLookahead;
  17172. function startLookahead(code2) {
  17173. effects.exit("chunkContent");
  17174. effects.enter("lineEnding");
  17175. effects.consume(code2);
  17176. effects.exit("lineEnding");
  17177. return factorySpace(effects, prefixed, "linePrefix");
  17178. }
  17179. function prefixed(code2) {
  17180. if (code2 === null || markdownLineEnding(code2)) {
  17181. return nok(code2);
  17182. }
  17183. const tail = self2.events[self2.events.length - 1];
  17184. if (!self2.parser.constructs.disable.null.includes("codeIndented") && tail && tail[1].type === "linePrefix" && tail[2].sliceSerialize(tail[1], true).length >= 4) {
  17185. return ok4(code2);
  17186. }
  17187. return effects.interrupt(self2.parser.constructs.flow, nok, ok4)(code2);
  17188. }
  17189. }
  17190. // node_modules/micromark-factory-destination/index.js
  17191. function factoryDestination(effects, ok4, nok, type, literalType, literalMarkerType, rawType, stringType, max) {
  17192. const limit = max || Number.POSITIVE_INFINITY;
  17193. let balance = 0;
  17194. return start2;
  17195. function start2(code2) {
  17196. if (code2 === 60) {
  17197. effects.enter(type);
  17198. effects.enter(literalType);
  17199. effects.enter(literalMarkerType);
  17200. effects.consume(code2);
  17201. effects.exit(literalMarkerType);
  17202. return enclosedBefore;
  17203. }
  17204. if (code2 === null || code2 === 32 || code2 === 41 || asciiControl(code2)) {
  17205. return nok(code2);
  17206. }
  17207. effects.enter(type);
  17208. effects.enter(rawType);
  17209. effects.enter(stringType);
  17210. effects.enter("chunkString", {
  17211. contentType: "string"
  17212. });
  17213. return raw(code2);
  17214. }
  17215. function enclosedBefore(code2) {
  17216. if (code2 === 62) {
  17217. effects.enter(literalMarkerType);
  17218. effects.consume(code2);
  17219. effects.exit(literalMarkerType);
  17220. effects.exit(literalType);
  17221. effects.exit(type);
  17222. return ok4;
  17223. }
  17224. effects.enter(stringType);
  17225. effects.enter("chunkString", {
  17226. contentType: "string"
  17227. });
  17228. return enclosed(code2);
  17229. }
  17230. function enclosed(code2) {
  17231. if (code2 === 62) {
  17232. effects.exit("chunkString");
  17233. effects.exit(stringType);
  17234. return enclosedBefore(code2);
  17235. }
  17236. if (code2 === null || code2 === 60 || markdownLineEnding(code2)) {
  17237. return nok(code2);
  17238. }
  17239. effects.consume(code2);
  17240. return code2 === 92 ? enclosedEscape : enclosed;
  17241. }
  17242. function enclosedEscape(code2) {
  17243. if (code2 === 60 || code2 === 62 || code2 === 92) {
  17244. effects.consume(code2);
  17245. return enclosed;
  17246. }
  17247. return enclosed(code2);
  17248. }
  17249. function raw(code2) {
  17250. if (!balance && (code2 === null || code2 === 41 || markdownLineEndingOrSpace(code2))) {
  17251. effects.exit("chunkString");
  17252. effects.exit(stringType);
  17253. effects.exit(rawType);
  17254. effects.exit(type);
  17255. return ok4(code2);
  17256. }
  17257. if (balance < limit && code2 === 40) {
  17258. effects.consume(code2);
  17259. balance++;
  17260. return raw;
  17261. }
  17262. if (code2 === 41) {
  17263. effects.consume(code2);
  17264. balance--;
  17265. return raw;
  17266. }
  17267. if (code2 === null || code2 === 32 || code2 === 40 || asciiControl(code2)) {
  17268. return nok(code2);
  17269. }
  17270. effects.consume(code2);
  17271. return code2 === 92 ? rawEscape : raw;
  17272. }
  17273. function rawEscape(code2) {
  17274. if (code2 === 40 || code2 === 41 || code2 === 92) {
  17275. effects.consume(code2);
  17276. return raw;
  17277. }
  17278. return raw(code2);
  17279. }
  17280. }
  17281. // node_modules/micromark-factory-label/index.js
  17282. function factoryLabel(effects, ok4, nok, type, markerType, stringType) {
  17283. const self2 = this;
  17284. let size = 0;
  17285. let seen;
  17286. return start2;
  17287. function start2(code2) {
  17288. effects.enter(type);
  17289. effects.enter(markerType);
  17290. effects.consume(code2);
  17291. effects.exit(markerType);
  17292. effects.enter(stringType);
  17293. return atBreak;
  17294. }
  17295. function atBreak(code2) {
  17296. if (size > 999 || code2 === null || code2 === 91 || code2 === 93 && !seen || // To do: remove in the future once we’ve switched from
  17297. // `micromark-extension-footnote` to `micromark-extension-gfm-footnote`,
  17298. // which doesn’t need this.
  17299. // Hidden footnotes hook.
  17300. /* c8 ignore next 3 */
  17301. code2 === 94 && !size && "_hiddenFootnoteSupport" in self2.parser.constructs) {
  17302. return nok(code2);
  17303. }
  17304. if (code2 === 93) {
  17305. effects.exit(stringType);
  17306. effects.enter(markerType);
  17307. effects.consume(code2);
  17308. effects.exit(markerType);
  17309. effects.exit(type);
  17310. return ok4;
  17311. }
  17312. if (markdownLineEnding(code2)) {
  17313. effects.enter("lineEnding");
  17314. effects.consume(code2);
  17315. effects.exit("lineEnding");
  17316. return atBreak;
  17317. }
  17318. effects.enter("chunkString", {
  17319. contentType: "string"
  17320. });
  17321. return labelInside(code2);
  17322. }
  17323. function labelInside(code2) {
  17324. if (code2 === null || code2 === 91 || code2 === 93 || markdownLineEnding(code2) || size++ > 999) {
  17325. effects.exit("chunkString");
  17326. return atBreak(code2);
  17327. }
  17328. effects.consume(code2);
  17329. if (!seen) seen = !markdownSpace(code2);
  17330. return code2 === 92 ? labelEscape : labelInside;
  17331. }
  17332. function labelEscape(code2) {
  17333. if (code2 === 91 || code2 === 92 || code2 === 93) {
  17334. effects.consume(code2);
  17335. size++;
  17336. return labelInside;
  17337. }
  17338. return labelInside(code2);
  17339. }
  17340. }
  17341. // node_modules/micromark-factory-title/index.js
  17342. function factoryTitle(effects, ok4, nok, type, markerType, stringType) {
  17343. let marker;
  17344. return start2;
  17345. function start2(code2) {
  17346. if (code2 === 34 || code2 === 39 || code2 === 40) {
  17347. effects.enter(type);
  17348. effects.enter(markerType);
  17349. effects.consume(code2);
  17350. effects.exit(markerType);
  17351. marker = code2 === 40 ? 41 : code2;
  17352. return begin;
  17353. }
  17354. return nok(code2);
  17355. }
  17356. function begin(code2) {
  17357. if (code2 === marker) {
  17358. effects.enter(markerType);
  17359. effects.consume(code2);
  17360. effects.exit(markerType);
  17361. effects.exit(type);
  17362. return ok4;
  17363. }
  17364. effects.enter(stringType);
  17365. return atBreak(code2);
  17366. }
  17367. function atBreak(code2) {
  17368. if (code2 === marker) {
  17369. effects.exit(stringType);
  17370. return begin(marker);
  17371. }
  17372. if (code2 === null) {
  17373. return nok(code2);
  17374. }
  17375. if (markdownLineEnding(code2)) {
  17376. effects.enter("lineEnding");
  17377. effects.consume(code2);
  17378. effects.exit("lineEnding");
  17379. return factorySpace(effects, atBreak, "linePrefix");
  17380. }
  17381. effects.enter("chunkString", {
  17382. contentType: "string"
  17383. });
  17384. return inside(code2);
  17385. }
  17386. function inside(code2) {
  17387. if (code2 === marker || code2 === null || markdownLineEnding(code2)) {
  17388. effects.exit("chunkString");
  17389. return atBreak(code2);
  17390. }
  17391. effects.consume(code2);
  17392. return code2 === 92 ? escape : inside;
  17393. }
  17394. function escape(code2) {
  17395. if (code2 === marker || code2 === 92) {
  17396. effects.consume(code2);
  17397. return inside;
  17398. }
  17399. return inside(code2);
  17400. }
  17401. }
  17402. // node_modules/micromark-factory-whitespace/index.js
  17403. function factoryWhitespace(effects, ok4) {
  17404. let seen;
  17405. return start2;
  17406. function start2(code2) {
  17407. if (markdownLineEnding(code2)) {
  17408. effects.enter("lineEnding");
  17409. effects.consume(code2);
  17410. effects.exit("lineEnding");
  17411. seen = true;
  17412. return start2;
  17413. }
  17414. if (markdownSpace(code2)) {
  17415. return factorySpace(
  17416. effects,
  17417. start2,
  17418. seen ? "linePrefix" : "lineSuffix"
  17419. )(code2);
  17420. }
  17421. return ok4(code2);
  17422. }
  17423. }
  17424. // node_modules/micromark-util-normalize-identifier/index.js
  17425. function normalizeIdentifier(value) {
  17426. return value.replace(/[\t\n\r ]+/g, " ").replace(/^ | $/g, "").toLowerCase().toUpperCase();
  17427. }
  17428. // node_modules/micromark-core-commonmark/lib/definition.js
  17429. var definition = {
  17430. name: "definition",
  17431. tokenize: tokenizeDefinition
  17432. };
  17433. var titleBefore = {
  17434. tokenize: tokenizeTitleBefore,
  17435. partial: true
  17436. };
  17437. function tokenizeDefinition(effects, ok4, nok) {
  17438. const self2 = this;
  17439. let identifier;
  17440. return start2;
  17441. function start2(code2) {
  17442. effects.enter("definition");
  17443. return before(code2);
  17444. }
  17445. function before(code2) {
  17446. return factoryLabel.call(
  17447. self2,
  17448. effects,
  17449. labelAfter,
  17450. // Note: we don’t need to reset the way `markdown-rs` does.
  17451. nok,
  17452. "definitionLabel",
  17453. "definitionLabelMarker",
  17454. "definitionLabelString"
  17455. )(code2);
  17456. }
  17457. function labelAfter(code2) {
  17458. identifier = normalizeIdentifier(self2.sliceSerialize(self2.events[self2.events.length - 1][1]).slice(1, -1));
  17459. if (code2 === 58) {
  17460. effects.enter("definitionMarker");
  17461. effects.consume(code2);
  17462. effects.exit("definitionMarker");
  17463. return markerAfter;
  17464. }
  17465. return nok(code2);
  17466. }
  17467. function markerAfter(code2) {
  17468. return markdownLineEndingOrSpace(code2) ? factoryWhitespace(effects, destinationBefore)(code2) : destinationBefore(code2);
  17469. }
  17470. function destinationBefore(code2) {
  17471. return factoryDestination(
  17472. effects,
  17473. destinationAfter,
  17474. // Note: we don’t need to reset the way `markdown-rs` does.
  17475. nok,
  17476. "definitionDestination",
  17477. "definitionDestinationLiteral",
  17478. "definitionDestinationLiteralMarker",
  17479. "definitionDestinationRaw",
  17480. "definitionDestinationString"
  17481. )(code2);
  17482. }
  17483. function destinationAfter(code2) {
  17484. return effects.attempt(titleBefore, after, after)(code2);
  17485. }
  17486. function after(code2) {
  17487. return markdownSpace(code2) ? factorySpace(effects, afterWhitespace, "whitespace")(code2) : afterWhitespace(code2);
  17488. }
  17489. function afterWhitespace(code2) {
  17490. if (code2 === null || markdownLineEnding(code2)) {
  17491. effects.exit("definition");
  17492. self2.parser.defined.push(identifier);
  17493. return ok4(code2);
  17494. }
  17495. return nok(code2);
  17496. }
  17497. }
  17498. function tokenizeTitleBefore(effects, ok4, nok) {
  17499. return titleBefore2;
  17500. function titleBefore2(code2) {
  17501. return markdownLineEndingOrSpace(code2) ? factoryWhitespace(effects, beforeMarker)(code2) : nok(code2);
  17502. }
  17503. function beforeMarker(code2) {
  17504. return factoryTitle(effects, titleAfter, nok, "definitionTitle", "definitionTitleMarker", "definitionTitleString")(code2);
  17505. }
  17506. function titleAfter(code2) {
  17507. return markdownSpace(code2) ? factorySpace(effects, titleAfterOptionalWhitespace, "whitespace")(code2) : titleAfterOptionalWhitespace(code2);
  17508. }
  17509. function titleAfterOptionalWhitespace(code2) {
  17510. return code2 === null || markdownLineEnding(code2) ? ok4(code2) : nok(code2);
  17511. }
  17512. }
  17513. // node_modules/micromark-core-commonmark/lib/hard-break-escape.js
  17514. var hardBreakEscape = {
  17515. name: "hardBreakEscape",
  17516. tokenize: tokenizeHardBreakEscape
  17517. };
  17518. function tokenizeHardBreakEscape(effects, ok4, nok) {
  17519. return start2;
  17520. function start2(code2) {
  17521. effects.enter("hardBreakEscape");
  17522. effects.consume(code2);
  17523. return after;
  17524. }
  17525. function after(code2) {
  17526. if (markdownLineEnding(code2)) {
  17527. effects.exit("hardBreakEscape");
  17528. return ok4(code2);
  17529. }
  17530. return nok(code2);
  17531. }
  17532. }
  17533. // node_modules/micromark-core-commonmark/lib/heading-atx.js
  17534. var headingAtx = {
  17535. name: "headingAtx",
  17536. tokenize: tokenizeHeadingAtx,
  17537. resolve: resolveHeadingAtx
  17538. };
  17539. function resolveHeadingAtx(events, context) {
  17540. let contentEnd = events.length - 2;
  17541. let contentStart = 3;
  17542. let content3;
  17543. let text5;
  17544. if (events[contentStart][1].type === "whitespace") {
  17545. contentStart += 2;
  17546. }
  17547. if (contentEnd - 2 > contentStart && events[contentEnd][1].type === "whitespace") {
  17548. contentEnd -= 2;
  17549. }
  17550. if (events[contentEnd][1].type === "atxHeadingSequence" && (contentStart === contentEnd - 1 || contentEnd - 4 > contentStart && events[contentEnd - 2][1].type === "whitespace")) {
  17551. contentEnd -= contentStart + 1 === contentEnd ? 2 : 4;
  17552. }
  17553. if (contentEnd > contentStart) {
  17554. content3 = {
  17555. type: "atxHeadingText",
  17556. start: events[contentStart][1].start,
  17557. end: events[contentEnd][1].end
  17558. };
  17559. text5 = {
  17560. type: "chunkText",
  17561. start: events[contentStart][1].start,
  17562. end: events[contentEnd][1].end,
  17563. contentType: "text"
  17564. };
  17565. splice(events, contentStart, contentEnd - contentStart + 1, [["enter", content3, context], ["enter", text5, context], ["exit", text5, context], ["exit", content3, context]]);
  17566. }
  17567. return events;
  17568. }
  17569. function tokenizeHeadingAtx(effects, ok4, nok) {
  17570. let size = 0;
  17571. return start2;
  17572. function start2(code2) {
  17573. effects.enter("atxHeading");
  17574. return before(code2);
  17575. }
  17576. function before(code2) {
  17577. effects.enter("atxHeadingSequence");
  17578. return sequenceOpen(code2);
  17579. }
  17580. function sequenceOpen(code2) {
  17581. if (code2 === 35 && size++ < 6) {
  17582. effects.consume(code2);
  17583. return sequenceOpen;
  17584. }
  17585. if (code2 === null || markdownLineEndingOrSpace(code2)) {
  17586. effects.exit("atxHeadingSequence");
  17587. return atBreak(code2);
  17588. }
  17589. return nok(code2);
  17590. }
  17591. function atBreak(code2) {
  17592. if (code2 === 35) {
  17593. effects.enter("atxHeadingSequence");
  17594. return sequenceFurther(code2);
  17595. }
  17596. if (code2 === null || markdownLineEnding(code2)) {
  17597. effects.exit("atxHeading");
  17598. return ok4(code2);
  17599. }
  17600. if (markdownSpace(code2)) {
  17601. return factorySpace(effects, atBreak, "whitespace")(code2);
  17602. }
  17603. effects.enter("atxHeadingText");
  17604. return data2(code2);
  17605. }
  17606. function sequenceFurther(code2) {
  17607. if (code2 === 35) {
  17608. effects.consume(code2);
  17609. return sequenceFurther;
  17610. }
  17611. effects.exit("atxHeadingSequence");
  17612. return atBreak(code2);
  17613. }
  17614. function data2(code2) {
  17615. if (code2 === null || code2 === 35 || markdownLineEndingOrSpace(code2)) {
  17616. effects.exit("atxHeadingText");
  17617. return atBreak(code2);
  17618. }
  17619. effects.consume(code2);
  17620. return data2;
  17621. }
  17622. }
  17623. // node_modules/micromark-util-html-tag-name/index.js
  17624. var htmlBlockNames = [
  17625. "address",
  17626. "article",
  17627. "aside",
  17628. "base",
  17629. "basefont",
  17630. "blockquote",
  17631. "body",
  17632. "caption",
  17633. "center",
  17634. "col",
  17635. "colgroup",
  17636. "dd",
  17637. "details",
  17638. "dialog",
  17639. "dir",
  17640. "div",
  17641. "dl",
  17642. "dt",
  17643. "fieldset",
  17644. "figcaption",
  17645. "figure",
  17646. "footer",
  17647. "form",
  17648. "frame",
  17649. "frameset",
  17650. "h1",
  17651. "h2",
  17652. "h3",
  17653. "h4",
  17654. "h5",
  17655. "h6",
  17656. "head",
  17657. "header",
  17658. "hr",
  17659. "html",
  17660. "iframe",
  17661. "legend",
  17662. "li",
  17663. "link",
  17664. "main",
  17665. "menu",
  17666. "menuitem",
  17667. "nav",
  17668. "noframes",
  17669. "ol",
  17670. "optgroup",
  17671. "option",
  17672. "p",
  17673. "param",
  17674. "search",
  17675. "section",
  17676. "summary",
  17677. "table",
  17678. "tbody",
  17679. "td",
  17680. "tfoot",
  17681. "th",
  17682. "thead",
  17683. "title",
  17684. "tr",
  17685. "track",
  17686. "ul"
  17687. ];
  17688. var htmlRawNames = ["pre", "script", "style", "textarea"];
  17689. // node_modules/micromark-core-commonmark/lib/html-flow.js
  17690. var htmlFlow = {
  17691. name: "htmlFlow",
  17692. tokenize: tokenizeHtmlFlow,
  17693. resolveTo: resolveToHtmlFlow,
  17694. concrete: true
  17695. };
  17696. var blankLineBefore = {
  17697. tokenize: tokenizeBlankLineBefore,
  17698. partial: true
  17699. };
  17700. var nonLazyContinuationStart = {
  17701. tokenize: tokenizeNonLazyContinuationStart,
  17702. partial: true
  17703. };
  17704. function resolveToHtmlFlow(events) {
  17705. let index2 = events.length;
  17706. while (index2--) {
  17707. if (events[index2][0] === "enter" && events[index2][1].type === "htmlFlow") {
  17708. break;
  17709. }
  17710. }
  17711. if (index2 > 1 && events[index2 - 2][1].type === "linePrefix") {
  17712. events[index2][1].start = events[index2 - 2][1].start;
  17713. events[index2 + 1][1].start = events[index2 - 2][1].start;
  17714. events.splice(index2 - 2, 2);
  17715. }
  17716. return events;
  17717. }
  17718. function tokenizeHtmlFlow(effects, ok4, nok) {
  17719. const self2 = this;
  17720. let marker;
  17721. let closingTag;
  17722. let buffer;
  17723. let index2;
  17724. let markerB;
  17725. return start2;
  17726. function start2(code2) {
  17727. return before(code2);
  17728. }
  17729. function before(code2) {
  17730. effects.enter("htmlFlow");
  17731. effects.enter("htmlFlowData");
  17732. effects.consume(code2);
  17733. return open;
  17734. }
  17735. function open(code2) {
  17736. if (code2 === 33) {
  17737. effects.consume(code2);
  17738. return declarationOpen;
  17739. }
  17740. if (code2 === 47) {
  17741. effects.consume(code2);
  17742. closingTag = true;
  17743. return tagCloseStart;
  17744. }
  17745. if (code2 === 63) {
  17746. effects.consume(code2);
  17747. marker = 3;
  17748. return self2.interrupt ? ok4 : continuationDeclarationInside;
  17749. }
  17750. if (asciiAlpha(code2)) {
  17751. effects.consume(code2);
  17752. buffer = String.fromCharCode(code2);
  17753. return tagName;
  17754. }
  17755. return nok(code2);
  17756. }
  17757. function declarationOpen(code2) {
  17758. if (code2 === 45) {
  17759. effects.consume(code2);
  17760. marker = 2;
  17761. return commentOpenInside;
  17762. }
  17763. if (code2 === 91) {
  17764. effects.consume(code2);
  17765. marker = 5;
  17766. index2 = 0;
  17767. return cdataOpenInside;
  17768. }
  17769. if (asciiAlpha(code2)) {
  17770. effects.consume(code2);
  17771. marker = 4;
  17772. return self2.interrupt ? ok4 : continuationDeclarationInside;
  17773. }
  17774. return nok(code2);
  17775. }
  17776. function commentOpenInside(code2) {
  17777. if (code2 === 45) {
  17778. effects.consume(code2);
  17779. return self2.interrupt ? ok4 : continuationDeclarationInside;
  17780. }
  17781. return nok(code2);
  17782. }
  17783. function cdataOpenInside(code2) {
  17784. const value = "CDATA[";
  17785. if (code2 === value.charCodeAt(index2++)) {
  17786. effects.consume(code2);
  17787. if (index2 === value.length) {
  17788. return self2.interrupt ? ok4 : continuation;
  17789. }
  17790. return cdataOpenInside;
  17791. }
  17792. return nok(code2);
  17793. }
  17794. function tagCloseStart(code2) {
  17795. if (asciiAlpha(code2)) {
  17796. effects.consume(code2);
  17797. buffer = String.fromCharCode(code2);
  17798. return tagName;
  17799. }
  17800. return nok(code2);
  17801. }
  17802. function tagName(code2) {
  17803. if (code2 === null || code2 === 47 || code2 === 62 || markdownLineEndingOrSpace(code2)) {
  17804. const slash = code2 === 47;
  17805. const name2 = buffer.toLowerCase();
  17806. if (!slash && !closingTag && htmlRawNames.includes(name2)) {
  17807. marker = 1;
  17808. return self2.interrupt ? ok4(code2) : continuation(code2);
  17809. }
  17810. if (htmlBlockNames.includes(buffer.toLowerCase())) {
  17811. marker = 6;
  17812. if (slash) {
  17813. effects.consume(code2);
  17814. return basicSelfClosing;
  17815. }
  17816. return self2.interrupt ? ok4(code2) : continuation(code2);
  17817. }
  17818. marker = 7;
  17819. return self2.interrupt && !self2.parser.lazy[self2.now().line] ? nok(code2) : closingTag ? completeClosingTagAfter(code2) : completeAttributeNameBefore(code2);
  17820. }
  17821. if (code2 === 45 || asciiAlphanumeric(code2)) {
  17822. effects.consume(code2);
  17823. buffer += String.fromCharCode(code2);
  17824. return tagName;
  17825. }
  17826. return nok(code2);
  17827. }
  17828. function basicSelfClosing(code2) {
  17829. if (code2 === 62) {
  17830. effects.consume(code2);
  17831. return self2.interrupt ? ok4 : continuation;
  17832. }
  17833. return nok(code2);
  17834. }
  17835. function completeClosingTagAfter(code2) {
  17836. if (markdownSpace(code2)) {
  17837. effects.consume(code2);
  17838. return completeClosingTagAfter;
  17839. }
  17840. return completeEnd(code2);
  17841. }
  17842. function completeAttributeNameBefore(code2) {
  17843. if (code2 === 47) {
  17844. effects.consume(code2);
  17845. return completeEnd;
  17846. }
  17847. if (code2 === 58 || code2 === 95 || asciiAlpha(code2)) {
  17848. effects.consume(code2);
  17849. return completeAttributeName;
  17850. }
  17851. if (markdownSpace(code2)) {
  17852. effects.consume(code2);
  17853. return completeAttributeNameBefore;
  17854. }
  17855. return completeEnd(code2);
  17856. }
  17857. function completeAttributeName(code2) {
  17858. if (code2 === 45 || code2 === 46 || code2 === 58 || code2 === 95 || asciiAlphanumeric(code2)) {
  17859. effects.consume(code2);
  17860. return completeAttributeName;
  17861. }
  17862. return completeAttributeNameAfter(code2);
  17863. }
  17864. function completeAttributeNameAfter(code2) {
  17865. if (code2 === 61) {
  17866. effects.consume(code2);
  17867. return completeAttributeValueBefore;
  17868. }
  17869. if (markdownSpace(code2)) {
  17870. effects.consume(code2);
  17871. return completeAttributeNameAfter;
  17872. }
  17873. return completeAttributeNameBefore(code2);
  17874. }
  17875. function completeAttributeValueBefore(code2) {
  17876. if (code2 === null || code2 === 60 || code2 === 61 || code2 === 62 || code2 === 96) {
  17877. return nok(code2);
  17878. }
  17879. if (code2 === 34 || code2 === 39) {
  17880. effects.consume(code2);
  17881. markerB = code2;
  17882. return completeAttributeValueQuoted;
  17883. }
  17884. if (markdownSpace(code2)) {
  17885. effects.consume(code2);
  17886. return completeAttributeValueBefore;
  17887. }
  17888. return completeAttributeValueUnquoted(code2);
  17889. }
  17890. function completeAttributeValueQuoted(code2) {
  17891. if (code2 === markerB) {
  17892. effects.consume(code2);
  17893. markerB = null;
  17894. return completeAttributeValueQuotedAfter;
  17895. }
  17896. if (code2 === null || markdownLineEnding(code2)) {
  17897. return nok(code2);
  17898. }
  17899. effects.consume(code2);
  17900. return completeAttributeValueQuoted;
  17901. }
  17902. function completeAttributeValueUnquoted(code2) {
  17903. if (code2 === null || code2 === 34 || code2 === 39 || code2 === 47 || code2 === 60 || code2 === 61 || code2 === 62 || code2 === 96 || markdownLineEndingOrSpace(code2)) {
  17904. return completeAttributeNameAfter(code2);
  17905. }
  17906. effects.consume(code2);
  17907. return completeAttributeValueUnquoted;
  17908. }
  17909. function completeAttributeValueQuotedAfter(code2) {
  17910. if (code2 === 47 || code2 === 62 || markdownSpace(code2)) {
  17911. return completeAttributeNameBefore(code2);
  17912. }
  17913. return nok(code2);
  17914. }
  17915. function completeEnd(code2) {
  17916. if (code2 === 62) {
  17917. effects.consume(code2);
  17918. return completeAfter;
  17919. }
  17920. return nok(code2);
  17921. }
  17922. function completeAfter(code2) {
  17923. if (code2 === null || markdownLineEnding(code2)) {
  17924. return continuation(code2);
  17925. }
  17926. if (markdownSpace(code2)) {
  17927. effects.consume(code2);
  17928. return completeAfter;
  17929. }
  17930. return nok(code2);
  17931. }
  17932. function continuation(code2) {
  17933. if (code2 === 45 && marker === 2) {
  17934. effects.consume(code2);
  17935. return continuationCommentInside;
  17936. }
  17937. if (code2 === 60 && marker === 1) {
  17938. effects.consume(code2);
  17939. return continuationRawTagOpen;
  17940. }
  17941. if (code2 === 62 && marker === 4) {
  17942. effects.consume(code2);
  17943. return continuationClose;
  17944. }
  17945. if (code2 === 63 && marker === 3) {
  17946. effects.consume(code2);
  17947. return continuationDeclarationInside;
  17948. }
  17949. if (code2 === 93 && marker === 5) {
  17950. effects.consume(code2);
  17951. return continuationCdataInside;
  17952. }
  17953. if (markdownLineEnding(code2) && (marker === 6 || marker === 7)) {
  17954. effects.exit("htmlFlowData");
  17955. return effects.check(blankLineBefore, continuationAfter, continuationStart)(code2);
  17956. }
  17957. if (code2 === null || markdownLineEnding(code2)) {
  17958. effects.exit("htmlFlowData");
  17959. return continuationStart(code2);
  17960. }
  17961. effects.consume(code2);
  17962. return continuation;
  17963. }
  17964. function continuationStart(code2) {
  17965. return effects.check(nonLazyContinuationStart, continuationStartNonLazy, continuationAfter)(code2);
  17966. }
  17967. function continuationStartNonLazy(code2) {
  17968. effects.enter("lineEnding");
  17969. effects.consume(code2);
  17970. effects.exit("lineEnding");
  17971. return continuationBefore;
  17972. }
  17973. function continuationBefore(code2) {
  17974. if (code2 === null || markdownLineEnding(code2)) {
  17975. return continuationStart(code2);
  17976. }
  17977. effects.enter("htmlFlowData");
  17978. return continuation(code2);
  17979. }
  17980. function continuationCommentInside(code2) {
  17981. if (code2 === 45) {
  17982. effects.consume(code2);
  17983. return continuationDeclarationInside;
  17984. }
  17985. return continuation(code2);
  17986. }
  17987. function continuationRawTagOpen(code2) {
  17988. if (code2 === 47) {
  17989. effects.consume(code2);
  17990. buffer = "";
  17991. return continuationRawEndTag;
  17992. }
  17993. return continuation(code2);
  17994. }
  17995. function continuationRawEndTag(code2) {
  17996. if (code2 === 62) {
  17997. const name2 = buffer.toLowerCase();
  17998. if (htmlRawNames.includes(name2)) {
  17999. effects.consume(code2);
  18000. return continuationClose;
  18001. }
  18002. return continuation(code2);
  18003. }
  18004. if (asciiAlpha(code2) && buffer.length < 8) {
  18005. effects.consume(code2);
  18006. buffer += String.fromCharCode(code2);
  18007. return continuationRawEndTag;
  18008. }
  18009. return continuation(code2);
  18010. }
  18011. function continuationCdataInside(code2) {
  18012. if (code2 === 93) {
  18013. effects.consume(code2);
  18014. return continuationDeclarationInside;
  18015. }
  18016. return continuation(code2);
  18017. }
  18018. function continuationDeclarationInside(code2) {
  18019. if (code2 === 62) {
  18020. effects.consume(code2);
  18021. return continuationClose;
  18022. }
  18023. if (code2 === 45 && marker === 2) {
  18024. effects.consume(code2);
  18025. return continuationDeclarationInside;
  18026. }
  18027. return continuation(code2);
  18028. }
  18029. function continuationClose(code2) {
  18030. if (code2 === null || markdownLineEnding(code2)) {
  18031. effects.exit("htmlFlowData");
  18032. return continuationAfter(code2);
  18033. }
  18034. effects.consume(code2);
  18035. return continuationClose;
  18036. }
  18037. function continuationAfter(code2) {
  18038. effects.exit("htmlFlow");
  18039. return ok4(code2);
  18040. }
  18041. }
  18042. function tokenizeNonLazyContinuationStart(effects, ok4, nok) {
  18043. const self2 = this;
  18044. return start2;
  18045. function start2(code2) {
  18046. if (markdownLineEnding(code2)) {
  18047. effects.enter("lineEnding");
  18048. effects.consume(code2);
  18049. effects.exit("lineEnding");
  18050. return after;
  18051. }
  18052. return nok(code2);
  18053. }
  18054. function after(code2) {
  18055. return self2.parser.lazy[self2.now().line] ? nok(code2) : ok4(code2);
  18056. }
  18057. }
  18058. function tokenizeBlankLineBefore(effects, ok4, nok) {
  18059. return start2;
  18060. function start2(code2) {
  18061. effects.enter("lineEnding");
  18062. effects.consume(code2);
  18063. effects.exit("lineEnding");
  18064. return effects.attempt(blankLine, ok4, nok);
  18065. }
  18066. }
  18067. // node_modules/micromark-core-commonmark/lib/html-text.js
  18068. var htmlText = {
  18069. name: "htmlText",
  18070. tokenize: tokenizeHtmlText
  18071. };
  18072. function tokenizeHtmlText(effects, ok4, nok) {
  18073. const self2 = this;
  18074. let marker;
  18075. let index2;
  18076. let returnState;
  18077. return start2;
  18078. function start2(code2) {
  18079. effects.enter("htmlText");
  18080. effects.enter("htmlTextData");
  18081. effects.consume(code2);
  18082. return open;
  18083. }
  18084. function open(code2) {
  18085. if (code2 === 33) {
  18086. effects.consume(code2);
  18087. return declarationOpen;
  18088. }
  18089. if (code2 === 47) {
  18090. effects.consume(code2);
  18091. return tagCloseStart;
  18092. }
  18093. if (code2 === 63) {
  18094. effects.consume(code2);
  18095. return instruction;
  18096. }
  18097. if (asciiAlpha(code2)) {
  18098. effects.consume(code2);
  18099. return tagOpen;
  18100. }
  18101. return nok(code2);
  18102. }
  18103. function declarationOpen(code2) {
  18104. if (code2 === 45) {
  18105. effects.consume(code2);
  18106. return commentOpenInside;
  18107. }
  18108. if (code2 === 91) {
  18109. effects.consume(code2);
  18110. index2 = 0;
  18111. return cdataOpenInside;
  18112. }
  18113. if (asciiAlpha(code2)) {
  18114. effects.consume(code2);
  18115. return declaration;
  18116. }
  18117. return nok(code2);
  18118. }
  18119. function commentOpenInside(code2) {
  18120. if (code2 === 45) {
  18121. effects.consume(code2);
  18122. return commentEnd;
  18123. }
  18124. return nok(code2);
  18125. }
  18126. function comment2(code2) {
  18127. if (code2 === null) {
  18128. return nok(code2);
  18129. }
  18130. if (code2 === 45) {
  18131. effects.consume(code2);
  18132. return commentClose;
  18133. }
  18134. if (markdownLineEnding(code2)) {
  18135. returnState = comment2;
  18136. return lineEndingBefore(code2);
  18137. }
  18138. effects.consume(code2);
  18139. return comment2;
  18140. }
  18141. function commentClose(code2) {
  18142. if (code2 === 45) {
  18143. effects.consume(code2);
  18144. return commentEnd;
  18145. }
  18146. return comment2(code2);
  18147. }
  18148. function commentEnd(code2) {
  18149. return code2 === 62 ? end(code2) : code2 === 45 ? commentClose(code2) : comment2(code2);
  18150. }
  18151. function cdataOpenInside(code2) {
  18152. const value = "CDATA[";
  18153. if (code2 === value.charCodeAt(index2++)) {
  18154. effects.consume(code2);
  18155. return index2 === value.length ? cdata : cdataOpenInside;
  18156. }
  18157. return nok(code2);
  18158. }
  18159. function cdata(code2) {
  18160. if (code2 === null) {
  18161. return nok(code2);
  18162. }
  18163. if (code2 === 93) {
  18164. effects.consume(code2);
  18165. return cdataClose;
  18166. }
  18167. if (markdownLineEnding(code2)) {
  18168. returnState = cdata;
  18169. return lineEndingBefore(code2);
  18170. }
  18171. effects.consume(code2);
  18172. return cdata;
  18173. }
  18174. function cdataClose(code2) {
  18175. if (code2 === 93) {
  18176. effects.consume(code2);
  18177. return cdataEnd;
  18178. }
  18179. return cdata(code2);
  18180. }
  18181. function cdataEnd(code2) {
  18182. if (code2 === 62) {
  18183. return end(code2);
  18184. }
  18185. if (code2 === 93) {
  18186. effects.consume(code2);
  18187. return cdataEnd;
  18188. }
  18189. return cdata(code2);
  18190. }
  18191. function declaration(code2) {
  18192. if (code2 === null || code2 === 62) {
  18193. return end(code2);
  18194. }
  18195. if (markdownLineEnding(code2)) {
  18196. returnState = declaration;
  18197. return lineEndingBefore(code2);
  18198. }
  18199. effects.consume(code2);
  18200. return declaration;
  18201. }
  18202. function instruction(code2) {
  18203. if (code2 === null) {
  18204. return nok(code2);
  18205. }
  18206. if (code2 === 63) {
  18207. effects.consume(code2);
  18208. return instructionClose;
  18209. }
  18210. if (markdownLineEnding(code2)) {
  18211. returnState = instruction;
  18212. return lineEndingBefore(code2);
  18213. }
  18214. effects.consume(code2);
  18215. return instruction;
  18216. }
  18217. function instructionClose(code2) {
  18218. return code2 === 62 ? end(code2) : instruction(code2);
  18219. }
  18220. function tagCloseStart(code2) {
  18221. if (asciiAlpha(code2)) {
  18222. effects.consume(code2);
  18223. return tagClose;
  18224. }
  18225. return nok(code2);
  18226. }
  18227. function tagClose(code2) {
  18228. if (code2 === 45 || asciiAlphanumeric(code2)) {
  18229. effects.consume(code2);
  18230. return tagClose;
  18231. }
  18232. return tagCloseBetween(code2);
  18233. }
  18234. function tagCloseBetween(code2) {
  18235. if (markdownLineEnding(code2)) {
  18236. returnState = tagCloseBetween;
  18237. return lineEndingBefore(code2);
  18238. }
  18239. if (markdownSpace(code2)) {
  18240. effects.consume(code2);
  18241. return tagCloseBetween;
  18242. }
  18243. return end(code2);
  18244. }
  18245. function tagOpen(code2) {
  18246. if (code2 === 45 || asciiAlphanumeric(code2)) {
  18247. effects.consume(code2);
  18248. return tagOpen;
  18249. }
  18250. if (code2 === 47 || code2 === 62 || markdownLineEndingOrSpace(code2)) {
  18251. return tagOpenBetween(code2);
  18252. }
  18253. return nok(code2);
  18254. }
  18255. function tagOpenBetween(code2) {
  18256. if (code2 === 47) {
  18257. effects.consume(code2);
  18258. return end;
  18259. }
  18260. if (code2 === 58 || code2 === 95 || asciiAlpha(code2)) {
  18261. effects.consume(code2);
  18262. return tagOpenAttributeName;
  18263. }
  18264. if (markdownLineEnding(code2)) {
  18265. returnState = tagOpenBetween;
  18266. return lineEndingBefore(code2);
  18267. }
  18268. if (markdownSpace(code2)) {
  18269. effects.consume(code2);
  18270. return tagOpenBetween;
  18271. }
  18272. return end(code2);
  18273. }
  18274. function tagOpenAttributeName(code2) {
  18275. if (code2 === 45 || code2 === 46 || code2 === 58 || code2 === 95 || asciiAlphanumeric(code2)) {
  18276. effects.consume(code2);
  18277. return tagOpenAttributeName;
  18278. }
  18279. return tagOpenAttributeNameAfter(code2);
  18280. }
  18281. function tagOpenAttributeNameAfter(code2) {
  18282. if (code2 === 61) {
  18283. effects.consume(code2);
  18284. return tagOpenAttributeValueBefore;
  18285. }
  18286. if (markdownLineEnding(code2)) {
  18287. returnState = tagOpenAttributeNameAfter;
  18288. return lineEndingBefore(code2);
  18289. }
  18290. if (markdownSpace(code2)) {
  18291. effects.consume(code2);
  18292. return tagOpenAttributeNameAfter;
  18293. }
  18294. return tagOpenBetween(code2);
  18295. }
  18296. function tagOpenAttributeValueBefore(code2) {
  18297. if (code2 === null || code2 === 60 || code2 === 61 || code2 === 62 || code2 === 96) {
  18298. return nok(code2);
  18299. }
  18300. if (code2 === 34 || code2 === 39) {
  18301. effects.consume(code2);
  18302. marker = code2;
  18303. return tagOpenAttributeValueQuoted;
  18304. }
  18305. if (markdownLineEnding(code2)) {
  18306. returnState = tagOpenAttributeValueBefore;
  18307. return lineEndingBefore(code2);
  18308. }
  18309. if (markdownSpace(code2)) {
  18310. effects.consume(code2);
  18311. return tagOpenAttributeValueBefore;
  18312. }
  18313. effects.consume(code2);
  18314. return tagOpenAttributeValueUnquoted;
  18315. }
  18316. function tagOpenAttributeValueQuoted(code2) {
  18317. if (code2 === marker) {
  18318. effects.consume(code2);
  18319. marker = void 0;
  18320. return tagOpenAttributeValueQuotedAfter;
  18321. }
  18322. if (code2 === null) {
  18323. return nok(code2);
  18324. }
  18325. if (markdownLineEnding(code2)) {
  18326. returnState = tagOpenAttributeValueQuoted;
  18327. return lineEndingBefore(code2);
  18328. }
  18329. effects.consume(code2);
  18330. return tagOpenAttributeValueQuoted;
  18331. }
  18332. function tagOpenAttributeValueUnquoted(code2) {
  18333. if (code2 === null || code2 === 34 || code2 === 39 || code2 === 60 || code2 === 61 || code2 === 96) {
  18334. return nok(code2);
  18335. }
  18336. if (code2 === 47 || code2 === 62 || markdownLineEndingOrSpace(code2)) {
  18337. return tagOpenBetween(code2);
  18338. }
  18339. effects.consume(code2);
  18340. return tagOpenAttributeValueUnquoted;
  18341. }
  18342. function tagOpenAttributeValueQuotedAfter(code2) {
  18343. if (code2 === 47 || code2 === 62 || markdownLineEndingOrSpace(code2)) {
  18344. return tagOpenBetween(code2);
  18345. }
  18346. return nok(code2);
  18347. }
  18348. function end(code2) {
  18349. if (code2 === 62) {
  18350. effects.consume(code2);
  18351. effects.exit("htmlTextData");
  18352. effects.exit("htmlText");
  18353. return ok4;
  18354. }
  18355. return nok(code2);
  18356. }
  18357. function lineEndingBefore(code2) {
  18358. effects.exit("htmlTextData");
  18359. effects.enter("lineEnding");
  18360. effects.consume(code2);
  18361. effects.exit("lineEnding");
  18362. return lineEndingAfter;
  18363. }
  18364. function lineEndingAfter(code2) {
  18365. return markdownSpace(code2) ? factorySpace(effects, lineEndingAfterPrefix, "linePrefix", self2.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(code2) : lineEndingAfterPrefix(code2);
  18366. }
  18367. function lineEndingAfterPrefix(code2) {
  18368. effects.enter("htmlTextData");
  18369. return returnState(code2);
  18370. }
  18371. }
  18372. // node_modules/micromark-core-commonmark/lib/label-end.js
  18373. var labelEnd = {
  18374. name: "labelEnd",
  18375. tokenize: tokenizeLabelEnd,
  18376. resolveTo: resolveToLabelEnd,
  18377. resolveAll: resolveAllLabelEnd
  18378. };
  18379. var resourceConstruct = {
  18380. tokenize: tokenizeResource
  18381. };
  18382. var referenceFullConstruct = {
  18383. tokenize: tokenizeReferenceFull
  18384. };
  18385. var referenceCollapsedConstruct = {
  18386. tokenize: tokenizeReferenceCollapsed
  18387. };
  18388. function resolveAllLabelEnd(events) {
  18389. let index2 = -1;
  18390. while (++index2 < events.length) {
  18391. const token = events[index2][1];
  18392. if (token.type === "labelImage" || token.type === "labelLink" || token.type === "labelEnd") {
  18393. events.splice(index2 + 1, token.type === "labelImage" ? 4 : 2);
  18394. token.type = "data";
  18395. index2++;
  18396. }
  18397. }
  18398. return events;
  18399. }
  18400. function resolveToLabelEnd(events, context) {
  18401. let index2 = events.length;
  18402. let offset2 = 0;
  18403. let token;
  18404. let open;
  18405. let close;
  18406. let media;
  18407. while (index2--) {
  18408. token = events[index2][1];
  18409. if (open) {
  18410. if (token.type === "link" || token.type === "labelLink" && token._inactive) {
  18411. break;
  18412. }
  18413. if (events[index2][0] === "enter" && token.type === "labelLink") {
  18414. token._inactive = true;
  18415. }
  18416. } else if (close) {
  18417. if (events[index2][0] === "enter" && (token.type === "labelImage" || token.type === "labelLink") && !token._balanced) {
  18418. open = index2;
  18419. if (token.type !== "labelLink") {
  18420. offset2 = 2;
  18421. break;
  18422. }
  18423. }
  18424. } else if (token.type === "labelEnd") {
  18425. close = index2;
  18426. }
  18427. }
  18428. const group = {
  18429. type: events[open][1].type === "labelLink" ? "link" : "image",
  18430. start: Object.assign({}, events[open][1].start),
  18431. end: Object.assign({}, events[events.length - 1][1].end)
  18432. };
  18433. const label = {
  18434. type: "label",
  18435. start: Object.assign({}, events[open][1].start),
  18436. end: Object.assign({}, events[close][1].end)
  18437. };
  18438. const text5 = {
  18439. type: "labelText",
  18440. start: Object.assign({}, events[open + offset2 + 2][1].end),
  18441. end: Object.assign({}, events[close - 2][1].start)
  18442. };
  18443. media = [["enter", group, context], ["enter", label, context]];
  18444. media = push(media, events.slice(open + 1, open + offset2 + 3));
  18445. media = push(media, [["enter", text5, context]]);
  18446. media = push(media, resolveAll(context.parser.constructs.insideSpan.null, events.slice(open + offset2 + 4, close - 3), context));
  18447. media = push(media, [["exit", text5, context], events[close - 2], events[close - 1], ["exit", label, context]]);
  18448. media = push(media, events.slice(close + 1));
  18449. media = push(media, [["exit", group, context]]);
  18450. splice(events, open, events.length, media);
  18451. return events;
  18452. }
  18453. function tokenizeLabelEnd(effects, ok4, nok) {
  18454. const self2 = this;
  18455. let index2 = self2.events.length;
  18456. let labelStart;
  18457. let defined;
  18458. while (index2--) {
  18459. if ((self2.events[index2][1].type === "labelImage" || self2.events[index2][1].type === "labelLink") && !self2.events[index2][1]._balanced) {
  18460. labelStart = self2.events[index2][1];
  18461. break;
  18462. }
  18463. }
  18464. return start2;
  18465. function start2(code2) {
  18466. if (!labelStart) {
  18467. return nok(code2);
  18468. }
  18469. if (labelStart._inactive) {
  18470. return labelEndNok(code2);
  18471. }
  18472. defined = self2.parser.defined.includes(normalizeIdentifier(self2.sliceSerialize({
  18473. start: labelStart.end,
  18474. end: self2.now()
  18475. })));
  18476. effects.enter("labelEnd");
  18477. effects.enter("labelMarker");
  18478. effects.consume(code2);
  18479. effects.exit("labelMarker");
  18480. effects.exit("labelEnd");
  18481. return after;
  18482. }
  18483. function after(code2) {
  18484. if (code2 === 40) {
  18485. return effects.attempt(resourceConstruct, labelEndOk, defined ? labelEndOk : labelEndNok)(code2);
  18486. }
  18487. if (code2 === 91) {
  18488. return effects.attempt(referenceFullConstruct, labelEndOk, defined ? referenceNotFull : labelEndNok)(code2);
  18489. }
  18490. return defined ? labelEndOk(code2) : labelEndNok(code2);
  18491. }
  18492. function referenceNotFull(code2) {
  18493. return effects.attempt(referenceCollapsedConstruct, labelEndOk, labelEndNok)(code2);
  18494. }
  18495. function labelEndOk(code2) {
  18496. return ok4(code2);
  18497. }
  18498. function labelEndNok(code2) {
  18499. labelStart._balanced = true;
  18500. return nok(code2);
  18501. }
  18502. }
  18503. function tokenizeResource(effects, ok4, nok) {
  18504. return resourceStart;
  18505. function resourceStart(code2) {
  18506. effects.enter("resource");
  18507. effects.enter("resourceMarker");
  18508. effects.consume(code2);
  18509. effects.exit("resourceMarker");
  18510. return resourceBefore;
  18511. }
  18512. function resourceBefore(code2) {
  18513. return markdownLineEndingOrSpace(code2) ? factoryWhitespace(effects, resourceOpen)(code2) : resourceOpen(code2);
  18514. }
  18515. function resourceOpen(code2) {
  18516. if (code2 === 41) {
  18517. return resourceEnd(code2);
  18518. }
  18519. return factoryDestination(effects, resourceDestinationAfter, resourceDestinationMissing, "resourceDestination", "resourceDestinationLiteral", "resourceDestinationLiteralMarker", "resourceDestinationRaw", "resourceDestinationString", 32)(code2);
  18520. }
  18521. function resourceDestinationAfter(code2) {
  18522. return markdownLineEndingOrSpace(code2) ? factoryWhitespace(effects, resourceBetween)(code2) : resourceEnd(code2);
  18523. }
  18524. function resourceDestinationMissing(code2) {
  18525. return nok(code2);
  18526. }
  18527. function resourceBetween(code2) {
  18528. if (code2 === 34 || code2 === 39 || code2 === 40) {
  18529. return factoryTitle(effects, resourceTitleAfter, nok, "resourceTitle", "resourceTitleMarker", "resourceTitleString")(code2);
  18530. }
  18531. return resourceEnd(code2);
  18532. }
  18533. function resourceTitleAfter(code2) {
  18534. return markdownLineEndingOrSpace(code2) ? factoryWhitespace(effects, resourceEnd)(code2) : resourceEnd(code2);
  18535. }
  18536. function resourceEnd(code2) {
  18537. if (code2 === 41) {
  18538. effects.enter("resourceMarker");
  18539. effects.consume(code2);
  18540. effects.exit("resourceMarker");
  18541. effects.exit("resource");
  18542. return ok4;
  18543. }
  18544. return nok(code2);
  18545. }
  18546. }
  18547. function tokenizeReferenceFull(effects, ok4, nok) {
  18548. const self2 = this;
  18549. return referenceFull;
  18550. function referenceFull(code2) {
  18551. return factoryLabel.call(self2, effects, referenceFullAfter, referenceFullMissing, "reference", "referenceMarker", "referenceString")(code2);
  18552. }
  18553. function referenceFullAfter(code2) {
  18554. return self2.parser.defined.includes(normalizeIdentifier(self2.sliceSerialize(self2.events[self2.events.length - 1][1]).slice(1, -1))) ? ok4(code2) : nok(code2);
  18555. }
  18556. function referenceFullMissing(code2) {
  18557. return nok(code2);
  18558. }
  18559. }
  18560. function tokenizeReferenceCollapsed(effects, ok4, nok) {
  18561. return referenceCollapsedStart;
  18562. function referenceCollapsedStart(code2) {
  18563. effects.enter("reference");
  18564. effects.enter("referenceMarker");
  18565. effects.consume(code2);
  18566. effects.exit("referenceMarker");
  18567. return referenceCollapsedOpen;
  18568. }
  18569. function referenceCollapsedOpen(code2) {
  18570. if (code2 === 93) {
  18571. effects.enter("referenceMarker");
  18572. effects.consume(code2);
  18573. effects.exit("referenceMarker");
  18574. effects.exit("reference");
  18575. return ok4;
  18576. }
  18577. return nok(code2);
  18578. }
  18579. }
  18580. // node_modules/micromark-core-commonmark/lib/label-start-image.js
  18581. var labelStartImage = {
  18582. name: "labelStartImage",
  18583. tokenize: tokenizeLabelStartImage,
  18584. resolveAll: labelEnd.resolveAll
  18585. };
  18586. function tokenizeLabelStartImage(effects, ok4, nok) {
  18587. const self2 = this;
  18588. return start2;
  18589. function start2(code2) {
  18590. effects.enter("labelImage");
  18591. effects.enter("labelImageMarker");
  18592. effects.consume(code2);
  18593. effects.exit("labelImageMarker");
  18594. return open;
  18595. }
  18596. function open(code2) {
  18597. if (code2 === 91) {
  18598. effects.enter("labelMarker");
  18599. effects.consume(code2);
  18600. effects.exit("labelMarker");
  18601. effects.exit("labelImage");
  18602. return after;
  18603. }
  18604. return nok(code2);
  18605. }
  18606. function after(code2) {
  18607. return code2 === 94 && "_hiddenFootnoteSupport" in self2.parser.constructs ? nok(code2) : ok4(code2);
  18608. }
  18609. }
  18610. // node_modules/micromark-core-commonmark/lib/label-start-link.js
  18611. var labelStartLink = {
  18612. name: "labelStartLink",
  18613. tokenize: tokenizeLabelStartLink,
  18614. resolveAll: labelEnd.resolveAll
  18615. };
  18616. function tokenizeLabelStartLink(effects, ok4, nok) {
  18617. const self2 = this;
  18618. return start2;
  18619. function start2(code2) {
  18620. effects.enter("labelLink");
  18621. effects.enter("labelMarker");
  18622. effects.consume(code2);
  18623. effects.exit("labelMarker");
  18624. effects.exit("labelLink");
  18625. return after;
  18626. }
  18627. function after(code2) {
  18628. return code2 === 94 && "_hiddenFootnoteSupport" in self2.parser.constructs ? nok(code2) : ok4(code2);
  18629. }
  18630. }
  18631. // node_modules/micromark-core-commonmark/lib/line-ending.js
  18632. var lineEnding = {
  18633. name: "lineEnding",
  18634. tokenize: tokenizeLineEnding
  18635. };
  18636. function tokenizeLineEnding(effects, ok4) {
  18637. return start2;
  18638. function start2(code2) {
  18639. effects.enter("lineEnding");
  18640. effects.consume(code2);
  18641. effects.exit("lineEnding");
  18642. return factorySpace(effects, ok4, "linePrefix");
  18643. }
  18644. }
  18645. // node_modules/micromark-core-commonmark/lib/thematic-break.js
  18646. var thematicBreak = {
  18647. name: "thematicBreak",
  18648. tokenize: tokenizeThematicBreak
  18649. };
  18650. function tokenizeThematicBreak(effects, ok4, nok) {
  18651. let size = 0;
  18652. let marker;
  18653. return start2;
  18654. function start2(code2) {
  18655. effects.enter("thematicBreak");
  18656. return before(code2);
  18657. }
  18658. function before(code2) {
  18659. marker = code2;
  18660. return atBreak(code2);
  18661. }
  18662. function atBreak(code2) {
  18663. if (code2 === marker) {
  18664. effects.enter("thematicBreakSequence");
  18665. return sequence(code2);
  18666. }
  18667. if (size >= 3 && (code2 === null || markdownLineEnding(code2))) {
  18668. effects.exit("thematicBreak");
  18669. return ok4(code2);
  18670. }
  18671. return nok(code2);
  18672. }
  18673. function sequence(code2) {
  18674. if (code2 === marker) {
  18675. effects.consume(code2);
  18676. size++;
  18677. return sequence;
  18678. }
  18679. effects.exit("thematicBreakSequence");
  18680. return markdownSpace(code2) ? factorySpace(effects, atBreak, "whitespace")(code2) : atBreak(code2);
  18681. }
  18682. }
  18683. // node_modules/micromark-core-commonmark/lib/list.js
  18684. var list = {
  18685. name: "list",
  18686. tokenize: tokenizeListStart,
  18687. continuation: {
  18688. tokenize: tokenizeListContinuation
  18689. },
  18690. exit: tokenizeListEnd
  18691. };
  18692. var listItemPrefixWhitespaceConstruct = {
  18693. tokenize: tokenizeListItemPrefixWhitespace,
  18694. partial: true
  18695. };
  18696. var indentConstruct = {
  18697. tokenize: tokenizeIndent,
  18698. partial: true
  18699. };
  18700. function tokenizeListStart(effects, ok4, nok) {
  18701. const self2 = this;
  18702. const tail = self2.events[self2.events.length - 1];
  18703. let initialSize = tail && tail[1].type === "linePrefix" ? tail[2].sliceSerialize(tail[1], true).length : 0;
  18704. let size = 0;
  18705. return start2;
  18706. function start2(code2) {
  18707. const kind = self2.containerState.type || (code2 === 42 || code2 === 43 || code2 === 45 ? "listUnordered" : "listOrdered");
  18708. if (kind === "listUnordered" ? !self2.containerState.marker || code2 === self2.containerState.marker : asciiDigit(code2)) {
  18709. if (!self2.containerState.type) {
  18710. self2.containerState.type = kind;
  18711. effects.enter(kind, {
  18712. _container: true
  18713. });
  18714. }
  18715. if (kind === "listUnordered") {
  18716. effects.enter("listItemPrefix");
  18717. return code2 === 42 || code2 === 45 ? effects.check(thematicBreak, nok, atMarker)(code2) : atMarker(code2);
  18718. }
  18719. if (!self2.interrupt || code2 === 49) {
  18720. effects.enter("listItemPrefix");
  18721. effects.enter("listItemValue");
  18722. return inside(code2);
  18723. }
  18724. }
  18725. return nok(code2);
  18726. }
  18727. function inside(code2) {
  18728. if (asciiDigit(code2) && ++size < 10) {
  18729. effects.consume(code2);
  18730. return inside;
  18731. }
  18732. if ((!self2.interrupt || size < 2) && (self2.containerState.marker ? code2 === self2.containerState.marker : code2 === 41 || code2 === 46)) {
  18733. effects.exit("listItemValue");
  18734. return atMarker(code2);
  18735. }
  18736. return nok(code2);
  18737. }
  18738. function atMarker(code2) {
  18739. effects.enter("listItemMarker");
  18740. effects.consume(code2);
  18741. effects.exit("listItemMarker");
  18742. self2.containerState.marker = self2.containerState.marker || code2;
  18743. return effects.check(
  18744. blankLine,
  18745. // Can’t be empty when interrupting.
  18746. self2.interrupt ? nok : onBlank,
  18747. effects.attempt(listItemPrefixWhitespaceConstruct, endOfPrefix, otherPrefix)
  18748. );
  18749. }
  18750. function onBlank(code2) {
  18751. self2.containerState.initialBlankLine = true;
  18752. initialSize++;
  18753. return endOfPrefix(code2);
  18754. }
  18755. function otherPrefix(code2) {
  18756. if (markdownSpace(code2)) {
  18757. effects.enter("listItemPrefixWhitespace");
  18758. effects.consume(code2);
  18759. effects.exit("listItemPrefixWhitespace");
  18760. return endOfPrefix;
  18761. }
  18762. return nok(code2);
  18763. }
  18764. function endOfPrefix(code2) {
  18765. self2.containerState.size = initialSize + self2.sliceSerialize(effects.exit("listItemPrefix"), true).length;
  18766. return ok4(code2);
  18767. }
  18768. }
  18769. function tokenizeListContinuation(effects, ok4, nok) {
  18770. const self2 = this;
  18771. self2.containerState._closeFlow = void 0;
  18772. return effects.check(blankLine, onBlank, notBlank);
  18773. function onBlank(code2) {
  18774. self2.containerState.furtherBlankLines = self2.containerState.furtherBlankLines || self2.containerState.initialBlankLine;
  18775. return factorySpace(effects, ok4, "listItemIndent", self2.containerState.size + 1)(code2);
  18776. }
  18777. function notBlank(code2) {
  18778. if (self2.containerState.furtherBlankLines || !markdownSpace(code2)) {
  18779. self2.containerState.furtherBlankLines = void 0;
  18780. self2.containerState.initialBlankLine = void 0;
  18781. return notInCurrentItem(code2);
  18782. }
  18783. self2.containerState.furtherBlankLines = void 0;
  18784. self2.containerState.initialBlankLine = void 0;
  18785. return effects.attempt(indentConstruct, ok4, notInCurrentItem)(code2);
  18786. }
  18787. function notInCurrentItem(code2) {
  18788. self2.containerState._closeFlow = true;
  18789. self2.interrupt = void 0;
  18790. return factorySpace(effects, effects.attempt(list, ok4, nok), "linePrefix", self2.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(code2);
  18791. }
  18792. }
  18793. function tokenizeIndent(effects, ok4, nok) {
  18794. const self2 = this;
  18795. return factorySpace(effects, afterPrefix, "listItemIndent", self2.containerState.size + 1);
  18796. function afterPrefix(code2) {
  18797. const tail = self2.events[self2.events.length - 1];
  18798. return tail && tail[1].type === "listItemIndent" && tail[2].sliceSerialize(tail[1], true).length === self2.containerState.size ? ok4(code2) : nok(code2);
  18799. }
  18800. }
  18801. function tokenizeListEnd(effects) {
  18802. effects.exit(this.containerState.type);
  18803. }
  18804. function tokenizeListItemPrefixWhitespace(effects, ok4, nok) {
  18805. const self2 = this;
  18806. return factorySpace(effects, afterPrefix, "listItemPrefixWhitespace", self2.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4 + 1);
  18807. function afterPrefix(code2) {
  18808. const tail = self2.events[self2.events.length - 1];
  18809. return !markdownSpace(code2) && tail && tail[1].type === "listItemPrefixWhitespace" ? ok4(code2) : nok(code2);
  18810. }
  18811. }
  18812. // node_modules/micromark-core-commonmark/lib/setext-underline.js
  18813. var setextUnderline = {
  18814. name: "setextUnderline",
  18815. tokenize: tokenizeSetextUnderline,
  18816. resolveTo: resolveToSetextUnderline
  18817. };
  18818. function resolveToSetextUnderline(events, context) {
  18819. let index2 = events.length;
  18820. let content3;
  18821. let text5;
  18822. let definition2;
  18823. while (index2--) {
  18824. if (events[index2][0] === "enter") {
  18825. if (events[index2][1].type === "content") {
  18826. content3 = index2;
  18827. break;
  18828. }
  18829. if (events[index2][1].type === "paragraph") {
  18830. text5 = index2;
  18831. }
  18832. } else {
  18833. if (events[index2][1].type === "content") {
  18834. events.splice(index2, 1);
  18835. }
  18836. if (!definition2 && events[index2][1].type === "definition") {
  18837. definition2 = index2;
  18838. }
  18839. }
  18840. }
  18841. const heading2 = {
  18842. type: "setextHeading",
  18843. start: Object.assign({}, events[text5][1].start),
  18844. end: Object.assign({}, events[events.length - 1][1].end)
  18845. };
  18846. events[text5][1].type = "setextHeadingText";
  18847. if (definition2) {
  18848. events.splice(text5, 0, ["enter", heading2, context]);
  18849. events.splice(definition2 + 1, 0, ["exit", events[content3][1], context]);
  18850. events[content3][1].end = Object.assign({}, events[definition2][1].end);
  18851. } else {
  18852. events[content3][1] = heading2;
  18853. }
  18854. events.push(["exit", heading2, context]);
  18855. return events;
  18856. }
  18857. function tokenizeSetextUnderline(effects, ok4, nok) {
  18858. const self2 = this;
  18859. let marker;
  18860. return start2;
  18861. function start2(code2) {
  18862. let index2 = self2.events.length;
  18863. let paragraph2;
  18864. while (index2--) {
  18865. if (self2.events[index2][1].type !== "lineEnding" && self2.events[index2][1].type !== "linePrefix" && self2.events[index2][1].type !== "content") {
  18866. paragraph2 = self2.events[index2][1].type === "paragraph";
  18867. break;
  18868. }
  18869. }
  18870. if (!self2.parser.lazy[self2.now().line] && (self2.interrupt || paragraph2)) {
  18871. effects.enter("setextHeadingLine");
  18872. marker = code2;
  18873. return before(code2);
  18874. }
  18875. return nok(code2);
  18876. }
  18877. function before(code2) {
  18878. effects.enter("setextHeadingLineSequence");
  18879. return inside(code2);
  18880. }
  18881. function inside(code2) {
  18882. if (code2 === marker) {
  18883. effects.consume(code2);
  18884. return inside;
  18885. }
  18886. effects.exit("setextHeadingLineSequence");
  18887. return markdownSpace(code2) ? factorySpace(effects, after, "lineSuffix")(code2) : after(code2);
  18888. }
  18889. function after(code2) {
  18890. if (code2 === null || markdownLineEnding(code2)) {
  18891. effects.exit("setextHeadingLine");
  18892. return ok4(code2);
  18893. }
  18894. return nok(code2);
  18895. }
  18896. }
  18897. // node_modules/micromark-extension-mdxjs-esm/lib/syntax.js
  18898. var blankLineBefore2 = {
  18899. tokenize: tokenizeNextBlank,
  18900. partial: true
  18901. };
  18902. var trouble3 = "https://github.com/micromark/micromark-extension-mdxjs-esm";
  18903. var allowedAcornTypes = /* @__PURE__ */ new Set(["ExportAllDeclaration", "ExportDefaultDeclaration", "ExportNamedDeclaration", "ImportDeclaration"]);
  18904. function mdxjsEsm(options) {
  18905. const exportImportConstruct = {
  18906. tokenize: tokenizeExportImport,
  18907. concrete: true
  18908. };
  18909. if (!options || !options.acorn || !options.acorn.parse) {
  18910. throw new Error("Expected an `acorn` instance passed in as `options.acorn`");
  18911. }
  18912. const acorn = options.acorn;
  18913. const acornOptions = Object.assign({
  18914. ecmaVersion: 2024,
  18915. sourceType: "module"
  18916. }, options.acornOptions, {
  18917. locations: true
  18918. });
  18919. return {
  18920. flow: {
  18921. [101]: exportImportConstruct,
  18922. [105]: exportImportConstruct
  18923. }
  18924. };
  18925. function tokenizeExportImport(effects, ok4, nok) {
  18926. const self2 = this;
  18927. const definedModuleSpecifiers = self2.parser.definedModuleSpecifiers || (self2.parser.definedModuleSpecifiers = []);
  18928. const eventStart = this.events.length + 1;
  18929. let buffer = "";
  18930. return self2.interrupt ? nok : start2;
  18931. function start2(code2) {
  18932. if (self2.now().column > 1) return nok(code2);
  18933. effects.enter("mdxjsEsm");
  18934. effects.enter("mdxjsEsmData");
  18935. effects.consume(code2);
  18936. buffer += String.fromCharCode(code2);
  18937. return word;
  18938. }
  18939. function word(code2) {
  18940. if (asciiAlpha(code2)) {
  18941. effects.consume(code2);
  18942. buffer += String.fromCharCode(code2);
  18943. return word;
  18944. }
  18945. if ((buffer === "import" || buffer === "export") && code2 === 32) {
  18946. effects.consume(code2);
  18947. return inside;
  18948. }
  18949. return nok(code2);
  18950. }
  18951. function inside(code2) {
  18952. if (code2 === null || markdownLineEnding(code2)) {
  18953. effects.exit("mdxjsEsmData");
  18954. return lineStart(code2);
  18955. }
  18956. effects.consume(code2);
  18957. return inside;
  18958. }
  18959. function lineStart(code2) {
  18960. if (code2 === null) {
  18961. return atEnd(code2);
  18962. }
  18963. if (markdownLineEnding(code2)) {
  18964. return effects.check(blankLineBefore2, atEnd, continuationStart)(code2);
  18965. }
  18966. effects.enter("mdxjsEsmData");
  18967. return inside(code2);
  18968. }
  18969. function continuationStart(code2) {
  18970. effects.enter("lineEnding");
  18971. effects.consume(code2);
  18972. effects.exit("lineEnding");
  18973. return lineStart;
  18974. }
  18975. function atEnd(code2) {
  18976. const result = eventsToAcorn(self2.events.slice(eventStart), {
  18977. acorn,
  18978. acornOptions,
  18979. tokenTypes: ["mdxjsEsmData"],
  18980. prefix: definedModuleSpecifiers.length > 0 ? "var " + definedModuleSpecifiers.join(",") + "\n" : ""
  18981. });
  18982. if (result.error) {
  18983. if (code2 !== null && result.swallow) {
  18984. return continuationStart(code2);
  18985. }
  18986. const error = new VFileMessage("Could not parse import/exports with acorn", {
  18987. cause: result.error,
  18988. place: {
  18989. line: result.error.loc.line,
  18990. column: result.error.loc.column + 1,
  18991. offset: result.error.pos
  18992. },
  18993. ruleId: "acorn",
  18994. source: "micromark-extension-mdxjs-esm"
  18995. });
  18996. error.url = trouble3 + "#could-not-parse-importexports-with-acorn";
  18997. throw error;
  18998. }
  18999. if (definedModuleSpecifiers.length > 0) {
  19000. const declaration = result.estree.body.shift();
  19001. }
  19002. let index2 = -1;
  19003. while (++index2 < result.estree.body.length) {
  19004. const node2 = result.estree.body[index2];
  19005. if (!allowedAcornTypes.has(node2.type)) {
  19006. const error = new VFileMessage("Unexpected `" + node2.type + "` in code: only import/exports are supported", {
  19007. place: positionFromEstree(node2),
  19008. ruleId: "non-esm",
  19009. source: "micromark-extension-mdxjs-esm"
  19010. });
  19011. error.url = trouble3 + "#unexpected-type-in-code-only-importexports-are-supported";
  19012. throw error;
  19013. }
  19014. if (node2.type === "ImportDeclaration" && !self2.interrupt) {
  19015. let index3 = -1;
  19016. while (++index3 < node2.specifiers.length) {
  19017. const specifier = node2.specifiers[index3];
  19018. definedModuleSpecifiers.push(specifier.local.name);
  19019. }
  19020. }
  19021. }
  19022. Object.assign(effects.exit("mdxjsEsm"), options.addResult ? {
  19023. estree: result.estree
  19024. } : void 0);
  19025. return ok4(code2);
  19026. }
  19027. }
  19028. }
  19029. function tokenizeNextBlank(effects, ok4, nok) {
  19030. return start2;
  19031. function start2(code2) {
  19032. effects.enter("lineEndingBlank");
  19033. effects.consume(code2);
  19034. effects.exit("lineEndingBlank");
  19035. return effects.attempt(blankLine, ok4, nok);
  19036. }
  19037. }
  19038. // node_modules/micromark-util-combine-extensions/index.js
  19039. var hasOwnProperty2 = {}.hasOwnProperty;
  19040. function combineExtensions(extensions) {
  19041. const all3 = {};
  19042. let index2 = -1;
  19043. while (++index2 < extensions.length) {
  19044. syntaxExtension(all3, extensions[index2]);
  19045. }
  19046. return all3;
  19047. }
  19048. function syntaxExtension(all3, extension2) {
  19049. let hook;
  19050. for (hook in extension2) {
  19051. const maybe = hasOwnProperty2.call(all3, hook) ? all3[hook] : void 0;
  19052. const left = maybe || (all3[hook] = {});
  19053. const right = extension2[hook];
  19054. let code2;
  19055. if (right) {
  19056. for (code2 in right) {
  19057. if (!hasOwnProperty2.call(left, code2)) left[code2] = [];
  19058. const value = right[code2];
  19059. constructs(
  19060. // @ts-expect-error Looks like a list.
  19061. left[code2],
  19062. Array.isArray(value) ? value : value ? [value] : []
  19063. );
  19064. }
  19065. }
  19066. }
  19067. }
  19068. function constructs(existing, list3) {
  19069. let index2 = -1;
  19070. const before = [];
  19071. while (++index2 < list3.length) {
  19072. ;
  19073. (list3[index2].add === "after" ? existing : before).push(list3[index2]);
  19074. }
  19075. splice(existing, 0, 0, before);
  19076. }
  19077. // node_modules/micromark-extension-mdxjs/index.js
  19078. function mdxjs(options) {
  19079. const settings = Object.assign(
  19080. {
  19081. acorn: Parser.extend((0, import_acorn_jsx.default)()),
  19082. acornOptions: { ecmaVersion: 2024, sourceType: "module" },
  19083. addResult: true
  19084. },
  19085. options
  19086. );
  19087. return combineExtensions([
  19088. mdxjsEsm(settings),
  19089. mdxExpression(settings),
  19090. mdxJsx(settings),
  19091. mdxMd()
  19092. ]);
  19093. }
  19094. // node_modules/remark-mdx/lib/index.js
  19095. var emptyOptions2 = {};
  19096. function remarkMdx(options) {
  19097. const self2 = (
  19098. /** @type {Processor} */
  19099. this
  19100. );
  19101. const settings = options || emptyOptions2;
  19102. const data2 = self2.data();
  19103. const micromarkExtensions = data2.micromarkExtensions || (data2.micromarkExtensions = []);
  19104. const fromMarkdownExtensions = data2.fromMarkdownExtensions || (data2.fromMarkdownExtensions = []);
  19105. const toMarkdownExtensions = data2.toMarkdownExtensions || (data2.toMarkdownExtensions = []);
  19106. micromarkExtensions.push(mdxjs(settings));
  19107. fromMarkdownExtensions.push(mdxFromMarkdown());
  19108. toMarkdownExtensions.push(mdxToMarkdown(settings));
  19109. }
  19110. // node_modules/mdast-util-from-markdown/node_modules/mdast-util-to-string/lib/index.js
  19111. var emptyOptions3 = {};
  19112. function toString2(value, options) {
  19113. const settings = options || emptyOptions3;
  19114. const includeImageAlt = typeof settings.includeImageAlt === "boolean" ? settings.includeImageAlt : true;
  19115. const includeHtml = typeof settings.includeHtml === "boolean" ? settings.includeHtml : true;
  19116. return one(value, includeImageAlt, includeHtml);
  19117. }
  19118. function one(value, includeImageAlt, includeHtml) {
  19119. if (node(value)) {
  19120. if ("value" in value) {
  19121. return value.type === "html" && !includeHtml ? "" : value.value;
  19122. }
  19123. if (includeImageAlt && "alt" in value && value.alt) {
  19124. return value.alt;
  19125. }
  19126. if ("children" in value) {
  19127. return all(value.children, includeImageAlt, includeHtml);
  19128. }
  19129. }
  19130. if (Array.isArray(value)) {
  19131. return all(value, includeImageAlt, includeHtml);
  19132. }
  19133. return "";
  19134. }
  19135. function all(values, includeImageAlt, includeHtml) {
  19136. const result = [];
  19137. let index2 = -1;
  19138. while (++index2 < values.length) {
  19139. result[index2] = one(values[index2], includeImageAlt, includeHtml);
  19140. }
  19141. return result.join("");
  19142. }
  19143. function node(value) {
  19144. return Boolean(value && typeof value === "object");
  19145. }
  19146. // node_modules/micromark-util-decode-numeric-character-reference/index.js
  19147. function decodeNumericCharacterReference(value, base) {
  19148. const code2 = Number.parseInt(value, base);
  19149. if (
  19150. // C0 except for HT, LF, FF, CR, space.
  19151. code2 < 9 || code2 === 11 || code2 > 13 && code2 < 32 || // Control character (DEL) of C0, and C1 controls.
  19152. code2 > 126 && code2 < 160 || // Lone high surrogates and low surrogates.
  19153. code2 > 55295 && code2 < 57344 || // Noncharacters.
  19154. code2 > 64975 && code2 < 65008 || /* eslint-disable no-bitwise */
  19155. (code2 & 65535) === 65535 || (code2 & 65535) === 65534 || /* eslint-enable no-bitwise */
  19156. // Out of range
  19157. code2 > 1114111
  19158. ) {
  19159. return "\uFFFD";
  19160. }
  19161. return String.fromCodePoint(code2);
  19162. }
  19163. // node_modules/micromark-util-sanitize-uri/index.js
  19164. function normalizeUri(value) {
  19165. const result = [];
  19166. let index2 = -1;
  19167. let start2 = 0;
  19168. let skip = 0;
  19169. while (++index2 < value.length) {
  19170. const code2 = value.charCodeAt(index2);
  19171. let replace = "";
  19172. if (code2 === 37 && asciiAlphanumeric(value.charCodeAt(index2 + 1)) && asciiAlphanumeric(value.charCodeAt(index2 + 2))) {
  19173. skip = 2;
  19174. } else if (code2 < 128) {
  19175. if (!/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(code2))) {
  19176. replace = String.fromCharCode(code2);
  19177. }
  19178. } else if (code2 > 55295 && code2 < 57344) {
  19179. const next = value.charCodeAt(index2 + 1);
  19180. if (code2 < 56320 && next > 56319 && next < 57344) {
  19181. replace = String.fromCharCode(code2, next);
  19182. skip = 1;
  19183. } else {
  19184. replace = "\uFFFD";
  19185. }
  19186. } else {
  19187. replace = String.fromCharCode(code2);
  19188. }
  19189. if (replace) {
  19190. result.push(value.slice(start2, index2), encodeURIComponent(replace));
  19191. start2 = index2 + skip + 1;
  19192. replace = "";
  19193. }
  19194. if (skip) {
  19195. index2 += skip;
  19196. skip = 0;
  19197. }
  19198. }
  19199. return result.join("") + value.slice(start2);
  19200. }
  19201. // node_modules/micromark/lib/initialize/content.js
  19202. var content2 = {
  19203. tokenize: initializeContent
  19204. };
  19205. function initializeContent(effects) {
  19206. const contentStart = effects.attempt(
  19207. this.parser.constructs.contentInitial,
  19208. afterContentStartConstruct,
  19209. paragraphInitial
  19210. );
  19211. let previous2;
  19212. return contentStart;
  19213. function afterContentStartConstruct(code2) {
  19214. if (code2 === null) {
  19215. effects.consume(code2);
  19216. return;
  19217. }
  19218. effects.enter("lineEnding");
  19219. effects.consume(code2);
  19220. effects.exit("lineEnding");
  19221. return factorySpace(effects, contentStart, "linePrefix");
  19222. }
  19223. function paragraphInitial(code2) {
  19224. effects.enter("paragraph");
  19225. return lineStart(code2);
  19226. }
  19227. function lineStart(code2) {
  19228. const token = effects.enter("chunkText", {
  19229. contentType: "text",
  19230. previous: previous2
  19231. });
  19232. if (previous2) {
  19233. previous2.next = token;
  19234. }
  19235. previous2 = token;
  19236. return data2(code2);
  19237. }
  19238. function data2(code2) {
  19239. if (code2 === null) {
  19240. effects.exit("chunkText");
  19241. effects.exit("paragraph");
  19242. effects.consume(code2);
  19243. return;
  19244. }
  19245. if (markdownLineEnding(code2)) {
  19246. effects.consume(code2);
  19247. effects.exit("chunkText");
  19248. return lineStart;
  19249. }
  19250. effects.consume(code2);
  19251. return data2;
  19252. }
  19253. }
  19254. // node_modules/micromark/lib/initialize/document.js
  19255. var document = {
  19256. tokenize: initializeDocument
  19257. };
  19258. var containerConstruct = {
  19259. tokenize: tokenizeContainer
  19260. };
  19261. function initializeDocument(effects) {
  19262. const self2 = this;
  19263. const stack = [];
  19264. let continued = 0;
  19265. let childFlow;
  19266. let childToken;
  19267. let lineStartOffset;
  19268. return start2;
  19269. function start2(code2) {
  19270. if (continued < stack.length) {
  19271. const item = stack[continued];
  19272. self2.containerState = item[1];
  19273. return effects.attempt(
  19274. item[0].continuation,
  19275. documentContinue,
  19276. checkNewContainers
  19277. )(code2);
  19278. }
  19279. return checkNewContainers(code2);
  19280. }
  19281. function documentContinue(code2) {
  19282. continued++;
  19283. if (self2.containerState._closeFlow) {
  19284. self2.containerState._closeFlow = void 0;
  19285. if (childFlow) {
  19286. closeFlow();
  19287. }
  19288. const indexBeforeExits = self2.events.length;
  19289. let indexBeforeFlow = indexBeforeExits;
  19290. let point4;
  19291. while (indexBeforeFlow--) {
  19292. if (self2.events[indexBeforeFlow][0] === "exit" && self2.events[indexBeforeFlow][1].type === "chunkFlow") {
  19293. point4 = self2.events[indexBeforeFlow][1].end;
  19294. break;
  19295. }
  19296. }
  19297. exitContainers(continued);
  19298. let index2 = indexBeforeExits;
  19299. while (index2 < self2.events.length) {
  19300. self2.events[index2][1].end = Object.assign({}, point4);
  19301. index2++;
  19302. }
  19303. splice(
  19304. self2.events,
  19305. indexBeforeFlow + 1,
  19306. 0,
  19307. self2.events.slice(indexBeforeExits)
  19308. );
  19309. self2.events.length = index2;
  19310. return checkNewContainers(code2);
  19311. }
  19312. return start2(code2);
  19313. }
  19314. function checkNewContainers(code2) {
  19315. if (continued === stack.length) {
  19316. if (!childFlow) {
  19317. return documentContinued(code2);
  19318. }
  19319. if (childFlow.currentConstruct && childFlow.currentConstruct.concrete) {
  19320. return flowStart(code2);
  19321. }
  19322. self2.interrupt = Boolean(
  19323. childFlow.currentConstruct && !childFlow._gfmTableDynamicInterruptHack
  19324. );
  19325. }
  19326. self2.containerState = {};
  19327. return effects.check(
  19328. containerConstruct,
  19329. thereIsANewContainer,
  19330. thereIsNoNewContainer
  19331. )(code2);
  19332. }
  19333. function thereIsANewContainer(code2) {
  19334. if (childFlow) closeFlow();
  19335. exitContainers(continued);
  19336. return documentContinued(code2);
  19337. }
  19338. function thereIsNoNewContainer(code2) {
  19339. self2.parser.lazy[self2.now().line] = continued !== stack.length;
  19340. lineStartOffset = self2.now().offset;
  19341. return flowStart(code2);
  19342. }
  19343. function documentContinued(code2) {
  19344. self2.containerState = {};
  19345. return effects.attempt(
  19346. containerConstruct,
  19347. containerContinue,
  19348. flowStart
  19349. )(code2);
  19350. }
  19351. function containerContinue(code2) {
  19352. continued++;
  19353. stack.push([self2.currentConstruct, self2.containerState]);
  19354. return documentContinued(code2);
  19355. }
  19356. function flowStart(code2) {
  19357. if (code2 === null) {
  19358. if (childFlow) closeFlow();
  19359. exitContainers(0);
  19360. effects.consume(code2);
  19361. return;
  19362. }
  19363. childFlow = childFlow || self2.parser.flow(self2.now());
  19364. effects.enter("chunkFlow", {
  19365. contentType: "flow",
  19366. previous: childToken,
  19367. _tokenizer: childFlow
  19368. });
  19369. return flowContinue(code2);
  19370. }
  19371. function flowContinue(code2) {
  19372. if (code2 === null) {
  19373. writeToChild(effects.exit("chunkFlow"), true);
  19374. exitContainers(0);
  19375. effects.consume(code2);
  19376. return;
  19377. }
  19378. if (markdownLineEnding(code2)) {
  19379. effects.consume(code2);
  19380. writeToChild(effects.exit("chunkFlow"));
  19381. continued = 0;
  19382. self2.interrupt = void 0;
  19383. return start2;
  19384. }
  19385. effects.consume(code2);
  19386. return flowContinue;
  19387. }
  19388. function writeToChild(token, eof) {
  19389. const stream = self2.sliceStream(token);
  19390. if (eof) stream.push(null);
  19391. token.previous = childToken;
  19392. if (childToken) childToken.next = token;
  19393. childToken = token;
  19394. childFlow.defineSkip(token.start);
  19395. childFlow.write(stream);
  19396. if (self2.parser.lazy[token.start.line]) {
  19397. let index2 = childFlow.events.length;
  19398. while (index2--) {
  19399. if (
  19400. // The token starts before the line ending…
  19401. childFlow.events[index2][1].start.offset < lineStartOffset && // …and either is not ended yet…
  19402. (!childFlow.events[index2][1].end || // …or ends after it.
  19403. childFlow.events[index2][1].end.offset > lineStartOffset)
  19404. ) {
  19405. return;
  19406. }
  19407. }
  19408. const indexBeforeExits = self2.events.length;
  19409. let indexBeforeFlow = indexBeforeExits;
  19410. let seen;
  19411. let point4;
  19412. while (indexBeforeFlow--) {
  19413. if (self2.events[indexBeforeFlow][0] === "exit" && self2.events[indexBeforeFlow][1].type === "chunkFlow") {
  19414. if (seen) {
  19415. point4 = self2.events[indexBeforeFlow][1].end;
  19416. break;
  19417. }
  19418. seen = true;
  19419. }
  19420. }
  19421. exitContainers(continued);
  19422. index2 = indexBeforeExits;
  19423. while (index2 < self2.events.length) {
  19424. self2.events[index2][1].end = Object.assign({}, point4);
  19425. index2++;
  19426. }
  19427. splice(
  19428. self2.events,
  19429. indexBeforeFlow + 1,
  19430. 0,
  19431. self2.events.slice(indexBeforeExits)
  19432. );
  19433. self2.events.length = index2;
  19434. }
  19435. }
  19436. function exitContainers(size) {
  19437. let index2 = stack.length;
  19438. while (index2-- > size) {
  19439. const entry = stack[index2];
  19440. self2.containerState = entry[1];
  19441. entry[0].exit.call(self2, effects);
  19442. }
  19443. stack.length = size;
  19444. }
  19445. function closeFlow() {
  19446. childFlow.write([null]);
  19447. childToken = void 0;
  19448. childFlow = void 0;
  19449. self2.containerState._closeFlow = void 0;
  19450. }
  19451. }
  19452. function tokenizeContainer(effects, ok4, nok) {
  19453. return factorySpace(
  19454. effects,
  19455. effects.attempt(this.parser.constructs.document, ok4, nok),
  19456. "linePrefix",
  19457. this.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4
  19458. );
  19459. }
  19460. // node_modules/micromark/lib/initialize/flow.js
  19461. var flow = {
  19462. tokenize: initializeFlow
  19463. };
  19464. function initializeFlow(effects) {
  19465. const self2 = this;
  19466. const initial = effects.attempt(
  19467. // Try to parse a blank line.
  19468. blankLine,
  19469. atBlankEnding,
  19470. // Try to parse initial flow (essentially, only code).
  19471. effects.attempt(
  19472. this.parser.constructs.flowInitial,
  19473. afterConstruct,
  19474. factorySpace(
  19475. effects,
  19476. effects.attempt(
  19477. this.parser.constructs.flow,
  19478. afterConstruct,
  19479. effects.attempt(content, afterConstruct)
  19480. ),
  19481. "linePrefix"
  19482. )
  19483. )
  19484. );
  19485. return initial;
  19486. function atBlankEnding(code2) {
  19487. if (code2 === null) {
  19488. effects.consume(code2);
  19489. return;
  19490. }
  19491. effects.enter("lineEndingBlank");
  19492. effects.consume(code2);
  19493. effects.exit("lineEndingBlank");
  19494. self2.currentConstruct = void 0;
  19495. return initial;
  19496. }
  19497. function afterConstruct(code2) {
  19498. if (code2 === null) {
  19499. effects.consume(code2);
  19500. return;
  19501. }
  19502. effects.enter("lineEnding");
  19503. effects.consume(code2);
  19504. effects.exit("lineEnding");
  19505. self2.currentConstruct = void 0;
  19506. return initial;
  19507. }
  19508. }
  19509. // node_modules/micromark/lib/initialize/text.js
  19510. var resolver = {
  19511. resolveAll: createResolver()
  19512. };
  19513. var string = initializeFactory("string");
  19514. var text = initializeFactory("text");
  19515. function initializeFactory(field) {
  19516. return {
  19517. tokenize: initializeText,
  19518. resolveAll: createResolver(
  19519. field === "text" ? resolveAllLineSuffixes : void 0
  19520. )
  19521. };
  19522. function initializeText(effects) {
  19523. const self2 = this;
  19524. const constructs2 = this.parser.constructs[field];
  19525. const text5 = effects.attempt(constructs2, start2, notText);
  19526. return start2;
  19527. function start2(code2) {
  19528. return atBreak(code2) ? text5(code2) : notText(code2);
  19529. }
  19530. function notText(code2) {
  19531. if (code2 === null) {
  19532. effects.consume(code2);
  19533. return;
  19534. }
  19535. effects.enter("data");
  19536. effects.consume(code2);
  19537. return data2;
  19538. }
  19539. function data2(code2) {
  19540. if (atBreak(code2)) {
  19541. effects.exit("data");
  19542. return text5(code2);
  19543. }
  19544. effects.consume(code2);
  19545. return data2;
  19546. }
  19547. function atBreak(code2) {
  19548. if (code2 === null) {
  19549. return true;
  19550. }
  19551. const list3 = constructs2[code2];
  19552. let index2 = -1;
  19553. if (list3) {
  19554. while (++index2 < list3.length) {
  19555. const item = list3[index2];
  19556. if (!item.previous || item.previous.call(self2, self2.previous)) {
  19557. return true;
  19558. }
  19559. }
  19560. }
  19561. return false;
  19562. }
  19563. }
  19564. }
  19565. function createResolver(extraResolver) {
  19566. return resolveAllText;
  19567. function resolveAllText(events, context) {
  19568. let index2 = -1;
  19569. let enter;
  19570. while (++index2 <= events.length) {
  19571. if (enter === void 0) {
  19572. if (events[index2] && events[index2][1].type === "data") {
  19573. enter = index2;
  19574. index2++;
  19575. }
  19576. } else if (!events[index2] || events[index2][1].type !== "data") {
  19577. if (index2 !== enter + 2) {
  19578. events[enter][1].end = events[index2 - 1][1].end;
  19579. events.splice(enter + 2, index2 - enter - 2);
  19580. index2 = enter + 2;
  19581. }
  19582. enter = void 0;
  19583. }
  19584. }
  19585. return extraResolver ? extraResolver(events, context) : events;
  19586. }
  19587. }
  19588. function resolveAllLineSuffixes(events, context) {
  19589. let eventIndex = 0;
  19590. while (++eventIndex <= events.length) {
  19591. if ((eventIndex === events.length || events[eventIndex][1].type === "lineEnding") && events[eventIndex - 1][1].type === "data") {
  19592. const data2 = events[eventIndex - 1][1];
  19593. const chunks = context.sliceStream(data2);
  19594. let index2 = chunks.length;
  19595. let bufferIndex = -1;
  19596. let size = 0;
  19597. let tabs;
  19598. while (index2--) {
  19599. const chunk = chunks[index2];
  19600. if (typeof chunk === "string") {
  19601. bufferIndex = chunk.length;
  19602. while (chunk.charCodeAt(bufferIndex - 1) === 32) {
  19603. size++;
  19604. bufferIndex--;
  19605. }
  19606. if (bufferIndex) break;
  19607. bufferIndex = -1;
  19608. } else if (chunk === -2) {
  19609. tabs = true;
  19610. size++;
  19611. } else if (chunk === -1) {
  19612. } else {
  19613. index2++;
  19614. break;
  19615. }
  19616. }
  19617. if (size) {
  19618. const token = {
  19619. type: eventIndex === events.length || tabs || size < 2 ? "lineSuffix" : "hardBreakTrailing",
  19620. start: {
  19621. line: data2.end.line,
  19622. column: data2.end.column - size,
  19623. offset: data2.end.offset - size,
  19624. _index: data2.start._index + index2,
  19625. _bufferIndex: index2 ? bufferIndex : data2.start._bufferIndex + bufferIndex
  19626. },
  19627. end: Object.assign({}, data2.end)
  19628. };
  19629. data2.end = Object.assign({}, token.start);
  19630. if (data2.start.offset === data2.end.offset) {
  19631. Object.assign(data2, token);
  19632. } else {
  19633. events.splice(
  19634. eventIndex,
  19635. 0,
  19636. ["enter", token, context],
  19637. ["exit", token, context]
  19638. );
  19639. eventIndex += 2;
  19640. }
  19641. }
  19642. eventIndex++;
  19643. }
  19644. }
  19645. return events;
  19646. }
  19647. // node_modules/micromark/lib/create-tokenizer.js
  19648. function createTokenizer(parser, initialize, from) {
  19649. let point4 = Object.assign(
  19650. from ? Object.assign({}, from) : {
  19651. line: 1,
  19652. column: 1,
  19653. offset: 0
  19654. },
  19655. {
  19656. _index: 0,
  19657. _bufferIndex: -1
  19658. }
  19659. );
  19660. const columnStart = {};
  19661. const resolveAllConstructs = [];
  19662. let chunks = [];
  19663. let stack = [];
  19664. let consumed = true;
  19665. const effects = {
  19666. consume,
  19667. enter,
  19668. exit: exit2,
  19669. attempt: constructFactory(onsuccessfulconstruct),
  19670. check: constructFactory(onsuccessfulcheck),
  19671. interrupt: constructFactory(onsuccessfulcheck, {
  19672. interrupt: true
  19673. })
  19674. };
  19675. const context = {
  19676. previous: null,
  19677. code: null,
  19678. containerState: {},
  19679. events: [],
  19680. parser,
  19681. sliceStream,
  19682. sliceSerialize,
  19683. now,
  19684. defineSkip,
  19685. write
  19686. };
  19687. let state = initialize.tokenize.call(context, effects);
  19688. let expectedCode;
  19689. if (initialize.resolveAll) {
  19690. resolveAllConstructs.push(initialize);
  19691. }
  19692. return context;
  19693. function write(slice2) {
  19694. chunks = push(chunks, slice2);
  19695. main();
  19696. if (chunks[chunks.length - 1] !== null) {
  19697. return [];
  19698. }
  19699. addResult(initialize, 0);
  19700. context.events = resolveAll(resolveAllConstructs, context.events, context);
  19701. return context.events;
  19702. }
  19703. function sliceSerialize(token, expandTabs) {
  19704. return serializeChunks2(sliceStream(token), expandTabs);
  19705. }
  19706. function sliceStream(token) {
  19707. return sliceChunks(chunks, token);
  19708. }
  19709. function now() {
  19710. const { line, column, offset: offset2, _index, _bufferIndex } = point4;
  19711. return {
  19712. line,
  19713. column,
  19714. offset: offset2,
  19715. _index,
  19716. _bufferIndex
  19717. };
  19718. }
  19719. function defineSkip(value) {
  19720. columnStart[value.line] = value.column;
  19721. accountForPotentialSkip();
  19722. }
  19723. function main() {
  19724. let chunkIndex;
  19725. while (point4._index < chunks.length) {
  19726. const chunk = chunks[point4._index];
  19727. if (typeof chunk === "string") {
  19728. chunkIndex = point4._index;
  19729. if (point4._bufferIndex < 0) {
  19730. point4._bufferIndex = 0;
  19731. }
  19732. while (point4._index === chunkIndex && point4._bufferIndex < chunk.length) {
  19733. go(chunk.charCodeAt(point4._bufferIndex));
  19734. }
  19735. } else {
  19736. go(chunk);
  19737. }
  19738. }
  19739. }
  19740. function go(code2) {
  19741. consumed = void 0;
  19742. expectedCode = code2;
  19743. state = state(code2);
  19744. }
  19745. function consume(code2) {
  19746. if (markdownLineEnding(code2)) {
  19747. point4.line++;
  19748. point4.column = 1;
  19749. point4.offset += code2 === -3 ? 2 : 1;
  19750. accountForPotentialSkip();
  19751. } else if (code2 !== -1) {
  19752. point4.column++;
  19753. point4.offset++;
  19754. }
  19755. if (point4._bufferIndex < 0) {
  19756. point4._index++;
  19757. } else {
  19758. point4._bufferIndex++;
  19759. if (point4._bufferIndex === chunks[point4._index].length) {
  19760. point4._bufferIndex = -1;
  19761. point4._index++;
  19762. }
  19763. }
  19764. context.previous = code2;
  19765. consumed = true;
  19766. }
  19767. function enter(type, fields) {
  19768. const token = fields || {};
  19769. token.type = type;
  19770. token.start = now();
  19771. context.events.push(["enter", token, context]);
  19772. stack.push(token);
  19773. return token;
  19774. }
  19775. function exit2(type) {
  19776. const token = stack.pop();
  19777. token.end = now();
  19778. context.events.push(["exit", token, context]);
  19779. return token;
  19780. }
  19781. function onsuccessfulconstruct(construct, info) {
  19782. addResult(construct, info.from);
  19783. }
  19784. function onsuccessfulcheck(_, info) {
  19785. info.restore();
  19786. }
  19787. function constructFactory(onreturn, fields) {
  19788. return hook;
  19789. function hook(constructs2, returnState, bogusState) {
  19790. let listOfConstructs;
  19791. let constructIndex;
  19792. let currentConstruct;
  19793. let info;
  19794. return Array.isArray(constructs2) ? handleListOfConstructs(constructs2) : "tokenize" in constructs2 ? (
  19795. // @ts-expect-error Looks like a construct.
  19796. handleListOfConstructs([constructs2])
  19797. ) : handleMapOfConstructs(constructs2);
  19798. function handleMapOfConstructs(map) {
  19799. return start2;
  19800. function start2(code2) {
  19801. const def = code2 !== null && map[code2];
  19802. const all3 = code2 !== null && map.null;
  19803. const list3 = [
  19804. // To do: add more extension tests.
  19805. /* c8 ignore next 2 */
  19806. ...Array.isArray(def) ? def : def ? [def] : [],
  19807. ...Array.isArray(all3) ? all3 : all3 ? [all3] : []
  19808. ];
  19809. return handleListOfConstructs(list3)(code2);
  19810. }
  19811. }
  19812. function handleListOfConstructs(list3) {
  19813. listOfConstructs = list3;
  19814. constructIndex = 0;
  19815. if (list3.length === 0) {
  19816. return bogusState;
  19817. }
  19818. return handleConstruct(list3[constructIndex]);
  19819. }
  19820. function handleConstruct(construct) {
  19821. return start2;
  19822. function start2(code2) {
  19823. info = store();
  19824. currentConstruct = construct;
  19825. if (!construct.partial) {
  19826. context.currentConstruct = construct;
  19827. }
  19828. if (construct.name && context.parser.constructs.disable.null.includes(construct.name)) {
  19829. return nok(code2);
  19830. }
  19831. return construct.tokenize.call(
  19832. // If we do have fields, create an object w/ `context` as its
  19833. // prototype.
  19834. // This allows a “live binding”, which is needed for `interrupt`.
  19835. fields ? Object.assign(Object.create(context), fields) : context,
  19836. effects,
  19837. ok4,
  19838. nok
  19839. )(code2);
  19840. }
  19841. }
  19842. function ok4(code2) {
  19843. consumed = true;
  19844. onreturn(currentConstruct, info);
  19845. return returnState;
  19846. }
  19847. function nok(code2) {
  19848. consumed = true;
  19849. info.restore();
  19850. if (++constructIndex < listOfConstructs.length) {
  19851. return handleConstruct(listOfConstructs[constructIndex]);
  19852. }
  19853. return bogusState;
  19854. }
  19855. }
  19856. }
  19857. function addResult(construct, from2) {
  19858. if (construct.resolveAll && !resolveAllConstructs.includes(construct)) {
  19859. resolveAllConstructs.push(construct);
  19860. }
  19861. if (construct.resolve) {
  19862. splice(
  19863. context.events,
  19864. from2,
  19865. context.events.length - from2,
  19866. construct.resolve(context.events.slice(from2), context)
  19867. );
  19868. }
  19869. if (construct.resolveTo) {
  19870. context.events = construct.resolveTo(context.events, context);
  19871. }
  19872. }
  19873. function store() {
  19874. const startPoint = now();
  19875. const startPrevious = context.previous;
  19876. const startCurrentConstruct = context.currentConstruct;
  19877. const startEventsIndex = context.events.length;
  19878. const startStack = Array.from(stack);
  19879. return {
  19880. restore,
  19881. from: startEventsIndex
  19882. };
  19883. function restore() {
  19884. point4 = startPoint;
  19885. context.previous = startPrevious;
  19886. context.currentConstruct = startCurrentConstruct;
  19887. context.events.length = startEventsIndex;
  19888. stack = startStack;
  19889. accountForPotentialSkip();
  19890. }
  19891. }
  19892. function accountForPotentialSkip() {
  19893. if (point4.line in columnStart && point4.column < 2) {
  19894. point4.column = columnStart[point4.line];
  19895. point4.offset += columnStart[point4.line] - 1;
  19896. }
  19897. }
  19898. }
  19899. function sliceChunks(chunks, token) {
  19900. const startIndex = token.start._index;
  19901. const startBufferIndex = token.start._bufferIndex;
  19902. const endIndex = token.end._index;
  19903. const endBufferIndex = token.end._bufferIndex;
  19904. let view;
  19905. if (startIndex === endIndex) {
  19906. view = [chunks[startIndex].slice(startBufferIndex, endBufferIndex)];
  19907. } else {
  19908. view = chunks.slice(startIndex, endIndex);
  19909. if (startBufferIndex > -1) {
  19910. const head = view[0];
  19911. if (typeof head === "string") {
  19912. view[0] = head.slice(startBufferIndex);
  19913. } else {
  19914. view.shift();
  19915. }
  19916. }
  19917. if (endBufferIndex > 0) {
  19918. view.push(chunks[endIndex].slice(0, endBufferIndex));
  19919. }
  19920. }
  19921. return view;
  19922. }
  19923. function serializeChunks2(chunks, expandTabs) {
  19924. let index2 = -1;
  19925. const result = [];
  19926. let atTab;
  19927. while (++index2 < chunks.length) {
  19928. const chunk = chunks[index2];
  19929. let value;
  19930. if (typeof chunk === "string") {
  19931. value = chunk;
  19932. } else
  19933. switch (chunk) {
  19934. case -5: {
  19935. value = "\r";
  19936. break;
  19937. }
  19938. case -4: {
  19939. value = "\n";
  19940. break;
  19941. }
  19942. case -3: {
  19943. value = "\r\n";
  19944. break;
  19945. }
  19946. case -2: {
  19947. value = expandTabs ? " " : " ";
  19948. break;
  19949. }
  19950. case -1: {
  19951. if (!expandTabs && atTab) continue;
  19952. value = " ";
  19953. break;
  19954. }
  19955. default: {
  19956. value = String.fromCharCode(chunk);
  19957. }
  19958. }
  19959. atTab = chunk === -2;
  19960. result.push(value);
  19961. }
  19962. return result.join("");
  19963. }
  19964. // node_modules/micromark/lib/constructs.js
  19965. var constructs_exports = {};
  19966. __export(constructs_exports, {
  19967. attentionMarkers: () => attentionMarkers,
  19968. contentInitial: () => contentInitial,
  19969. disable: () => disable,
  19970. document: () => document2,
  19971. flow: () => flow2,
  19972. flowInitial: () => flowInitial,
  19973. insideSpan: () => insideSpan,
  19974. string: () => string2,
  19975. text: () => text2
  19976. });
  19977. var document2 = {
  19978. [42]: list,
  19979. [43]: list,
  19980. [45]: list,
  19981. [48]: list,
  19982. [49]: list,
  19983. [50]: list,
  19984. [51]: list,
  19985. [52]: list,
  19986. [53]: list,
  19987. [54]: list,
  19988. [55]: list,
  19989. [56]: list,
  19990. [57]: list,
  19991. [62]: blockQuote
  19992. };
  19993. var contentInitial = {
  19994. [91]: definition
  19995. };
  19996. var flowInitial = {
  19997. [-2]: codeIndented,
  19998. [-1]: codeIndented,
  19999. [32]: codeIndented
  20000. };
  20001. var flow2 = {
  20002. [35]: headingAtx,
  20003. [42]: thematicBreak,
  20004. [45]: [setextUnderline, thematicBreak],
  20005. [60]: htmlFlow,
  20006. [61]: setextUnderline,
  20007. [95]: thematicBreak,
  20008. [96]: codeFenced,
  20009. [126]: codeFenced
  20010. };
  20011. var string2 = {
  20012. [38]: characterReference,
  20013. [92]: characterEscape
  20014. };
  20015. var text2 = {
  20016. [-5]: lineEnding,
  20017. [-4]: lineEnding,
  20018. [-3]: lineEnding,
  20019. [33]: labelStartImage,
  20020. [38]: characterReference,
  20021. [42]: attention,
  20022. [60]: [autolink, htmlText],
  20023. [91]: labelStartLink,
  20024. [92]: [hardBreakEscape, characterEscape],
  20025. [93]: labelEnd,
  20026. [95]: attention,
  20027. [96]: codeText
  20028. };
  20029. var insideSpan = {
  20030. null: [attention, resolver]
  20031. };
  20032. var attentionMarkers = {
  20033. null: [42, 95]
  20034. };
  20035. var disable = {
  20036. null: []
  20037. };
  20038. // node_modules/micromark/lib/parse.js
  20039. function parse3(options) {
  20040. const settings = options || {};
  20041. const constructs2 = (
  20042. /** @type {FullNormalizedExtension} */
  20043. combineExtensions([constructs_exports, ...settings.extensions || []])
  20044. );
  20045. const parser = {
  20046. defined: [],
  20047. lazy: {},
  20048. constructs: constructs2,
  20049. content: create4(content2),
  20050. document: create4(document),
  20051. flow: create4(flow),
  20052. string: create4(string),
  20053. text: create4(text)
  20054. };
  20055. return parser;
  20056. function create4(initial) {
  20057. return creator;
  20058. function creator(from) {
  20059. return createTokenizer(parser, initial, from);
  20060. }
  20061. }
  20062. }
  20063. // node_modules/micromark/lib/postprocess.js
  20064. function postprocess(events) {
  20065. while (!subtokenize(events)) {
  20066. }
  20067. return events;
  20068. }
  20069. // node_modules/micromark/lib/preprocess.js
  20070. var search = /[\0\t\n\r]/g;
  20071. function preprocess() {
  20072. let column = 1;
  20073. let buffer = "";
  20074. let start2 = true;
  20075. let atCarriageReturn;
  20076. return preprocessor;
  20077. function preprocessor(value, encoding, end) {
  20078. const chunks = [];
  20079. let match;
  20080. let next;
  20081. let startPosition;
  20082. let endPosition;
  20083. let code2;
  20084. value = buffer + (typeof value === "string" ? value.toString() : new TextDecoder(encoding || void 0).decode(value));
  20085. startPosition = 0;
  20086. buffer = "";
  20087. if (start2) {
  20088. if (value.charCodeAt(0) === 65279) {
  20089. startPosition++;
  20090. }
  20091. start2 = void 0;
  20092. }
  20093. while (startPosition < value.length) {
  20094. search.lastIndex = startPosition;
  20095. match = search.exec(value);
  20096. endPosition = match && match.index !== void 0 ? match.index : value.length;
  20097. code2 = value.charCodeAt(endPosition);
  20098. if (!match) {
  20099. buffer = value.slice(startPosition);
  20100. break;
  20101. }
  20102. if (code2 === 10 && startPosition === endPosition && atCarriageReturn) {
  20103. chunks.push(-3);
  20104. atCarriageReturn = void 0;
  20105. } else {
  20106. if (atCarriageReturn) {
  20107. chunks.push(-5);
  20108. atCarriageReturn = void 0;
  20109. }
  20110. if (startPosition < endPosition) {
  20111. chunks.push(value.slice(startPosition, endPosition));
  20112. column += endPosition - startPosition;
  20113. }
  20114. switch (code2) {
  20115. case 0: {
  20116. chunks.push(65533);
  20117. column++;
  20118. break;
  20119. }
  20120. case 9: {
  20121. next = Math.ceil(column / 4) * 4;
  20122. chunks.push(-2);
  20123. while (column++ < next) chunks.push(-1);
  20124. break;
  20125. }
  20126. case 10: {
  20127. chunks.push(-4);
  20128. column = 1;
  20129. break;
  20130. }
  20131. default: {
  20132. atCarriageReturn = true;
  20133. column = 1;
  20134. }
  20135. }
  20136. }
  20137. startPosition = endPosition + 1;
  20138. }
  20139. if (end) {
  20140. if (atCarriageReturn) chunks.push(-5);
  20141. if (buffer) chunks.push(buffer);
  20142. chunks.push(null);
  20143. }
  20144. return chunks;
  20145. }
  20146. }
  20147. // node_modules/micromark-util-decode-string/index.js
  20148. var characterEscapeOrReference = /\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;
  20149. function decodeString(value) {
  20150. return value.replace(characterEscapeOrReference, decode);
  20151. }
  20152. function decode($0, $1, $2) {
  20153. if ($1) {
  20154. return $1;
  20155. }
  20156. const head = $2.charCodeAt(0);
  20157. if (head === 35) {
  20158. const head2 = $2.charCodeAt(1);
  20159. const hex = head2 === 120 || head2 === 88;
  20160. return decodeNumericCharacterReference($2.slice(hex ? 2 : 1), hex ? 16 : 10);
  20161. }
  20162. return decodeNamedCharacterReference($2) || $0;
  20163. }
  20164. // node_modules/mdast-util-from-markdown/lib/index.js
  20165. var own3 = {}.hasOwnProperty;
  20166. function fromMarkdown(value, encoding, options) {
  20167. if (typeof encoding !== "string") {
  20168. options = encoding;
  20169. encoding = void 0;
  20170. }
  20171. return compiler(options)(postprocess(parse3(options).document().write(preprocess()(value, encoding, true))));
  20172. }
  20173. function compiler(options) {
  20174. const config = {
  20175. transforms: [],
  20176. canContainEols: ["emphasis", "fragment", "heading", "paragraph", "strong"],
  20177. enter: {
  20178. autolink: opener(link2),
  20179. autolinkProtocol: onenterdata,
  20180. autolinkEmail: onenterdata,
  20181. atxHeading: opener(heading2),
  20182. blockQuote: opener(blockQuote2),
  20183. characterEscape: onenterdata,
  20184. characterReference: onenterdata,
  20185. codeFenced: opener(codeFlow),
  20186. codeFencedFenceInfo: buffer,
  20187. codeFencedFenceMeta: buffer,
  20188. codeIndented: opener(codeFlow, buffer),
  20189. codeText: opener(codeText2, buffer),
  20190. codeTextData: onenterdata,
  20191. data: onenterdata,
  20192. codeFlowValue: onenterdata,
  20193. definition: opener(definition2),
  20194. definitionDestinationString: buffer,
  20195. definitionLabelString: buffer,
  20196. definitionTitleString: buffer,
  20197. emphasis: opener(emphasis2),
  20198. hardBreakEscape: opener(hardBreak2),
  20199. hardBreakTrailing: opener(hardBreak2),
  20200. htmlFlow: opener(html5, buffer),
  20201. htmlFlowData: onenterdata,
  20202. htmlText: opener(html5, buffer),
  20203. htmlTextData: onenterdata,
  20204. image: opener(image2),
  20205. label: buffer,
  20206. link: opener(link2),
  20207. listItem: opener(listItem2),
  20208. listItemValue: onenterlistitemvalue,
  20209. listOrdered: opener(list3, onenterlistordered),
  20210. listUnordered: opener(list3),
  20211. paragraph: opener(paragraph2),
  20212. reference: onenterreference,
  20213. referenceString: buffer,
  20214. resourceDestinationString: buffer,
  20215. resourceTitleString: buffer,
  20216. setextHeading: opener(heading2),
  20217. strong: opener(strong2),
  20218. thematicBreak: opener(thematicBreak3)
  20219. },
  20220. exit: {
  20221. atxHeading: closer(),
  20222. atxHeadingSequence: onexitatxheadingsequence,
  20223. autolink: closer(),
  20224. autolinkEmail: onexitautolinkemail,
  20225. autolinkProtocol: onexitautolinkprotocol,
  20226. blockQuote: closer(),
  20227. characterEscapeValue: onexitdata,
  20228. characterReferenceMarkerHexadecimal: onexitcharacterreferencemarker,
  20229. characterReferenceMarkerNumeric: onexitcharacterreferencemarker,
  20230. characterReferenceValue: onexitcharacterreferencevalue,
  20231. characterReference: onexitcharacterreference,
  20232. codeFenced: closer(onexitcodefenced),
  20233. codeFencedFence: onexitcodefencedfence,
  20234. codeFencedFenceInfo: onexitcodefencedfenceinfo,
  20235. codeFencedFenceMeta: onexitcodefencedfencemeta,
  20236. codeFlowValue: onexitdata,
  20237. codeIndented: closer(onexitcodeindented),
  20238. codeText: closer(onexitcodetext),
  20239. codeTextData: onexitdata,
  20240. data: onexitdata,
  20241. definition: closer(),
  20242. definitionDestinationString: onexitdefinitiondestinationstring,
  20243. definitionLabelString: onexitdefinitionlabelstring,
  20244. definitionTitleString: onexitdefinitiontitlestring,
  20245. emphasis: closer(),
  20246. hardBreakEscape: closer(onexithardbreak),
  20247. hardBreakTrailing: closer(onexithardbreak),
  20248. htmlFlow: closer(onexithtmlflow),
  20249. htmlFlowData: onexitdata,
  20250. htmlText: closer(onexithtmltext),
  20251. htmlTextData: onexitdata,
  20252. image: closer(onexitimage),
  20253. label: onexitlabel,
  20254. labelText: onexitlabeltext,
  20255. lineEnding: onexitlineending,
  20256. link: closer(onexitlink),
  20257. listItem: closer(),
  20258. listOrdered: closer(),
  20259. listUnordered: closer(),
  20260. paragraph: closer(),
  20261. referenceString: onexitreferencestring,
  20262. resourceDestinationString: onexitresourcedestinationstring,
  20263. resourceTitleString: onexitresourcetitlestring,
  20264. resource: onexitresource,
  20265. setextHeading: closer(onexitsetextheading),
  20266. setextHeadingLineSequence: onexitsetextheadinglinesequence,
  20267. setextHeadingText: onexitsetextheadingtext,
  20268. strong: closer(),
  20269. thematicBreak: closer()
  20270. }
  20271. };
  20272. configure(config, (options || {}).mdastExtensions || []);
  20273. const data2 = {};
  20274. return compile2;
  20275. function compile2(events) {
  20276. let tree = {
  20277. type: "root",
  20278. children: []
  20279. };
  20280. const context = {
  20281. stack: [tree],
  20282. tokenStack: [],
  20283. config,
  20284. enter,
  20285. exit: exit2,
  20286. buffer,
  20287. resume,
  20288. data: data2
  20289. };
  20290. const listStack = [];
  20291. let index2 = -1;
  20292. while (++index2 < events.length) {
  20293. if (events[index2][1].type === "listOrdered" || events[index2][1].type === "listUnordered") {
  20294. if (events[index2][0] === "enter") {
  20295. listStack.push(index2);
  20296. } else {
  20297. const tail = listStack.pop();
  20298. index2 = prepareList(events, tail, index2);
  20299. }
  20300. }
  20301. }
  20302. index2 = -1;
  20303. while (++index2 < events.length) {
  20304. const handler = config[events[index2][0]];
  20305. if (own3.call(handler, events[index2][1].type)) {
  20306. handler[events[index2][1].type].call(Object.assign({
  20307. sliceSerialize: events[index2][2].sliceSerialize
  20308. }, context), events[index2][1]);
  20309. }
  20310. }
  20311. if (context.tokenStack.length > 0) {
  20312. const tail = context.tokenStack[context.tokenStack.length - 1];
  20313. const handler = tail[1] || defaultOnError;
  20314. handler.call(context, void 0, tail[0]);
  20315. }
  20316. tree.position = {
  20317. start: point2(events.length > 0 ? events[0][1].start : {
  20318. line: 1,
  20319. column: 1,
  20320. offset: 0
  20321. }),
  20322. end: point2(events.length > 0 ? events[events.length - 2][1].end : {
  20323. line: 1,
  20324. column: 1,
  20325. offset: 0
  20326. })
  20327. };
  20328. index2 = -1;
  20329. while (++index2 < config.transforms.length) {
  20330. tree = config.transforms[index2](tree) || tree;
  20331. }
  20332. return tree;
  20333. }
  20334. function prepareList(events, start2, length) {
  20335. let index2 = start2 - 1;
  20336. let containerBalance = -1;
  20337. let listSpread = false;
  20338. let listItem3;
  20339. let lineIndex;
  20340. let firstBlankLineIndex;
  20341. let atMarker;
  20342. while (++index2 <= length) {
  20343. const event = events[index2];
  20344. switch (event[1].type) {
  20345. case "listUnordered":
  20346. case "listOrdered":
  20347. case "blockQuote": {
  20348. if (event[0] === "enter") {
  20349. containerBalance++;
  20350. } else {
  20351. containerBalance--;
  20352. }
  20353. atMarker = void 0;
  20354. break;
  20355. }
  20356. case "lineEndingBlank": {
  20357. if (event[0] === "enter") {
  20358. if (listItem3 && !atMarker && !containerBalance && !firstBlankLineIndex) {
  20359. firstBlankLineIndex = index2;
  20360. }
  20361. atMarker = void 0;
  20362. }
  20363. break;
  20364. }
  20365. case "linePrefix":
  20366. case "listItemValue":
  20367. case "listItemMarker":
  20368. case "listItemPrefix":
  20369. case "listItemPrefixWhitespace": {
  20370. break;
  20371. }
  20372. default: {
  20373. atMarker = void 0;
  20374. }
  20375. }
  20376. if (!containerBalance && event[0] === "enter" && event[1].type === "listItemPrefix" || containerBalance === -1 && event[0] === "exit" && (event[1].type === "listUnordered" || event[1].type === "listOrdered")) {
  20377. if (listItem3) {
  20378. let tailIndex = index2;
  20379. lineIndex = void 0;
  20380. while (tailIndex--) {
  20381. const tailEvent = events[tailIndex];
  20382. if (tailEvent[1].type === "lineEnding" || tailEvent[1].type === "lineEndingBlank") {
  20383. if (tailEvent[0] === "exit") continue;
  20384. if (lineIndex) {
  20385. events[lineIndex][1].type = "lineEndingBlank";
  20386. listSpread = true;
  20387. }
  20388. tailEvent[1].type = "lineEnding";
  20389. lineIndex = tailIndex;
  20390. } else if (tailEvent[1].type === "linePrefix" || tailEvent[1].type === "blockQuotePrefix" || tailEvent[1].type === "blockQuotePrefixWhitespace" || tailEvent[1].type === "blockQuoteMarker" || tailEvent[1].type === "listItemIndent") {
  20391. } else {
  20392. break;
  20393. }
  20394. }
  20395. if (firstBlankLineIndex && (!lineIndex || firstBlankLineIndex < lineIndex)) {
  20396. listItem3._spread = true;
  20397. }
  20398. listItem3.end = Object.assign({}, lineIndex ? events[lineIndex][1].start : event[1].end);
  20399. events.splice(lineIndex || index2, 0, ["exit", listItem3, event[2]]);
  20400. index2++;
  20401. length++;
  20402. }
  20403. if (event[1].type === "listItemPrefix") {
  20404. const item = {
  20405. type: "listItem",
  20406. _spread: false,
  20407. start: Object.assign({}, event[1].start),
  20408. // @ts-expect-error: we’ll add `end` in a second.
  20409. end: void 0
  20410. };
  20411. listItem3 = item;
  20412. events.splice(index2, 0, ["enter", item, event[2]]);
  20413. index2++;
  20414. length++;
  20415. firstBlankLineIndex = void 0;
  20416. atMarker = true;
  20417. }
  20418. }
  20419. }
  20420. events[start2][1]._spread = listSpread;
  20421. return length;
  20422. }
  20423. function opener(create4, and) {
  20424. return open;
  20425. function open(token) {
  20426. enter.call(this, create4(token), token);
  20427. if (and) and.call(this, token);
  20428. }
  20429. }
  20430. function buffer() {
  20431. this.stack.push({
  20432. type: "fragment",
  20433. children: []
  20434. });
  20435. }
  20436. function enter(node2, token, errorHandler) {
  20437. const parent = this.stack[this.stack.length - 1];
  20438. const siblings = parent.children;
  20439. siblings.push(node2);
  20440. this.stack.push(node2);
  20441. this.tokenStack.push([token, errorHandler]);
  20442. node2.position = {
  20443. start: point2(token.start),
  20444. // @ts-expect-error: `end` will be patched later.
  20445. end: void 0
  20446. };
  20447. }
  20448. function closer(and) {
  20449. return close;
  20450. function close(token) {
  20451. if (and) and.call(this, token);
  20452. exit2.call(this, token);
  20453. }
  20454. }
  20455. function exit2(token, onExitError) {
  20456. const node2 = this.stack.pop();
  20457. const open = this.tokenStack.pop();
  20458. if (!open) {
  20459. throw new Error("Cannot close `" + token.type + "` (" + stringifyPosition({
  20460. start: token.start,
  20461. end: token.end
  20462. }) + "): it\u2019s not open");
  20463. } else if (open[0].type !== token.type) {
  20464. if (onExitError) {
  20465. onExitError.call(this, token, open[0]);
  20466. } else {
  20467. const handler = open[1] || defaultOnError;
  20468. handler.call(this, token, open[0]);
  20469. }
  20470. }
  20471. node2.position.end = point2(token.end);
  20472. }
  20473. function resume() {
  20474. return toString2(this.stack.pop());
  20475. }
  20476. function onenterlistordered() {
  20477. this.data.expectingFirstListItemValue = true;
  20478. }
  20479. function onenterlistitemvalue(token) {
  20480. if (this.data.expectingFirstListItemValue) {
  20481. const ancestor = this.stack[this.stack.length - 2];
  20482. ancestor.start = Number.parseInt(this.sliceSerialize(token), 10);
  20483. this.data.expectingFirstListItemValue = void 0;
  20484. }
  20485. }
  20486. function onexitcodefencedfenceinfo() {
  20487. const data3 = this.resume();
  20488. const node2 = this.stack[this.stack.length - 1];
  20489. node2.lang = data3;
  20490. }
  20491. function onexitcodefencedfencemeta() {
  20492. const data3 = this.resume();
  20493. const node2 = this.stack[this.stack.length - 1];
  20494. node2.meta = data3;
  20495. }
  20496. function onexitcodefencedfence() {
  20497. if (this.data.flowCodeInside) return;
  20498. this.buffer();
  20499. this.data.flowCodeInside = true;
  20500. }
  20501. function onexitcodefenced() {
  20502. const data3 = this.resume();
  20503. const node2 = this.stack[this.stack.length - 1];
  20504. node2.value = data3.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g, "");
  20505. this.data.flowCodeInside = void 0;
  20506. }
  20507. function onexitcodeindented() {
  20508. const data3 = this.resume();
  20509. const node2 = this.stack[this.stack.length - 1];
  20510. node2.value = data3.replace(/(\r?\n|\r)$/g, "");
  20511. }
  20512. function onexitdefinitionlabelstring(token) {
  20513. const label = this.resume();
  20514. const node2 = this.stack[this.stack.length - 1];
  20515. node2.label = label;
  20516. node2.identifier = normalizeIdentifier(this.sliceSerialize(token)).toLowerCase();
  20517. }
  20518. function onexitdefinitiontitlestring() {
  20519. const data3 = this.resume();
  20520. const node2 = this.stack[this.stack.length - 1];
  20521. node2.title = data3;
  20522. }
  20523. function onexitdefinitiondestinationstring() {
  20524. const data3 = this.resume();
  20525. const node2 = this.stack[this.stack.length - 1];
  20526. node2.url = data3;
  20527. }
  20528. function onexitatxheadingsequence(token) {
  20529. const node2 = this.stack[this.stack.length - 1];
  20530. if (!node2.depth) {
  20531. const depth = this.sliceSerialize(token).length;
  20532. node2.depth = depth;
  20533. }
  20534. }
  20535. function onexitsetextheadingtext() {
  20536. this.data.setextHeadingSlurpLineEnding = true;
  20537. }
  20538. function onexitsetextheadinglinesequence(token) {
  20539. const node2 = this.stack[this.stack.length - 1];
  20540. node2.depth = this.sliceSerialize(token).codePointAt(0) === 61 ? 1 : 2;
  20541. }
  20542. function onexitsetextheading() {
  20543. this.data.setextHeadingSlurpLineEnding = void 0;
  20544. }
  20545. function onenterdata(token) {
  20546. const node2 = this.stack[this.stack.length - 1];
  20547. const siblings = node2.children;
  20548. let tail = siblings[siblings.length - 1];
  20549. if (!tail || tail.type !== "text") {
  20550. tail = text5();
  20551. tail.position = {
  20552. start: point2(token.start),
  20553. // @ts-expect-error: we’ll add `end` later.
  20554. end: void 0
  20555. };
  20556. siblings.push(tail);
  20557. }
  20558. this.stack.push(tail);
  20559. }
  20560. function onexitdata(token) {
  20561. const tail = this.stack.pop();
  20562. tail.value += this.sliceSerialize(token);
  20563. tail.position.end = point2(token.end);
  20564. }
  20565. function onexitlineending(token) {
  20566. const context = this.stack[this.stack.length - 1];
  20567. if (this.data.atHardBreak) {
  20568. const tail = context.children[context.children.length - 1];
  20569. tail.position.end = point2(token.end);
  20570. this.data.atHardBreak = void 0;
  20571. return;
  20572. }
  20573. if (!this.data.setextHeadingSlurpLineEnding && config.canContainEols.includes(context.type)) {
  20574. onenterdata.call(this, token);
  20575. onexitdata.call(this, token);
  20576. }
  20577. }
  20578. function onexithardbreak() {
  20579. this.data.atHardBreak = true;
  20580. }
  20581. function onexithtmlflow() {
  20582. const data3 = this.resume();
  20583. const node2 = this.stack[this.stack.length - 1];
  20584. node2.value = data3;
  20585. }
  20586. function onexithtmltext() {
  20587. const data3 = this.resume();
  20588. const node2 = this.stack[this.stack.length - 1];
  20589. node2.value = data3;
  20590. }
  20591. function onexitcodetext() {
  20592. const data3 = this.resume();
  20593. const node2 = this.stack[this.stack.length - 1];
  20594. node2.value = data3;
  20595. }
  20596. function onexitlink() {
  20597. const node2 = this.stack[this.stack.length - 1];
  20598. if (this.data.inReference) {
  20599. const referenceType = this.data.referenceType || "shortcut";
  20600. node2.type += "Reference";
  20601. node2.referenceType = referenceType;
  20602. delete node2.url;
  20603. delete node2.title;
  20604. } else {
  20605. delete node2.identifier;
  20606. delete node2.label;
  20607. }
  20608. this.data.referenceType = void 0;
  20609. }
  20610. function onexitimage() {
  20611. const node2 = this.stack[this.stack.length - 1];
  20612. if (this.data.inReference) {
  20613. const referenceType = this.data.referenceType || "shortcut";
  20614. node2.type += "Reference";
  20615. node2.referenceType = referenceType;
  20616. delete node2.url;
  20617. delete node2.title;
  20618. } else {
  20619. delete node2.identifier;
  20620. delete node2.label;
  20621. }
  20622. this.data.referenceType = void 0;
  20623. }
  20624. function onexitlabeltext(token) {
  20625. const string3 = this.sliceSerialize(token);
  20626. const ancestor = this.stack[this.stack.length - 2];
  20627. ancestor.label = decodeString(string3);
  20628. ancestor.identifier = normalizeIdentifier(string3).toLowerCase();
  20629. }
  20630. function onexitlabel() {
  20631. const fragment = this.stack[this.stack.length - 1];
  20632. const value = this.resume();
  20633. const node2 = this.stack[this.stack.length - 1];
  20634. this.data.inReference = true;
  20635. if (node2.type === "link") {
  20636. const children = fragment.children;
  20637. node2.children = children;
  20638. } else {
  20639. node2.alt = value;
  20640. }
  20641. }
  20642. function onexitresourcedestinationstring() {
  20643. const data3 = this.resume();
  20644. const node2 = this.stack[this.stack.length - 1];
  20645. node2.url = data3;
  20646. }
  20647. function onexitresourcetitlestring() {
  20648. const data3 = this.resume();
  20649. const node2 = this.stack[this.stack.length - 1];
  20650. node2.title = data3;
  20651. }
  20652. function onexitresource() {
  20653. this.data.inReference = void 0;
  20654. }
  20655. function onenterreference() {
  20656. this.data.referenceType = "collapsed";
  20657. }
  20658. function onexitreferencestring(token) {
  20659. const label = this.resume();
  20660. const node2 = this.stack[this.stack.length - 1];
  20661. node2.label = label;
  20662. node2.identifier = normalizeIdentifier(this.sliceSerialize(token)).toLowerCase();
  20663. this.data.referenceType = "full";
  20664. }
  20665. function onexitcharacterreferencemarker(token) {
  20666. this.data.characterReferenceType = token.type;
  20667. }
  20668. function onexitcharacterreferencevalue(token) {
  20669. const data3 = this.sliceSerialize(token);
  20670. const type = this.data.characterReferenceType;
  20671. let value;
  20672. if (type) {
  20673. value = decodeNumericCharacterReference(data3, type === "characterReferenceMarkerNumeric" ? 10 : 16);
  20674. this.data.characterReferenceType = void 0;
  20675. } else {
  20676. const result = decodeNamedCharacterReference(data3);
  20677. value = result;
  20678. }
  20679. const tail = this.stack[this.stack.length - 1];
  20680. tail.value += value;
  20681. }
  20682. function onexitcharacterreference(token) {
  20683. const tail = this.stack.pop();
  20684. tail.position.end = point2(token.end);
  20685. }
  20686. function onexitautolinkprotocol(token) {
  20687. onexitdata.call(this, token);
  20688. const node2 = this.stack[this.stack.length - 1];
  20689. node2.url = this.sliceSerialize(token);
  20690. }
  20691. function onexitautolinkemail(token) {
  20692. onexitdata.call(this, token);
  20693. const node2 = this.stack[this.stack.length - 1];
  20694. node2.url = "mailto:" + this.sliceSerialize(token);
  20695. }
  20696. function blockQuote2() {
  20697. return {
  20698. type: "blockquote",
  20699. children: []
  20700. };
  20701. }
  20702. function codeFlow() {
  20703. return {
  20704. type: "code",
  20705. lang: null,
  20706. meta: null,
  20707. value: ""
  20708. };
  20709. }
  20710. function codeText2() {
  20711. return {
  20712. type: "inlineCode",
  20713. value: ""
  20714. };
  20715. }
  20716. function definition2() {
  20717. return {
  20718. type: "definition",
  20719. identifier: "",
  20720. label: null,
  20721. title: null,
  20722. url: ""
  20723. };
  20724. }
  20725. function emphasis2() {
  20726. return {
  20727. type: "emphasis",
  20728. children: []
  20729. };
  20730. }
  20731. function heading2() {
  20732. return {
  20733. type: "heading",
  20734. // @ts-expect-error `depth` will be set later.
  20735. depth: 0,
  20736. children: []
  20737. };
  20738. }
  20739. function hardBreak2() {
  20740. return {
  20741. type: "break"
  20742. };
  20743. }
  20744. function html5() {
  20745. return {
  20746. type: "html",
  20747. value: ""
  20748. };
  20749. }
  20750. function image2() {
  20751. return {
  20752. type: "image",
  20753. title: null,
  20754. url: "",
  20755. alt: null
  20756. };
  20757. }
  20758. function link2() {
  20759. return {
  20760. type: "link",
  20761. title: null,
  20762. url: "",
  20763. children: []
  20764. };
  20765. }
  20766. function list3(token) {
  20767. return {
  20768. type: "list",
  20769. ordered: token.type === "listOrdered",
  20770. start: null,
  20771. spread: token._spread,
  20772. children: []
  20773. };
  20774. }
  20775. function listItem2(token) {
  20776. return {
  20777. type: "listItem",
  20778. spread: token._spread,
  20779. checked: null,
  20780. children: []
  20781. };
  20782. }
  20783. function paragraph2() {
  20784. return {
  20785. type: "paragraph",
  20786. children: []
  20787. };
  20788. }
  20789. function strong2() {
  20790. return {
  20791. type: "strong",
  20792. children: []
  20793. };
  20794. }
  20795. function text5() {
  20796. return {
  20797. type: "text",
  20798. value: ""
  20799. };
  20800. }
  20801. function thematicBreak3() {
  20802. return {
  20803. type: "thematicBreak"
  20804. };
  20805. }
  20806. }
  20807. function point2(d) {
  20808. return {
  20809. line: d.line,
  20810. column: d.column,
  20811. offset: d.offset
  20812. };
  20813. }
  20814. function configure(combined, extensions) {
  20815. let index2 = -1;
  20816. while (++index2 < extensions.length) {
  20817. const value = extensions[index2];
  20818. if (Array.isArray(value)) {
  20819. configure(combined, value);
  20820. } else {
  20821. extension(combined, value);
  20822. }
  20823. }
  20824. }
  20825. function extension(combined, extension2) {
  20826. let key;
  20827. for (key in extension2) {
  20828. if (own3.call(extension2, key)) {
  20829. switch (key) {
  20830. case "canContainEols": {
  20831. const right = extension2[key];
  20832. if (right) {
  20833. combined[key].push(...right);
  20834. }
  20835. break;
  20836. }
  20837. case "transforms": {
  20838. const right = extension2[key];
  20839. if (right) {
  20840. combined[key].push(...right);
  20841. }
  20842. break;
  20843. }
  20844. case "enter":
  20845. case "exit": {
  20846. const right = extension2[key];
  20847. if (right) {
  20848. Object.assign(combined[key], right);
  20849. }
  20850. break;
  20851. }
  20852. }
  20853. }
  20854. }
  20855. }
  20856. function defaultOnError(left, right) {
  20857. if (left) {
  20858. throw new Error("Cannot close `" + left.type + "` (" + stringifyPosition({
  20859. start: left.start,
  20860. end: left.end
  20861. }) + "): a different token (`" + right.type + "`, " + stringifyPosition({
  20862. start: right.start,
  20863. end: right.end
  20864. }) + ") is open");
  20865. } else {
  20866. throw new Error("Cannot close document, a token (`" + right.type + "`, " + stringifyPosition({
  20867. start: right.start,
  20868. end: right.end
  20869. }) + ") is still open");
  20870. }
  20871. }
  20872. // node_modules/@mdx-js/mdx/node_modules/remark-parse/lib/index.js
  20873. function remarkParse(options) {
  20874. const self2 = this;
  20875. self2.parser = parser;
  20876. function parser(doc) {
  20877. return fromMarkdown(doc, {
  20878. ...self2.data("settings"),
  20879. ...options,
  20880. // Note: these options are not in the readme.
  20881. // The goal is for them to be set by plugins on `data` instead of being
  20882. // passed by users.
  20883. extensions: self2.data("micromarkExtensions") || [],
  20884. mdastExtensions: self2.data("fromMarkdownExtensions") || []
  20885. });
  20886. }
  20887. }
  20888. // node_modules/mdast-util-to-hast/lib/handlers/blockquote.js
  20889. function blockquote(state, node2) {
  20890. const result = {
  20891. type: "element",
  20892. tagName: "blockquote",
  20893. properties: {},
  20894. children: state.wrap(state.all(node2), true)
  20895. };
  20896. state.patch(node2, result);
  20897. return state.applyData(node2, result);
  20898. }
  20899. // node_modules/mdast-util-to-hast/lib/handlers/break.js
  20900. function hardBreak(state, node2) {
  20901. const result = { type: "element", tagName: "br", properties: {}, children: [] };
  20902. state.patch(node2, result);
  20903. return [state.applyData(node2, result), { type: "text", value: "\n" }];
  20904. }
  20905. // node_modules/mdast-util-to-hast/lib/handlers/code.js
  20906. function code(state, node2) {
  20907. const value = node2.value ? node2.value + "\n" : "";
  20908. const properties = {};
  20909. if (node2.lang) {
  20910. properties.className = ["language-" + node2.lang];
  20911. }
  20912. let result = {
  20913. type: "element",
  20914. tagName: "code",
  20915. properties,
  20916. children: [{ type: "text", value }]
  20917. };
  20918. if (node2.meta) {
  20919. result.data = { meta: node2.meta };
  20920. }
  20921. state.patch(node2, result);
  20922. result = state.applyData(node2, result);
  20923. result = { type: "element", tagName: "pre", properties: {}, children: [result] };
  20924. state.patch(node2, result);
  20925. return result;
  20926. }
  20927. // node_modules/mdast-util-to-hast/lib/handlers/delete.js
  20928. function strikethrough(state, node2) {
  20929. const result = {
  20930. type: "element",
  20931. tagName: "del",
  20932. properties: {},
  20933. children: state.all(node2)
  20934. };
  20935. state.patch(node2, result);
  20936. return state.applyData(node2, result);
  20937. }
  20938. // node_modules/mdast-util-to-hast/lib/handlers/emphasis.js
  20939. function emphasis(state, node2) {
  20940. const result = {
  20941. type: "element",
  20942. tagName: "em",
  20943. properties: {},
  20944. children: state.all(node2)
  20945. };
  20946. state.patch(node2, result);
  20947. return state.applyData(node2, result);
  20948. }
  20949. // node_modules/mdast-util-to-hast/lib/handlers/footnote-reference.js
  20950. function footnoteReference(state, node2) {
  20951. const clobberPrefix = typeof state.options.clobberPrefix === "string" ? state.options.clobberPrefix : "user-content-";
  20952. const id = String(node2.identifier).toUpperCase();
  20953. const safeId = normalizeUri(id.toLowerCase());
  20954. const index2 = state.footnoteOrder.indexOf(id);
  20955. let counter;
  20956. let reuseCounter = state.footnoteCounts.get(id);
  20957. if (reuseCounter === void 0) {
  20958. reuseCounter = 0;
  20959. state.footnoteOrder.push(id);
  20960. counter = state.footnoteOrder.length;
  20961. } else {
  20962. counter = index2 + 1;
  20963. }
  20964. reuseCounter += 1;
  20965. state.footnoteCounts.set(id, reuseCounter);
  20966. const link2 = {
  20967. type: "element",
  20968. tagName: "a",
  20969. properties: {
  20970. href: "#" + clobberPrefix + "fn-" + safeId,
  20971. id: clobberPrefix + "fnref-" + safeId + (reuseCounter > 1 ? "-" + reuseCounter : ""),
  20972. dataFootnoteRef: true,
  20973. ariaDescribedBy: ["footnote-label"]
  20974. },
  20975. children: [{ type: "text", value: String(counter) }]
  20976. };
  20977. state.patch(node2, link2);
  20978. const sup = {
  20979. type: "element",
  20980. tagName: "sup",
  20981. properties: {},
  20982. children: [link2]
  20983. };
  20984. state.patch(node2, sup);
  20985. return state.applyData(node2, sup);
  20986. }
  20987. // node_modules/mdast-util-to-hast/lib/handlers/heading.js
  20988. function heading(state, node2) {
  20989. const result = {
  20990. type: "element",
  20991. tagName: "h" + node2.depth,
  20992. properties: {},
  20993. children: state.all(node2)
  20994. };
  20995. state.patch(node2, result);
  20996. return state.applyData(node2, result);
  20997. }
  20998. // node_modules/mdast-util-to-hast/lib/handlers/html.js
  20999. function html(state, node2) {
  21000. if (state.options.allowDangerousHtml) {
  21001. const result = { type: "raw", value: node2.value };
  21002. state.patch(node2, result);
  21003. return state.applyData(node2, result);
  21004. }
  21005. return void 0;
  21006. }
  21007. // node_modules/mdast-util-to-hast/lib/revert.js
  21008. function revert(state, node2) {
  21009. const subtype = node2.referenceType;
  21010. let suffix = "]";
  21011. if (subtype === "collapsed") {
  21012. suffix += "[]";
  21013. } else if (subtype === "full") {
  21014. suffix += "[" + (node2.label || node2.identifier) + "]";
  21015. }
  21016. if (node2.type === "imageReference") {
  21017. return [{ type: "text", value: "![" + node2.alt + suffix }];
  21018. }
  21019. const contents = state.all(node2);
  21020. const head = contents[0];
  21021. if (head && head.type === "text") {
  21022. head.value = "[" + head.value;
  21023. } else {
  21024. contents.unshift({ type: "text", value: "[" });
  21025. }
  21026. const tail = contents[contents.length - 1];
  21027. if (tail && tail.type === "text") {
  21028. tail.value += suffix;
  21029. } else {
  21030. contents.push({ type: "text", value: suffix });
  21031. }
  21032. return contents;
  21033. }
  21034. // node_modules/mdast-util-to-hast/lib/handlers/image-reference.js
  21035. function imageReference(state, node2) {
  21036. const id = String(node2.identifier).toUpperCase();
  21037. const definition2 = state.definitionById.get(id);
  21038. if (!definition2) {
  21039. return revert(state, node2);
  21040. }
  21041. const properties = { src: normalizeUri(definition2.url || ""), alt: node2.alt };
  21042. if (definition2.title !== null && definition2.title !== void 0) {
  21043. properties.title = definition2.title;
  21044. }
  21045. const result = { type: "element", tagName: "img", properties, children: [] };
  21046. state.patch(node2, result);
  21047. return state.applyData(node2, result);
  21048. }
  21049. // node_modules/mdast-util-to-hast/lib/handlers/image.js
  21050. function image(state, node2) {
  21051. const properties = { src: normalizeUri(node2.url) };
  21052. if (node2.alt !== null && node2.alt !== void 0) {
  21053. properties.alt = node2.alt;
  21054. }
  21055. if (node2.title !== null && node2.title !== void 0) {
  21056. properties.title = node2.title;
  21057. }
  21058. const result = { type: "element", tagName: "img", properties, children: [] };
  21059. state.patch(node2, result);
  21060. return state.applyData(node2, result);
  21061. }
  21062. // node_modules/mdast-util-to-hast/lib/handlers/inline-code.js
  21063. function inlineCode(state, node2) {
  21064. const text5 = { type: "text", value: node2.value.replace(/\r?\n|\r/g, " ") };
  21065. state.patch(node2, text5);
  21066. const result = {
  21067. type: "element",
  21068. tagName: "code",
  21069. properties: {},
  21070. children: [text5]
  21071. };
  21072. state.patch(node2, result);
  21073. return state.applyData(node2, result);
  21074. }
  21075. // node_modules/mdast-util-to-hast/lib/handlers/link-reference.js
  21076. function linkReference(state, node2) {
  21077. const id = String(node2.identifier).toUpperCase();
  21078. const definition2 = state.definitionById.get(id);
  21079. if (!definition2) {
  21080. return revert(state, node2);
  21081. }
  21082. const properties = { href: normalizeUri(definition2.url || "") };
  21083. if (definition2.title !== null && definition2.title !== void 0) {
  21084. properties.title = definition2.title;
  21085. }
  21086. const result = {
  21087. type: "element",
  21088. tagName: "a",
  21089. properties,
  21090. children: state.all(node2)
  21091. };
  21092. state.patch(node2, result);
  21093. return state.applyData(node2, result);
  21094. }
  21095. // node_modules/mdast-util-to-hast/lib/handlers/link.js
  21096. function link(state, node2) {
  21097. const properties = { href: normalizeUri(node2.url) };
  21098. if (node2.title !== null && node2.title !== void 0) {
  21099. properties.title = node2.title;
  21100. }
  21101. const result = {
  21102. type: "element",
  21103. tagName: "a",
  21104. properties,
  21105. children: state.all(node2)
  21106. };
  21107. state.patch(node2, result);
  21108. return state.applyData(node2, result);
  21109. }
  21110. // node_modules/mdast-util-to-hast/lib/handlers/list-item.js
  21111. function listItem(state, node2, parent) {
  21112. const results = state.all(node2);
  21113. const loose = parent ? listLoose(parent) : listItemLoose(node2);
  21114. const properties = {};
  21115. const children = [];
  21116. if (typeof node2.checked === "boolean") {
  21117. const head = results[0];
  21118. let paragraph2;
  21119. if (head && head.type === "element" && head.tagName === "p") {
  21120. paragraph2 = head;
  21121. } else {
  21122. paragraph2 = { type: "element", tagName: "p", properties: {}, children: [] };
  21123. results.unshift(paragraph2);
  21124. }
  21125. if (paragraph2.children.length > 0) {
  21126. paragraph2.children.unshift({ type: "text", value: " " });
  21127. }
  21128. paragraph2.children.unshift({
  21129. type: "element",
  21130. tagName: "input",
  21131. properties: { type: "checkbox", checked: node2.checked, disabled: true },
  21132. children: []
  21133. });
  21134. properties.className = ["task-list-item"];
  21135. }
  21136. let index2 = -1;
  21137. while (++index2 < results.length) {
  21138. const child = results[index2];
  21139. if (loose || index2 !== 0 || child.type !== "element" || child.tagName !== "p") {
  21140. children.push({ type: "text", value: "\n" });
  21141. }
  21142. if (child.type === "element" && child.tagName === "p" && !loose) {
  21143. children.push(...child.children);
  21144. } else {
  21145. children.push(child);
  21146. }
  21147. }
  21148. const tail = results[results.length - 1];
  21149. if (tail && (loose || tail.type !== "element" || tail.tagName !== "p")) {
  21150. children.push({ type: "text", value: "\n" });
  21151. }
  21152. const result = { type: "element", tagName: "li", properties, children };
  21153. state.patch(node2, result);
  21154. return state.applyData(node2, result);
  21155. }
  21156. function listLoose(node2) {
  21157. let loose = false;
  21158. if (node2.type === "list") {
  21159. loose = node2.spread || false;
  21160. const children = node2.children;
  21161. let index2 = -1;
  21162. while (!loose && ++index2 < children.length) {
  21163. loose = listItemLoose(children[index2]);
  21164. }
  21165. }
  21166. return loose;
  21167. }
  21168. function listItemLoose(node2) {
  21169. const spread = node2.spread;
  21170. return spread === null || spread === void 0 ? node2.children.length > 1 : spread;
  21171. }
  21172. // node_modules/mdast-util-to-hast/lib/handlers/list.js
  21173. function list2(state, node2) {
  21174. const properties = {};
  21175. const results = state.all(node2);
  21176. let index2 = -1;
  21177. if (typeof node2.start === "number" && node2.start !== 1) {
  21178. properties.start = node2.start;
  21179. }
  21180. while (++index2 < results.length) {
  21181. const child = results[index2];
  21182. if (child.type === "element" && child.tagName === "li" && child.properties && Array.isArray(child.properties.className) && child.properties.className.includes("task-list-item")) {
  21183. properties.className = ["contains-task-list"];
  21184. break;
  21185. }
  21186. }
  21187. const result = {
  21188. type: "element",
  21189. tagName: node2.ordered ? "ol" : "ul",
  21190. properties,
  21191. children: state.wrap(results, true)
  21192. };
  21193. state.patch(node2, result);
  21194. return state.applyData(node2, result);
  21195. }
  21196. // node_modules/mdast-util-to-hast/lib/handlers/paragraph.js
  21197. function paragraph(state, node2) {
  21198. const result = {
  21199. type: "element",
  21200. tagName: "p",
  21201. properties: {},
  21202. children: state.all(node2)
  21203. };
  21204. state.patch(node2, result);
  21205. return state.applyData(node2, result);
  21206. }
  21207. // node_modules/mdast-util-to-hast/lib/handlers/root.js
  21208. function root(state, node2) {
  21209. const result = { type: "root", children: state.wrap(state.all(node2)) };
  21210. state.patch(node2, result);
  21211. return state.applyData(node2, result);
  21212. }
  21213. // node_modules/mdast-util-to-hast/lib/handlers/strong.js
  21214. function strong(state, node2) {
  21215. const result = {
  21216. type: "element",
  21217. tagName: "strong",
  21218. properties: {},
  21219. children: state.all(node2)
  21220. };
  21221. state.patch(node2, result);
  21222. return state.applyData(node2, result);
  21223. }
  21224. // node_modules/unist-util-position/lib/index.js
  21225. var pointEnd = point3("end");
  21226. var pointStart = point3("start");
  21227. function point3(type) {
  21228. return point4;
  21229. function point4(node2) {
  21230. const point5 = node2 && node2.position && node2.position[type] || {};
  21231. if (typeof point5.line === "number" && point5.line > 0 && typeof point5.column === "number" && point5.column > 0) {
  21232. return {
  21233. line: point5.line,
  21234. column: point5.column,
  21235. offset: typeof point5.offset === "number" && point5.offset > -1 ? point5.offset : void 0
  21236. };
  21237. }
  21238. }
  21239. }
  21240. function position2(node2) {
  21241. const start2 = pointStart(node2);
  21242. const end = pointEnd(node2);
  21243. if (start2 && end) {
  21244. return { start: start2, end };
  21245. }
  21246. }
  21247. // node_modules/mdast-util-to-hast/lib/handlers/table.js
  21248. function table(state, node2) {
  21249. const rows = state.all(node2);
  21250. const firstRow = rows.shift();
  21251. const tableContent = [];
  21252. if (firstRow) {
  21253. const head = {
  21254. type: "element",
  21255. tagName: "thead",
  21256. properties: {},
  21257. children: state.wrap([firstRow], true)
  21258. };
  21259. state.patch(node2.children[0], head);
  21260. tableContent.push(head);
  21261. }
  21262. if (rows.length > 0) {
  21263. const body = {
  21264. type: "element",
  21265. tagName: "tbody",
  21266. properties: {},
  21267. children: state.wrap(rows, true)
  21268. };
  21269. const start2 = pointStart(node2.children[1]);
  21270. const end = pointEnd(node2.children[node2.children.length - 1]);
  21271. if (start2 && end) body.position = { start: start2, end };
  21272. tableContent.push(body);
  21273. }
  21274. const result = {
  21275. type: "element",
  21276. tagName: "table",
  21277. properties: {},
  21278. children: state.wrap(tableContent, true)
  21279. };
  21280. state.patch(node2, result);
  21281. return state.applyData(node2, result);
  21282. }
  21283. // node_modules/mdast-util-to-hast/lib/handlers/table-row.js
  21284. function tableRow(state, node2, parent) {
  21285. const siblings = parent ? parent.children : void 0;
  21286. const rowIndex = siblings ? siblings.indexOf(node2) : 1;
  21287. const tagName = rowIndex === 0 ? "th" : "td";
  21288. const align = parent && parent.type === "table" ? parent.align : void 0;
  21289. const length = align ? align.length : node2.children.length;
  21290. let cellIndex = -1;
  21291. const cells = [];
  21292. while (++cellIndex < length) {
  21293. const cell = node2.children[cellIndex];
  21294. const properties = {};
  21295. const alignValue = align ? align[cellIndex] : void 0;
  21296. if (alignValue) {
  21297. properties.align = alignValue;
  21298. }
  21299. let result2 = { type: "element", tagName, properties, children: [] };
  21300. if (cell) {
  21301. result2.children = state.all(cell);
  21302. state.patch(cell, result2);
  21303. result2 = state.applyData(cell, result2);
  21304. }
  21305. cells.push(result2);
  21306. }
  21307. const result = {
  21308. type: "element",
  21309. tagName: "tr",
  21310. properties: {},
  21311. children: state.wrap(cells, true)
  21312. };
  21313. state.patch(node2, result);
  21314. return state.applyData(node2, result);
  21315. }
  21316. // node_modules/mdast-util-to-hast/lib/handlers/table-cell.js
  21317. function tableCell(state, node2) {
  21318. const result = {
  21319. type: "element",
  21320. tagName: "td",
  21321. // Assume body cell.
  21322. properties: {},
  21323. children: state.all(node2)
  21324. };
  21325. state.patch(node2, result);
  21326. return state.applyData(node2, result);
  21327. }
  21328. // node_modules/trim-lines/index.js
  21329. var tab = 9;
  21330. var space = 32;
  21331. function trimLines(value) {
  21332. const source = String(value);
  21333. const search2 = /\r?\n|\r/g;
  21334. let match = search2.exec(source);
  21335. let last = 0;
  21336. const lines = [];
  21337. while (match) {
  21338. lines.push(
  21339. trimLine(source.slice(last, match.index), last > 0, true),
  21340. match[0]
  21341. );
  21342. last = match.index + match[0].length;
  21343. match = search2.exec(source);
  21344. }
  21345. lines.push(trimLine(source.slice(last), last > 0, false));
  21346. return lines.join("");
  21347. }
  21348. function trimLine(value, start2, end) {
  21349. let startIndex = 0;
  21350. let endIndex = value.length;
  21351. if (start2) {
  21352. let code2 = value.codePointAt(startIndex);
  21353. while (code2 === tab || code2 === space) {
  21354. startIndex++;
  21355. code2 = value.codePointAt(startIndex);
  21356. }
  21357. }
  21358. if (end) {
  21359. let code2 = value.codePointAt(endIndex - 1);
  21360. while (code2 === tab || code2 === space) {
  21361. endIndex--;
  21362. code2 = value.codePointAt(endIndex - 1);
  21363. }
  21364. }
  21365. return endIndex > startIndex ? value.slice(startIndex, endIndex) : "";
  21366. }
  21367. // node_modules/mdast-util-to-hast/lib/handlers/text.js
  21368. function text3(state, node2) {
  21369. const result = { type: "text", value: trimLines(String(node2.value)) };
  21370. state.patch(node2, result);
  21371. return state.applyData(node2, result);
  21372. }
  21373. // node_modules/mdast-util-to-hast/lib/handlers/thematic-break.js
  21374. function thematicBreak2(state, node2) {
  21375. const result = {
  21376. type: "element",
  21377. tagName: "hr",
  21378. properties: {},
  21379. children: []
  21380. };
  21381. state.patch(node2, result);
  21382. return state.applyData(node2, result);
  21383. }
  21384. // node_modules/mdast-util-to-hast/lib/handlers/index.js
  21385. var handlers = {
  21386. blockquote,
  21387. break: hardBreak,
  21388. code,
  21389. delete: strikethrough,
  21390. emphasis,
  21391. footnoteReference,
  21392. heading,
  21393. html,
  21394. imageReference,
  21395. image,
  21396. inlineCode,
  21397. linkReference,
  21398. link,
  21399. listItem,
  21400. list: list2,
  21401. paragraph,
  21402. // @ts-expect-error: root is different, but hard to type.
  21403. root,
  21404. strong,
  21405. table,
  21406. tableCell,
  21407. tableRow,
  21408. text: text3,
  21409. thematicBreak: thematicBreak2,
  21410. toml: ignore,
  21411. yaml: ignore,
  21412. definition: ignore,
  21413. footnoteDefinition: ignore
  21414. };
  21415. function ignore() {
  21416. return void 0;
  21417. }
  21418. // node_modules/@ungap/structured-clone/esm/types.js
  21419. var VOID = -1;
  21420. var PRIMITIVE = 0;
  21421. var ARRAY = 1;
  21422. var OBJECT = 2;
  21423. var DATE = 3;
  21424. var REGEXP = 4;
  21425. var MAP = 5;
  21426. var SET = 6;
  21427. var ERROR = 7;
  21428. var BIGINT = 8;
  21429. // node_modules/@ungap/structured-clone/esm/deserialize.js
  21430. var env = typeof self === "object" ? self : globalThis;
  21431. var deserializer = ($, _) => {
  21432. const as = (out, index2) => {
  21433. $.set(index2, out);
  21434. return out;
  21435. };
  21436. const unpair = (index2) => {
  21437. if ($.has(index2))
  21438. return $.get(index2);
  21439. const [type, value] = _[index2];
  21440. switch (type) {
  21441. case PRIMITIVE:
  21442. case VOID:
  21443. return as(value, index2);
  21444. case ARRAY: {
  21445. const arr = as([], index2);
  21446. for (const index3 of value)
  21447. arr.push(unpair(index3));
  21448. return arr;
  21449. }
  21450. case OBJECT: {
  21451. const object = as({}, index2);
  21452. for (const [key, index3] of value)
  21453. object[unpair(key)] = unpair(index3);
  21454. return object;
  21455. }
  21456. case DATE:
  21457. return as(new Date(value), index2);
  21458. case REGEXP: {
  21459. const { source, flags } = value;
  21460. return as(new RegExp(source, flags), index2);
  21461. }
  21462. case MAP: {
  21463. const map = as(/* @__PURE__ */ new Map(), index2);
  21464. for (const [key, index3] of value)
  21465. map.set(unpair(key), unpair(index3));
  21466. return map;
  21467. }
  21468. case SET: {
  21469. const set = as(/* @__PURE__ */ new Set(), index2);
  21470. for (const index3 of value)
  21471. set.add(unpair(index3));
  21472. return set;
  21473. }
  21474. case ERROR: {
  21475. const { name: name2, message } = value;
  21476. return as(new env[name2](message), index2);
  21477. }
  21478. case BIGINT:
  21479. return as(BigInt(value), index2);
  21480. case "BigInt":
  21481. return as(Object(BigInt(value)), index2);
  21482. }
  21483. return as(new env[type](value), index2);
  21484. };
  21485. return unpair;
  21486. };
  21487. var deserialize = (serialized) => deserializer(/* @__PURE__ */ new Map(), serialized)(0);
  21488. // node_modules/@ungap/structured-clone/esm/serialize.js
  21489. var EMPTY = "";
  21490. var { toString: toString3 } = {};
  21491. var { keys } = Object;
  21492. var typeOf = (value) => {
  21493. const type = typeof value;
  21494. if (type !== "object" || !value)
  21495. return [PRIMITIVE, type];
  21496. const asString = toString3.call(value).slice(8, -1);
  21497. switch (asString) {
  21498. case "Array":
  21499. return [ARRAY, EMPTY];
  21500. case "Object":
  21501. return [OBJECT, EMPTY];
  21502. case "Date":
  21503. return [DATE, EMPTY];
  21504. case "RegExp":
  21505. return [REGEXP, EMPTY];
  21506. case "Map":
  21507. return [MAP, EMPTY];
  21508. case "Set":
  21509. return [SET, EMPTY];
  21510. }
  21511. if (asString.includes("Array"))
  21512. return [ARRAY, asString];
  21513. if (asString.includes("Error"))
  21514. return [ERROR, asString];
  21515. return [OBJECT, asString];
  21516. };
  21517. var shouldSkip = ([TYPE, type]) => TYPE === PRIMITIVE && (type === "function" || type === "symbol");
  21518. var serializer = (strict, json, $, _) => {
  21519. const as = (out, value) => {
  21520. const index2 = _.push(out) - 1;
  21521. $.set(value, index2);
  21522. return index2;
  21523. };
  21524. const pair = (value) => {
  21525. if ($.has(value))
  21526. return $.get(value);
  21527. let [TYPE, type] = typeOf(value);
  21528. switch (TYPE) {
  21529. case PRIMITIVE: {
  21530. let entry = value;
  21531. switch (type) {
  21532. case "bigint":
  21533. TYPE = BIGINT;
  21534. entry = value.toString();
  21535. break;
  21536. case "function":
  21537. case "symbol":
  21538. if (strict)
  21539. throw new TypeError("unable to serialize " + type);
  21540. entry = null;
  21541. break;
  21542. case "undefined":
  21543. return as([VOID], value);
  21544. }
  21545. return as([TYPE, entry], value);
  21546. }
  21547. case ARRAY: {
  21548. if (type)
  21549. return as([type, [...value]], value);
  21550. const arr = [];
  21551. const index2 = as([TYPE, arr], value);
  21552. for (const entry of value)
  21553. arr.push(pair(entry));
  21554. return index2;
  21555. }
  21556. case OBJECT: {
  21557. if (type) {
  21558. switch (type) {
  21559. case "BigInt":
  21560. return as([type, value.toString()], value);
  21561. case "Boolean":
  21562. case "Number":
  21563. case "String":
  21564. return as([type, value.valueOf()], value);
  21565. }
  21566. }
  21567. if (json && "toJSON" in value)
  21568. return pair(value.toJSON());
  21569. const entries = [];
  21570. const index2 = as([TYPE, entries], value);
  21571. for (const key of keys(value)) {
  21572. if (strict || !shouldSkip(typeOf(value[key])))
  21573. entries.push([pair(key), pair(value[key])]);
  21574. }
  21575. return index2;
  21576. }
  21577. case DATE:
  21578. return as([TYPE, value.toISOString()], value);
  21579. case REGEXP: {
  21580. const { source, flags } = value;
  21581. return as([TYPE, { source, flags }], value);
  21582. }
  21583. case MAP: {
  21584. const entries = [];
  21585. const index2 = as([TYPE, entries], value);
  21586. for (const [key, entry] of value) {
  21587. if (strict || !(shouldSkip(typeOf(key)) || shouldSkip(typeOf(entry))))
  21588. entries.push([pair(key), pair(entry)]);
  21589. }
  21590. return index2;
  21591. }
  21592. case SET: {
  21593. const entries = [];
  21594. const index2 = as([TYPE, entries], value);
  21595. for (const entry of value) {
  21596. if (strict || !shouldSkip(typeOf(entry)))
  21597. entries.push(pair(entry));
  21598. }
  21599. return index2;
  21600. }
  21601. }
  21602. const { message } = value;
  21603. return as([TYPE, { name: type, message }], value);
  21604. };
  21605. return pair;
  21606. };
  21607. var serialize = (value, { json, lossy } = {}) => {
  21608. const _ = [];
  21609. return serializer(!(json || lossy), !!json, /* @__PURE__ */ new Map(), _)(value), _;
  21610. };
  21611. // node_modules/@ungap/structured-clone/esm/index.js
  21612. var esm_default = typeof structuredClone === "function" ? (
  21613. /* c8 ignore start */
  21614. (any, options) => options && ("json" in options || "lossy" in options) ? deserialize(serialize(any, options)) : structuredClone(any)
  21615. ) : (any, options) => deserialize(serialize(any, options));
  21616. // node_modules/mdast-util-to-hast/lib/footer.js
  21617. function defaultFootnoteBackContent(_, rereferenceIndex) {
  21618. const result = [{ type: "text", value: "\u21A9" }];
  21619. if (rereferenceIndex > 1) {
  21620. result.push({
  21621. type: "element",
  21622. tagName: "sup",
  21623. properties: {},
  21624. children: [{ type: "text", value: String(rereferenceIndex) }]
  21625. });
  21626. }
  21627. return result;
  21628. }
  21629. function defaultFootnoteBackLabel(referenceIndex, rereferenceIndex) {
  21630. return "Back to reference " + (referenceIndex + 1) + (rereferenceIndex > 1 ? "-" + rereferenceIndex : "");
  21631. }
  21632. function footer(state) {
  21633. const clobberPrefix = typeof state.options.clobberPrefix === "string" ? state.options.clobberPrefix : "user-content-";
  21634. const footnoteBackContent = state.options.footnoteBackContent || defaultFootnoteBackContent;
  21635. const footnoteBackLabel = state.options.footnoteBackLabel || defaultFootnoteBackLabel;
  21636. const footnoteLabel = state.options.footnoteLabel || "Footnotes";
  21637. const footnoteLabelTagName = state.options.footnoteLabelTagName || "h2";
  21638. const footnoteLabelProperties = state.options.footnoteLabelProperties || {
  21639. className: ["sr-only"]
  21640. };
  21641. const listItems = [];
  21642. let referenceIndex = -1;
  21643. while (++referenceIndex < state.footnoteOrder.length) {
  21644. const definition2 = state.footnoteById.get(
  21645. state.footnoteOrder[referenceIndex]
  21646. );
  21647. if (!definition2) {
  21648. continue;
  21649. }
  21650. const content3 = state.all(definition2);
  21651. const id = String(definition2.identifier).toUpperCase();
  21652. const safeId = normalizeUri(id.toLowerCase());
  21653. let rereferenceIndex = 0;
  21654. const backReferences = [];
  21655. const counts = state.footnoteCounts.get(id);
  21656. while (counts !== void 0 && ++rereferenceIndex <= counts) {
  21657. if (backReferences.length > 0) {
  21658. backReferences.push({ type: "text", value: " " });
  21659. }
  21660. let children = typeof footnoteBackContent === "string" ? footnoteBackContent : footnoteBackContent(referenceIndex, rereferenceIndex);
  21661. if (typeof children === "string") {
  21662. children = { type: "text", value: children };
  21663. }
  21664. backReferences.push({
  21665. type: "element",
  21666. tagName: "a",
  21667. properties: {
  21668. href: "#" + clobberPrefix + "fnref-" + safeId + (rereferenceIndex > 1 ? "-" + rereferenceIndex : ""),
  21669. dataFootnoteBackref: "",
  21670. ariaLabel: typeof footnoteBackLabel === "string" ? footnoteBackLabel : footnoteBackLabel(referenceIndex, rereferenceIndex),
  21671. className: ["data-footnote-backref"]
  21672. },
  21673. children: Array.isArray(children) ? children : [children]
  21674. });
  21675. }
  21676. const tail = content3[content3.length - 1];
  21677. if (tail && tail.type === "element" && tail.tagName === "p") {
  21678. const tailTail = tail.children[tail.children.length - 1];
  21679. if (tailTail && tailTail.type === "text") {
  21680. tailTail.value += " ";
  21681. } else {
  21682. tail.children.push({ type: "text", value: " " });
  21683. }
  21684. tail.children.push(...backReferences);
  21685. } else {
  21686. content3.push(...backReferences);
  21687. }
  21688. const listItem2 = {
  21689. type: "element",
  21690. tagName: "li",
  21691. properties: { id: clobberPrefix + "fn-" + safeId },
  21692. children: state.wrap(content3, true)
  21693. };
  21694. state.patch(definition2, listItem2);
  21695. listItems.push(listItem2);
  21696. }
  21697. if (listItems.length === 0) {
  21698. return;
  21699. }
  21700. return {
  21701. type: "element",
  21702. tagName: "section",
  21703. properties: { dataFootnotes: true, className: ["footnotes"] },
  21704. children: [
  21705. {
  21706. type: "element",
  21707. tagName: footnoteLabelTagName,
  21708. properties: {
  21709. ...esm_default(footnoteLabelProperties),
  21710. id: "footnote-label"
  21711. },
  21712. children: [{ type: "text", value: footnoteLabel }]
  21713. },
  21714. { type: "text", value: "\n" },
  21715. {
  21716. type: "element",
  21717. tagName: "ol",
  21718. properties: {},
  21719. children: state.wrap(listItems, true)
  21720. },
  21721. { type: "text", value: "\n" }
  21722. ]
  21723. };
  21724. }
  21725. // node_modules/mdast-util-to-hast/node_modules/unist-util-is/lib/index.js
  21726. var convert = (
  21727. // Note: overloads in JSDoc can’t yet use different `@template`s.
  21728. /**
  21729. * @type {(
  21730. * (<Condition extends string>(test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & {type: Condition}) &
  21731. * (<Condition extends Props>(test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Condition) &
  21732. * (<Condition extends TestFunction>(test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Predicate<Condition, Node>) &
  21733. * ((test?: null | undefined) => (node?: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node) &
  21734. * ((test?: Test) => Check)
  21735. * )}
  21736. */
  21737. /**
  21738. * @param {Test} [test]
  21739. * @returns {Check}
  21740. */
  21741. function(test) {
  21742. if (test === null || test === void 0) {
  21743. return ok2;
  21744. }
  21745. if (typeof test === "function") {
  21746. return castFactory(test);
  21747. }
  21748. if (typeof test === "object") {
  21749. return Array.isArray(test) ? anyFactory(test) : propsFactory(test);
  21750. }
  21751. if (typeof test === "string") {
  21752. return typeFactory(test);
  21753. }
  21754. throw new Error("Expected function, string, or object as test");
  21755. }
  21756. );
  21757. function anyFactory(tests) {
  21758. const checks2 = [];
  21759. let index2 = -1;
  21760. while (++index2 < tests.length) {
  21761. checks2[index2] = convert(tests[index2]);
  21762. }
  21763. return castFactory(any);
  21764. function any(...parameters) {
  21765. let index3 = -1;
  21766. while (++index3 < checks2.length) {
  21767. if (checks2[index3].apply(this, parameters)) return true;
  21768. }
  21769. return false;
  21770. }
  21771. }
  21772. function propsFactory(check) {
  21773. const checkAsRecord = (
  21774. /** @type {Record<string, unknown>} */
  21775. check
  21776. );
  21777. return castFactory(all3);
  21778. function all3(node2) {
  21779. const nodeAsRecord = (
  21780. /** @type {Record<string, unknown>} */
  21781. /** @type {unknown} */
  21782. node2
  21783. );
  21784. let key;
  21785. for (key in check) {
  21786. if (nodeAsRecord[key] !== checkAsRecord[key]) return false;
  21787. }
  21788. return true;
  21789. }
  21790. }
  21791. function typeFactory(check) {
  21792. return castFactory(type);
  21793. function type(node2) {
  21794. return node2 && node2.type === check;
  21795. }
  21796. }
  21797. function castFactory(testFunction) {
  21798. return check;
  21799. function check(value, index2, parent) {
  21800. return Boolean(
  21801. looksLikeANode(value) && testFunction.call(
  21802. this,
  21803. value,
  21804. typeof index2 === "number" ? index2 : void 0,
  21805. parent || void 0
  21806. )
  21807. );
  21808. }
  21809. }
  21810. function ok2() {
  21811. return true;
  21812. }
  21813. function looksLikeANode(value) {
  21814. return value !== null && typeof value === "object" && "type" in value;
  21815. }
  21816. // node_modules/mdast-util-to-hast/node_modules/unist-util-visit-parents/lib/color.node.js
  21817. function color2(d) {
  21818. return "\x1B[33m" + d + "\x1B[39m";
  21819. }
  21820. // node_modules/mdast-util-to-hast/node_modules/unist-util-visit-parents/lib/index.js
  21821. var empty3 = [];
  21822. var CONTINUE2 = true;
  21823. var EXIT2 = false;
  21824. var SKIP2 = "skip";
  21825. function visitParents(tree, test, visitor, reverse) {
  21826. let check;
  21827. if (typeof test === "function" && typeof visitor !== "function") {
  21828. reverse = visitor;
  21829. visitor = test;
  21830. } else {
  21831. check = test;
  21832. }
  21833. const is3 = convert(check);
  21834. const step = reverse ? -1 : 1;
  21835. factory(tree, void 0, [])();
  21836. function factory(node2, index2, parents) {
  21837. const value = (
  21838. /** @type {Record<string, unknown>} */
  21839. node2 && typeof node2 === "object" ? node2 : {}
  21840. );
  21841. if (typeof value.type === "string") {
  21842. const name2 = (
  21843. // `hast`
  21844. typeof value.tagName === "string" ? value.tagName : (
  21845. // `xast`
  21846. typeof value.name === "string" ? value.name : void 0
  21847. )
  21848. );
  21849. Object.defineProperty(visit4, "name", {
  21850. value: "node (" + color2(node2.type + (name2 ? "<" + name2 + ">" : "")) + ")"
  21851. });
  21852. }
  21853. return visit4;
  21854. function visit4() {
  21855. let result = empty3;
  21856. let subresult;
  21857. let offset2;
  21858. let grandparents;
  21859. if (!test || is3(node2, index2, parents[parents.length - 1] || void 0)) {
  21860. result = toResult2(visitor(node2, parents));
  21861. if (result[0] === EXIT2) {
  21862. return result;
  21863. }
  21864. }
  21865. if ("children" in node2 && node2.children) {
  21866. const nodeAsParent = (
  21867. /** @type {UnistParent} */
  21868. node2
  21869. );
  21870. if (nodeAsParent.children && result[0] !== SKIP2) {
  21871. offset2 = (reverse ? nodeAsParent.children.length : -1) + step;
  21872. grandparents = parents.concat(nodeAsParent);
  21873. while (offset2 > -1 && offset2 < nodeAsParent.children.length) {
  21874. const child = nodeAsParent.children[offset2];
  21875. subresult = factory(child, offset2, grandparents)();
  21876. if (subresult[0] === EXIT2) {
  21877. return subresult;
  21878. }
  21879. offset2 = typeof subresult[1] === "number" ? subresult[1] : offset2 + step;
  21880. }
  21881. }
  21882. }
  21883. return result;
  21884. }
  21885. }
  21886. }
  21887. function toResult2(value) {
  21888. if (Array.isArray(value)) {
  21889. return value;
  21890. }
  21891. if (typeof value === "number") {
  21892. return [CONTINUE2, value];
  21893. }
  21894. return value === null || value === void 0 ? empty3 : [value];
  21895. }
  21896. // node_modules/mdast-util-to-hast/node_modules/unist-util-visit/lib/index.js
  21897. function visit2(tree, testOrVisitor, visitorOrReverse, maybeReverse) {
  21898. let reverse;
  21899. let test;
  21900. let visitor;
  21901. if (typeof testOrVisitor === "function" && typeof visitorOrReverse !== "function") {
  21902. test = void 0;
  21903. visitor = testOrVisitor;
  21904. reverse = visitorOrReverse;
  21905. } else {
  21906. test = testOrVisitor;
  21907. visitor = visitorOrReverse;
  21908. reverse = maybeReverse;
  21909. }
  21910. visitParents(tree, test, overload, reverse);
  21911. function overload(node2, parents) {
  21912. const parent = parents[parents.length - 1];
  21913. const index2 = parent ? parent.children.indexOf(node2) : void 0;
  21914. return visitor(node2, index2, parent);
  21915. }
  21916. }
  21917. // node_modules/mdast-util-to-hast/lib/state.js
  21918. var own4 = {}.hasOwnProperty;
  21919. var emptyOptions4 = {};
  21920. function createState(tree, options) {
  21921. const settings = options || emptyOptions4;
  21922. const definitionById = /* @__PURE__ */ new Map();
  21923. const footnoteById = /* @__PURE__ */ new Map();
  21924. const footnoteCounts = /* @__PURE__ */ new Map();
  21925. const handlers3 = { ...handlers, ...settings.handlers };
  21926. const state = {
  21927. all: all3,
  21928. applyData,
  21929. definitionById,
  21930. footnoteById,
  21931. footnoteCounts,
  21932. footnoteOrder: [],
  21933. handlers: handlers3,
  21934. one: one2,
  21935. options: settings,
  21936. patch,
  21937. wrap
  21938. };
  21939. visit2(tree, function(node2) {
  21940. if (node2.type === "definition" || node2.type === "footnoteDefinition") {
  21941. const map = node2.type === "definition" ? definitionById : footnoteById;
  21942. const id = String(node2.identifier).toUpperCase();
  21943. if (!map.has(id)) {
  21944. map.set(id, node2);
  21945. }
  21946. }
  21947. });
  21948. return state;
  21949. function one2(node2, parent) {
  21950. const type = node2.type;
  21951. const handle = state.handlers[type];
  21952. if (own4.call(state.handlers, type) && handle) {
  21953. return handle(state, node2, parent);
  21954. }
  21955. if (state.options.passThrough && state.options.passThrough.includes(type)) {
  21956. if ("children" in node2) {
  21957. const { children, ...shallow } = node2;
  21958. const result = esm_default(shallow);
  21959. result.children = state.all(node2);
  21960. return result;
  21961. }
  21962. return esm_default(node2);
  21963. }
  21964. const unknown2 = state.options.unknownHandler || defaultUnknownHandler;
  21965. return unknown2(state, node2, parent);
  21966. }
  21967. function all3(parent) {
  21968. const values = [];
  21969. if ("children" in parent) {
  21970. const nodes = parent.children;
  21971. let index2 = -1;
  21972. while (++index2 < nodes.length) {
  21973. const result = state.one(nodes[index2], parent);
  21974. if (result) {
  21975. if (index2 && nodes[index2 - 1].type === "break") {
  21976. if (!Array.isArray(result) && result.type === "text") {
  21977. result.value = trimMarkdownSpaceStart(result.value);
  21978. }
  21979. if (!Array.isArray(result) && result.type === "element") {
  21980. const head = result.children[0];
  21981. if (head && head.type === "text") {
  21982. head.value = trimMarkdownSpaceStart(head.value);
  21983. }
  21984. }
  21985. }
  21986. if (Array.isArray(result)) {
  21987. values.push(...result);
  21988. } else {
  21989. values.push(result);
  21990. }
  21991. }
  21992. }
  21993. }
  21994. return values;
  21995. }
  21996. }
  21997. function patch(from, to) {
  21998. if (from.position) to.position = position2(from);
  21999. }
  22000. function applyData(from, to) {
  22001. let result = to;
  22002. if (from && from.data) {
  22003. const hName = from.data.hName;
  22004. const hChildren = from.data.hChildren;
  22005. const hProperties = from.data.hProperties;
  22006. if (typeof hName === "string") {
  22007. if (result.type === "element") {
  22008. result.tagName = hName;
  22009. } else {
  22010. const children = "children" in result ? result.children : [result];
  22011. result = { type: "element", tagName: hName, properties: {}, children };
  22012. }
  22013. }
  22014. if (result.type === "element" && hProperties) {
  22015. Object.assign(result.properties, esm_default(hProperties));
  22016. }
  22017. if ("children" in result && result.children && hChildren !== null && hChildren !== void 0) {
  22018. result.children = hChildren;
  22019. }
  22020. }
  22021. return result;
  22022. }
  22023. function defaultUnknownHandler(state, node2) {
  22024. const data2 = node2.data || {};
  22025. const result = "value" in node2 && !(own4.call(data2, "hProperties") || own4.call(data2, "hChildren")) ? { type: "text", value: node2.value } : {
  22026. type: "element",
  22027. tagName: "div",
  22028. properties: {},
  22029. children: state.all(node2)
  22030. };
  22031. state.patch(node2, result);
  22032. return state.applyData(node2, result);
  22033. }
  22034. function wrap(nodes, loose) {
  22035. const result = [];
  22036. let index2 = -1;
  22037. if (loose) {
  22038. result.push({ type: "text", value: "\n" });
  22039. }
  22040. while (++index2 < nodes.length) {
  22041. if (index2) result.push({ type: "text", value: "\n" });
  22042. result.push(nodes[index2]);
  22043. }
  22044. if (loose && nodes.length > 0) {
  22045. result.push({ type: "text", value: "\n" });
  22046. }
  22047. return result;
  22048. }
  22049. function trimMarkdownSpaceStart(value) {
  22050. let index2 = 0;
  22051. let code2 = value.charCodeAt(index2);
  22052. while (code2 === 9 || code2 === 32) {
  22053. index2++;
  22054. code2 = value.charCodeAt(index2);
  22055. }
  22056. return value.slice(index2);
  22057. }
  22058. // node_modules/mdast-util-to-hast/lib/index.js
  22059. function toHast(tree, options) {
  22060. const state = createState(tree, options);
  22061. const node2 = state.one(tree, void 0);
  22062. const foot = footer(state);
  22063. const result = Array.isArray(node2) ? { type: "root", children: node2 } : node2 || { type: "root", children: [] };
  22064. if (foot) {
  22065. ok("children" in result);
  22066. result.children.push({ type: "text", value: "\n" }, foot);
  22067. }
  22068. return result;
  22069. }
  22070. // node_modules/remark-rehype/lib/index.js
  22071. function remarkRehype(destination, options) {
  22072. if (destination && "run" in destination) {
  22073. return async function(tree, file) {
  22074. const hastTree = (
  22075. /** @type {HastRoot} */
  22076. toHast(tree, { file, ...options })
  22077. );
  22078. await destination.run(hastTree, file);
  22079. };
  22080. }
  22081. return function(tree, file) {
  22082. return (
  22083. /** @type {HastRoot} */
  22084. toHast(tree, { file, ...options || destination })
  22085. );
  22086. };
  22087. }
  22088. // node_modules/unified/node_modules/bail/index.js
  22089. function bail(error) {
  22090. if (error) {
  22091. throw error;
  22092. }
  22093. }
  22094. // node_modules/unified/lib/index.js
  22095. var import_extend = __toESM(require_extend(), 1);
  22096. // node_modules/unified/node_modules/is-plain-obj/index.js
  22097. function isPlainObject(value) {
  22098. if (typeof value !== "object" || value === null) {
  22099. return false;
  22100. }
  22101. const prototype = Object.getPrototypeOf(value);
  22102. return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in value) && !(Symbol.iterator in value);
  22103. }
  22104. // node_modules/unified/node_modules/trough/lib/index.js
  22105. function trough() {
  22106. const fns = [];
  22107. const pipeline = { run: run2, use };
  22108. return pipeline;
  22109. function run2(...values) {
  22110. let middlewareIndex = -1;
  22111. const callback = values.pop();
  22112. if (typeof callback !== "function") {
  22113. throw new TypeError("Expected function as last argument, not " + callback);
  22114. }
  22115. next(null, ...values);
  22116. function next(error, ...output) {
  22117. const fn = fns[++middlewareIndex];
  22118. let index2 = -1;
  22119. if (error) {
  22120. callback(error);
  22121. return;
  22122. }
  22123. while (++index2 < values.length) {
  22124. if (output[index2] === null || output[index2] === void 0) {
  22125. output[index2] = values[index2];
  22126. }
  22127. }
  22128. values = output;
  22129. if (fn) {
  22130. wrap2(fn, next)(...output);
  22131. } else {
  22132. callback(null, ...output);
  22133. }
  22134. }
  22135. }
  22136. function use(middelware) {
  22137. if (typeof middelware !== "function") {
  22138. throw new TypeError(
  22139. "Expected `middelware` to be a function, not " + middelware
  22140. );
  22141. }
  22142. fns.push(middelware);
  22143. return pipeline;
  22144. }
  22145. }
  22146. function wrap2(middleware, callback) {
  22147. let called;
  22148. return wrapped;
  22149. function wrapped(...parameters) {
  22150. const fnExpectsCallback = middleware.length > parameters.length;
  22151. let result;
  22152. if (fnExpectsCallback) {
  22153. parameters.push(done);
  22154. }
  22155. try {
  22156. result = middleware.apply(this, parameters);
  22157. } catch (error) {
  22158. const exception = (
  22159. /** @type {Error} */
  22160. error
  22161. );
  22162. if (fnExpectsCallback && called) {
  22163. throw exception;
  22164. }
  22165. return done(exception);
  22166. }
  22167. if (!fnExpectsCallback) {
  22168. if (result && result.then && typeof result.then === "function") {
  22169. result.then(then, done);
  22170. } else if (result instanceof Error) {
  22171. done(result);
  22172. } else {
  22173. then(result);
  22174. }
  22175. }
  22176. }
  22177. function done(error, ...output) {
  22178. if (!called) {
  22179. called = true;
  22180. callback(error, ...output);
  22181. }
  22182. }
  22183. function then(value) {
  22184. done(null, value);
  22185. }
  22186. }
  22187. // node_modules/unified/node_modules/vfile/lib/minpath.js
  22188. // var import_node_path2 = __toESM(require("node:path"), 1);
  22189. // node_modules/unified/node_modules/vfile/lib/minproc.js
  22190. // var import_node_process2 = __toESM(require("node:process"), 1);
  22191. // node_modules/unified/node_modules/vfile/lib/minurl.js
  22192. // var import_node_url2 = require("node:url");
  22193. // node_modules/unified/node_modules/vfile/lib/minurl.shared.js
  22194. function isUrl2(fileUrlOrPath) {
  22195. return Boolean(
  22196. fileUrlOrPath !== null && typeof fileUrlOrPath === "object" && "href" in fileUrlOrPath && fileUrlOrPath.href && "protocol" in fileUrlOrPath && fileUrlOrPath.protocol && // @ts-expect-error: indexing is fine.
  22197. fileUrlOrPath.auth === void 0
  22198. );
  22199. }
  22200. // node_modules/unified/node_modules/vfile/lib/index.js
  22201. var order2 = (
  22202. /** @type {const} */
  22203. [
  22204. "history",
  22205. "path",
  22206. "basename",
  22207. "stem",
  22208. "extname",
  22209. "dirname"
  22210. ]
  22211. );
  22212. var VFile2 = class {
  22213. /**
  22214. * Create a new virtual file.
  22215. *
  22216. * `options` is treated as:
  22217. *
  22218. * * `string` or `Uint8Array` — `{value: options}`
  22219. * * `URL` — `{path: options}`
  22220. * * `VFile` — shallow copies its data over to the new file
  22221. * * `object` — all fields are shallow copied over to the new file
  22222. *
  22223. * Path related fields are set in the following order (least specific to
  22224. * most specific): `history`, `path`, `basename`, `stem`, `extname`,
  22225. * `dirname`.
  22226. *
  22227. * You cannot set `dirname` or `extname` without setting either `history`,
  22228. * `path`, `basename`, or `stem` too.
  22229. *
  22230. * @param {Compatible | null | undefined} [value]
  22231. * File value.
  22232. * @returns
  22233. * New instance.
  22234. */
  22235. constructor(value) {
  22236. let options;
  22237. if (!value) {
  22238. options = {};
  22239. } else if (isUrl2(value)) {
  22240. options = { path: value };
  22241. } else if (typeof value === "string" || isUint8Array2(value)) {
  22242. options = { value };
  22243. } else {
  22244. options = value;
  22245. }
  22246. this.cwd = PROCESS.cwd();
  22247. this.data = {};
  22248. this.history = [];
  22249. this.messages = [];
  22250. this.value;
  22251. this.map;
  22252. this.result;
  22253. this.stored;
  22254. let index2 = -1;
  22255. while (++index2 < order2.length) {
  22256. const prop2 = order2[index2];
  22257. if (prop2 in options && options[prop2] !== void 0 && options[prop2] !== null) {
  22258. this[prop2] = prop2 === "history" ? [...options[prop2]] : options[prop2];
  22259. }
  22260. }
  22261. let prop;
  22262. for (prop in options) {
  22263. if (!order2.includes(prop)) {
  22264. this[prop] = options[prop];
  22265. }
  22266. }
  22267. }
  22268. /**
  22269. * Get the basename (including extname) (example: `'index.min.js'`).
  22270. *
  22271. * @returns {string | undefined}
  22272. * Basename.
  22273. */
  22274. get basename() {
  22275. return typeof this.path === "string" ? PATH.basename(this.path) : void 0;
  22276. }
  22277. /**
  22278. * Set basename (including extname) (`'index.min.js'`).
  22279. *
  22280. * Cannot contain path separators (`'/'` on unix, macOS, and browsers, `'\'`
  22281. * on windows).
  22282. * Cannot be nullified (use `file.path = file.dirname` instead).
  22283. *
  22284. * @param {string} basename
  22285. * Basename.
  22286. * @returns {undefined}
  22287. * Nothing.
  22288. */
  22289. set basename(basename) {
  22290. assertNonEmpty2(basename, "basename");
  22291. assertPart2(basename, "basename");
  22292. this.path = PATH.join(this.dirname || "", basename);
  22293. }
  22294. /**
  22295. * Get the parent path (example: `'~'`).
  22296. *
  22297. * @returns {string | undefined}
  22298. * Dirname.
  22299. */
  22300. get dirname() {
  22301. return typeof this.path === "string" ? PATH.dirname(this.path) : void 0;
  22302. }
  22303. /**
  22304. * Set the parent path (example: `'~'`).
  22305. *
  22306. * Cannot be set if there’s no `path` yet.
  22307. *
  22308. * @param {string | undefined} dirname
  22309. * Dirname.
  22310. * @returns {undefined}
  22311. * Nothing.
  22312. */
  22313. set dirname(dirname) {
  22314. assertPath2(this.basename, "dirname");
  22315. this.path = PATH.join(dirname || "", this.basename);
  22316. }
  22317. /**
  22318. * Get the extname (including dot) (example: `'.js'`).
  22319. *
  22320. * @returns {string | undefined}
  22321. * Extname.
  22322. */
  22323. get extname() {
  22324. return typeof this.path === "string" ? PATH.extname(this.path) : void 0;
  22325. }
  22326. /**
  22327. * Set the extname (including dot) (example: `'.js'`).
  22328. *
  22329. * Cannot contain path separators (`'/'` on unix, macOS, and browsers, `'\'`
  22330. * on windows).
  22331. * Cannot be set if there’s no `path` yet.
  22332. *
  22333. * @param {string | undefined} extname
  22334. * Extname.
  22335. * @returns {undefined}
  22336. * Nothing.
  22337. */
  22338. set extname(extname) {
  22339. assertPart2(extname, "extname");
  22340. assertPath2(this.dirname, "extname");
  22341. if (extname) {
  22342. if (extname.codePointAt(0) !== 46) {
  22343. throw new Error("`extname` must start with `.`");
  22344. }
  22345. if (extname.includes(".", 1)) {
  22346. throw new Error("`extname` cannot contain multiple dots");
  22347. }
  22348. }
  22349. this.path = PATH.join(this.dirname, this.stem + (extname || ""));
  22350. }
  22351. /**
  22352. * Get the full path (example: `'~/index.min.js'`).
  22353. *
  22354. * @returns {string}
  22355. * Path.
  22356. */
  22357. get path() {
  22358. return this.history[this.history.length - 1];
  22359. }
  22360. /**
  22361. * Set the full path (example: `'~/index.min.js'`).
  22362. *
  22363. * Cannot be nullified.
  22364. * You can set a file URL (a `URL` object with a `file:` protocol) which will
  22365. * be turned into a path with `url.fileURLToPath`.
  22366. *
  22367. * @param {URL | string} path
  22368. * Path.
  22369. * @returns {undefined}
  22370. * Nothing.
  22371. */
  22372. set path(path) {
  22373. if (isUrl2(path)) {
  22374. path = (0, URL.fileURLToPath)(path);
  22375. }
  22376. assertNonEmpty2(path, "path");
  22377. if (this.path !== path) {
  22378. this.history.push(path);
  22379. }
  22380. }
  22381. /**
  22382. * Get the stem (basename w/o extname) (example: `'index.min'`).
  22383. *
  22384. * @returns {string | undefined}
  22385. * Stem.
  22386. */
  22387. get stem() {
  22388. return typeof this.path === "string" ? PATH.basename(this.path, this.extname) : void 0;
  22389. }
  22390. /**
  22391. * Set the stem (basename w/o extname) (example: `'index.min'`).
  22392. *
  22393. * Cannot contain path separators (`'/'` on unix, macOS, and browsers, `'\'`
  22394. * on windows).
  22395. * Cannot be nullified (use `file.path = file.dirname` instead).
  22396. *
  22397. * @param {string} stem
  22398. * Stem.
  22399. * @returns {undefined}
  22400. * Nothing.
  22401. */
  22402. set stem(stem) {
  22403. assertNonEmpty2(stem, "stem");
  22404. assertPart2(stem, "stem");
  22405. this.path = PATH.join(this.dirname || "", stem + (this.extname || ""));
  22406. }
  22407. // Normal prototypal methods.
  22408. /**
  22409. * Create a fatal message for `reason` associated with the file.
  22410. *
  22411. * The `fatal` field of the message is set to `true` (error; file not usable)
  22412. * and the `file` field is set to the current file path.
  22413. * The message is added to the `messages` field on `file`.
  22414. *
  22415. * > 🪦 **Note**: also has obsolete signatures.
  22416. *
  22417. * @overload
  22418. * @param {string} reason
  22419. * @param {MessageOptions | null | undefined} [options]
  22420. * @returns {never}
  22421. *
  22422. * @overload
  22423. * @param {string} reason
  22424. * @param {Node | NodeLike | null | undefined} parent
  22425. * @param {string | null | undefined} [origin]
  22426. * @returns {never}
  22427. *
  22428. * @overload
  22429. * @param {string} reason
  22430. * @param {Point | Position | null | undefined} place
  22431. * @param {string | null | undefined} [origin]
  22432. * @returns {never}
  22433. *
  22434. * @overload
  22435. * @param {string} reason
  22436. * @param {string | null | undefined} [origin]
  22437. * @returns {never}
  22438. *
  22439. * @overload
  22440. * @param {Error | VFileMessage} cause
  22441. * @param {Node | NodeLike | null | undefined} parent
  22442. * @param {string | null | undefined} [origin]
  22443. * @returns {never}
  22444. *
  22445. * @overload
  22446. * @param {Error | VFileMessage} cause
  22447. * @param {Point | Position | null | undefined} place
  22448. * @param {string | null | undefined} [origin]
  22449. * @returns {never}
  22450. *
  22451. * @overload
  22452. * @param {Error | VFileMessage} cause
  22453. * @param {string | null | undefined} [origin]
  22454. * @returns {never}
  22455. *
  22456. * @param {Error | VFileMessage | string} causeOrReason
  22457. * Reason for message, should use markdown.
  22458. * @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace]
  22459. * Configuration (optional).
  22460. * @param {string | null | undefined} [origin]
  22461. * Place in code where the message originates (example:
  22462. * `'my-package:my-rule'` or `'my-rule'`).
  22463. * @returns {never}
  22464. * Never.
  22465. * @throws {VFileMessage}
  22466. * Message.
  22467. */
  22468. fail(causeOrReason, optionsOrParentOrPlace, origin) {
  22469. const message = this.message(causeOrReason, optionsOrParentOrPlace, origin);
  22470. message.fatal = true;
  22471. throw message;
  22472. }
  22473. /**
  22474. * Create an info message for `reason` associated with the file.
  22475. *
  22476. * The `fatal` field of the message is set to `undefined` (info; change
  22477. * likely not needed) and the `file` field is set to the current file path.
  22478. * The message is added to the `messages` field on `file`.
  22479. *
  22480. * > 🪦 **Note**: also has obsolete signatures.
  22481. *
  22482. * @overload
  22483. * @param {string} reason
  22484. * @param {MessageOptions | null | undefined} [options]
  22485. * @returns {VFileMessage}
  22486. *
  22487. * @overload
  22488. * @param {string} reason
  22489. * @param {Node | NodeLike | null | undefined} parent
  22490. * @param {string | null | undefined} [origin]
  22491. * @returns {VFileMessage}
  22492. *
  22493. * @overload
  22494. * @param {string} reason
  22495. * @param {Point | Position | null | undefined} place
  22496. * @param {string | null | undefined} [origin]
  22497. * @returns {VFileMessage}
  22498. *
  22499. * @overload
  22500. * @param {string} reason
  22501. * @param {string | null | undefined} [origin]
  22502. * @returns {VFileMessage}
  22503. *
  22504. * @overload
  22505. * @param {Error | VFileMessage} cause
  22506. * @param {Node | NodeLike | null | undefined} parent
  22507. * @param {string | null | undefined} [origin]
  22508. * @returns {VFileMessage}
  22509. *
  22510. * @overload
  22511. * @param {Error | VFileMessage} cause
  22512. * @param {Point | Position | null | undefined} place
  22513. * @param {string | null | undefined} [origin]
  22514. * @returns {VFileMessage}
  22515. *
  22516. * @overload
  22517. * @param {Error | VFileMessage} cause
  22518. * @param {string | null | undefined} [origin]
  22519. * @returns {VFileMessage}
  22520. *
  22521. * @param {Error | VFileMessage | string} causeOrReason
  22522. * Reason for message, should use markdown.
  22523. * @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace]
  22524. * Configuration (optional).
  22525. * @param {string | null | undefined} [origin]
  22526. * Place in code where the message originates (example:
  22527. * `'my-package:my-rule'` or `'my-rule'`).
  22528. * @returns {VFileMessage}
  22529. * Message.
  22530. */
  22531. info(causeOrReason, optionsOrParentOrPlace, origin) {
  22532. const message = this.message(causeOrReason, optionsOrParentOrPlace, origin);
  22533. message.fatal = void 0;
  22534. return message;
  22535. }
  22536. /**
  22537. * Create a message for `reason` associated with the file.
  22538. *
  22539. * The `fatal` field of the message is set to `false` (warning; change may be
  22540. * needed) and the `file` field is set to the current file path.
  22541. * The message is added to the `messages` field on `file`.
  22542. *
  22543. * > 🪦 **Note**: also has obsolete signatures.
  22544. *
  22545. * @overload
  22546. * @param {string} reason
  22547. * @param {MessageOptions | null | undefined} [options]
  22548. * @returns {VFileMessage}
  22549. *
  22550. * @overload
  22551. * @param {string} reason
  22552. * @param {Node | NodeLike | null | undefined} parent
  22553. * @param {string | null | undefined} [origin]
  22554. * @returns {VFileMessage}
  22555. *
  22556. * @overload
  22557. * @param {string} reason
  22558. * @param {Point | Position | null | undefined} place
  22559. * @param {string | null | undefined} [origin]
  22560. * @returns {VFileMessage}
  22561. *
  22562. * @overload
  22563. * @param {string} reason
  22564. * @param {string | null | undefined} [origin]
  22565. * @returns {VFileMessage}
  22566. *
  22567. * @overload
  22568. * @param {Error | VFileMessage} cause
  22569. * @param {Node | NodeLike | null | undefined} parent
  22570. * @param {string | null | undefined} [origin]
  22571. * @returns {VFileMessage}
  22572. *
  22573. * @overload
  22574. * @param {Error | VFileMessage} cause
  22575. * @param {Point | Position | null | undefined} place
  22576. * @param {string | null | undefined} [origin]
  22577. * @returns {VFileMessage}
  22578. *
  22579. * @overload
  22580. * @param {Error | VFileMessage} cause
  22581. * @param {string | null | undefined} [origin]
  22582. * @returns {VFileMessage}
  22583. *
  22584. * @param {Error | VFileMessage | string} causeOrReason
  22585. * Reason for message, should use markdown.
  22586. * @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace]
  22587. * Configuration (optional).
  22588. * @param {string | null | undefined} [origin]
  22589. * Place in code where the message originates (example:
  22590. * `'my-package:my-rule'` or `'my-rule'`).
  22591. * @returns {VFileMessage}
  22592. * Message.
  22593. */
  22594. message(causeOrReason, optionsOrParentOrPlace, origin) {
  22595. const message = new VFileMessage(
  22596. // @ts-expect-error: the overloads are fine.
  22597. causeOrReason,
  22598. optionsOrParentOrPlace,
  22599. origin
  22600. );
  22601. if (this.path) {
  22602. message.name = this.path + ":" + message.name;
  22603. message.file = this.path;
  22604. }
  22605. message.fatal = false;
  22606. this.messages.push(message);
  22607. return message;
  22608. }
  22609. /**
  22610. * Serialize the file.
  22611. *
  22612. * > **Note**: which encodings are supported depends on the engine.
  22613. * > For info on Node.js, see:
  22614. * > <https://nodejs.org/api/util.html#whatwg-supported-encodings>.
  22615. *
  22616. * @param {string | null | undefined} [encoding='utf8']
  22617. * Character encoding to understand `value` as when it’s a `Uint8Array`
  22618. * (default: `'utf-8'`).
  22619. * @returns {string}
  22620. * Serialized file.
  22621. */
  22622. toString(encoding) {
  22623. if (this.value === void 0) {
  22624. return "";
  22625. }
  22626. if (typeof this.value === "string") {
  22627. return this.value;
  22628. }
  22629. const decoder = new TextDecoder(encoding || void 0);
  22630. return decoder.decode(this.value);
  22631. }
  22632. };
  22633. function assertPart2(part, name2) {
  22634. if (part && part.includes(PATH.sep)) {
  22635. throw new Error(
  22636. "`" + name2 + "` cannot be a path: did not expect `" + PATH.sep + "`"
  22637. );
  22638. }
  22639. }
  22640. function assertNonEmpty2(part, name2) {
  22641. if (!part) {
  22642. throw new Error("`" + name2 + "` cannot be empty");
  22643. }
  22644. }
  22645. function assertPath2(path, name2) {
  22646. if (!path) {
  22647. throw new Error("Setting `" + name2 + "` requires `path` to be set too");
  22648. }
  22649. }
  22650. function isUint8Array2(value) {
  22651. return Boolean(
  22652. value && typeof value === "object" && "byteLength" in value && "byteOffset" in value
  22653. );
  22654. }
  22655. // node_modules/unified/lib/callable-instance.js
  22656. var CallableInstance = (
  22657. /**
  22658. * @type {new <Parameters extends Array<unknown>, Result>(property: string | symbol) => (...parameters: Parameters) => Result}
  22659. */
  22660. /** @type {unknown} */
  22661. /**
  22662. * @this {Function}
  22663. * @param {string | symbol} property
  22664. * @returns {(...parameters: Array<unknown>) => unknown}
  22665. */
  22666. function(property) {
  22667. const self2 = this;
  22668. const constr = self2.constructor;
  22669. const proto = (
  22670. /** @type {Record<string | symbol, Function>} */
  22671. // Prototypes do exist.
  22672. // type-coverage:ignore-next-line
  22673. constr.prototype
  22674. );
  22675. const value = proto[property];
  22676. const apply = function() {
  22677. return value.apply(apply, arguments);
  22678. };
  22679. Object.setPrototypeOf(apply, proto);
  22680. return apply;
  22681. }
  22682. );
  22683. // node_modules/unified/lib/index.js
  22684. var own5 = {}.hasOwnProperty;
  22685. var Processor = class _Processor extends CallableInstance {
  22686. /**
  22687. * Create a processor.
  22688. */
  22689. constructor() {
  22690. super("copy");
  22691. this.Compiler = void 0;
  22692. this.Parser = void 0;
  22693. this.attachers = [];
  22694. this.compiler = void 0;
  22695. this.freezeIndex = -1;
  22696. this.frozen = void 0;
  22697. this.namespace = {};
  22698. this.parser = void 0;
  22699. this.transformers = trough();
  22700. }
  22701. /**
  22702. * Copy a processor.
  22703. *
  22704. * @deprecated
  22705. * This is a private internal method and should not be used.
  22706. * @returns {Processor<ParseTree, HeadTree, TailTree, CompileTree, CompileResult>}
  22707. * New *unfrozen* processor ({@linkcode Processor}) that is
  22708. * configured to work the same as its ancestor.
  22709. * When the descendant processor is configured in the future it does not
  22710. * affect the ancestral processor.
  22711. */
  22712. copy() {
  22713. const destination = (
  22714. /** @type {Processor<ParseTree, HeadTree, TailTree, CompileTree, CompileResult>} */
  22715. new _Processor()
  22716. );
  22717. let index2 = -1;
  22718. while (++index2 < this.attachers.length) {
  22719. const attacher = this.attachers[index2];
  22720. destination.use(...attacher);
  22721. }
  22722. destination.data((0, import_extend.default)(true, {}, this.namespace));
  22723. return destination;
  22724. }
  22725. /**
  22726. * Configure the processor with info available to all plugins.
  22727. * Information is stored in an object.
  22728. *
  22729. * Typically, options can be given to a specific plugin, but sometimes it
  22730. * makes sense to have information shared with several plugins.
  22731. * For example, a list of HTML elements that are self-closing, which is
  22732. * needed during all phases.
  22733. *
  22734. * > **Note**: setting information cannot occur on *frozen* processors.
  22735. * > Call the processor first to create a new unfrozen processor.
  22736. *
  22737. * > **Note**: to register custom data in TypeScript, augment the
  22738. * > {@linkcode Data} interface.
  22739. *
  22740. * @example
  22741. * This example show how to get and set info:
  22742. *
  22743. * ```js
  22744. * import {unified} from 'unified'
  22745. *
  22746. * const processor = unified().data('alpha', 'bravo')
  22747. *
  22748. * processor.data('alpha') // => 'bravo'
  22749. *
  22750. * processor.data() // => {alpha: 'bravo'}
  22751. *
  22752. * processor.data({charlie: 'delta'})
  22753. *
  22754. * processor.data() // => {charlie: 'delta'}
  22755. * ```
  22756. *
  22757. * @template {keyof Data} Key
  22758. *
  22759. * @overload
  22760. * @returns {Data}
  22761. *
  22762. * @overload
  22763. * @param {Data} dataset
  22764. * @returns {Processor<ParseTree, HeadTree, TailTree, CompileTree, CompileResult>}
  22765. *
  22766. * @overload
  22767. * @param {Key} key
  22768. * @returns {Data[Key]}
  22769. *
  22770. * @overload
  22771. * @param {Key} key
  22772. * @param {Data[Key]} value
  22773. * @returns {Processor<ParseTree, HeadTree, TailTree, CompileTree, CompileResult>}
  22774. *
  22775. * @param {Data | Key} [key]
  22776. * Key to get or set, or entire dataset to set, or nothing to get the
  22777. * entire dataset (optional).
  22778. * @param {Data[Key]} [value]
  22779. * Value to set (optional).
  22780. * @returns {unknown}
  22781. * The current processor when setting, the value at `key` when getting, or
  22782. * the entire dataset when getting without key.
  22783. */
  22784. data(key, value) {
  22785. if (typeof key === "string") {
  22786. if (arguments.length === 2) {
  22787. assertUnfrozen("data", this.frozen);
  22788. this.namespace[key] = value;
  22789. return this;
  22790. }
  22791. return own5.call(this.namespace, key) && this.namespace[key] || void 0;
  22792. }
  22793. if (key) {
  22794. assertUnfrozen("data", this.frozen);
  22795. this.namespace = key;
  22796. return this;
  22797. }
  22798. return this.namespace;
  22799. }
  22800. /**
  22801. * Freeze a processor.
  22802. *
  22803. * Frozen processors are meant to be extended and not to be configured
  22804. * directly.
  22805. *
  22806. * When a processor is frozen it cannot be unfrozen.
  22807. * New processors working the same way can be created by calling the
  22808. * processor.
  22809. *
  22810. * It’s possible to freeze processors explicitly by calling `.freeze()`.
  22811. * Processors freeze automatically when `.parse()`, `.run()`, `.runSync()`,
  22812. * `.stringify()`, `.process()`, or `.processSync()` are called.
  22813. *
  22814. * @returns {Processor<ParseTree, HeadTree, TailTree, CompileTree, CompileResult>}
  22815. * The current processor.
  22816. */
  22817. freeze() {
  22818. if (this.frozen) {
  22819. return this;
  22820. }
  22821. const self2 = (
  22822. /** @type {Processor} */
  22823. /** @type {unknown} */
  22824. this
  22825. );
  22826. while (++this.freezeIndex < this.attachers.length) {
  22827. const [attacher, ...options] = this.attachers[this.freezeIndex];
  22828. if (options[0] === false) {
  22829. continue;
  22830. }
  22831. if (options[0] === true) {
  22832. options[0] = void 0;
  22833. }
  22834. const transformer = attacher.call(self2, ...options);
  22835. if (typeof transformer === "function") {
  22836. this.transformers.use(transformer);
  22837. }
  22838. }
  22839. this.frozen = true;
  22840. this.freezeIndex = Number.POSITIVE_INFINITY;
  22841. return this;
  22842. }
  22843. /**
  22844. * Parse text to a syntax tree.
  22845. *
  22846. * > **Note**: `parse` freezes the processor if not already *frozen*.
  22847. *
  22848. * > **Note**: `parse` performs the parse phase, not the run phase or other
  22849. * > phases.
  22850. *
  22851. * @param {Compatible | undefined} [file]
  22852. * file to parse (optional); typically `string` or `VFile`; any value
  22853. * accepted as `x` in `new VFile(x)`.
  22854. * @returns {ParseTree extends undefined ? Node : ParseTree}
  22855. * Syntax tree representing `file`.
  22856. */
  22857. parse(file) {
  22858. this.freeze();
  22859. const realFile = vfile(file);
  22860. const parser = this.parser || this.Parser;
  22861. assertParser("parse", parser);
  22862. return parser(String(realFile), realFile);
  22863. }
  22864. /**
  22865. * Process the given file as configured on the processor.
  22866. *
  22867. * > **Note**: `process` freezes the processor if not already *frozen*.
  22868. *
  22869. * > **Note**: `process` performs the parse, run, and stringify phases.
  22870. *
  22871. * @overload
  22872. * @param {Compatible | undefined} file
  22873. * @param {ProcessCallback<VFileWithOutput<CompileResult>>} done
  22874. * @returns {undefined}
  22875. *
  22876. * @overload
  22877. * @param {Compatible | undefined} [file]
  22878. * @returns {Promise<VFileWithOutput<CompileResult>>}
  22879. *
  22880. * @param {Compatible | undefined} [file]
  22881. * File (optional); typically `string` or `VFile`]; any value accepted as
  22882. * `x` in `new VFile(x)`.
  22883. * @param {ProcessCallback<VFileWithOutput<CompileResult>> | undefined} [done]
  22884. * Callback (optional).
  22885. * @returns {Promise<VFile> | undefined}
  22886. * Nothing if `done` is given.
  22887. * Otherwise a promise, rejected with a fatal error or resolved with the
  22888. * processed file.
  22889. *
  22890. * The parsed, transformed, and compiled value is available at
  22891. * `file.value` (see note).
  22892. *
  22893. * > **Note**: unified typically compiles by serializing: most
  22894. * > compilers return `string` (or `Uint8Array`).
  22895. * > Some compilers, such as the one configured with
  22896. * > [`rehype-react`][rehype-react], return other values (in this case, a
  22897. * > React tree).
  22898. * > If you’re using a compiler that doesn’t serialize, expect different
  22899. * > result values.
  22900. * >
  22901. * > To register custom results in TypeScript, add them to
  22902. * > {@linkcode CompileResultMap}.
  22903. *
  22904. * [rehype-react]: https://github.com/rehypejs/rehype-react
  22905. */
  22906. process(file, done) {
  22907. const self2 = this;
  22908. this.freeze();
  22909. assertParser("process", this.parser || this.Parser);
  22910. assertCompiler("process", this.compiler || this.Compiler);
  22911. return done ? executor(void 0, done) : new Promise(executor);
  22912. function executor(resolve, reject) {
  22913. const realFile = vfile(file);
  22914. const parseTree = (
  22915. /** @type {HeadTree extends undefined ? Node : HeadTree} */
  22916. /** @type {unknown} */
  22917. self2.parse(realFile)
  22918. );
  22919. self2.run(parseTree, realFile, function(error, tree, file2) {
  22920. if (error || !tree || !file2) {
  22921. return realDone(error);
  22922. }
  22923. const compileTree = (
  22924. /** @type {CompileTree extends undefined ? Node : CompileTree} */
  22925. /** @type {unknown} */
  22926. tree
  22927. );
  22928. const compileResult = self2.stringify(compileTree, file2);
  22929. if (looksLikeAValue(compileResult)) {
  22930. file2.value = compileResult;
  22931. } else {
  22932. file2.result = compileResult;
  22933. }
  22934. realDone(
  22935. error,
  22936. /** @type {VFileWithOutput<CompileResult>} */
  22937. file2
  22938. );
  22939. });
  22940. function realDone(error, file2) {
  22941. if (error || !file2) {
  22942. reject(error);
  22943. } else if (resolve) {
  22944. resolve(file2);
  22945. } else {
  22946. ok(done, "`done` is defined if `resolve` is not");
  22947. done(void 0, file2);
  22948. }
  22949. }
  22950. }
  22951. }
  22952. /**
  22953. * Process the given file as configured on the processor.
  22954. *
  22955. * An error is thrown if asynchronous transforms are configured.
  22956. *
  22957. * > **Note**: `processSync` freezes the processor if not already *frozen*.
  22958. *
  22959. * > **Note**: `processSync` performs the parse, run, and stringify phases.
  22960. *
  22961. * @param {Compatible | undefined} [file]
  22962. * File (optional); typically `string` or `VFile`; any value accepted as
  22963. * `x` in `new VFile(x)`.
  22964. * @returns {VFileWithOutput<CompileResult>}
  22965. * The processed file.
  22966. *
  22967. * The parsed, transformed, and compiled value is available at
  22968. * `file.value` (see note).
  22969. *
  22970. * > **Note**: unified typically compiles by serializing: most
  22971. * > compilers return `string` (or `Uint8Array`).
  22972. * > Some compilers, such as the one configured with
  22973. * > [`rehype-react`][rehype-react], return other values (in this case, a
  22974. * > React tree).
  22975. * > If you’re using a compiler that doesn’t serialize, expect different
  22976. * > result values.
  22977. * >
  22978. * > To register custom results in TypeScript, add them to
  22979. * > {@linkcode CompileResultMap}.
  22980. *
  22981. * [rehype-react]: https://github.com/rehypejs/rehype-react
  22982. */
  22983. processSync(file) {
  22984. let complete = false;
  22985. let result;
  22986. this.freeze();
  22987. assertParser("processSync", this.parser || this.Parser);
  22988. assertCompiler("processSync", this.compiler || this.Compiler);
  22989. this.process(file, realDone);
  22990. assertDone("processSync", "process", complete);
  22991. ok(result, "we either bailed on an error or have a tree");
  22992. return result;
  22993. function realDone(error, file2) {
  22994. complete = true;
  22995. bail(error);
  22996. result = file2;
  22997. }
  22998. }
  22999. /**
  23000. * Run *transformers* on a syntax tree.
  23001. *
  23002. * > **Note**: `run` freezes the processor if not already *frozen*.
  23003. *
  23004. * > **Note**: `run` performs the run phase, not other phases.
  23005. *
  23006. * @overload
  23007. * @param {HeadTree extends undefined ? Node : HeadTree} tree
  23008. * @param {RunCallback<TailTree extends undefined ? Node : TailTree>} done
  23009. * @returns {undefined}
  23010. *
  23011. * @overload
  23012. * @param {HeadTree extends undefined ? Node : HeadTree} tree
  23013. * @param {Compatible | undefined} file
  23014. * @param {RunCallback<TailTree extends undefined ? Node : TailTree>} done
  23015. * @returns {undefined}
  23016. *
  23017. * @overload
  23018. * @param {HeadTree extends undefined ? Node : HeadTree} tree
  23019. * @param {Compatible | undefined} [file]
  23020. * @returns {Promise<TailTree extends undefined ? Node : TailTree>}
  23021. *
  23022. * @param {HeadTree extends undefined ? Node : HeadTree} tree
  23023. * Tree to transform and inspect.
  23024. * @param {(
  23025. * RunCallback<TailTree extends undefined ? Node : TailTree> |
  23026. * Compatible
  23027. * )} [file]
  23028. * File associated with `node` (optional); any value accepted as `x` in
  23029. * `new VFile(x)`.
  23030. * @param {RunCallback<TailTree extends undefined ? Node : TailTree>} [done]
  23031. * Callback (optional).
  23032. * @returns {Promise<TailTree extends undefined ? Node : TailTree> | undefined}
  23033. * Nothing if `done` is given.
  23034. * Otherwise, a promise rejected with a fatal error or resolved with the
  23035. * transformed tree.
  23036. */
  23037. run(tree, file, done) {
  23038. assertNode(tree);
  23039. this.freeze();
  23040. const transformers = this.transformers;
  23041. if (!done && typeof file === "function") {
  23042. done = file;
  23043. file = void 0;
  23044. }
  23045. return done ? executor(void 0, done) : new Promise(executor);
  23046. function executor(resolve, reject) {
  23047. ok(
  23048. typeof file !== "function",
  23049. "`file` can\u2019t be a `done` anymore, we checked"
  23050. );
  23051. const realFile = vfile(file);
  23052. transformers.run(tree, realFile, realDone);
  23053. function realDone(error, outputTree, file2) {
  23054. const resultingTree = (
  23055. /** @type {TailTree extends undefined ? Node : TailTree} */
  23056. outputTree || tree
  23057. );
  23058. if (error) {
  23059. reject(error);
  23060. } else if (resolve) {
  23061. resolve(resultingTree);
  23062. } else {
  23063. ok(done, "`done` is defined if `resolve` is not");
  23064. done(void 0, resultingTree, file2);
  23065. }
  23066. }
  23067. }
  23068. }
  23069. /**
  23070. * Run *transformers* on a syntax tree.
  23071. *
  23072. * An error is thrown if asynchronous transforms are configured.
  23073. *
  23074. * > **Note**: `runSync` freezes the processor if not already *frozen*.
  23075. *
  23076. * > **Note**: `runSync` performs the run phase, not other phases.
  23077. *
  23078. * @param {HeadTree extends undefined ? Node : HeadTree} tree
  23079. * Tree to transform and inspect.
  23080. * @param {Compatible | undefined} [file]
  23081. * File associated with `node` (optional); any value accepted as `x` in
  23082. * `new VFile(x)`.
  23083. * @returns {TailTree extends undefined ? Node : TailTree}
  23084. * Transformed tree.
  23085. */
  23086. runSync(tree, file) {
  23087. let complete = false;
  23088. let result;
  23089. this.run(tree, file, realDone);
  23090. assertDone("runSync", "run", complete);
  23091. ok(result, "we either bailed on an error or have a tree");
  23092. return result;
  23093. function realDone(error, tree2) {
  23094. bail(error);
  23095. result = tree2;
  23096. complete = true;
  23097. }
  23098. }
  23099. /**
  23100. * Compile a syntax tree.
  23101. *
  23102. * > **Note**: `stringify` freezes the processor if not already *frozen*.
  23103. *
  23104. * > **Note**: `stringify` performs the stringify phase, not the run phase
  23105. * > or other phases.
  23106. *
  23107. * @param {CompileTree extends undefined ? Node : CompileTree} tree
  23108. * Tree to compile.
  23109. * @param {Compatible | undefined} [file]
  23110. * File associated with `node` (optional); any value accepted as `x` in
  23111. * `new VFile(x)`.
  23112. * @returns {CompileResult extends undefined ? Value : CompileResult}
  23113. * Textual representation of the tree (see note).
  23114. *
  23115. * > **Note**: unified typically compiles by serializing: most compilers
  23116. * > return `string` (or `Uint8Array`).
  23117. * > Some compilers, such as the one configured with
  23118. * > [`rehype-react`][rehype-react], return other values (in this case, a
  23119. * > React tree).
  23120. * > If you’re using a compiler that doesn’t serialize, expect different
  23121. * > result values.
  23122. * >
  23123. * > To register custom results in TypeScript, add them to
  23124. * > {@linkcode CompileResultMap}.
  23125. *
  23126. * [rehype-react]: https://github.com/rehypejs/rehype-react
  23127. */
  23128. stringify(tree, file) {
  23129. this.freeze();
  23130. const realFile = vfile(file);
  23131. const compiler2 = this.compiler || this.Compiler;
  23132. assertCompiler("stringify", compiler2);
  23133. assertNode(tree);
  23134. return compiler2(tree, realFile);
  23135. }
  23136. /**
  23137. * Configure the processor to use a plugin, a list of usable values, or a
  23138. * preset.
  23139. *
  23140. * If the processor is already using a plugin, the previous plugin
  23141. * configuration is changed based on the options that are passed in.
  23142. * In other words, the plugin is not added a second time.
  23143. *
  23144. * > **Note**: `use` cannot be called on *frozen* processors.
  23145. * > Call the processor first to create a new unfrozen processor.
  23146. *
  23147. * @example
  23148. * There are many ways to pass plugins to `.use()`.
  23149. * This example gives an overview:
  23150. *
  23151. * ```js
  23152. * import {unified} from 'unified'
  23153. *
  23154. * unified()
  23155. * // Plugin with options:
  23156. * .use(pluginA, {x: true, y: true})
  23157. * // Passing the same plugin again merges configuration (to `{x: true, y: false, z: true}`):
  23158. * .use(pluginA, {y: false, z: true})
  23159. * // Plugins:
  23160. * .use([pluginB, pluginC])
  23161. * // Two plugins, the second with options:
  23162. * .use([pluginD, [pluginE, {}]])
  23163. * // Preset with plugins and settings:
  23164. * .use({plugins: [pluginF, [pluginG, {}]], settings: {position: false}})
  23165. * // Settings only:
  23166. * .use({settings: {position: false}})
  23167. * ```
  23168. *
  23169. * @template {Array<unknown>} [Parameters=[]]
  23170. * @template {Node | string | undefined} [Input=undefined]
  23171. * @template [Output=Input]
  23172. *
  23173. * @overload
  23174. * @param {Preset | null | undefined} [preset]
  23175. * @returns {Processor<ParseTree, HeadTree, TailTree, CompileTree, CompileResult>}
  23176. *
  23177. * @overload
  23178. * @param {PluggableList} list
  23179. * @returns {Processor<ParseTree, HeadTree, TailTree, CompileTree, CompileResult>}
  23180. *
  23181. * @overload
  23182. * @param {Plugin<Parameters, Input, Output>} plugin
  23183. * @param {...(Parameters | [boolean])} parameters
  23184. * @returns {UsePlugin<ParseTree, HeadTree, TailTree, CompileTree, CompileResult, Input, Output>}
  23185. *
  23186. * @param {PluggableList | Plugin | Preset | null | undefined} value
  23187. * Usable value.
  23188. * @param {...unknown} parameters
  23189. * Parameters, when a plugin is given as a usable value.
  23190. * @returns {Processor<ParseTree, HeadTree, TailTree, CompileTree, CompileResult>}
  23191. * Current processor.
  23192. */
  23193. use(value, ...parameters) {
  23194. const attachers = this.attachers;
  23195. const namespace = this.namespace;
  23196. assertUnfrozen("use", this.frozen);
  23197. if (value === null || value === void 0) {
  23198. } else if (typeof value === "function") {
  23199. addPlugin(value, parameters);
  23200. } else if (typeof value === "object") {
  23201. if (Array.isArray(value)) {
  23202. addList(value);
  23203. } else {
  23204. addPreset(value);
  23205. }
  23206. } else {
  23207. throw new TypeError("Expected usable value, not `" + value + "`");
  23208. }
  23209. return this;
  23210. function add(value2) {
  23211. if (typeof value2 === "function") {
  23212. addPlugin(value2, []);
  23213. } else if (typeof value2 === "object") {
  23214. if (Array.isArray(value2)) {
  23215. const [plugin, ...parameters2] = (
  23216. /** @type {PluginTuple<Array<unknown>>} */
  23217. value2
  23218. );
  23219. addPlugin(plugin, parameters2);
  23220. } else {
  23221. addPreset(value2);
  23222. }
  23223. } else {
  23224. throw new TypeError("Expected usable value, not `" + value2 + "`");
  23225. }
  23226. }
  23227. function addPreset(result) {
  23228. if (!("plugins" in result) && !("settings" in result)) {
  23229. throw new Error(
  23230. "Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither"
  23231. );
  23232. }
  23233. addList(result.plugins);
  23234. if (result.settings) {
  23235. namespace.settings = (0, import_extend.default)(true, namespace.settings, result.settings);
  23236. }
  23237. }
  23238. function addList(plugins) {
  23239. let index2 = -1;
  23240. if (plugins === null || plugins === void 0) {
  23241. } else if (Array.isArray(plugins)) {
  23242. while (++index2 < plugins.length) {
  23243. const thing = plugins[index2];
  23244. add(thing);
  23245. }
  23246. } else {
  23247. throw new TypeError("Expected a list of plugins, not `" + plugins + "`");
  23248. }
  23249. }
  23250. function addPlugin(plugin, parameters2) {
  23251. let index2 = -1;
  23252. let entryIndex = -1;
  23253. while (++index2 < attachers.length) {
  23254. if (attachers[index2][0] === plugin) {
  23255. entryIndex = index2;
  23256. break;
  23257. }
  23258. }
  23259. if (entryIndex === -1) {
  23260. attachers.push([plugin, ...parameters2]);
  23261. } else if (parameters2.length > 0) {
  23262. let [primary, ...rest] = parameters2;
  23263. const currentPrimary = attachers[entryIndex][1];
  23264. if (isPlainObject(currentPrimary) && isPlainObject(primary)) {
  23265. primary = (0, import_extend.default)(true, currentPrimary, primary);
  23266. }
  23267. attachers[entryIndex] = [plugin, primary, ...rest];
  23268. }
  23269. }
  23270. }
  23271. };
  23272. var unified = new Processor().freeze();
  23273. function assertParser(name2, value) {
  23274. if (typeof value !== "function") {
  23275. throw new TypeError("Cannot `" + name2 + "` without `parser`");
  23276. }
  23277. }
  23278. function assertCompiler(name2, value) {
  23279. if (typeof value !== "function") {
  23280. throw new TypeError("Cannot `" + name2 + "` without `compiler`");
  23281. }
  23282. }
  23283. function assertUnfrozen(name2, frozen) {
  23284. if (frozen) {
  23285. throw new Error(
  23286. "Cannot call `" + name2 + "` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`."
  23287. );
  23288. }
  23289. }
  23290. function assertNode(node2) {
  23291. if (!isPlainObject(node2) || typeof node2.type !== "string") {
  23292. throw new TypeError("Expected node, got `" + node2 + "`");
  23293. }
  23294. }
  23295. function assertDone(name2, asyncName, complete) {
  23296. if (!complete) {
  23297. throw new Error(
  23298. "`" + name2 + "` finished async. Use `" + asyncName + "` instead"
  23299. );
  23300. }
  23301. }
  23302. function vfile(value) {
  23303. return looksLikeAVFile2(value) ? value : new VFile2(value);
  23304. }
  23305. function looksLikeAVFile2(value) {
  23306. return Boolean(
  23307. value && typeof value === "object" && "message" in value && "messages" in value
  23308. );
  23309. }
  23310. function looksLikeAValue(value) {
  23311. return typeof value === "string" || isUint8Array3(value);
  23312. }
  23313. function isUint8Array3(value) {
  23314. return Boolean(
  23315. value && typeof value === "object" && "byteLength" in value && "byteOffset" in value
  23316. );
  23317. }
  23318. // node_modules/estree-walker/src/walker.js
  23319. var WalkerBase = class {
  23320. constructor() {
  23321. this.should_skip = false;
  23322. this.should_remove = false;
  23323. this.replacement = null;
  23324. this.context = {
  23325. skip: () => this.should_skip = true,
  23326. remove: () => this.should_remove = true,
  23327. replace: (node2) => this.replacement = node2
  23328. };
  23329. }
  23330. /**
  23331. * @template {Node} Parent
  23332. * @param {Parent | null | undefined} parent
  23333. * @param {keyof Parent | null | undefined} prop
  23334. * @param {number | null | undefined} index
  23335. * @param {Node} node
  23336. */
  23337. replace(parent, prop, index2, node2) {
  23338. if (parent && prop) {
  23339. if (index2 != null) {
  23340. parent[prop][index2] = node2;
  23341. } else {
  23342. parent[prop] = node2;
  23343. }
  23344. }
  23345. }
  23346. /**
  23347. * @template {Node} Parent
  23348. * @param {Parent | null | undefined} parent
  23349. * @param {keyof Parent | null | undefined} prop
  23350. * @param {number | null | undefined} index
  23351. */
  23352. remove(parent, prop, index2) {
  23353. if (parent && prop) {
  23354. if (index2 !== null && index2 !== void 0) {
  23355. parent[prop].splice(index2, 1);
  23356. } else {
  23357. delete parent[prop];
  23358. }
  23359. }
  23360. }
  23361. };
  23362. // node_modules/estree-walker/src/sync.js
  23363. var SyncWalker = class extends WalkerBase {
  23364. /**
  23365. *
  23366. * @param {SyncHandler} [enter]
  23367. * @param {SyncHandler} [leave]
  23368. */
  23369. constructor(enter, leave) {
  23370. super();
  23371. this.should_skip = false;
  23372. this.should_remove = false;
  23373. this.replacement = null;
  23374. this.context = {
  23375. skip: () => this.should_skip = true,
  23376. remove: () => this.should_remove = true,
  23377. replace: (node2) => this.replacement = node2
  23378. };
  23379. this.enter = enter;
  23380. this.leave = leave;
  23381. }
  23382. /**
  23383. * @template {Node} Parent
  23384. * @param {Node} node
  23385. * @param {Parent | null} parent
  23386. * @param {keyof Parent} [prop]
  23387. * @param {number | null} [index]
  23388. * @returns {Node | null}
  23389. */
  23390. visit(node2, parent, prop, index2) {
  23391. if (node2) {
  23392. if (this.enter) {
  23393. const _should_skip = this.should_skip;
  23394. const _should_remove = this.should_remove;
  23395. const _replacement = this.replacement;
  23396. this.should_skip = false;
  23397. this.should_remove = false;
  23398. this.replacement = null;
  23399. this.enter.call(this.context, node2, parent, prop, index2);
  23400. if (this.replacement) {
  23401. node2 = this.replacement;
  23402. this.replace(parent, prop, index2, node2);
  23403. }
  23404. if (this.should_remove) {
  23405. this.remove(parent, prop, index2);
  23406. }
  23407. const skipped = this.should_skip;
  23408. const removed = this.should_remove;
  23409. this.should_skip = _should_skip;
  23410. this.should_remove = _should_remove;
  23411. this.replacement = _replacement;
  23412. if (skipped) return node2;
  23413. if (removed) return null;
  23414. }
  23415. let key;
  23416. for (key in node2) {
  23417. const value = node2[key];
  23418. if (value && typeof value === "object") {
  23419. if (Array.isArray(value)) {
  23420. const nodes = (
  23421. /** @type {Array<unknown>} */
  23422. value
  23423. );
  23424. for (let i = 0; i < nodes.length; i += 1) {
  23425. const item = nodes[i];
  23426. if (isNode(item)) {
  23427. if (!this.visit(item, node2, key, i)) {
  23428. i--;
  23429. }
  23430. }
  23431. }
  23432. } else if (isNode(value)) {
  23433. this.visit(value, node2, key, null);
  23434. }
  23435. }
  23436. }
  23437. if (this.leave) {
  23438. const _replacement = this.replacement;
  23439. const _should_remove = this.should_remove;
  23440. this.replacement = null;
  23441. this.should_remove = false;
  23442. this.leave.call(this.context, node2, parent, prop, index2);
  23443. if (this.replacement) {
  23444. node2 = this.replacement;
  23445. this.replace(parent, prop, index2, node2);
  23446. }
  23447. if (this.should_remove) {
  23448. this.remove(parent, prop, index2);
  23449. }
  23450. const removed = this.should_remove;
  23451. this.replacement = _replacement;
  23452. this.should_remove = _should_remove;
  23453. if (removed) return null;
  23454. }
  23455. }
  23456. return node2;
  23457. }
  23458. };
  23459. function isNode(value) {
  23460. return value !== null && typeof value === "object" && "type" in value && typeof value.type === "string";
  23461. }
  23462. // node_modules/estree-walker/src/index.js
  23463. function walk(ast, { enter, leave }) {
  23464. const instance = new SyncWalker(enter, leave);
  23465. return instance.visit(ast, null);
  23466. }
  23467. // node_modules/periscopic/node_modules/is-reference/src/index.js
  23468. function is_reference(node2, parent) {
  23469. if (node2.type === "MemberExpression") {
  23470. return !node2.computed && is_reference(node2.object, node2);
  23471. }
  23472. if (node2.type === "Identifier") {
  23473. if (!parent) return true;
  23474. switch (parent.type) {
  23475. case "MemberExpression":
  23476. return parent.computed || node2 === parent.object;
  23477. case "MethodDefinition":
  23478. return parent.computed;
  23479. case "PropertyDefinition":
  23480. return parent.computed || node2 === parent.value;
  23481. case "Property":
  23482. return parent.computed || node2 === parent.value;
  23483. case "ExportSpecifier":
  23484. case "ImportSpecifier":
  23485. return node2 === parent.local;
  23486. case "LabeledStatement":
  23487. case "BreakStatement":
  23488. case "ContinueStatement":
  23489. return false;
  23490. default:
  23491. return true;
  23492. }
  23493. }
  23494. return false;
  23495. }
  23496. // node_modules/periscopic/src/index.js
  23497. function analyze(expression) {
  23498. const map = /* @__PURE__ */ new WeakMap();
  23499. const globals = /* @__PURE__ */ new Map();
  23500. const scope = new Scope3(null, false);
  23501. const references = [];
  23502. let current_scope = scope;
  23503. walk(expression, {
  23504. enter(node2, parent) {
  23505. switch (node2.type) {
  23506. case "Identifier":
  23507. if (parent && is_reference(node2, parent)) {
  23508. references.push([current_scope, node2]);
  23509. }
  23510. break;
  23511. case "ImportDeclaration":
  23512. node2.specifiers.forEach((specifier) => {
  23513. current_scope.declarations.set(specifier.local.name, specifier);
  23514. });
  23515. break;
  23516. case "FunctionExpression":
  23517. case "FunctionDeclaration":
  23518. case "ArrowFunctionExpression":
  23519. if (node2.type === "FunctionDeclaration") {
  23520. if (node2.id) {
  23521. current_scope.declarations.set(node2.id.name, node2);
  23522. }
  23523. map.set(node2, current_scope = new Scope3(current_scope, false));
  23524. } else {
  23525. map.set(node2, current_scope = new Scope3(current_scope, false));
  23526. if (node2.type === "FunctionExpression" && node2.id) {
  23527. current_scope.declarations.set(node2.id.name, node2);
  23528. }
  23529. }
  23530. node2.params.forEach((param) => {
  23531. extract_names(param).forEach((name2) => {
  23532. current_scope.declarations.set(name2, node2);
  23533. });
  23534. });
  23535. break;
  23536. case "ForStatement":
  23537. case "ForInStatement":
  23538. case "ForOfStatement":
  23539. map.set(node2, current_scope = new Scope3(current_scope, true));
  23540. break;
  23541. case "BlockStatement":
  23542. map.set(node2, current_scope = new Scope3(current_scope, true));
  23543. break;
  23544. case "ClassDeclaration":
  23545. case "VariableDeclaration":
  23546. current_scope.add_declaration(node2);
  23547. break;
  23548. case "CatchClause":
  23549. map.set(node2, current_scope = new Scope3(current_scope, true));
  23550. if (node2.param) {
  23551. extract_names(node2.param).forEach((name2) => {
  23552. if (node2.param) {
  23553. current_scope.declarations.set(name2, node2.param);
  23554. }
  23555. });
  23556. }
  23557. break;
  23558. }
  23559. },
  23560. leave(node2) {
  23561. if (map.has(node2) && current_scope !== null && current_scope.parent) {
  23562. current_scope = current_scope.parent;
  23563. }
  23564. }
  23565. });
  23566. for (let i = references.length - 1; i >= 0; --i) {
  23567. const [scope2, reference] = references[i];
  23568. if (!scope2.references.has(reference.name)) {
  23569. add_reference(scope2, reference.name);
  23570. }
  23571. if (!scope2.find_owner(reference.name)) {
  23572. globals.set(reference.name, reference);
  23573. }
  23574. }
  23575. return { map, scope, globals };
  23576. }
  23577. function add_reference(scope, name2) {
  23578. scope.references.add(name2);
  23579. if (scope.parent) add_reference(scope.parent, name2);
  23580. }
  23581. var Scope3 = class {
  23582. /**
  23583. * @param {Scope | null} parent
  23584. * @param {boolean} block
  23585. */
  23586. constructor(parent, block) {
  23587. this.parent = parent;
  23588. this.block = block;
  23589. this.declarations = /* @__PURE__ */ new Map();
  23590. this.initialised_declarations = /* @__PURE__ */ new Set();
  23591. this.references = /* @__PURE__ */ new Set();
  23592. }
  23593. /**
  23594. * @param {import('estree').VariableDeclaration | import('estree').ClassDeclaration} node
  23595. */
  23596. add_declaration(node2) {
  23597. if (node2.type === "VariableDeclaration") {
  23598. if (node2.kind === "var" && this.block && this.parent) {
  23599. this.parent.add_declaration(node2);
  23600. } else {
  23601. const handle_declarator = (declarator) => {
  23602. extract_names(declarator.id).forEach((name2) => {
  23603. this.declarations.set(name2, node2);
  23604. if (declarator.init) this.initialised_declarations.add(name2);
  23605. });
  23606. ;
  23607. };
  23608. node2.declarations.forEach(handle_declarator);
  23609. }
  23610. } else if (node2.id) {
  23611. this.declarations.set(node2.id.name, node2);
  23612. }
  23613. }
  23614. /**
  23615. * @param {string} name
  23616. * @returns {Scope | null}
  23617. */
  23618. find_owner(name2) {
  23619. if (this.declarations.has(name2)) return this;
  23620. return this.parent && this.parent.find_owner(name2);
  23621. }
  23622. /**
  23623. * @param {string} name
  23624. * @returns {boolean}
  23625. */
  23626. has(name2) {
  23627. return this.declarations.has(name2) || !!this.parent && this.parent.has(name2);
  23628. }
  23629. };
  23630. function extract_names(param) {
  23631. return extract_identifiers(param).map((node2) => node2.name);
  23632. }
  23633. function extract_identifiers(param, nodes = []) {
  23634. switch (param.type) {
  23635. case "Identifier":
  23636. nodes.push(param);
  23637. break;
  23638. case "MemberExpression":
  23639. let object = param;
  23640. while (object.type === "MemberExpression") {
  23641. object = /** @type {any} */
  23642. object.object;
  23643. }
  23644. nodes.push(
  23645. /** @type {any} */
  23646. object
  23647. );
  23648. break;
  23649. case "ObjectPattern":
  23650. const handle_prop = (prop) => {
  23651. if (prop.type === "RestElement") {
  23652. extract_identifiers(prop.argument, nodes);
  23653. } else {
  23654. extract_identifiers(prop.value, nodes);
  23655. }
  23656. };
  23657. param.properties.forEach(handle_prop);
  23658. break;
  23659. case "ArrayPattern":
  23660. const handle_element = (element2) => {
  23661. if (element2) extract_identifiers(element2, nodes);
  23662. };
  23663. param.elements.forEach((element2) => {
  23664. if (element2) {
  23665. handle_element(element2);
  23666. }
  23667. });
  23668. break;
  23669. case "RestElement":
  23670. extract_identifiers(param.argument, nodes);
  23671. break;
  23672. case "AssignmentPattern":
  23673. extract_identifiers(param.left, nodes);
  23674. break;
  23675. }
  23676. return nodes;
  23677. }
  23678. // node_modules/@mdx-js/mdx/lib/util/estree-util-create.js
  23679. function create(from, to) {
  23680. const fields = ["start", "end", "loc", "range", "comments"];
  23681. let index2 = -1;
  23682. while (++index2 < fields.length) {
  23683. const field = fields[index2];
  23684. if (field in from) {
  23685. to[field] = from[field];
  23686. }
  23687. }
  23688. }
  23689. // node_modules/@mdx-js/mdx/lib/util/estree-util-declaration-to-expression.js
  23690. function declarationToExpression(declaration) {
  23691. if (declaration.type === "FunctionDeclaration") {
  23692. return { ...declaration, type: "FunctionExpression" };
  23693. }
  23694. ok(declaration.type === "ClassDeclaration", "unexpected node type");
  23695. return { ...declaration, type: "ClassExpression" };
  23696. }
  23697. // node_modules/@mdx-js/mdx/lib/util/estree-util-is-declaration.js
  23698. function isDeclaration(node2) {
  23699. return Boolean(
  23700. node2.type === "FunctionDeclaration" || node2.type === "ClassDeclaration" || node2.type === "VariableDeclaration"
  23701. );
  23702. }
  23703. // node_modules/@mdx-js/mdx/lib/util/estree-util-specifiers-to-declarations.js
  23704. function specifiersToDeclarations(specifiers, init) {
  23705. let index2 = -1;
  23706. const declarations = [];
  23707. const otherSpecifiers = [];
  23708. let importNamespaceSpecifier;
  23709. while (++index2 < specifiers.length) {
  23710. const specifier = specifiers[index2];
  23711. if (specifier.type === "ImportNamespaceSpecifier") {
  23712. importNamespaceSpecifier = specifier;
  23713. } else {
  23714. otherSpecifiers.push(specifier);
  23715. }
  23716. }
  23717. if (importNamespaceSpecifier) {
  23718. const declarator = {
  23719. type: "VariableDeclarator",
  23720. id: importNamespaceSpecifier.local,
  23721. init
  23722. };
  23723. create(importNamespaceSpecifier, declarator);
  23724. declarations.push(declarator);
  23725. }
  23726. declarations.push({
  23727. type: "VariableDeclarator",
  23728. id: {
  23729. type: "ObjectPattern",
  23730. properties: otherSpecifiers.map(function(specifier) {
  23731. let key = specifier.type === "ImportSpecifier" ? specifier.imported : specifier.type === "ExportSpecifier" ? specifier.exported : { type: "Identifier", name: "default" };
  23732. let value = specifier.local;
  23733. if (specifier.type === "ExportSpecifier") {
  23734. value = key;
  23735. key = specifier.local;
  23736. }
  23737. const property = {
  23738. type: "Property",
  23739. kind: "init",
  23740. shorthand: key.name === value.name,
  23741. method: false,
  23742. computed: false,
  23743. key,
  23744. value
  23745. };
  23746. create(specifier, property);
  23747. return property;
  23748. })
  23749. },
  23750. init: importNamespaceSpecifier ? { type: "Identifier", name: importNamespaceSpecifier.local.name } : init
  23751. });
  23752. return declarations;
  23753. }
  23754. // node_modules/@mdx-js/mdx/lib/util/estree-util-to-id-or-member-expression.js
  23755. function toIdOrMemberExpression(ids) {
  23756. let index2 = -1;
  23757. let object;
  23758. while (++index2 < ids.length) {
  23759. const name2 = ids[index2];
  23760. const id = typeof name2 === "string" && name(name2) ? { type: "Identifier", name: name2 } : { type: "Literal", value: name2 };
  23761. object = object ? {
  23762. type: "MemberExpression",
  23763. object,
  23764. property: id,
  23765. computed: id.type === "Literal",
  23766. optional: false
  23767. } : id;
  23768. }
  23769. ok(object, "expected non-empty `ids` to be passed");
  23770. ok(object.type !== "Literal", "expected identifier as left-most value");
  23771. return object;
  23772. }
  23773. function toJsxIdOrMemberExpression(ids) {
  23774. let index2 = -1;
  23775. let object;
  23776. while (++index2 < ids.length) {
  23777. const name2 = ids[index2];
  23778. ok(
  23779. typeof name2 === "string" && name(name2, { jsx: true }),
  23780. "expected valid jsx identifier, not `" + name2 + "`"
  23781. );
  23782. const id = { type: "JSXIdentifier", name: name2 };
  23783. object = object ? { type: "JSXMemberExpression", object, property: id } : id;
  23784. }
  23785. ok(object, "expected non-empty `ids` to be passed");
  23786. return object;
  23787. }
  23788. // node_modules/@mdx-js/mdx/lib/plugin/recma-document.js
  23789. function recmaDocument(options) {
  23790. const baseUrl = options.baseUrl || void 0;
  23791. const baseHref = typeof baseUrl === "object" ? baseUrl.href : baseUrl;
  23792. const outputFormat = options.outputFormat || "program";
  23793. const pragma = options.pragma === void 0 ? "React.createElement" : options.pragma;
  23794. const pragmaFrag = options.pragmaFrag === void 0 ? "React.Fragment" : options.pragmaFrag;
  23795. const pragmaImportSource = options.pragmaImportSource || "react";
  23796. const jsxImportSource = options.jsxImportSource || "react";
  23797. const jsxRuntime = options.jsxRuntime || "automatic";
  23798. return function(tree, file) {
  23799. const exportedIdentifiers = [];
  23800. const replacement = [];
  23801. let exportAllCount = 0;
  23802. let layout;
  23803. let content3;
  23804. let child;
  23805. if (jsxRuntime === "classic" && pragmaFrag) {
  23806. injectPragma(tree, "@jsxFrag", pragmaFrag);
  23807. }
  23808. if (jsxRuntime === "classic" && pragma) {
  23809. injectPragma(tree, "@jsx", pragma);
  23810. }
  23811. if (jsxRuntime === "automatic" && jsxImportSource) {
  23812. injectPragma(tree, "@jsxImportSource", jsxImportSource);
  23813. }
  23814. if (jsxRuntime) {
  23815. injectPragma(tree, "@jsxRuntime", jsxRuntime);
  23816. }
  23817. if (jsxRuntime === "classic" && pragmaImportSource) {
  23818. if (!pragma) {
  23819. throw new Error(
  23820. "Missing `pragma` in classic runtime with `pragmaImportSource`"
  23821. );
  23822. }
  23823. handleEsm({
  23824. type: "ImportDeclaration",
  23825. specifiers: [
  23826. {
  23827. type: "ImportDefaultSpecifier",
  23828. local: { type: "Identifier", name: pragma.split(".")[0] }
  23829. }
  23830. ],
  23831. source: { type: "Literal", value: pragmaImportSource }
  23832. });
  23833. }
  23834. for (child of tree.body) {
  23835. if (child.type === "ExportDefaultDeclaration") {
  23836. if (layout) {
  23837. file.fail(
  23838. "Unexpected duplicate layout, expected a single layout (previous: " + stringifyPosition(positionFromEstree(layout)) + ")",
  23839. {
  23840. ancestors: [tree, child],
  23841. place: positionFromEstree(child),
  23842. ruleId: "duplicate-layout",
  23843. source: "recma-document"
  23844. }
  23845. );
  23846. }
  23847. layout = child;
  23848. replacement.push({
  23849. type: "VariableDeclaration",
  23850. kind: "const",
  23851. declarations: [
  23852. {
  23853. type: "VariableDeclarator",
  23854. id: { type: "Identifier", name: "MDXLayout" },
  23855. init: isDeclaration(child.declaration) ? declarationToExpression(child.declaration) : child.declaration
  23856. }
  23857. ]
  23858. });
  23859. } else if (child.type === "ExportNamedDeclaration" && child.source) {
  23860. const source = (
  23861. /** @type {SimpleLiteral} */
  23862. child.source
  23863. );
  23864. child.specifiers = child.specifiers.filter(function(specifier) {
  23865. if (specifier.exported.name === "default") {
  23866. if (layout) {
  23867. file.fail(
  23868. "Unexpected duplicate layout, expected a single layout (previous: " + stringifyPosition(positionFromEstree(layout)) + ")",
  23869. {
  23870. ancestors: [tree, child, specifier],
  23871. place: positionFromEstree(child),
  23872. ruleId: "duplicate-layout",
  23873. source: "recma-document"
  23874. }
  23875. );
  23876. }
  23877. layout = specifier;
  23878. const specifiers = [];
  23879. if (specifier.local.name === "default") {
  23880. specifiers.push({
  23881. type: "ImportDefaultSpecifier",
  23882. local: { type: "Identifier", name: "MDXLayout" }
  23883. });
  23884. } else {
  23885. const importSpecifier = {
  23886. type: "ImportSpecifier",
  23887. imported: specifier.local,
  23888. local: { type: "Identifier", name: "MDXLayout" }
  23889. };
  23890. create(specifier.local, importSpecifier);
  23891. specifiers.push(importSpecifier);
  23892. }
  23893. const from = { type: "Literal", value: source.value };
  23894. create(source, from);
  23895. const declaration = {
  23896. type: "ImportDeclaration",
  23897. specifiers,
  23898. source: from
  23899. };
  23900. create(specifier, declaration);
  23901. handleEsm(declaration);
  23902. return false;
  23903. }
  23904. return true;
  23905. });
  23906. if (child.specifiers.length > 0) {
  23907. handleExport(child);
  23908. }
  23909. } else if (child.type === "ExportNamedDeclaration" || child.type === "ExportAllDeclaration") {
  23910. handleExport(child);
  23911. } else if (child.type === "ImportDeclaration") {
  23912. handleEsm(child);
  23913. } else if (child.type === "ExpressionStatement" && (child.expression.type === "JSXElement" || // @ts-expect-error: `estree-jsx` does not register `JSXFragment` as an expression.
  23914. child.expression.type === "JSXFragment")) {
  23915. content3 = true;
  23916. replacement.push(
  23917. ...createMdxContent(child.expression, outputFormat, Boolean(layout))
  23918. );
  23919. } else {
  23920. replacement.push(child);
  23921. }
  23922. }
  23923. if (!content3) {
  23924. replacement.push(
  23925. ...createMdxContent(void 0, outputFormat, Boolean(layout))
  23926. );
  23927. }
  23928. exportedIdentifiers.push(["MDXContent", "default"]);
  23929. if (outputFormat === "function-body") {
  23930. replacement.push({
  23931. type: "ReturnStatement",
  23932. argument: {
  23933. type: "ObjectExpression",
  23934. properties: [
  23935. ...Array.from({ length: exportAllCount }).map(
  23936. /**
  23937. * @param {undefined} _
  23938. * Nothing.
  23939. * @param {number} index
  23940. * Index.
  23941. * @returns {SpreadElement}
  23942. * Node.
  23943. */
  23944. function(_, index2) {
  23945. return {
  23946. type: "SpreadElement",
  23947. argument: {
  23948. type: "Identifier",
  23949. name: "_exportAll" + (index2 + 1)
  23950. }
  23951. };
  23952. }
  23953. ),
  23954. ...exportedIdentifiers.map(function(d) {
  23955. const property = {
  23956. type: "Property",
  23957. kind: "init",
  23958. method: false,
  23959. computed: false,
  23960. shorthand: typeof d === "string",
  23961. key: {
  23962. type: "Identifier",
  23963. name: typeof d === "string" ? d : d[1]
  23964. },
  23965. value: {
  23966. type: "Identifier",
  23967. name: typeof d === "string" ? d : d[0]
  23968. }
  23969. };
  23970. return property;
  23971. })
  23972. ]
  23973. }
  23974. });
  23975. }
  23976. tree.body = replacement;
  23977. let usesImportMetaUrlVariable = false;
  23978. let usesResolveDynamicHelper = false;
  23979. if (baseHref || outputFormat === "function-body") {
  23980. walk(tree, {
  23981. enter(node2) {
  23982. if ((node2.type === "ExportAllDeclaration" || node2.type === "ExportNamedDeclaration" || node2.type === "ImportDeclaration") && node2.source) {
  23983. ok(baseHref, "unexpected missing `baseHref` in branch");
  23984. let value = node2.source.value;
  23985. ok(typeof value === "string", "expected string source");
  23986. try {
  23987. new URL(value);
  23988. } catch {
  23989. if (value.startsWith("/") || value.startsWith("./") || value.startsWith("../")) {
  23990. value = new URL(value, baseHref).href;
  23991. } else {
  23992. }
  23993. }
  23994. const replacement2 = { type: "Literal", value };
  23995. create(node2.source, replacement2);
  23996. node2.source = replacement2;
  23997. return;
  23998. }
  23999. if (node2.type === "ImportExpression") {
  24000. usesResolveDynamicHelper = true;
  24001. const replacement2 = {
  24002. type: "CallExpression",
  24003. callee: { type: "Identifier", name: "_resolveDynamicMdxSpecifier" },
  24004. arguments: [node2.source],
  24005. optional: false
  24006. };
  24007. node2.source = replacement2;
  24008. return;
  24009. }
  24010. if (node2.type === "MemberExpression" && "object" in node2 && node2.object.type === "MetaProperty" && node2.property.type === "Identifier" && node2.object.meta.name === "import" && node2.object.property.name === "meta" && node2.property.name === "url") {
  24011. usesImportMetaUrlVariable = true;
  24012. const replacement2 = { type: "Identifier", name: "_importMetaUrl" };
  24013. create(node2, replacement2);
  24014. this.replace(replacement2);
  24015. }
  24016. }
  24017. });
  24018. }
  24019. if (usesResolveDynamicHelper) {
  24020. if (!baseHref) {
  24021. usesImportMetaUrlVariable = true;
  24022. }
  24023. tree.body.push(
  24024. resolveDynamicMdxSpecifier(
  24025. baseHref ? { type: "Literal", value: baseHref } : { type: "Identifier", name: "_importMetaUrl" }
  24026. )
  24027. );
  24028. }
  24029. if (usesImportMetaUrlVariable) {
  24030. ok(
  24031. outputFormat === "function-body",
  24032. "expected `function-body` when using dynamic url injection"
  24033. );
  24034. tree.body.unshift(...createImportMetaUrlVariable());
  24035. }
  24036. function handleExport(node2) {
  24037. if (node2.type === "ExportNamedDeclaration") {
  24038. if (node2.declaration) {
  24039. exportedIdentifiers.push(
  24040. ...analyze(node2.declaration).scope.declarations.keys()
  24041. );
  24042. }
  24043. for (child of node2.specifiers) {
  24044. exportedIdentifiers.push(child.exported.name);
  24045. }
  24046. }
  24047. handleEsm(node2);
  24048. }
  24049. function handleEsm(node2) {
  24050. let replace;
  24051. let init;
  24052. if (outputFormat === "function-body") {
  24053. if (
  24054. // Always have a source:
  24055. node2.type === "ImportDeclaration" || node2.type === "ExportAllDeclaration" || // Source optional:
  24056. node2.type === "ExportNamedDeclaration" && node2.source
  24057. ) {
  24058. ok(node2.source, "expected `node.source` to be defined");
  24059. const argument = { type: "ImportExpression", source: node2.source };
  24060. create(node2, argument);
  24061. init = { type: "AwaitExpression", argument };
  24062. if ((node2.type === "ImportDeclaration" || node2.type === "ExportNamedDeclaration") && node2.specifiers.length === 0) {
  24063. replace = { type: "ExpressionStatement", expression: init };
  24064. } else {
  24065. replace = {
  24066. type: "VariableDeclaration",
  24067. kind: "const",
  24068. declarations: node2.type === "ExportAllDeclaration" ? [
  24069. {
  24070. type: "VariableDeclarator",
  24071. id: {
  24072. type: "Identifier",
  24073. name: "_exportAll" + ++exportAllCount
  24074. },
  24075. init
  24076. }
  24077. ] : specifiersToDeclarations(node2.specifiers, init)
  24078. };
  24079. }
  24080. } else if (node2.declaration) {
  24081. replace = node2.declaration;
  24082. } else {
  24083. const declarators = node2.specifiers.filter(function(specifier) {
  24084. return specifier.local.name !== specifier.exported.name;
  24085. }).map(function(specifier) {
  24086. return {
  24087. type: "VariableDeclarator",
  24088. id: specifier.exported,
  24089. init: specifier.local
  24090. };
  24091. });
  24092. if (declarators.length > 0) {
  24093. replace = {
  24094. type: "VariableDeclaration",
  24095. kind: "const",
  24096. declarations: declarators
  24097. };
  24098. }
  24099. }
  24100. } else {
  24101. replace = node2;
  24102. }
  24103. if (replace) {
  24104. replacement.push(replace);
  24105. }
  24106. }
  24107. };
  24108. function createMdxContent(content3, outputFormat2, hasInternalLayout) {
  24109. const element2 = {
  24110. type: "JSXElement",
  24111. openingElement: {
  24112. type: "JSXOpeningElement",
  24113. name: { type: "JSXIdentifier", name: "MDXLayout" },
  24114. attributes: [
  24115. {
  24116. type: "JSXSpreadAttribute",
  24117. argument: { type: "Identifier", name: "props" }
  24118. }
  24119. ],
  24120. selfClosing: false
  24121. },
  24122. closingElement: {
  24123. type: "JSXClosingElement",
  24124. name: { type: "JSXIdentifier", name: "MDXLayout" }
  24125. },
  24126. children: [
  24127. {
  24128. type: "JSXElement",
  24129. openingElement: {
  24130. type: "JSXOpeningElement",
  24131. name: { type: "JSXIdentifier", name: "_createMdxContent" },
  24132. attributes: [
  24133. {
  24134. type: "JSXSpreadAttribute",
  24135. argument: { type: "Identifier", name: "props" }
  24136. }
  24137. ],
  24138. selfClosing: true
  24139. },
  24140. closingElement: null,
  24141. children: []
  24142. }
  24143. ]
  24144. };
  24145. let result = (
  24146. /** @type {Expression} */
  24147. element2
  24148. );
  24149. if (!hasInternalLayout) {
  24150. result = {
  24151. type: "ConditionalExpression",
  24152. test: { type: "Identifier", name: "MDXLayout" },
  24153. consequent: result,
  24154. alternate: {
  24155. type: "CallExpression",
  24156. callee: { type: "Identifier", name: "_createMdxContent" },
  24157. arguments: [{ type: "Identifier", name: "props" }],
  24158. optional: false
  24159. }
  24160. };
  24161. }
  24162. let argument = (
  24163. // Cast because TS otherwise does not think `JSXFragment`s are expressions.
  24164. /** @type {Readonly<Expression> | Readonly<JSXFragment>} */
  24165. content3 || { type: "Identifier", name: "undefined" }
  24166. );
  24167. if (argument.type === "JSXFragment" && argument.children.length === 1 && argument.children[0].type === "JSXElement") {
  24168. argument = argument.children[0];
  24169. }
  24170. let awaitExpression = false;
  24171. walk(argument, {
  24172. enter(node2) {
  24173. if (node2.type === "ArrowFunctionExpression" || node2.type === "FunctionDeclaration" || node2.type === "FunctionExpression") {
  24174. return this.skip();
  24175. }
  24176. if (node2.type === "AwaitExpression" || /* c8 ignore next 2 -- can only occur in a function (which then can
  24177. * only be async, so skipped it) */
  24178. node2.type === "ForOfStatement" && node2.await) {
  24179. awaitExpression = true;
  24180. }
  24181. }
  24182. });
  24183. const declaration = {
  24184. type: "FunctionDeclaration",
  24185. id: { type: "Identifier", name: "MDXContent" },
  24186. params: [
  24187. {
  24188. type: "AssignmentPattern",
  24189. left: { type: "Identifier", name: "props" },
  24190. right: { type: "ObjectExpression", properties: [] }
  24191. }
  24192. ],
  24193. body: {
  24194. type: "BlockStatement",
  24195. body: [{ type: "ReturnStatement", argument: result }]
  24196. }
  24197. };
  24198. return [
  24199. {
  24200. type: "FunctionDeclaration",
  24201. async: awaitExpression,
  24202. id: { type: "Identifier", name: "_createMdxContent" },
  24203. params: [{ type: "Identifier", name: "props" }],
  24204. body: {
  24205. type: "BlockStatement",
  24206. body: [
  24207. {
  24208. type: "ReturnStatement",
  24209. // Cast because TS doesn’t think `JSXFragment` is an expression.
  24210. // eslint-disable-next-line object-shorthand
  24211. argument: (
  24212. /** @type {Expression} */
  24213. argument
  24214. )
  24215. }
  24216. ]
  24217. }
  24218. },
  24219. outputFormat2 === "program" ? { type: "ExportDefaultDeclaration", declaration } : declaration
  24220. ];
  24221. }
  24222. }
  24223. function injectPragma(tree, name2, value) {
  24224. tree.comments?.unshift({
  24225. type: "Block",
  24226. value: name2 + " " + value,
  24227. data: { _mdxIsPragmaComment: true }
  24228. });
  24229. }
  24230. function resolveDynamicMdxSpecifier(importMetaUrl) {
  24231. return {
  24232. type: "FunctionDeclaration",
  24233. id: { type: "Identifier", name: "_resolveDynamicMdxSpecifier" },
  24234. generator: false,
  24235. async: false,
  24236. params: [{ type: "Identifier", name: "d" }],
  24237. body: {
  24238. type: "BlockStatement",
  24239. body: [
  24240. {
  24241. type: "IfStatement",
  24242. test: {
  24243. type: "BinaryExpression",
  24244. left: {
  24245. type: "UnaryExpression",
  24246. operator: "typeof",
  24247. prefix: true,
  24248. argument: { type: "Identifier", name: "d" }
  24249. },
  24250. operator: "!==",
  24251. right: { type: "Literal", value: "string" }
  24252. },
  24253. consequent: {
  24254. type: "ReturnStatement",
  24255. argument: { type: "Identifier", name: "d" }
  24256. },
  24257. alternate: null
  24258. },
  24259. // To do: use `URL.canParse` when widely supported (see commented
  24260. // out code below).
  24261. {
  24262. type: "TryStatement",
  24263. block: {
  24264. type: "BlockStatement",
  24265. body: [
  24266. {
  24267. type: "ExpressionStatement",
  24268. expression: {
  24269. type: "NewExpression",
  24270. callee: { type: "Identifier", name: "URL" },
  24271. arguments: [{ type: "Identifier", name: "d" }]
  24272. }
  24273. },
  24274. {
  24275. type: "ReturnStatement",
  24276. argument: { type: "Identifier", name: "d" }
  24277. }
  24278. ]
  24279. },
  24280. handler: {
  24281. type: "CatchClause",
  24282. param: null,
  24283. body: { type: "BlockStatement", body: [] }
  24284. },
  24285. finalizer: null
  24286. },
  24287. // To do: use `URL.canParse` when widely supported.
  24288. // {
  24289. // type: 'IfStatement',
  24290. // test: {
  24291. // type: 'CallExpression',
  24292. // callee: toIdOrMemberExpression(['URL', 'canParse']),
  24293. // arguments: [{type: 'Identifier', name: 'd'}],
  24294. // optional: false
  24295. // },
  24296. // consequent: {
  24297. // type: 'ReturnStatement',
  24298. // argument: {type: 'Identifier', name: 'd'}
  24299. // },
  24300. // alternate: null
  24301. // },
  24302. {
  24303. type: "IfStatement",
  24304. test: {
  24305. type: "LogicalExpression",
  24306. left: {
  24307. type: "LogicalExpression",
  24308. left: {
  24309. type: "CallExpression",
  24310. callee: toIdOrMemberExpression(["d", "startsWith"]),
  24311. arguments: [{ type: "Literal", value: "/" }],
  24312. optional: false
  24313. },
  24314. operator: "||",
  24315. right: {
  24316. type: "CallExpression",
  24317. callee: toIdOrMemberExpression(["d", "startsWith"]),
  24318. arguments: [{ type: "Literal", value: "./" }],
  24319. optional: false
  24320. }
  24321. },
  24322. operator: "||",
  24323. right: {
  24324. type: "CallExpression",
  24325. callee: toIdOrMemberExpression(["d", "startsWith"]),
  24326. arguments: [{ type: "Literal", value: "../" }],
  24327. optional: false
  24328. }
  24329. },
  24330. consequent: {
  24331. type: "ReturnStatement",
  24332. argument: {
  24333. type: "MemberExpression",
  24334. object: {
  24335. type: "NewExpression",
  24336. callee: { type: "Identifier", name: "URL" },
  24337. arguments: [{ type: "Identifier", name: "d" }, importMetaUrl]
  24338. },
  24339. property: { type: "Identifier", name: "href" },
  24340. computed: false,
  24341. optional: false
  24342. }
  24343. },
  24344. alternate: null
  24345. },
  24346. {
  24347. type: "ReturnStatement",
  24348. argument: { type: "Identifier", name: "d" }
  24349. }
  24350. ]
  24351. }
  24352. };
  24353. }
  24354. function createImportMetaUrlVariable() {
  24355. return [
  24356. {
  24357. type: "VariableDeclaration",
  24358. declarations: [
  24359. {
  24360. type: "VariableDeclarator",
  24361. id: { type: "Identifier", name: "_importMetaUrl" },
  24362. init: toIdOrMemberExpression(["arguments", 0, "baseUrl"])
  24363. }
  24364. ],
  24365. kind: "const"
  24366. },
  24367. {
  24368. type: "IfStatement",
  24369. test: {
  24370. type: "UnaryExpression",
  24371. operator: "!",
  24372. prefix: true,
  24373. argument: { type: "Identifier", name: "_importMetaUrl" }
  24374. },
  24375. consequent: {
  24376. type: "ThrowStatement",
  24377. argument: {
  24378. type: "NewExpression",
  24379. callee: { type: "Identifier", name: "Error" },
  24380. arguments: [
  24381. {
  24382. type: "Literal",
  24383. value: "Unexpected missing `options.baseUrl` needed to support `export \u2026 from`, `import`, or `import.meta.url` when generating `function-body`"
  24384. }
  24385. ]
  24386. }
  24387. },
  24388. alternate: null
  24389. }
  24390. ];
  24391. }
  24392. // node_modules/estree-util-build-jsx/lib/index.js
  24393. var regex = /@(jsx|jsxFrag|jsxImportSource|jsxRuntime)\s+(\S+)/g;
  24394. function buildJsx(tree, options) {
  24395. const config = options || {};
  24396. let automatic = config.runtime === "automatic";
  24397. const annotations = {};
  24398. const imports = {};
  24399. walk(tree, {
  24400. enter(node2) {
  24401. if (node2.type === "Program") {
  24402. const comments = node2.comments || [];
  24403. let index2 = -1;
  24404. while (++index2 < comments.length) {
  24405. regex.lastIndex = 0;
  24406. let match = regex.exec(comments[index2].value);
  24407. while (match) {
  24408. annotations[match[1]] = match[2];
  24409. match = regex.exec(comments[index2].value);
  24410. }
  24411. }
  24412. if (annotations.jsxRuntime) {
  24413. if (annotations.jsxRuntime === "automatic") {
  24414. automatic = true;
  24415. if (annotations.jsx) {
  24416. throw new Error("Unexpected `@jsx` pragma w/ automatic runtime");
  24417. }
  24418. if (annotations.jsxFrag) {
  24419. throw new Error(
  24420. "Unexpected `@jsxFrag` pragma w/ automatic runtime"
  24421. );
  24422. }
  24423. } else if (annotations.jsxRuntime === "classic") {
  24424. automatic = false;
  24425. if (annotations.jsxImportSource) {
  24426. throw new Error(
  24427. "Unexpected `@jsxImportSource` w/ classic runtime"
  24428. );
  24429. }
  24430. } else {
  24431. throw new Error(
  24432. "Unexpected `jsxRuntime` `" + annotations.jsxRuntime + "`, expected `automatic` or `classic`"
  24433. );
  24434. }
  24435. }
  24436. }
  24437. },
  24438. // eslint-disable-next-line complexity
  24439. leave(node2) {
  24440. if (node2.type === "Program") {
  24441. const specifiers = [];
  24442. if (imports.fragment) {
  24443. specifiers.push({
  24444. type: "ImportSpecifier",
  24445. imported: { type: "Identifier", name: "Fragment" },
  24446. local: { type: "Identifier", name: "_Fragment" }
  24447. });
  24448. }
  24449. if (imports.jsx) {
  24450. specifiers.push({
  24451. type: "ImportSpecifier",
  24452. imported: { type: "Identifier", name: "jsx" },
  24453. local: { type: "Identifier", name: "_jsx" }
  24454. });
  24455. }
  24456. if (imports.jsxs) {
  24457. specifiers.push({
  24458. type: "ImportSpecifier",
  24459. imported: { type: "Identifier", name: "jsxs" },
  24460. local: { type: "Identifier", name: "_jsxs" }
  24461. });
  24462. }
  24463. if (imports.jsxDEV) {
  24464. specifiers.push({
  24465. type: "ImportSpecifier",
  24466. imported: { type: "Identifier", name: "jsxDEV" },
  24467. local: { type: "Identifier", name: "_jsxDEV" }
  24468. });
  24469. }
  24470. if (specifiers.length > 0) {
  24471. let injectIndex = 0;
  24472. while (injectIndex < node2.body.length) {
  24473. const child = node2.body[injectIndex];
  24474. if ("directive" in child && child.directive) {
  24475. injectIndex++;
  24476. } else {
  24477. break;
  24478. }
  24479. }
  24480. node2.body.splice(injectIndex, 0, {
  24481. type: "ImportDeclaration",
  24482. specifiers,
  24483. source: {
  24484. type: "Literal",
  24485. value: (annotations.jsxImportSource || config.importSource || "react") + (config.development ? "/jsx-dev-runtime" : "/jsx-runtime")
  24486. }
  24487. });
  24488. }
  24489. }
  24490. if (node2.type !== "JSXElement" && node2.type !== "JSXFragment") {
  24491. return;
  24492. }
  24493. const children = [];
  24494. let index2 = -1;
  24495. while (++index2 < node2.children.length) {
  24496. const child = node2.children[index2];
  24497. if (child.type === "JSXExpressionContainer") {
  24498. if (child.expression.type !== "JSXEmptyExpression") {
  24499. children.push(child.expression);
  24500. }
  24501. } else if (child.type === "JSXText") {
  24502. const value = child.value.replace(/\t/g, " ").replace(/ *(\r?\n|\r) */g, "\n").replace(/\n+/g, "\n").replace(/\n+$/, "").replace(/^\n+/, "").replace(/\n/g, " ");
  24503. if (value) {
  24504. const text5 = { type: "Literal", value };
  24505. create2(child, text5);
  24506. children.push(text5);
  24507. }
  24508. } else {
  24509. ok(
  24510. child.type !== "JSXElement" && child.type !== "JSXFragment" && child.type !== "JSXSpreadChild"
  24511. );
  24512. children.push(child);
  24513. }
  24514. }
  24515. let name2;
  24516. const fields = [];
  24517. let parameters = [];
  24518. let key;
  24519. if (node2.type === "JSXElement") {
  24520. name2 = toIdentifier(node2.openingElement.name);
  24521. if (name2.type === "Identifier" && /^[a-z]/.test(name2.name)) {
  24522. const next = { type: "Literal", value: name2.name };
  24523. create2(name2, next);
  24524. name2 = next;
  24525. }
  24526. let spread;
  24527. const attributes = node2.openingElement.attributes;
  24528. let index3 = -1;
  24529. while (++index3 < attributes.length) {
  24530. const attribute = attributes[index3];
  24531. if (attribute.type === "JSXSpreadAttribute") {
  24532. if (attribute.argument.type === "ObjectExpression") {
  24533. fields.push(...attribute.argument.properties);
  24534. } else {
  24535. fields.push({ type: "SpreadElement", argument: attribute.argument });
  24536. }
  24537. spread = true;
  24538. } else {
  24539. const prop = toProperty(attribute);
  24540. if (automatic && prop.key.type === "Identifier" && prop.key.name === "key") {
  24541. if (spread) {
  24542. throw new Error(
  24543. "Expected `key` to come before any spread expressions"
  24544. );
  24545. }
  24546. const value = prop.value;
  24547. ok(
  24548. value.type !== "AssignmentPattern" && value.type !== "ArrayPattern" && value.type !== "ObjectPattern" && value.type !== "RestElement"
  24549. );
  24550. key = value;
  24551. } else {
  24552. fields.push(prop);
  24553. }
  24554. }
  24555. }
  24556. } else if (automatic) {
  24557. imports.fragment = true;
  24558. name2 = { type: "Identifier", name: "_Fragment" };
  24559. } else {
  24560. name2 = toMemberExpression(
  24561. annotations.jsxFrag || config.pragmaFrag || "React.Fragment"
  24562. );
  24563. }
  24564. if (automatic) {
  24565. if (children.length > 0) {
  24566. fields.push({
  24567. type: "Property",
  24568. key: { type: "Identifier", name: "children" },
  24569. value: children.length > 1 ? { type: "ArrayExpression", elements: children } : children[0],
  24570. kind: "init",
  24571. method: false,
  24572. shorthand: false,
  24573. computed: false
  24574. });
  24575. }
  24576. } else {
  24577. parameters = children;
  24578. }
  24579. let callee;
  24580. if (automatic) {
  24581. parameters.push({ type: "ObjectExpression", properties: fields });
  24582. if (key) {
  24583. parameters.push(key);
  24584. } else if (config.development) {
  24585. parameters.push({ type: "Identifier", name: "undefined" });
  24586. }
  24587. const isStaticChildren = children.length > 1;
  24588. if (config.development) {
  24589. imports.jsxDEV = true;
  24590. callee = {
  24591. type: "Identifier",
  24592. name: "_jsxDEV"
  24593. };
  24594. parameters.push({ type: "Literal", value: isStaticChildren });
  24595. const source = {
  24596. type: "ObjectExpression",
  24597. properties: [
  24598. {
  24599. type: "Property",
  24600. method: false,
  24601. shorthand: false,
  24602. computed: false,
  24603. kind: "init",
  24604. key: { type: "Identifier", name: "fileName" },
  24605. value: {
  24606. type: "Literal",
  24607. value: config.filePath || "<source.js>"
  24608. }
  24609. }
  24610. ]
  24611. };
  24612. if (node2.loc) {
  24613. source.properties.push(
  24614. {
  24615. type: "Property",
  24616. method: false,
  24617. shorthand: false,
  24618. computed: false,
  24619. kind: "init",
  24620. key: { type: "Identifier", name: "lineNumber" },
  24621. value: { type: "Literal", value: node2.loc.start.line }
  24622. },
  24623. {
  24624. type: "Property",
  24625. method: false,
  24626. shorthand: false,
  24627. computed: false,
  24628. kind: "init",
  24629. key: { type: "Identifier", name: "columnNumber" },
  24630. value: { type: "Literal", value: node2.loc.start.column + 1 }
  24631. }
  24632. );
  24633. }
  24634. parameters.push(source, { type: "ThisExpression" });
  24635. } else if (isStaticChildren) {
  24636. imports.jsxs = true;
  24637. callee = { type: "Identifier", name: "_jsxs" };
  24638. } else {
  24639. imports.jsx = true;
  24640. callee = { type: "Identifier", name: "_jsx" };
  24641. }
  24642. } else {
  24643. if (fields.length > 0) {
  24644. parameters.unshift({ type: "ObjectExpression", properties: fields });
  24645. } else if (parameters.length > 0) {
  24646. parameters.unshift({ type: "Literal", value: null });
  24647. }
  24648. callee = toMemberExpression(
  24649. annotations.jsx || config.pragma || "React.createElement"
  24650. );
  24651. }
  24652. parameters.unshift(name2);
  24653. const call = {
  24654. type: "CallExpression",
  24655. callee,
  24656. arguments: parameters,
  24657. optional: false
  24658. };
  24659. create2(node2, call);
  24660. this.replace(call);
  24661. }
  24662. });
  24663. }
  24664. function toProperty(node2) {
  24665. let value;
  24666. if (node2.value) {
  24667. if (node2.value.type === "JSXExpressionContainer") {
  24668. const valueExpression = node2.value.expression;
  24669. ok(
  24670. valueExpression.type !== "JSXEmptyExpression",
  24671. "`JSXEmptyExpression` is not allowed in props."
  24672. );
  24673. value = valueExpression;
  24674. } else {
  24675. const nodeValue = node2.value;
  24676. ok(
  24677. nodeValue.type !== "JSXElement" && nodeValue.type !== "JSXFragment",
  24678. "JSX{Element,Fragment} are already compiled to `CallExpression`"
  24679. );
  24680. value = nodeValue;
  24681. delete value.raw;
  24682. }
  24683. } else {
  24684. value = { type: "Literal", value: true };
  24685. }
  24686. const replacement = {
  24687. type: "Property",
  24688. key: toIdentifier(node2.name),
  24689. value,
  24690. kind: "init",
  24691. method: false,
  24692. shorthand: false,
  24693. computed: false
  24694. };
  24695. create2(node2, replacement);
  24696. return replacement;
  24697. }
  24698. function toIdentifier(node2) {
  24699. let replace;
  24700. if (node2.type === "JSXMemberExpression") {
  24701. const id = toIdentifier(node2.property);
  24702. replace = {
  24703. type: "MemberExpression",
  24704. object: toIdentifier(node2.object),
  24705. property: id,
  24706. computed: id.type === "Literal",
  24707. optional: false
  24708. };
  24709. } else if (node2.type === "JSXNamespacedName") {
  24710. replace = {
  24711. type: "Literal",
  24712. value: node2.namespace.name + ":" + node2.name.name
  24713. };
  24714. } else {
  24715. replace = name(node2.name) ? { type: "Identifier", name: node2.name } : { type: "Literal", value: node2.name };
  24716. }
  24717. create2(node2, replace);
  24718. return replace;
  24719. }
  24720. function toMemberExpression(id) {
  24721. const identifiers = id.split(".");
  24722. let index2 = -1;
  24723. let result;
  24724. while (++index2 < identifiers.length) {
  24725. const prop = name(identifiers[index2]) ? { type: "Identifier", name: identifiers[index2] } : { type: "Literal", value: identifiers[index2] };
  24726. result = result ? {
  24727. type: "MemberExpression",
  24728. object: result,
  24729. property: prop,
  24730. computed: Boolean(index2 && prop.type === "Literal"),
  24731. optional: false
  24732. } : prop;
  24733. }
  24734. ok(result, "always a result");
  24735. return result;
  24736. }
  24737. function create2(from, to) {
  24738. const fields = ["start", "end", "loc", "range", "comments"];
  24739. let index2 = -1;
  24740. while (++index2 < fields.length) {
  24741. const field = fields[index2];
  24742. if (field in from) {
  24743. to[field] = from[field];
  24744. }
  24745. }
  24746. }
  24747. // node_modules/@mdx-js/mdx/lib/plugin/recma-jsx-build.js
  24748. function recmaJsxBuild(options) {
  24749. const { development, outputFormat } = options || {};
  24750. return function(tree, file) {
  24751. buildJsx(tree, { development, filePath: file.history[0] });
  24752. if (tree.comments) {
  24753. tree.comments = tree.comments.filter(function(d) {
  24754. return !d.data?._mdxIsPragmaComment;
  24755. });
  24756. }
  24757. if (outputFormat === "function-body") {
  24758. let index2 = 0;
  24759. while (index2 < tree.body.length) {
  24760. const child = tree.body[index2];
  24761. if ("directive" in child && child.directive) {
  24762. index2++;
  24763. } else {
  24764. break;
  24765. }
  24766. }
  24767. const declaration = tree.body[index2];
  24768. if (declaration && declaration.type === "ImportDeclaration" && typeof declaration.source.value === "string" && /\/jsx-(dev-)?runtime$/.test(declaration.source.value)) {
  24769. tree.body[index2] = {
  24770. type: "VariableDeclaration",
  24771. kind: "const",
  24772. declarations: specifiersToDeclarations(
  24773. declaration.specifiers,
  24774. toIdOrMemberExpression(["arguments", 0])
  24775. )
  24776. };
  24777. }
  24778. }
  24779. };
  24780. }
  24781. // node_modules/@mdx-js/mdx/lib/util/estree-util-to-binary-addition.js
  24782. function toBinaryAddition(expressions) {
  24783. let index2 = -1;
  24784. let left;
  24785. while (++index2 < expressions.length) {
  24786. const right = expressions[index2];
  24787. left = left ? { type: "BinaryExpression", left, operator: "+", right } : right;
  24788. }
  24789. ok(left, "expected non-empty `expressions` to be passed");
  24790. return left;
  24791. }
  24792. // node_modules/@mdx-js/mdx/lib/plugin/recma-jsx-rewrite.js
  24793. function recmaJsxRewrite(options) {
  24794. const { development, outputFormat, providerImportSource } = options;
  24795. return function(tree, file) {
  24796. const scopeInfo = analyze(tree);
  24797. const functionStack = [];
  24798. let importProvider = false;
  24799. let createErrorHelper = false;
  24800. let currentScope;
  24801. walk(tree, {
  24802. enter(node2) {
  24803. const newScope = (
  24804. /** @type {Scope | undefined} */
  24805. scopeInfo.map.get(node2)
  24806. );
  24807. if (node2.type === "FunctionDeclaration" || node2.type === "FunctionExpression" || node2.type === "ArrowFunctionExpression") {
  24808. functionStack.push({
  24809. components: [],
  24810. idToInvalidComponentName: /* @__PURE__ */ new Map(),
  24811. node: node2,
  24812. objects: [],
  24813. references: {},
  24814. tags: []
  24815. });
  24816. if (isNamedFunction(node2, "MDXContent") && newScope && !inScope(newScope, "MDXLayout")) {
  24817. functionStack[0].components.push("MDXLayout");
  24818. }
  24819. }
  24820. const functionScope = functionStack[0];
  24821. if (!functionScope || !isNamedFunction(functionScope.node, "_createMdxContent") && !providerImportSource) {
  24822. return;
  24823. }
  24824. if (newScope) {
  24825. newScope.node = node2;
  24826. currentScope = newScope;
  24827. }
  24828. if (currentScope && node2.type === "JSXElement") {
  24829. let name2 = node2.openingElement.name;
  24830. if (name2.type === "JSXMemberExpression") {
  24831. const ids = [];
  24832. while (name2.type === "JSXMemberExpression") {
  24833. ids.unshift(name2.property.name);
  24834. name2 = name2.object;
  24835. }
  24836. ids.unshift(name2.name);
  24837. const fullId = ids.join(".");
  24838. const id = name2.name;
  24839. const isInScope = inScope(currentScope, id);
  24840. if (!Object.hasOwn(functionScope.references, fullId)) {
  24841. const parentScope = (
  24842. /** @type {Scope | undefined} */
  24843. currentScope.parent
  24844. );
  24845. if (!isInScope || // If the parent scope is `_createMdxContent`, then this
  24846. // references a component we can add a check statement for.
  24847. parentScope && parentScope.node.type === "FunctionDeclaration" && isNamedFunction(parentScope.node, "_createMdxContent")) {
  24848. functionScope.references[fullId] = { component: true, node: node2 };
  24849. }
  24850. }
  24851. if (!functionScope.objects.includes(id) && !isInScope) {
  24852. functionScope.objects.push(id);
  24853. }
  24854. } else if (name2.type === "JSXNamespacedName") {
  24855. } else if (name(name2.name) && !/^[a-z]/.test(name2.name)) {
  24856. const id = name2.name;
  24857. if (!inScope(currentScope, id)) {
  24858. if (id !== "MDXLayout" && !Object.hasOwn(functionScope.references, id)) {
  24859. functionScope.references[id] = { component: true, node: node2 };
  24860. }
  24861. if (!functionScope.components.includes(id)) {
  24862. functionScope.components.push(id);
  24863. }
  24864. }
  24865. } else if (node2.data && node2.data._mdxExplicitJsx) {
  24866. } else {
  24867. const id = name2.name;
  24868. if (!functionScope.tags.includes(id)) {
  24869. functionScope.tags.push(id);
  24870. }
  24871. let jsxIdExpression = ["_components", id];
  24872. if (name(id) === false) {
  24873. let invalidComponentName = functionScope.idToInvalidComponentName.get(id);
  24874. if (invalidComponentName === void 0) {
  24875. invalidComponentName = `_component${functionScope.idToInvalidComponentName.size}`;
  24876. functionScope.idToInvalidComponentName.set(
  24877. id,
  24878. invalidComponentName
  24879. );
  24880. }
  24881. jsxIdExpression = [invalidComponentName];
  24882. }
  24883. node2.openingElement.name = toJsxIdOrMemberExpression(jsxIdExpression);
  24884. if (node2.closingElement) {
  24885. node2.closingElement.name = toJsxIdOrMemberExpression(jsxIdExpression);
  24886. }
  24887. }
  24888. }
  24889. },
  24890. leave(node2) {
  24891. const defaults = [];
  24892. const actual = [];
  24893. const parameters = [];
  24894. const declarations = [];
  24895. if (currentScope && currentScope.node === node2) {
  24896. currentScope = /** @type {Scope} */
  24897. currentScope.parent;
  24898. }
  24899. if (node2.type === "FunctionDeclaration" || node2.type === "FunctionExpression" || node2.type === "ArrowFunctionExpression") {
  24900. const scopeNode = node2;
  24901. const scope = functionStack[functionStack.length - 1];
  24902. let name2;
  24903. for (name2 of scope.tags.sort()) {
  24904. defaults.push({
  24905. type: "Property",
  24906. kind: "init",
  24907. key: name(name2) ? { type: "Identifier", name: name2 } : { type: "Literal", value: name2 },
  24908. value: { type: "Literal", value: name2 },
  24909. method: false,
  24910. shorthand: false,
  24911. computed: false
  24912. });
  24913. }
  24914. actual.push(...scope.components);
  24915. for (name2 of scope.objects) {
  24916. if (!actual.includes(name2)) {
  24917. actual.push(name2);
  24918. }
  24919. }
  24920. actual.sort();
  24921. const statements = [];
  24922. if (defaults.length > 0 || actual.length > 0 || scope.idToInvalidComponentName.size > 0) {
  24923. if (providerImportSource) {
  24924. importProvider = true;
  24925. parameters.push({
  24926. type: "CallExpression",
  24927. callee: { type: "Identifier", name: "_provideComponents" },
  24928. arguments: [],
  24929. optional: false
  24930. });
  24931. }
  24932. if (isNamedFunction(scope.node, "MDXContent") || isNamedFunction(scope.node, "_createMdxContent")) {
  24933. parameters.push(toIdOrMemberExpression(["props", "components"]));
  24934. }
  24935. if (defaults.length > 0 || parameters.length > 1) {
  24936. for (const parameter of parameters) {
  24937. defaults.push({ type: "SpreadElement", argument: parameter });
  24938. }
  24939. }
  24940. let componentsInit = defaults.length > 0 ? { type: "ObjectExpression", properties: defaults } : (
  24941. // If we’re only getting components from `props.components`,
  24942. // make sure it’s defined.
  24943. {
  24944. type: "LogicalExpression",
  24945. operator: "||",
  24946. left: parameters[0],
  24947. right: { type: "ObjectExpression", properties: [] }
  24948. }
  24949. );
  24950. let componentsPattern;
  24951. if (actual.length > 0) {
  24952. componentsPattern = {
  24953. type: "ObjectPattern",
  24954. properties: actual.map(function(name3) {
  24955. return {
  24956. type: "Property",
  24957. kind: "init",
  24958. key: {
  24959. type: "Identifier",
  24960. name: name3 === "MDXLayout" ? "wrapper" : name3
  24961. },
  24962. value: { type: "Identifier", name: name3 },
  24963. method: false,
  24964. shorthand: name3 !== "MDXLayout",
  24965. computed: false
  24966. };
  24967. })
  24968. };
  24969. }
  24970. if (scope.tags.length > 0) {
  24971. declarations.push({
  24972. type: "VariableDeclarator",
  24973. id: { type: "Identifier", name: "_components" },
  24974. init: componentsInit
  24975. });
  24976. componentsInit = { type: "Identifier", name: "_components" };
  24977. }
  24978. if (isNamedFunction(scope.node, "_createMdxContent")) {
  24979. for (const [id, componentName] of [
  24980. ...scope.idToInvalidComponentName
  24981. ].sort(function([a], [b]) {
  24982. return a.localeCompare(b);
  24983. })) {
  24984. declarations.push({
  24985. type: "VariableDeclarator",
  24986. id: {
  24987. type: "Identifier",
  24988. name: componentName
  24989. },
  24990. init: {
  24991. type: "MemberExpression",
  24992. object: { type: "Identifier", name: "_components" },
  24993. property: { type: "Literal", value: id },
  24994. computed: true,
  24995. optional: false
  24996. }
  24997. });
  24998. }
  24999. }
  25000. if (componentsPattern) {
  25001. declarations.push({
  25002. type: "VariableDeclarator",
  25003. id: componentsPattern,
  25004. init: componentsInit
  25005. });
  25006. }
  25007. if (declarations.length > 0) {
  25008. statements.push({
  25009. type: "VariableDeclaration",
  25010. kind: "const",
  25011. declarations
  25012. });
  25013. }
  25014. }
  25015. let key;
  25016. for (key in scope.references) {
  25017. if (Object.hasOwn(scope.references, key)) {
  25018. const parts = key.split(".");
  25019. let index3 = 0;
  25020. while (++index3 < parts.length) {
  25021. const partial = parts.slice(0, index3).join(".");
  25022. if (!Object.hasOwn(scope.references, partial)) {
  25023. scope.references[partial] = {
  25024. component: false,
  25025. node: scope.references[key].node
  25026. };
  25027. }
  25028. }
  25029. }
  25030. }
  25031. const references = Object.keys(scope.references).sort();
  25032. let index2 = -1;
  25033. while (++index2 < references.length) {
  25034. const id = references[index2];
  25035. const info = scope.references[id];
  25036. const place = stringifyPosition(positionFromEstree(info.node));
  25037. const parameters2 = [
  25038. { type: "Literal", value: id },
  25039. { type: "Literal", value: info.component }
  25040. ];
  25041. createErrorHelper = true;
  25042. if (development && place) {
  25043. parameters2.push({ type: "Literal", value: place });
  25044. }
  25045. statements.push({
  25046. type: "IfStatement",
  25047. test: {
  25048. type: "UnaryExpression",
  25049. operator: "!",
  25050. prefix: true,
  25051. argument: toIdOrMemberExpression(id.split("."))
  25052. },
  25053. consequent: {
  25054. type: "ExpressionStatement",
  25055. expression: {
  25056. type: "CallExpression",
  25057. callee: { type: "Identifier", name: "_missingMdxReference" },
  25058. arguments: parameters2,
  25059. optional: false
  25060. }
  25061. },
  25062. alternate: void 0
  25063. });
  25064. }
  25065. if (statements.length > 0) {
  25066. if (scopeNode.body.type !== "BlockStatement") {
  25067. scopeNode.body = {
  25068. type: "BlockStatement",
  25069. body: [{ type: "ReturnStatement", argument: scopeNode.body }]
  25070. };
  25071. }
  25072. scopeNode.body.body.unshift(...statements);
  25073. }
  25074. functionStack.pop();
  25075. }
  25076. }
  25077. });
  25078. if (importProvider && providerImportSource) {
  25079. tree.body.unshift(
  25080. createImportProvider(providerImportSource, outputFormat)
  25081. );
  25082. }
  25083. if (createErrorHelper) {
  25084. const message = [
  25085. { type: "Literal", value: "Expected " },
  25086. {
  25087. type: "ConditionalExpression",
  25088. test: { type: "Identifier", name: "component" },
  25089. consequent: { type: "Literal", value: "component" },
  25090. alternate: { type: "Literal", value: "object" }
  25091. },
  25092. { type: "Literal", value: " `" },
  25093. { type: "Identifier", name: "id" },
  25094. {
  25095. type: "Literal",
  25096. value: "` to be defined: you likely forgot to import, pass, or provide it."
  25097. }
  25098. ];
  25099. const parameters = [
  25100. { type: "Identifier", name: "id" },
  25101. { type: "Identifier", name: "component" }
  25102. ];
  25103. if (development) {
  25104. message.push({
  25105. type: "ConditionalExpression",
  25106. test: { type: "Identifier", name: "place" },
  25107. consequent: toBinaryAddition([
  25108. { type: "Literal", value: "\nIt\u2019s referenced in your code at `" },
  25109. { type: "Identifier", name: "place" },
  25110. {
  25111. type: "Literal",
  25112. value: (file.path ? "` in `" + file.path : "") + "`"
  25113. }
  25114. ]),
  25115. alternate: { type: "Literal", value: "" }
  25116. });
  25117. parameters.push({ type: "Identifier", name: "place" });
  25118. }
  25119. tree.body.push({
  25120. type: "FunctionDeclaration",
  25121. id: { type: "Identifier", name: "_missingMdxReference" },
  25122. generator: false,
  25123. async: false,
  25124. params: parameters,
  25125. body: {
  25126. type: "BlockStatement",
  25127. body: [
  25128. {
  25129. type: "ThrowStatement",
  25130. argument: {
  25131. type: "NewExpression",
  25132. callee: { type: "Identifier", name: "Error" },
  25133. arguments: [toBinaryAddition(message)]
  25134. }
  25135. }
  25136. ]
  25137. }
  25138. });
  25139. }
  25140. if (outputFormat === "function-body") {
  25141. tree.body.unshift({
  25142. type: "ExpressionStatement",
  25143. expression: { type: "Literal", value: "use strict" },
  25144. directive: "use strict"
  25145. });
  25146. }
  25147. };
  25148. }
  25149. function createImportProvider(providerImportSource, outputFormat) {
  25150. const specifiers = [
  25151. {
  25152. type: "ImportSpecifier",
  25153. imported: { type: "Identifier", name: "useMDXComponents" },
  25154. local: { type: "Identifier", name: "_provideComponents" }
  25155. }
  25156. ];
  25157. return outputFormat === "function-body" ? {
  25158. type: "VariableDeclaration",
  25159. kind: "const",
  25160. declarations: specifiersToDeclarations(
  25161. specifiers,
  25162. toIdOrMemberExpression(["arguments", 0])
  25163. )
  25164. } : {
  25165. type: "ImportDeclaration",
  25166. specifiers,
  25167. source: { type: "Literal", value: providerImportSource }
  25168. };
  25169. }
  25170. function isNamedFunction(node2, name2) {
  25171. return Boolean(node2 && "id" in node2 && node2.id && node2.id.name === name2);
  25172. }
  25173. function inScope(scope, id) {
  25174. let currentScope = scope;
  25175. while (currentScope) {
  25176. if (currentScope.declarations.has(id)) {
  25177. return true;
  25178. }
  25179. currentScope = /** @type {Scope | undefined} */
  25180. currentScope.parent || void 0;
  25181. }
  25182. return false;
  25183. }
  25184. // node_modules/astring/dist/astring.mjs
  25185. var { stringify } = JSON;
  25186. if (!String.prototype.repeat) {
  25187. throw new Error(
  25188. "String.prototype.repeat is undefined, see https://github.com/davidbonnet/astring#installation"
  25189. );
  25190. }
  25191. if (!String.prototype.endsWith) {
  25192. throw new Error(
  25193. "String.prototype.endsWith is undefined, see https://github.com/davidbonnet/astring#installation"
  25194. );
  25195. }
  25196. var OPERATOR_PRECEDENCE = {
  25197. "||": 2,
  25198. "??": 3,
  25199. "&&": 4,
  25200. "|": 5,
  25201. "^": 6,
  25202. "&": 7,
  25203. "==": 8,
  25204. "!=": 8,
  25205. "===": 8,
  25206. "!==": 8,
  25207. "<": 9,
  25208. ">": 9,
  25209. "<=": 9,
  25210. ">=": 9,
  25211. in: 9,
  25212. instanceof: 9,
  25213. "<<": 10,
  25214. ">>": 10,
  25215. ">>>": 10,
  25216. "+": 11,
  25217. "-": 11,
  25218. "*": 12,
  25219. "%": 12,
  25220. "/": 12,
  25221. "**": 13
  25222. };
  25223. var NEEDS_PARENTHESES = 17;
  25224. var EXPRESSIONS_PRECEDENCE = {
  25225. // Definitions
  25226. ArrayExpression: 20,
  25227. TaggedTemplateExpression: 20,
  25228. ThisExpression: 20,
  25229. Identifier: 20,
  25230. PrivateIdentifier: 20,
  25231. Literal: 18,
  25232. TemplateLiteral: 20,
  25233. Super: 20,
  25234. SequenceExpression: 20,
  25235. // Operations
  25236. MemberExpression: 19,
  25237. ChainExpression: 19,
  25238. CallExpression: 19,
  25239. NewExpression: 19,
  25240. // Other definitions
  25241. ArrowFunctionExpression: NEEDS_PARENTHESES,
  25242. ClassExpression: NEEDS_PARENTHESES,
  25243. FunctionExpression: NEEDS_PARENTHESES,
  25244. ObjectExpression: NEEDS_PARENTHESES,
  25245. // Other operations
  25246. UpdateExpression: 16,
  25247. UnaryExpression: 15,
  25248. AwaitExpression: 15,
  25249. BinaryExpression: 14,
  25250. LogicalExpression: 13,
  25251. ConditionalExpression: 4,
  25252. AssignmentExpression: 3,
  25253. YieldExpression: 2,
  25254. RestElement: 1
  25255. };
  25256. function formatSequence(state, nodes) {
  25257. const { generator } = state;
  25258. state.write("(");
  25259. if (nodes != null && nodes.length > 0) {
  25260. generator[nodes[0].type](nodes[0], state);
  25261. const { length } = nodes;
  25262. for (let i = 1; i < length; i++) {
  25263. const param = nodes[i];
  25264. state.write(", ");
  25265. generator[param.type](param, state);
  25266. }
  25267. }
  25268. state.write(")");
  25269. }
  25270. function expressionNeedsParenthesis(state, node2, parentNode, isRightHand) {
  25271. const nodePrecedence = state.expressionsPrecedence[node2.type];
  25272. if (nodePrecedence === NEEDS_PARENTHESES) {
  25273. return true;
  25274. }
  25275. const parentNodePrecedence = state.expressionsPrecedence[parentNode.type];
  25276. if (nodePrecedence !== parentNodePrecedence) {
  25277. return !isRightHand && nodePrecedence === 15 && parentNodePrecedence === 14 && parentNode.operator === "**" || nodePrecedence < parentNodePrecedence;
  25278. }
  25279. if (nodePrecedence !== 13 && nodePrecedence !== 14) {
  25280. return false;
  25281. }
  25282. if (node2.operator === "**" && parentNode.operator === "**") {
  25283. return !isRightHand;
  25284. }
  25285. if (nodePrecedence === 13 && parentNodePrecedence === 13 && (node2.operator === "??" || parentNode.operator === "??")) {
  25286. return true;
  25287. }
  25288. if (isRightHand) {
  25289. return OPERATOR_PRECEDENCE[node2.operator] <= OPERATOR_PRECEDENCE[parentNode.operator];
  25290. }
  25291. return OPERATOR_PRECEDENCE[node2.operator] < OPERATOR_PRECEDENCE[parentNode.operator];
  25292. }
  25293. function formatExpression(state, node2, parentNode, isRightHand) {
  25294. const { generator } = state;
  25295. if (expressionNeedsParenthesis(state, node2, parentNode, isRightHand)) {
  25296. state.write("(");
  25297. generator[node2.type](node2, state);
  25298. state.write(")");
  25299. } else {
  25300. generator[node2.type](node2, state);
  25301. }
  25302. }
  25303. function reindent(state, text5, indent2, lineEnd) {
  25304. const lines = text5.split("\n");
  25305. const end = lines.length - 1;
  25306. state.write(lines[0].trim());
  25307. if (end > 0) {
  25308. state.write(lineEnd);
  25309. for (let i = 1; i < end; i++) {
  25310. state.write(indent2 + lines[i].trim() + lineEnd);
  25311. }
  25312. state.write(indent2 + lines[end].trim());
  25313. }
  25314. }
  25315. function formatComments(state, comments, indent2, lineEnd) {
  25316. const { length } = comments;
  25317. for (let i = 0; i < length; i++) {
  25318. const comment2 = comments[i];
  25319. state.write(indent2);
  25320. if (comment2.type[0] === "L") {
  25321. state.write("// " + comment2.value.trim() + "\n", comment2);
  25322. } else {
  25323. state.write("/*");
  25324. reindent(state, comment2.value, indent2, lineEnd);
  25325. state.write("*/" + lineEnd);
  25326. }
  25327. }
  25328. }
  25329. function hasCallExpression(node2) {
  25330. let currentNode = node2;
  25331. while (currentNode != null) {
  25332. const { type } = currentNode;
  25333. if (type[0] === "C" && type[1] === "a") {
  25334. return true;
  25335. } else if (type[0] === "M" && type[1] === "e" && type[2] === "m") {
  25336. currentNode = currentNode.object;
  25337. } else {
  25338. return false;
  25339. }
  25340. }
  25341. }
  25342. function formatVariableDeclaration(state, node2) {
  25343. const { generator } = state;
  25344. const { declarations } = node2;
  25345. state.write(node2.kind + " ");
  25346. const { length } = declarations;
  25347. if (length > 0) {
  25348. generator.VariableDeclarator(declarations[0], state);
  25349. for (let i = 1; i < length; i++) {
  25350. state.write(", ");
  25351. generator.VariableDeclarator(declarations[i], state);
  25352. }
  25353. }
  25354. }
  25355. var ForInStatement;
  25356. var FunctionDeclaration;
  25357. var RestElement;
  25358. var BinaryExpression;
  25359. var ArrayExpression;
  25360. var BlockStatement;
  25361. var GENERATOR = {
  25362. /*
  25363. Default generator.
  25364. */
  25365. Program(node2, state) {
  25366. const indent2 = state.indent.repeat(state.indentLevel);
  25367. const { lineEnd, writeComments } = state;
  25368. if (writeComments && node2.comments != null) {
  25369. formatComments(state, node2.comments, indent2, lineEnd);
  25370. }
  25371. const statements = node2.body;
  25372. const { length } = statements;
  25373. for (let i = 0; i < length; i++) {
  25374. const statement = statements[i];
  25375. if (writeComments && statement.comments != null) {
  25376. formatComments(state, statement.comments, indent2, lineEnd);
  25377. }
  25378. state.write(indent2);
  25379. this[statement.type](statement, state);
  25380. state.write(lineEnd);
  25381. }
  25382. if (writeComments && node2.trailingComments != null) {
  25383. formatComments(state, node2.trailingComments, indent2, lineEnd);
  25384. }
  25385. },
  25386. BlockStatement: BlockStatement = function(node2, state) {
  25387. const indent2 = state.indent.repeat(state.indentLevel++);
  25388. const { lineEnd, writeComments } = state;
  25389. const statementIndent = indent2 + state.indent;
  25390. state.write("{");
  25391. const statements = node2.body;
  25392. if (statements != null && statements.length > 0) {
  25393. state.write(lineEnd);
  25394. if (writeComments && node2.comments != null) {
  25395. formatComments(state, node2.comments, statementIndent, lineEnd);
  25396. }
  25397. const { length } = statements;
  25398. for (let i = 0; i < length; i++) {
  25399. const statement = statements[i];
  25400. if (writeComments && statement.comments != null) {
  25401. formatComments(state, statement.comments, statementIndent, lineEnd);
  25402. }
  25403. state.write(statementIndent);
  25404. this[statement.type](statement, state);
  25405. state.write(lineEnd);
  25406. }
  25407. state.write(indent2);
  25408. } else {
  25409. if (writeComments && node2.comments != null) {
  25410. state.write(lineEnd);
  25411. formatComments(state, node2.comments, statementIndent, lineEnd);
  25412. state.write(indent2);
  25413. }
  25414. }
  25415. if (writeComments && node2.trailingComments != null) {
  25416. formatComments(state, node2.trailingComments, statementIndent, lineEnd);
  25417. }
  25418. state.write("}");
  25419. state.indentLevel--;
  25420. },
  25421. ClassBody: BlockStatement,
  25422. StaticBlock(node2, state) {
  25423. state.write("static ");
  25424. this.BlockStatement(node2, state);
  25425. },
  25426. EmptyStatement(node2, state) {
  25427. state.write(";");
  25428. },
  25429. ExpressionStatement(node2, state) {
  25430. const precedence = state.expressionsPrecedence[node2.expression.type];
  25431. if (precedence === NEEDS_PARENTHESES || precedence === 3 && node2.expression.left.type[0] === "O") {
  25432. state.write("(");
  25433. this[node2.expression.type](node2.expression, state);
  25434. state.write(")");
  25435. } else {
  25436. this[node2.expression.type](node2.expression, state);
  25437. }
  25438. state.write(";");
  25439. },
  25440. IfStatement(node2, state) {
  25441. state.write("if (");
  25442. this[node2.test.type](node2.test, state);
  25443. state.write(") ");
  25444. this[node2.consequent.type](node2.consequent, state);
  25445. if (node2.alternate != null) {
  25446. state.write(" else ");
  25447. this[node2.alternate.type](node2.alternate, state);
  25448. }
  25449. },
  25450. LabeledStatement(node2, state) {
  25451. this[node2.label.type](node2.label, state);
  25452. state.write(": ");
  25453. this[node2.body.type](node2.body, state);
  25454. },
  25455. BreakStatement(node2, state) {
  25456. state.write("break");
  25457. if (node2.label != null) {
  25458. state.write(" ");
  25459. this[node2.label.type](node2.label, state);
  25460. }
  25461. state.write(";");
  25462. },
  25463. ContinueStatement(node2, state) {
  25464. state.write("continue");
  25465. if (node2.label != null) {
  25466. state.write(" ");
  25467. this[node2.label.type](node2.label, state);
  25468. }
  25469. state.write(";");
  25470. },
  25471. WithStatement(node2, state) {
  25472. state.write("with (");
  25473. this[node2.object.type](node2.object, state);
  25474. state.write(") ");
  25475. this[node2.body.type](node2.body, state);
  25476. },
  25477. SwitchStatement(node2, state) {
  25478. const indent2 = state.indent.repeat(state.indentLevel++);
  25479. const { lineEnd, writeComments } = state;
  25480. state.indentLevel++;
  25481. const caseIndent = indent2 + state.indent;
  25482. const statementIndent = caseIndent + state.indent;
  25483. state.write("switch (");
  25484. this[node2.discriminant.type](node2.discriminant, state);
  25485. state.write(") {" + lineEnd);
  25486. const { cases: occurences } = node2;
  25487. const { length: occurencesCount } = occurences;
  25488. for (let i = 0; i < occurencesCount; i++) {
  25489. const occurence = occurences[i];
  25490. if (writeComments && occurence.comments != null) {
  25491. formatComments(state, occurence.comments, caseIndent, lineEnd);
  25492. }
  25493. if (occurence.test) {
  25494. state.write(caseIndent + "case ");
  25495. this[occurence.test.type](occurence.test, state);
  25496. state.write(":" + lineEnd);
  25497. } else {
  25498. state.write(caseIndent + "default:" + lineEnd);
  25499. }
  25500. const { consequent } = occurence;
  25501. const { length: consequentCount } = consequent;
  25502. for (let i2 = 0; i2 < consequentCount; i2++) {
  25503. const statement = consequent[i2];
  25504. if (writeComments && statement.comments != null) {
  25505. formatComments(state, statement.comments, statementIndent, lineEnd);
  25506. }
  25507. state.write(statementIndent);
  25508. this[statement.type](statement, state);
  25509. state.write(lineEnd);
  25510. }
  25511. }
  25512. state.indentLevel -= 2;
  25513. state.write(indent2 + "}");
  25514. },
  25515. ReturnStatement(node2, state) {
  25516. state.write("return");
  25517. if (node2.argument) {
  25518. state.write(" ");
  25519. this[node2.argument.type](node2.argument, state);
  25520. }
  25521. state.write(";");
  25522. },
  25523. ThrowStatement(node2, state) {
  25524. state.write("throw ");
  25525. this[node2.argument.type](node2.argument, state);
  25526. state.write(";");
  25527. },
  25528. TryStatement(node2, state) {
  25529. state.write("try ");
  25530. this[node2.block.type](node2.block, state);
  25531. if (node2.handler) {
  25532. const { handler } = node2;
  25533. if (handler.param == null) {
  25534. state.write(" catch ");
  25535. } else {
  25536. state.write(" catch (");
  25537. this[handler.param.type](handler.param, state);
  25538. state.write(") ");
  25539. }
  25540. this[handler.body.type](handler.body, state);
  25541. }
  25542. if (node2.finalizer) {
  25543. state.write(" finally ");
  25544. this[node2.finalizer.type](node2.finalizer, state);
  25545. }
  25546. },
  25547. WhileStatement(node2, state) {
  25548. state.write("while (");
  25549. this[node2.test.type](node2.test, state);
  25550. state.write(") ");
  25551. this[node2.body.type](node2.body, state);
  25552. },
  25553. DoWhileStatement(node2, state) {
  25554. state.write("do ");
  25555. this[node2.body.type](node2.body, state);
  25556. state.write(" while (");
  25557. this[node2.test.type](node2.test, state);
  25558. state.write(");");
  25559. },
  25560. ForStatement(node2, state) {
  25561. state.write("for (");
  25562. if (node2.init != null) {
  25563. const { init } = node2;
  25564. if (init.type[0] === "V") {
  25565. formatVariableDeclaration(state, init);
  25566. } else {
  25567. this[init.type](init, state);
  25568. }
  25569. }
  25570. state.write("; ");
  25571. if (node2.test) {
  25572. this[node2.test.type](node2.test, state);
  25573. }
  25574. state.write("; ");
  25575. if (node2.update) {
  25576. this[node2.update.type](node2.update, state);
  25577. }
  25578. state.write(") ");
  25579. this[node2.body.type](node2.body, state);
  25580. },
  25581. ForInStatement: ForInStatement = function(node2, state) {
  25582. state.write(`for ${node2.await ? "await " : ""}(`);
  25583. const { left } = node2;
  25584. if (left.type[0] === "V") {
  25585. formatVariableDeclaration(state, left);
  25586. } else {
  25587. this[left.type](left, state);
  25588. }
  25589. state.write(node2.type[3] === "I" ? " in " : " of ");
  25590. this[node2.right.type](node2.right, state);
  25591. state.write(") ");
  25592. this[node2.body.type](node2.body, state);
  25593. },
  25594. ForOfStatement: ForInStatement,
  25595. DebuggerStatement(node2, state) {
  25596. state.write("debugger;", node2);
  25597. },
  25598. FunctionDeclaration: FunctionDeclaration = function(node2, state) {
  25599. state.write(
  25600. (node2.async ? "async " : "") + (node2.generator ? "function* " : "function ") + (node2.id ? node2.id.name : ""),
  25601. node2
  25602. );
  25603. formatSequence(state, node2.params);
  25604. state.write(" ");
  25605. this[node2.body.type](node2.body, state);
  25606. },
  25607. FunctionExpression: FunctionDeclaration,
  25608. VariableDeclaration(node2, state) {
  25609. formatVariableDeclaration(state, node2);
  25610. state.write(";");
  25611. },
  25612. VariableDeclarator(node2, state) {
  25613. this[node2.id.type](node2.id, state);
  25614. if (node2.init != null) {
  25615. state.write(" = ");
  25616. this[node2.init.type](node2.init, state);
  25617. }
  25618. },
  25619. ClassDeclaration(node2, state) {
  25620. state.write("class " + (node2.id ? `${node2.id.name} ` : ""), node2);
  25621. if (node2.superClass) {
  25622. state.write("extends ");
  25623. const { superClass } = node2;
  25624. const { type } = superClass;
  25625. const precedence = state.expressionsPrecedence[type];
  25626. if ((type[0] !== "C" || type[1] !== "l" || type[5] !== "E") && (precedence === NEEDS_PARENTHESES || precedence < state.expressionsPrecedence.ClassExpression)) {
  25627. state.write("(");
  25628. this[node2.superClass.type](superClass, state);
  25629. state.write(")");
  25630. } else {
  25631. this[superClass.type](superClass, state);
  25632. }
  25633. state.write(" ");
  25634. }
  25635. this.ClassBody(node2.body, state);
  25636. },
  25637. ImportDeclaration(node2, state) {
  25638. state.write("import ");
  25639. const { specifiers } = node2;
  25640. const { length } = specifiers;
  25641. let i = 0;
  25642. if (length > 0) {
  25643. for (; i < length; ) {
  25644. if (i > 0) {
  25645. state.write(", ");
  25646. }
  25647. const specifier = specifiers[i];
  25648. const type = specifier.type[6];
  25649. if (type === "D") {
  25650. state.write(specifier.local.name, specifier);
  25651. i++;
  25652. } else if (type === "N") {
  25653. state.write("* as " + specifier.local.name, specifier);
  25654. i++;
  25655. } else {
  25656. break;
  25657. }
  25658. }
  25659. if (i < length) {
  25660. state.write("{");
  25661. for (; ; ) {
  25662. const specifier = specifiers[i];
  25663. const { name: name2 } = specifier.imported;
  25664. state.write(name2, specifier);
  25665. if (name2 !== specifier.local.name) {
  25666. state.write(" as " + specifier.local.name);
  25667. }
  25668. if (++i < length) {
  25669. state.write(", ");
  25670. } else {
  25671. break;
  25672. }
  25673. }
  25674. state.write("}");
  25675. }
  25676. state.write(" from ");
  25677. }
  25678. this.Literal(node2.source, state);
  25679. state.write(";");
  25680. },
  25681. ImportExpression(node2, state) {
  25682. state.write("import(");
  25683. this[node2.source.type](node2.source, state);
  25684. state.write(")");
  25685. },
  25686. ExportDefaultDeclaration(node2, state) {
  25687. state.write("export default ");
  25688. this[node2.declaration.type](node2.declaration, state);
  25689. if (state.expressionsPrecedence[node2.declaration.type] != null && node2.declaration.type[0] !== "F") {
  25690. state.write(";");
  25691. }
  25692. },
  25693. ExportNamedDeclaration(node2, state) {
  25694. state.write("export ");
  25695. if (node2.declaration) {
  25696. this[node2.declaration.type](node2.declaration, state);
  25697. } else {
  25698. state.write("{");
  25699. const { specifiers } = node2, { length } = specifiers;
  25700. if (length > 0) {
  25701. for (let i = 0; ; ) {
  25702. const specifier = specifiers[i];
  25703. const { name: name2 } = specifier.local;
  25704. state.write(name2, specifier);
  25705. if (name2 !== specifier.exported.name) {
  25706. state.write(" as " + specifier.exported.name);
  25707. }
  25708. if (++i < length) {
  25709. state.write(", ");
  25710. } else {
  25711. break;
  25712. }
  25713. }
  25714. }
  25715. state.write("}");
  25716. if (node2.source) {
  25717. state.write(" from ");
  25718. this.Literal(node2.source, state);
  25719. }
  25720. state.write(";");
  25721. }
  25722. },
  25723. ExportAllDeclaration(node2, state) {
  25724. if (node2.exported != null) {
  25725. state.write("export * as " + node2.exported.name + " from ");
  25726. } else {
  25727. state.write("export * from ");
  25728. }
  25729. this.Literal(node2.source, state);
  25730. state.write(";");
  25731. },
  25732. MethodDefinition(node2, state) {
  25733. if (node2.static) {
  25734. state.write("static ");
  25735. }
  25736. const kind = node2.kind[0];
  25737. if (kind === "g" || kind === "s") {
  25738. state.write(node2.kind + " ");
  25739. }
  25740. if (node2.value.async) {
  25741. state.write("async ");
  25742. }
  25743. if (node2.value.generator) {
  25744. state.write("*");
  25745. }
  25746. if (node2.computed) {
  25747. state.write("[");
  25748. this[node2.key.type](node2.key, state);
  25749. state.write("]");
  25750. } else {
  25751. this[node2.key.type](node2.key, state);
  25752. }
  25753. formatSequence(state, node2.value.params);
  25754. state.write(" ");
  25755. this[node2.value.body.type](node2.value.body, state);
  25756. },
  25757. ClassExpression(node2, state) {
  25758. this.ClassDeclaration(node2, state);
  25759. },
  25760. ArrowFunctionExpression(node2, state) {
  25761. state.write(node2.async ? "async " : "", node2);
  25762. const { params } = node2;
  25763. if (params != null) {
  25764. if (params.length === 1 && params[0].type[0] === "I") {
  25765. state.write(params[0].name, params[0]);
  25766. } else {
  25767. formatSequence(state, node2.params);
  25768. }
  25769. }
  25770. state.write(" => ");
  25771. if (node2.body.type[0] === "O") {
  25772. state.write("(");
  25773. this.ObjectExpression(node2.body, state);
  25774. state.write(")");
  25775. } else {
  25776. this[node2.body.type](node2.body, state);
  25777. }
  25778. },
  25779. ThisExpression(node2, state) {
  25780. state.write("this", node2);
  25781. },
  25782. Super(node2, state) {
  25783. state.write("super", node2);
  25784. },
  25785. RestElement: RestElement = function(node2, state) {
  25786. state.write("...");
  25787. this[node2.argument.type](node2.argument, state);
  25788. },
  25789. SpreadElement: RestElement,
  25790. YieldExpression(node2, state) {
  25791. state.write(node2.delegate ? "yield*" : "yield");
  25792. if (node2.argument) {
  25793. state.write(" ");
  25794. this[node2.argument.type](node2.argument, state);
  25795. }
  25796. },
  25797. AwaitExpression(node2, state) {
  25798. state.write("await ", node2);
  25799. formatExpression(state, node2.argument, node2);
  25800. },
  25801. TemplateLiteral(node2, state) {
  25802. const { quasis, expressions } = node2;
  25803. state.write("`");
  25804. const { length } = expressions;
  25805. for (let i = 0; i < length; i++) {
  25806. const expression = expressions[i];
  25807. const quasi2 = quasis[i];
  25808. state.write(quasi2.value.raw, quasi2);
  25809. state.write("${");
  25810. this[expression.type](expression, state);
  25811. state.write("}");
  25812. }
  25813. const quasi = quasis[quasis.length - 1];
  25814. state.write(quasi.value.raw, quasi);
  25815. state.write("`");
  25816. },
  25817. TemplateElement(node2, state) {
  25818. state.write(node2.value.raw, node2);
  25819. },
  25820. TaggedTemplateExpression(node2, state) {
  25821. formatExpression(state, node2.tag, node2);
  25822. this[node2.quasi.type](node2.quasi, state);
  25823. },
  25824. ArrayExpression: ArrayExpression = function(node2, state) {
  25825. state.write("[");
  25826. if (node2.elements.length > 0) {
  25827. const { elements } = node2, { length } = elements;
  25828. for (let i = 0; ; ) {
  25829. const element2 = elements[i];
  25830. if (element2 != null) {
  25831. this[element2.type](element2, state);
  25832. }
  25833. if (++i < length) {
  25834. state.write(", ");
  25835. } else {
  25836. if (element2 == null) {
  25837. state.write(", ");
  25838. }
  25839. break;
  25840. }
  25841. }
  25842. }
  25843. state.write("]");
  25844. },
  25845. ArrayPattern: ArrayExpression,
  25846. ObjectExpression(node2, state) {
  25847. const indent2 = state.indent.repeat(state.indentLevel++);
  25848. const { lineEnd, writeComments } = state;
  25849. const propertyIndent = indent2 + state.indent;
  25850. state.write("{");
  25851. if (node2.properties.length > 0) {
  25852. state.write(lineEnd);
  25853. if (writeComments && node2.comments != null) {
  25854. formatComments(state, node2.comments, propertyIndent, lineEnd);
  25855. }
  25856. const comma = "," + lineEnd;
  25857. const { properties } = node2, { length } = properties;
  25858. for (let i = 0; ; ) {
  25859. const property = properties[i];
  25860. if (writeComments && property.comments != null) {
  25861. formatComments(state, property.comments, propertyIndent, lineEnd);
  25862. }
  25863. state.write(propertyIndent);
  25864. this[property.type](property, state);
  25865. if (++i < length) {
  25866. state.write(comma);
  25867. } else {
  25868. break;
  25869. }
  25870. }
  25871. state.write(lineEnd);
  25872. if (writeComments && node2.trailingComments != null) {
  25873. formatComments(state, node2.trailingComments, propertyIndent, lineEnd);
  25874. }
  25875. state.write(indent2 + "}");
  25876. } else if (writeComments) {
  25877. if (node2.comments != null) {
  25878. state.write(lineEnd);
  25879. formatComments(state, node2.comments, propertyIndent, lineEnd);
  25880. if (node2.trailingComments != null) {
  25881. formatComments(state, node2.trailingComments, propertyIndent, lineEnd);
  25882. }
  25883. state.write(indent2 + "}");
  25884. } else if (node2.trailingComments != null) {
  25885. state.write(lineEnd);
  25886. formatComments(state, node2.trailingComments, propertyIndent, lineEnd);
  25887. state.write(indent2 + "}");
  25888. } else {
  25889. state.write("}");
  25890. }
  25891. } else {
  25892. state.write("}");
  25893. }
  25894. state.indentLevel--;
  25895. },
  25896. Property(node2, state) {
  25897. if (node2.method || node2.kind[0] !== "i") {
  25898. this.MethodDefinition(node2, state);
  25899. } else {
  25900. if (!node2.shorthand) {
  25901. if (node2.computed) {
  25902. state.write("[");
  25903. this[node2.key.type](node2.key, state);
  25904. state.write("]");
  25905. } else {
  25906. this[node2.key.type](node2.key, state);
  25907. }
  25908. state.write(": ");
  25909. }
  25910. this[node2.value.type](node2.value, state);
  25911. }
  25912. },
  25913. PropertyDefinition(node2, state) {
  25914. if (node2.static) {
  25915. state.write("static ");
  25916. }
  25917. if (node2.computed) {
  25918. state.write("[");
  25919. }
  25920. this[node2.key.type](node2.key, state);
  25921. if (node2.computed) {
  25922. state.write("]");
  25923. }
  25924. if (node2.value == null) {
  25925. if (node2.key.type[0] !== "F") {
  25926. state.write(";");
  25927. }
  25928. return;
  25929. }
  25930. state.write(" = ");
  25931. this[node2.value.type](node2.value, state);
  25932. state.write(";");
  25933. },
  25934. ObjectPattern(node2, state) {
  25935. state.write("{");
  25936. if (node2.properties.length > 0) {
  25937. const { properties } = node2, { length } = properties;
  25938. for (let i = 0; ; ) {
  25939. this[properties[i].type](properties[i], state);
  25940. if (++i < length) {
  25941. state.write(", ");
  25942. } else {
  25943. break;
  25944. }
  25945. }
  25946. }
  25947. state.write("}");
  25948. },
  25949. SequenceExpression(node2, state) {
  25950. formatSequence(state, node2.expressions);
  25951. },
  25952. UnaryExpression(node2, state) {
  25953. if (node2.prefix) {
  25954. const {
  25955. operator,
  25956. argument,
  25957. argument: { type }
  25958. } = node2;
  25959. state.write(operator);
  25960. const needsParentheses = expressionNeedsParenthesis(state, argument, node2);
  25961. if (!needsParentheses && (operator.length > 1 || type[0] === "U" && (type[1] === "n" || type[1] === "p") && argument.prefix && argument.operator[0] === operator && (operator === "+" || operator === "-"))) {
  25962. state.write(" ");
  25963. }
  25964. if (needsParentheses) {
  25965. state.write(operator.length > 1 ? " (" : "(");
  25966. this[type](argument, state);
  25967. state.write(")");
  25968. } else {
  25969. this[type](argument, state);
  25970. }
  25971. } else {
  25972. this[node2.argument.type](node2.argument, state);
  25973. state.write(node2.operator);
  25974. }
  25975. },
  25976. UpdateExpression(node2, state) {
  25977. if (node2.prefix) {
  25978. state.write(node2.operator);
  25979. this[node2.argument.type](node2.argument, state);
  25980. } else {
  25981. this[node2.argument.type](node2.argument, state);
  25982. state.write(node2.operator);
  25983. }
  25984. },
  25985. AssignmentExpression(node2, state) {
  25986. this[node2.left.type](node2.left, state);
  25987. state.write(" " + node2.operator + " ");
  25988. this[node2.right.type](node2.right, state);
  25989. },
  25990. AssignmentPattern(node2, state) {
  25991. this[node2.left.type](node2.left, state);
  25992. state.write(" = ");
  25993. this[node2.right.type](node2.right, state);
  25994. },
  25995. BinaryExpression: BinaryExpression = function(node2, state) {
  25996. const isIn = node2.operator === "in";
  25997. if (isIn) {
  25998. state.write("(");
  25999. }
  26000. formatExpression(state, node2.left, node2, false);
  26001. state.write(" " + node2.operator + " ");
  26002. formatExpression(state, node2.right, node2, true);
  26003. if (isIn) {
  26004. state.write(")");
  26005. }
  26006. },
  26007. LogicalExpression: BinaryExpression,
  26008. ConditionalExpression(node2, state) {
  26009. const { test } = node2;
  26010. const precedence = state.expressionsPrecedence[test.type];
  26011. if (precedence === NEEDS_PARENTHESES || precedence <= state.expressionsPrecedence.ConditionalExpression) {
  26012. state.write("(");
  26013. this[test.type](test, state);
  26014. state.write(")");
  26015. } else {
  26016. this[test.type](test, state);
  26017. }
  26018. state.write(" ? ");
  26019. this[node2.consequent.type](node2.consequent, state);
  26020. state.write(" : ");
  26021. this[node2.alternate.type](node2.alternate, state);
  26022. },
  26023. NewExpression(node2, state) {
  26024. state.write("new ");
  26025. const precedence = state.expressionsPrecedence[node2.callee.type];
  26026. if (precedence === NEEDS_PARENTHESES || precedence < state.expressionsPrecedence.CallExpression || hasCallExpression(node2.callee)) {
  26027. state.write("(");
  26028. this[node2.callee.type](node2.callee, state);
  26029. state.write(")");
  26030. } else {
  26031. this[node2.callee.type](node2.callee, state);
  26032. }
  26033. formatSequence(state, node2["arguments"]);
  26034. },
  26035. CallExpression(node2, state) {
  26036. const precedence = state.expressionsPrecedence[node2.callee.type];
  26037. if (precedence === NEEDS_PARENTHESES || precedence < state.expressionsPrecedence.CallExpression) {
  26038. state.write("(");
  26039. this[node2.callee.type](node2.callee, state);
  26040. state.write(")");
  26041. } else {
  26042. this[node2.callee.type](node2.callee, state);
  26043. }
  26044. if (node2.optional) {
  26045. state.write("?.");
  26046. }
  26047. formatSequence(state, node2["arguments"]);
  26048. },
  26049. ChainExpression(node2, state) {
  26050. this[node2.expression.type](node2.expression, state);
  26051. },
  26052. MemberExpression(node2, state) {
  26053. const precedence = state.expressionsPrecedence[node2.object.type];
  26054. if (precedence === NEEDS_PARENTHESES || precedence < state.expressionsPrecedence.MemberExpression) {
  26055. state.write("(");
  26056. this[node2.object.type](node2.object, state);
  26057. state.write(")");
  26058. } else {
  26059. this[node2.object.type](node2.object, state);
  26060. }
  26061. if (node2.computed) {
  26062. if (node2.optional) {
  26063. state.write("?.");
  26064. }
  26065. state.write("[");
  26066. this[node2.property.type](node2.property, state);
  26067. state.write("]");
  26068. } else {
  26069. if (node2.optional) {
  26070. state.write("?.");
  26071. } else {
  26072. state.write(".");
  26073. }
  26074. this[node2.property.type](node2.property, state);
  26075. }
  26076. },
  26077. MetaProperty(node2, state) {
  26078. state.write(node2.meta.name + "." + node2.property.name, node2);
  26079. },
  26080. Identifier(node2, state) {
  26081. state.write(node2.name, node2);
  26082. },
  26083. PrivateIdentifier(node2, state) {
  26084. state.write(`#${node2.name}`, node2);
  26085. },
  26086. Literal(node2, state) {
  26087. if (node2.raw != null) {
  26088. state.write(node2.raw, node2);
  26089. } else if (node2.regex != null) {
  26090. this.RegExpLiteral(node2, state);
  26091. } else if (node2.bigint != null) {
  26092. state.write(node2.bigint + "n", node2);
  26093. } else {
  26094. state.write(stringify(node2.value), node2);
  26095. }
  26096. },
  26097. RegExpLiteral(node2, state) {
  26098. const { regex: regex2 } = node2;
  26099. state.write(`/${regex2.pattern}/${regex2.flags}`, node2);
  26100. }
  26101. };
  26102. var EMPTY_OBJECT = {};
  26103. var State = class {
  26104. constructor(options) {
  26105. const setup = options == null ? EMPTY_OBJECT : options;
  26106. this.output = "";
  26107. if (setup.output != null) {
  26108. this.output = setup.output;
  26109. this.write = this.writeToStream;
  26110. } else {
  26111. this.output = "";
  26112. }
  26113. this.generator = setup.generator != null ? setup.generator : GENERATOR;
  26114. this.expressionsPrecedence = setup.expressionsPrecedence != null ? setup.expressionsPrecedence : EXPRESSIONS_PRECEDENCE;
  26115. this.indent = setup.indent != null ? setup.indent : " ";
  26116. this.lineEnd = setup.lineEnd != null ? setup.lineEnd : "\n";
  26117. this.indentLevel = setup.startingIndentLevel != null ? setup.startingIndentLevel : 0;
  26118. this.writeComments = setup.comments ? setup.comments : false;
  26119. if (setup.sourceMap != null) {
  26120. this.write = setup.output == null ? this.writeAndMap : this.writeToStreamAndMap;
  26121. this.sourceMap = setup.sourceMap;
  26122. this.line = 1;
  26123. this.column = 0;
  26124. this.lineEndSize = this.lineEnd.split("\n").length - 1;
  26125. this.mapping = {
  26126. original: null,
  26127. // Uses the entire state to avoid generating ephemeral objects
  26128. generated: this,
  26129. name: void 0,
  26130. source: setup.sourceMap.file || setup.sourceMap._file
  26131. };
  26132. }
  26133. }
  26134. write(code2) {
  26135. this.output += code2;
  26136. }
  26137. writeToStream(code2) {
  26138. this.output.write(code2);
  26139. }
  26140. writeAndMap(code2, node2) {
  26141. this.output += code2;
  26142. this.map(code2, node2);
  26143. }
  26144. writeToStreamAndMap(code2, node2) {
  26145. this.output.write(code2);
  26146. this.map(code2, node2);
  26147. }
  26148. map(code2, node2) {
  26149. if (node2 != null) {
  26150. const { type } = node2;
  26151. if (type[0] === "L" && type[2] === "n") {
  26152. this.column = 0;
  26153. this.line++;
  26154. return;
  26155. }
  26156. if (node2.loc != null) {
  26157. const { mapping } = this;
  26158. mapping.original = node2.loc.start;
  26159. mapping.name = node2.name;
  26160. this.sourceMap.addMapping(mapping);
  26161. }
  26162. if (type[0] === "T" && type[8] === "E" || type[0] === "L" && type[1] === "i" && typeof node2.value === "string") {
  26163. const { length: length2 } = code2;
  26164. let { column, line } = this;
  26165. for (let i = 0; i < length2; i++) {
  26166. if (code2[i] === "\n") {
  26167. column = 0;
  26168. line++;
  26169. } else {
  26170. column++;
  26171. }
  26172. }
  26173. this.column = column;
  26174. this.line = line;
  26175. return;
  26176. }
  26177. }
  26178. const { length } = code2;
  26179. const { lineEnd } = this;
  26180. if (length > 0) {
  26181. if (this.lineEndSize > 0 && (lineEnd.length === 1 ? code2[length - 1] === lineEnd : code2.endsWith(lineEnd))) {
  26182. this.line += this.lineEndSize;
  26183. this.column = 0;
  26184. } else {
  26185. this.column += length;
  26186. }
  26187. }
  26188. }
  26189. toString() {
  26190. return this.output;
  26191. }
  26192. };
  26193. function generate(node2, options) {
  26194. const state = new State(options);
  26195. state.generator[node2.type](node2, state);
  26196. return state.output;
  26197. }
  26198. // node_modules/estree-util-to-js/lib/index.js
  26199. var emptyOptions5 = {};
  26200. function toJs(tree, options) {
  26201. const { SourceMapGenerator, filePath, handlers: handlers3 } = options || emptyOptions5;
  26202. const sourceMap = SourceMapGenerator ? new SourceMapGenerator({ file: filePath || "<unknown>.js" }) : void 0;
  26203. const value = generate(
  26204. tree,
  26205. // @ts-expect-error: `sourceMap` can be undefined, `astring` types are buggy.
  26206. {
  26207. comments: true,
  26208. generator: { ...GENERATOR, ...handlers3 },
  26209. sourceMap: sourceMap || void 0
  26210. }
  26211. );
  26212. const map = sourceMap ? sourceMap.toJSON() : void 0;
  26213. return { value, map };
  26214. }
  26215. // node_modules/estree-util-to-js/lib/jsx.js
  26216. var jsx = {
  26217. JSXAttribute: jsxAttribute,
  26218. JSXClosingElement: jsxClosingElement,
  26219. JSXClosingFragment: jsxClosingFragment,
  26220. JSXElement: jsxElement,
  26221. JSXEmptyExpression: jsxEmptyExpression,
  26222. JSXExpressionContainer: jsxExpressionContainer,
  26223. JSXFragment: jsxFragment,
  26224. JSXIdentifier: jsxIdentifier,
  26225. JSXMemberExpression: jsxMemberExpression,
  26226. JSXNamespacedName: jsxNamespacedName,
  26227. JSXOpeningElement: jsxOpeningElement,
  26228. JSXOpeningFragment: jsxOpeningFragment,
  26229. JSXSpreadAttribute: jsxSpreadAttribute,
  26230. JSXText: jsxText2
  26231. };
  26232. function jsxAttribute(node2, state) {
  26233. this[node2.name.type](node2.name, state);
  26234. if (node2.value !== null && node2.value !== void 0) {
  26235. state.write("=");
  26236. if (node2.value.type === "Literal") {
  26237. state.write(
  26238. '"' + encodeJsx(String(node2.value.value)).replace(/"/g, "&quot;") + '"',
  26239. node2
  26240. );
  26241. } else {
  26242. this[node2.value.type](node2.value, state);
  26243. }
  26244. }
  26245. }
  26246. function jsxClosingElement(node2, state) {
  26247. state.write("</");
  26248. this[node2.name.type](node2.name, state);
  26249. state.write(">");
  26250. }
  26251. function jsxClosingFragment(node2, state) {
  26252. state.write("</>", node2);
  26253. }
  26254. function jsxElement(node2, state) {
  26255. let index2 = -1;
  26256. this[node2.openingElement.type](node2.openingElement, state);
  26257. if (node2.children) {
  26258. while (++index2 < node2.children.length) {
  26259. const child = node2.children[index2];
  26260. if (child.type === "JSXSpreadChild") {
  26261. throw new Error("JSX spread children are not supported");
  26262. }
  26263. this[child.type](child, state);
  26264. }
  26265. }
  26266. if (node2.closingElement) {
  26267. this[node2.closingElement.type](node2.closingElement, state);
  26268. }
  26269. }
  26270. function jsxEmptyExpression() {
  26271. }
  26272. function jsxExpressionContainer(node2, state) {
  26273. state.write("{");
  26274. this[node2.expression.type](node2.expression, state);
  26275. state.write("}");
  26276. }
  26277. function jsxFragment(node2, state) {
  26278. let index2 = -1;
  26279. this[node2.openingFragment.type](node2.openingFragment, state);
  26280. if (node2.children) {
  26281. while (++index2 < node2.children.length) {
  26282. const child = node2.children[index2];
  26283. if (child.type === "JSXSpreadChild") {
  26284. throw new Error("JSX spread children are not supported");
  26285. }
  26286. this[child.type](child, state);
  26287. }
  26288. }
  26289. this[node2.closingFragment.type](node2.closingFragment, state);
  26290. }
  26291. function jsxIdentifier(node2, state) {
  26292. state.write(node2.name, node2);
  26293. }
  26294. function jsxMemberExpression(node2, state) {
  26295. this[node2.object.type](node2.object, state);
  26296. state.write(".");
  26297. this[node2.property.type](node2.property, state);
  26298. }
  26299. function jsxNamespacedName(node2, state) {
  26300. this[node2.namespace.type](node2.namespace, state);
  26301. state.write(":");
  26302. this[node2.name.type](node2.name, state);
  26303. }
  26304. function jsxOpeningElement(node2, state) {
  26305. let index2 = -1;
  26306. state.write("<");
  26307. this[node2.name.type](node2.name, state);
  26308. if (node2.attributes) {
  26309. while (++index2 < node2.attributes.length) {
  26310. state.write(" ");
  26311. this[node2.attributes[index2].type](node2.attributes[index2], state);
  26312. }
  26313. }
  26314. state.write(node2.selfClosing ? " />" : ">");
  26315. }
  26316. function jsxOpeningFragment(node2, state) {
  26317. state.write("<>", node2);
  26318. }
  26319. function jsxSpreadAttribute(node2, state) {
  26320. state.write("{");
  26321. this.SpreadElement(node2, state);
  26322. state.write("}");
  26323. }
  26324. function jsxText2(node2, state) {
  26325. state.write(encodeJsx(node2.value).replace(/[<>{}]/g, replaceJsxChar), node2);
  26326. }
  26327. function encodeJsx(value) {
  26328. return value.replace(/&(?=[#a-z])/gi, "&amp;");
  26329. }
  26330. function replaceJsxChar($0) {
  26331. return $0 === "<" ? "&lt;" : $0 === ">" ? "&gt;" : $0 === "{" ? "&#123;" : "&#125;";
  26332. }
  26333. // node_modules/@mdx-js/mdx/lib/plugin/recma-stringify.js
  26334. function recmaStringify(options) {
  26335. const self2 = (
  26336. /** @type {Processor} */
  26337. this
  26338. );
  26339. const { SourceMapGenerator } = options;
  26340. self2.compiler = compiler2;
  26341. function compiler2(tree, file) {
  26342. const result = SourceMapGenerator ? toJs(tree, {
  26343. SourceMapGenerator,
  26344. filePath: file.path || "unknown.mdx",
  26345. handlers: jsx
  26346. }) : toJs(tree, { handlers: jsx });
  26347. file.map = result.map;
  26348. return result.value;
  26349. }
  26350. }
  26351. // node_modules/hast-util-to-estree/lib/handlers/comment.js
  26352. function comment(node2, state) {
  26353. const result = { type: "Block", value: node2.value };
  26354. state.inherit(node2, result);
  26355. state.comments.push(result);
  26356. const expression = {
  26357. type: "JSXEmptyExpression",
  26358. // @ts-expect-error: `comments` is custom.
  26359. comments: [Object.assign({}, result, { leading: false, trailing: true })]
  26360. };
  26361. state.patch(node2, expression);
  26362. const container = { type: "JSXExpressionContainer", expression };
  26363. state.patch(node2, container);
  26364. return container;
  26365. }
  26366. // node_modules/hast-util-to-estree/node_modules/comma-separated-tokens/index.js
  26367. function stringify2(values, options) {
  26368. const settings = options || {};
  26369. const input = values[values.length - 1] === "" ? [...values, ""] : values;
  26370. return input.join(
  26371. (settings.padRight ? " " : "") + "," + (settings.padLeft === false ? "" : " ")
  26372. ).trim();
  26373. }
  26374. // node_modules/hast-util-to-estree/node_modules/property-information/lib/util/schema.js
  26375. var Schema = class {
  26376. /**
  26377. * @constructor
  26378. * @param {Properties} property
  26379. * @param {Normal} normal
  26380. * @param {string} [space]
  26381. */
  26382. constructor(property, normal, space2) {
  26383. this.property = property;
  26384. this.normal = normal;
  26385. if (space2) {
  26386. this.space = space2;
  26387. }
  26388. }
  26389. };
  26390. Schema.prototype.property = {};
  26391. Schema.prototype.normal = {};
  26392. Schema.prototype.space = null;
  26393. // node_modules/hast-util-to-estree/node_modules/property-information/lib/util/merge.js
  26394. function merge(definitions, space2) {
  26395. const property = {};
  26396. const normal = {};
  26397. let index2 = -1;
  26398. while (++index2 < definitions.length) {
  26399. Object.assign(property, definitions[index2].property);
  26400. Object.assign(normal, definitions[index2].normal);
  26401. }
  26402. return new Schema(property, normal, space2);
  26403. }
  26404. // node_modules/hast-util-to-estree/node_modules/property-information/lib/normalize.js
  26405. function normalize(value) {
  26406. return value.toLowerCase();
  26407. }
  26408. // node_modules/hast-util-to-estree/node_modules/property-information/lib/util/info.js
  26409. var Info = class {
  26410. /**
  26411. * @constructor
  26412. * @param {string} property
  26413. * @param {string} attribute
  26414. */
  26415. constructor(property, attribute) {
  26416. this.property = property;
  26417. this.attribute = attribute;
  26418. }
  26419. };
  26420. Info.prototype.space = null;
  26421. Info.prototype.boolean = false;
  26422. Info.prototype.booleanish = false;
  26423. Info.prototype.overloadedBoolean = false;
  26424. Info.prototype.number = false;
  26425. Info.prototype.commaSeparated = false;
  26426. Info.prototype.spaceSeparated = false;
  26427. Info.prototype.commaOrSpaceSeparated = false;
  26428. Info.prototype.mustUseProperty = false;
  26429. Info.prototype.defined = false;
  26430. // node_modules/hast-util-to-estree/node_modules/property-information/lib/util/types.js
  26431. var types_exports = {};
  26432. __export(types_exports, {
  26433. boolean: () => boolean,
  26434. booleanish: () => booleanish,
  26435. commaOrSpaceSeparated: () => commaOrSpaceSeparated,
  26436. commaSeparated: () => commaSeparated,
  26437. number: () => number,
  26438. overloadedBoolean: () => overloadedBoolean,
  26439. spaceSeparated: () => spaceSeparated
  26440. });
  26441. var powers = 0;
  26442. var boolean = increment();
  26443. var booleanish = increment();
  26444. var overloadedBoolean = increment();
  26445. var number = increment();
  26446. var spaceSeparated = increment();
  26447. var commaSeparated = increment();
  26448. var commaOrSpaceSeparated = increment();
  26449. function increment() {
  26450. return 2 ** ++powers;
  26451. }
  26452. // node_modules/hast-util-to-estree/node_modules/property-information/lib/util/defined-info.js
  26453. var checks = Object.keys(types_exports);
  26454. var DefinedInfo = class extends Info {
  26455. /**
  26456. * @constructor
  26457. * @param {string} property
  26458. * @param {string} attribute
  26459. * @param {number|null} [mask]
  26460. * @param {string} [space]
  26461. */
  26462. constructor(property, attribute, mask, space2) {
  26463. let index2 = -1;
  26464. super(property, attribute);
  26465. mark(this, "space", space2);
  26466. if (typeof mask === "number") {
  26467. while (++index2 < checks.length) {
  26468. const check = checks[index2];
  26469. mark(this, checks[index2], (mask & types_exports[check]) === types_exports[check]);
  26470. }
  26471. }
  26472. }
  26473. };
  26474. DefinedInfo.prototype.defined = true;
  26475. function mark(values, key, value) {
  26476. if (value) {
  26477. values[key] = value;
  26478. }
  26479. }
  26480. // node_modules/hast-util-to-estree/node_modules/property-information/lib/util/create.js
  26481. var own6 = {}.hasOwnProperty;
  26482. function create3(definition2) {
  26483. const property = {};
  26484. const normal = {};
  26485. let prop;
  26486. for (prop in definition2.properties) {
  26487. if (own6.call(definition2.properties, prop)) {
  26488. const value = definition2.properties[prop];
  26489. const info = new DefinedInfo(
  26490. prop,
  26491. definition2.transform(definition2.attributes || {}, prop),
  26492. value,
  26493. definition2.space
  26494. );
  26495. if (definition2.mustUseProperty && definition2.mustUseProperty.includes(prop)) {
  26496. info.mustUseProperty = true;
  26497. }
  26498. property[prop] = info;
  26499. normal[normalize(prop)] = prop;
  26500. normal[normalize(info.attribute)] = prop;
  26501. }
  26502. }
  26503. return new Schema(property, normal, definition2.space);
  26504. }
  26505. // node_modules/hast-util-to-estree/node_modules/property-information/lib/xlink.js
  26506. var xlink = create3({
  26507. space: "xlink",
  26508. transform(_, prop) {
  26509. return "xlink:" + prop.slice(5).toLowerCase();
  26510. },
  26511. properties: {
  26512. xLinkActuate: null,
  26513. xLinkArcRole: null,
  26514. xLinkHref: null,
  26515. xLinkRole: null,
  26516. xLinkShow: null,
  26517. xLinkTitle: null,
  26518. xLinkType: null
  26519. }
  26520. });
  26521. // node_modules/hast-util-to-estree/node_modules/property-information/lib/xml.js
  26522. var xml = create3({
  26523. space: "xml",
  26524. transform(_, prop) {
  26525. return "xml:" + prop.slice(3).toLowerCase();
  26526. },
  26527. properties: { xmlLang: null, xmlBase: null, xmlSpace: null }
  26528. });
  26529. // node_modules/hast-util-to-estree/node_modules/property-information/lib/util/case-sensitive-transform.js
  26530. function caseSensitiveTransform(attributes, attribute) {
  26531. return attribute in attributes ? attributes[attribute] : attribute;
  26532. }
  26533. // node_modules/hast-util-to-estree/node_modules/property-information/lib/util/case-insensitive-transform.js
  26534. function caseInsensitiveTransform(attributes, property) {
  26535. return caseSensitiveTransform(attributes, property.toLowerCase());
  26536. }
  26537. // node_modules/hast-util-to-estree/node_modules/property-information/lib/xmlns.js
  26538. var xmlns = create3({
  26539. space: "xmlns",
  26540. attributes: { xmlnsxlink: "xmlns:xlink" },
  26541. transform: caseInsensitiveTransform,
  26542. properties: { xmlns: null, xmlnsXLink: null }
  26543. });
  26544. // node_modules/hast-util-to-estree/node_modules/property-information/lib/aria.js
  26545. var aria = create3({
  26546. transform(_, prop) {
  26547. return prop === "role" ? prop : "aria-" + prop.slice(4).toLowerCase();
  26548. },
  26549. properties: {
  26550. ariaActiveDescendant: null,
  26551. ariaAtomic: booleanish,
  26552. ariaAutoComplete: null,
  26553. ariaBusy: booleanish,
  26554. ariaChecked: booleanish,
  26555. ariaColCount: number,
  26556. ariaColIndex: number,
  26557. ariaColSpan: number,
  26558. ariaControls: spaceSeparated,
  26559. ariaCurrent: null,
  26560. ariaDescribedBy: spaceSeparated,
  26561. ariaDetails: null,
  26562. ariaDisabled: booleanish,
  26563. ariaDropEffect: spaceSeparated,
  26564. ariaErrorMessage: null,
  26565. ariaExpanded: booleanish,
  26566. ariaFlowTo: spaceSeparated,
  26567. ariaGrabbed: booleanish,
  26568. ariaHasPopup: null,
  26569. ariaHidden: booleanish,
  26570. ariaInvalid: null,
  26571. ariaKeyShortcuts: null,
  26572. ariaLabel: null,
  26573. ariaLabelledBy: spaceSeparated,
  26574. ariaLevel: number,
  26575. ariaLive: null,
  26576. ariaModal: booleanish,
  26577. ariaMultiLine: booleanish,
  26578. ariaMultiSelectable: booleanish,
  26579. ariaOrientation: null,
  26580. ariaOwns: spaceSeparated,
  26581. ariaPlaceholder: null,
  26582. ariaPosInSet: number,
  26583. ariaPressed: booleanish,
  26584. ariaReadOnly: booleanish,
  26585. ariaRelevant: null,
  26586. ariaRequired: booleanish,
  26587. ariaRoleDescription: spaceSeparated,
  26588. ariaRowCount: number,
  26589. ariaRowIndex: number,
  26590. ariaRowSpan: number,
  26591. ariaSelected: booleanish,
  26592. ariaSetSize: number,
  26593. ariaSort: null,
  26594. ariaValueMax: number,
  26595. ariaValueMin: number,
  26596. ariaValueNow: number,
  26597. ariaValueText: null,
  26598. role: null
  26599. }
  26600. });
  26601. // node_modules/hast-util-to-estree/node_modules/property-information/lib/html.js
  26602. var html2 = create3({
  26603. space: "html",
  26604. attributes: {
  26605. acceptcharset: "accept-charset",
  26606. classname: "class",
  26607. htmlfor: "for",
  26608. httpequiv: "http-equiv"
  26609. },
  26610. transform: caseInsensitiveTransform,
  26611. mustUseProperty: ["checked", "multiple", "muted", "selected"],
  26612. properties: {
  26613. // Standard Properties.
  26614. abbr: null,
  26615. accept: commaSeparated,
  26616. acceptCharset: spaceSeparated,
  26617. accessKey: spaceSeparated,
  26618. action: null,
  26619. allow: null,
  26620. allowFullScreen: boolean,
  26621. allowPaymentRequest: boolean,
  26622. allowUserMedia: boolean,
  26623. alt: null,
  26624. as: null,
  26625. async: boolean,
  26626. autoCapitalize: null,
  26627. autoComplete: spaceSeparated,
  26628. autoFocus: boolean,
  26629. autoPlay: boolean,
  26630. blocking: spaceSeparated,
  26631. capture: null,
  26632. charSet: null,
  26633. checked: boolean,
  26634. cite: null,
  26635. className: spaceSeparated,
  26636. cols: number,
  26637. colSpan: null,
  26638. content: null,
  26639. contentEditable: booleanish,
  26640. controls: boolean,
  26641. controlsList: spaceSeparated,
  26642. coords: number | commaSeparated,
  26643. crossOrigin: null,
  26644. data: null,
  26645. dateTime: null,
  26646. decoding: null,
  26647. default: boolean,
  26648. defer: boolean,
  26649. dir: null,
  26650. dirName: null,
  26651. disabled: boolean,
  26652. download: overloadedBoolean,
  26653. draggable: booleanish,
  26654. encType: null,
  26655. enterKeyHint: null,
  26656. fetchPriority: null,
  26657. form: null,
  26658. formAction: null,
  26659. formEncType: null,
  26660. formMethod: null,
  26661. formNoValidate: boolean,
  26662. formTarget: null,
  26663. headers: spaceSeparated,
  26664. height: number,
  26665. hidden: boolean,
  26666. high: number,
  26667. href: null,
  26668. hrefLang: null,
  26669. htmlFor: spaceSeparated,
  26670. httpEquiv: spaceSeparated,
  26671. id: null,
  26672. imageSizes: null,
  26673. imageSrcSet: null,
  26674. inert: boolean,
  26675. inputMode: null,
  26676. integrity: null,
  26677. is: null,
  26678. isMap: boolean,
  26679. itemId: null,
  26680. itemProp: spaceSeparated,
  26681. itemRef: spaceSeparated,
  26682. itemScope: boolean,
  26683. itemType: spaceSeparated,
  26684. kind: null,
  26685. label: null,
  26686. lang: null,
  26687. language: null,
  26688. list: null,
  26689. loading: null,
  26690. loop: boolean,
  26691. low: number,
  26692. manifest: null,
  26693. max: null,
  26694. maxLength: number,
  26695. media: null,
  26696. method: null,
  26697. min: null,
  26698. minLength: number,
  26699. multiple: boolean,
  26700. muted: boolean,
  26701. name: null,
  26702. nonce: null,
  26703. noModule: boolean,
  26704. noValidate: boolean,
  26705. onAbort: null,
  26706. onAfterPrint: null,
  26707. onAuxClick: null,
  26708. onBeforeMatch: null,
  26709. onBeforePrint: null,
  26710. onBeforeToggle: null,
  26711. onBeforeUnload: null,
  26712. onBlur: null,
  26713. onCancel: null,
  26714. onCanPlay: null,
  26715. onCanPlayThrough: null,
  26716. onChange: null,
  26717. onClick: null,
  26718. onClose: null,
  26719. onContextLost: null,
  26720. onContextMenu: null,
  26721. onContextRestored: null,
  26722. onCopy: null,
  26723. onCueChange: null,
  26724. onCut: null,
  26725. onDblClick: null,
  26726. onDrag: null,
  26727. onDragEnd: null,
  26728. onDragEnter: null,
  26729. onDragExit: null,
  26730. onDragLeave: null,
  26731. onDragOver: null,
  26732. onDragStart: null,
  26733. onDrop: null,
  26734. onDurationChange: null,
  26735. onEmptied: null,
  26736. onEnded: null,
  26737. onError: null,
  26738. onFocus: null,
  26739. onFormData: null,
  26740. onHashChange: null,
  26741. onInput: null,
  26742. onInvalid: null,
  26743. onKeyDown: null,
  26744. onKeyPress: null,
  26745. onKeyUp: null,
  26746. onLanguageChange: null,
  26747. onLoad: null,
  26748. onLoadedData: null,
  26749. onLoadedMetadata: null,
  26750. onLoadEnd: null,
  26751. onLoadStart: null,
  26752. onMessage: null,
  26753. onMessageError: null,
  26754. onMouseDown: null,
  26755. onMouseEnter: null,
  26756. onMouseLeave: null,
  26757. onMouseMove: null,
  26758. onMouseOut: null,
  26759. onMouseOver: null,
  26760. onMouseUp: null,
  26761. onOffline: null,
  26762. onOnline: null,
  26763. onPageHide: null,
  26764. onPageShow: null,
  26765. onPaste: null,
  26766. onPause: null,
  26767. onPlay: null,
  26768. onPlaying: null,
  26769. onPopState: null,
  26770. onProgress: null,
  26771. onRateChange: null,
  26772. onRejectionHandled: null,
  26773. onReset: null,
  26774. onResize: null,
  26775. onScroll: null,
  26776. onScrollEnd: null,
  26777. onSecurityPolicyViolation: null,
  26778. onSeeked: null,
  26779. onSeeking: null,
  26780. onSelect: null,
  26781. onSlotChange: null,
  26782. onStalled: null,
  26783. onStorage: null,
  26784. onSubmit: null,
  26785. onSuspend: null,
  26786. onTimeUpdate: null,
  26787. onToggle: null,
  26788. onUnhandledRejection: null,
  26789. onUnload: null,
  26790. onVolumeChange: null,
  26791. onWaiting: null,
  26792. onWheel: null,
  26793. open: boolean,
  26794. optimum: number,
  26795. pattern: null,
  26796. ping: spaceSeparated,
  26797. placeholder: null,
  26798. playsInline: boolean,
  26799. popover: null,
  26800. popoverTarget: null,
  26801. popoverTargetAction: null,
  26802. poster: null,
  26803. preload: null,
  26804. readOnly: boolean,
  26805. referrerPolicy: null,
  26806. rel: spaceSeparated,
  26807. required: boolean,
  26808. reversed: boolean,
  26809. rows: number,
  26810. rowSpan: number,
  26811. sandbox: spaceSeparated,
  26812. scope: null,
  26813. scoped: boolean,
  26814. seamless: boolean,
  26815. selected: boolean,
  26816. shadowRootClonable: boolean,
  26817. shadowRootDelegatesFocus: boolean,
  26818. shadowRootMode: null,
  26819. shape: null,
  26820. size: number,
  26821. sizes: null,
  26822. slot: null,
  26823. span: number,
  26824. spellCheck: booleanish,
  26825. src: null,
  26826. srcDoc: null,
  26827. srcLang: null,
  26828. srcSet: null,
  26829. start: number,
  26830. step: null,
  26831. style: null,
  26832. tabIndex: number,
  26833. target: null,
  26834. title: null,
  26835. translate: null,
  26836. type: null,
  26837. typeMustMatch: boolean,
  26838. useMap: null,
  26839. value: booleanish,
  26840. width: number,
  26841. wrap: null,
  26842. writingSuggestions: null,
  26843. // Legacy.
  26844. // See: https://html.spec.whatwg.org/#other-elements,-attributes-and-apis
  26845. align: null,
  26846. // Several. Use CSS `text-align` instead,
  26847. aLink: null,
  26848. // `<body>`. Use CSS `a:active {color}` instead
  26849. archive: spaceSeparated,
  26850. // `<object>`. List of URIs to archives
  26851. axis: null,
  26852. // `<td>` and `<th>`. Use `scope` on `<th>`
  26853. background: null,
  26854. // `<body>`. Use CSS `background-image` instead
  26855. bgColor: null,
  26856. // `<body>` and table elements. Use CSS `background-color` instead
  26857. border: number,
  26858. // `<table>`. Use CSS `border-width` instead,
  26859. borderColor: null,
  26860. // `<table>`. Use CSS `border-color` instead,
  26861. bottomMargin: number,
  26862. // `<body>`
  26863. cellPadding: null,
  26864. // `<table>`
  26865. cellSpacing: null,
  26866. // `<table>`
  26867. char: null,
  26868. // Several table elements. When `align=char`, sets the character to align on
  26869. charOff: null,
  26870. // Several table elements. When `char`, offsets the alignment
  26871. classId: null,
  26872. // `<object>`
  26873. clear: null,
  26874. // `<br>`. Use CSS `clear` instead
  26875. code: null,
  26876. // `<object>`
  26877. codeBase: null,
  26878. // `<object>`
  26879. codeType: null,
  26880. // `<object>`
  26881. color: null,
  26882. // `<font>` and `<hr>`. Use CSS instead
  26883. compact: boolean,
  26884. // Lists. Use CSS to reduce space between items instead
  26885. declare: boolean,
  26886. // `<object>`
  26887. event: null,
  26888. // `<script>`
  26889. face: null,
  26890. // `<font>`. Use CSS instead
  26891. frame: null,
  26892. // `<table>`
  26893. frameBorder: null,
  26894. // `<iframe>`. Use CSS `border` instead
  26895. hSpace: number,
  26896. // `<img>` and `<object>`
  26897. leftMargin: number,
  26898. // `<body>`
  26899. link: null,
  26900. // `<body>`. Use CSS `a:link {color: *}` instead
  26901. longDesc: null,
  26902. // `<frame>`, `<iframe>`, and `<img>`. Use an `<a>`
  26903. lowSrc: null,
  26904. // `<img>`. Use a `<picture>`
  26905. marginHeight: number,
  26906. // `<body>`
  26907. marginWidth: number,
  26908. // `<body>`
  26909. noResize: boolean,
  26910. // `<frame>`
  26911. noHref: boolean,
  26912. // `<area>`. Use no href instead of an explicit `nohref`
  26913. noShade: boolean,
  26914. // `<hr>`. Use background-color and height instead of borders
  26915. noWrap: boolean,
  26916. // `<td>` and `<th>`
  26917. object: null,
  26918. // `<applet>`
  26919. profile: null,
  26920. // `<head>`
  26921. prompt: null,
  26922. // `<isindex>`
  26923. rev: null,
  26924. // `<link>`
  26925. rightMargin: number,
  26926. // `<body>`
  26927. rules: null,
  26928. // `<table>`
  26929. scheme: null,
  26930. // `<meta>`
  26931. scrolling: booleanish,
  26932. // `<frame>`. Use overflow in the child context
  26933. standby: null,
  26934. // `<object>`
  26935. summary: null,
  26936. // `<table>`
  26937. text: null,
  26938. // `<body>`. Use CSS `color` instead
  26939. topMargin: number,
  26940. // `<body>`
  26941. valueType: null,
  26942. // `<param>`
  26943. version: null,
  26944. // `<html>`. Use a doctype.
  26945. vAlign: null,
  26946. // Several. Use CSS `vertical-align` instead
  26947. vLink: null,
  26948. // `<body>`. Use CSS `a:visited {color}` instead
  26949. vSpace: number,
  26950. // `<img>` and `<object>`
  26951. // Non-standard Properties.
  26952. allowTransparency: null,
  26953. autoCorrect: null,
  26954. autoSave: null,
  26955. disablePictureInPicture: boolean,
  26956. disableRemotePlayback: boolean,
  26957. prefix: null,
  26958. property: null,
  26959. results: number,
  26960. security: null,
  26961. unselectable: null
  26962. }
  26963. });
  26964. // node_modules/hast-util-to-estree/node_modules/property-information/lib/svg.js
  26965. var svg = create3({
  26966. space: "svg",
  26967. attributes: {
  26968. accentHeight: "accent-height",
  26969. alignmentBaseline: "alignment-baseline",
  26970. arabicForm: "arabic-form",
  26971. baselineShift: "baseline-shift",
  26972. capHeight: "cap-height",
  26973. className: "class",
  26974. clipPath: "clip-path",
  26975. clipRule: "clip-rule",
  26976. colorInterpolation: "color-interpolation",
  26977. colorInterpolationFilters: "color-interpolation-filters",
  26978. colorProfile: "color-profile",
  26979. colorRendering: "color-rendering",
  26980. crossOrigin: "crossorigin",
  26981. dataType: "datatype",
  26982. dominantBaseline: "dominant-baseline",
  26983. enableBackground: "enable-background",
  26984. fillOpacity: "fill-opacity",
  26985. fillRule: "fill-rule",
  26986. floodColor: "flood-color",
  26987. floodOpacity: "flood-opacity",
  26988. fontFamily: "font-family",
  26989. fontSize: "font-size",
  26990. fontSizeAdjust: "font-size-adjust",
  26991. fontStretch: "font-stretch",
  26992. fontStyle: "font-style",
  26993. fontVariant: "font-variant",
  26994. fontWeight: "font-weight",
  26995. glyphName: "glyph-name",
  26996. glyphOrientationHorizontal: "glyph-orientation-horizontal",
  26997. glyphOrientationVertical: "glyph-orientation-vertical",
  26998. hrefLang: "hreflang",
  26999. horizAdvX: "horiz-adv-x",
  27000. horizOriginX: "horiz-origin-x",
  27001. horizOriginY: "horiz-origin-y",
  27002. imageRendering: "image-rendering",
  27003. letterSpacing: "letter-spacing",
  27004. lightingColor: "lighting-color",
  27005. markerEnd: "marker-end",
  27006. markerMid: "marker-mid",
  27007. markerStart: "marker-start",
  27008. navDown: "nav-down",
  27009. navDownLeft: "nav-down-left",
  27010. navDownRight: "nav-down-right",
  27011. navLeft: "nav-left",
  27012. navNext: "nav-next",
  27013. navPrev: "nav-prev",
  27014. navRight: "nav-right",
  27015. navUp: "nav-up",
  27016. navUpLeft: "nav-up-left",
  27017. navUpRight: "nav-up-right",
  27018. onAbort: "onabort",
  27019. onActivate: "onactivate",
  27020. onAfterPrint: "onafterprint",
  27021. onBeforePrint: "onbeforeprint",
  27022. onBegin: "onbegin",
  27023. onCancel: "oncancel",
  27024. onCanPlay: "oncanplay",
  27025. onCanPlayThrough: "oncanplaythrough",
  27026. onChange: "onchange",
  27027. onClick: "onclick",
  27028. onClose: "onclose",
  27029. onCopy: "oncopy",
  27030. onCueChange: "oncuechange",
  27031. onCut: "oncut",
  27032. onDblClick: "ondblclick",
  27033. onDrag: "ondrag",
  27034. onDragEnd: "ondragend",
  27035. onDragEnter: "ondragenter",
  27036. onDragExit: "ondragexit",
  27037. onDragLeave: "ondragleave",
  27038. onDragOver: "ondragover",
  27039. onDragStart: "ondragstart",
  27040. onDrop: "ondrop",
  27041. onDurationChange: "ondurationchange",
  27042. onEmptied: "onemptied",
  27043. onEnd: "onend",
  27044. onEnded: "onended",
  27045. onError: "onerror",
  27046. onFocus: "onfocus",
  27047. onFocusIn: "onfocusin",
  27048. onFocusOut: "onfocusout",
  27049. onHashChange: "onhashchange",
  27050. onInput: "oninput",
  27051. onInvalid: "oninvalid",
  27052. onKeyDown: "onkeydown",
  27053. onKeyPress: "onkeypress",
  27054. onKeyUp: "onkeyup",
  27055. onLoad: "onload",
  27056. onLoadedData: "onloadeddata",
  27057. onLoadedMetadata: "onloadedmetadata",
  27058. onLoadStart: "onloadstart",
  27059. onMessage: "onmessage",
  27060. onMouseDown: "onmousedown",
  27061. onMouseEnter: "onmouseenter",
  27062. onMouseLeave: "onmouseleave",
  27063. onMouseMove: "onmousemove",
  27064. onMouseOut: "onmouseout",
  27065. onMouseOver: "onmouseover",
  27066. onMouseUp: "onmouseup",
  27067. onMouseWheel: "onmousewheel",
  27068. onOffline: "onoffline",
  27069. onOnline: "ononline",
  27070. onPageHide: "onpagehide",
  27071. onPageShow: "onpageshow",
  27072. onPaste: "onpaste",
  27073. onPause: "onpause",
  27074. onPlay: "onplay",
  27075. onPlaying: "onplaying",
  27076. onPopState: "onpopstate",
  27077. onProgress: "onprogress",
  27078. onRateChange: "onratechange",
  27079. onRepeat: "onrepeat",
  27080. onReset: "onreset",
  27081. onResize: "onresize",
  27082. onScroll: "onscroll",
  27083. onSeeked: "onseeked",
  27084. onSeeking: "onseeking",
  27085. onSelect: "onselect",
  27086. onShow: "onshow",
  27087. onStalled: "onstalled",
  27088. onStorage: "onstorage",
  27089. onSubmit: "onsubmit",
  27090. onSuspend: "onsuspend",
  27091. onTimeUpdate: "ontimeupdate",
  27092. onToggle: "ontoggle",
  27093. onUnload: "onunload",
  27094. onVolumeChange: "onvolumechange",
  27095. onWaiting: "onwaiting",
  27096. onZoom: "onzoom",
  27097. overlinePosition: "overline-position",
  27098. overlineThickness: "overline-thickness",
  27099. paintOrder: "paint-order",
  27100. panose1: "panose-1",
  27101. pointerEvents: "pointer-events",
  27102. referrerPolicy: "referrerpolicy",
  27103. renderingIntent: "rendering-intent",
  27104. shapeRendering: "shape-rendering",
  27105. stopColor: "stop-color",
  27106. stopOpacity: "stop-opacity",
  27107. strikethroughPosition: "strikethrough-position",
  27108. strikethroughThickness: "strikethrough-thickness",
  27109. strokeDashArray: "stroke-dasharray",
  27110. strokeDashOffset: "stroke-dashoffset",
  27111. strokeLineCap: "stroke-linecap",
  27112. strokeLineJoin: "stroke-linejoin",
  27113. strokeMiterLimit: "stroke-miterlimit",
  27114. strokeOpacity: "stroke-opacity",
  27115. strokeWidth: "stroke-width",
  27116. tabIndex: "tabindex",
  27117. textAnchor: "text-anchor",
  27118. textDecoration: "text-decoration",
  27119. textRendering: "text-rendering",
  27120. transformOrigin: "transform-origin",
  27121. typeOf: "typeof",
  27122. underlinePosition: "underline-position",
  27123. underlineThickness: "underline-thickness",
  27124. unicodeBidi: "unicode-bidi",
  27125. unicodeRange: "unicode-range",
  27126. unitsPerEm: "units-per-em",
  27127. vAlphabetic: "v-alphabetic",
  27128. vHanging: "v-hanging",
  27129. vIdeographic: "v-ideographic",
  27130. vMathematical: "v-mathematical",
  27131. vectorEffect: "vector-effect",
  27132. vertAdvY: "vert-adv-y",
  27133. vertOriginX: "vert-origin-x",
  27134. vertOriginY: "vert-origin-y",
  27135. wordSpacing: "word-spacing",
  27136. writingMode: "writing-mode",
  27137. xHeight: "x-height",
  27138. // These were camelcased in Tiny. Now lowercased in SVG 2
  27139. playbackOrder: "playbackorder",
  27140. timelineBegin: "timelinebegin"
  27141. },
  27142. transform: caseSensitiveTransform,
  27143. properties: {
  27144. about: commaOrSpaceSeparated,
  27145. accentHeight: number,
  27146. accumulate: null,
  27147. additive: null,
  27148. alignmentBaseline: null,
  27149. alphabetic: number,
  27150. amplitude: number,
  27151. arabicForm: null,
  27152. ascent: number,
  27153. attributeName: null,
  27154. attributeType: null,
  27155. azimuth: number,
  27156. bandwidth: null,
  27157. baselineShift: null,
  27158. baseFrequency: null,
  27159. baseProfile: null,
  27160. bbox: null,
  27161. begin: null,
  27162. bias: number,
  27163. by: null,
  27164. calcMode: null,
  27165. capHeight: number,
  27166. className: spaceSeparated,
  27167. clip: null,
  27168. clipPath: null,
  27169. clipPathUnits: null,
  27170. clipRule: null,
  27171. color: null,
  27172. colorInterpolation: null,
  27173. colorInterpolationFilters: null,
  27174. colorProfile: null,
  27175. colorRendering: null,
  27176. content: null,
  27177. contentScriptType: null,
  27178. contentStyleType: null,
  27179. crossOrigin: null,
  27180. cursor: null,
  27181. cx: null,
  27182. cy: null,
  27183. d: null,
  27184. dataType: null,
  27185. defaultAction: null,
  27186. descent: number,
  27187. diffuseConstant: number,
  27188. direction: null,
  27189. display: null,
  27190. dur: null,
  27191. divisor: number,
  27192. dominantBaseline: null,
  27193. download: boolean,
  27194. dx: null,
  27195. dy: null,
  27196. edgeMode: null,
  27197. editable: null,
  27198. elevation: number,
  27199. enableBackground: null,
  27200. end: null,
  27201. event: null,
  27202. exponent: number,
  27203. externalResourcesRequired: null,
  27204. fill: null,
  27205. fillOpacity: number,
  27206. fillRule: null,
  27207. filter: null,
  27208. filterRes: null,
  27209. filterUnits: null,
  27210. floodColor: null,
  27211. floodOpacity: null,
  27212. focusable: null,
  27213. focusHighlight: null,
  27214. fontFamily: null,
  27215. fontSize: null,
  27216. fontSizeAdjust: null,
  27217. fontStretch: null,
  27218. fontStyle: null,
  27219. fontVariant: null,
  27220. fontWeight: null,
  27221. format: null,
  27222. fr: null,
  27223. from: null,
  27224. fx: null,
  27225. fy: null,
  27226. g1: commaSeparated,
  27227. g2: commaSeparated,
  27228. glyphName: commaSeparated,
  27229. glyphOrientationHorizontal: null,
  27230. glyphOrientationVertical: null,
  27231. glyphRef: null,
  27232. gradientTransform: null,
  27233. gradientUnits: null,
  27234. handler: null,
  27235. hanging: number,
  27236. hatchContentUnits: null,
  27237. hatchUnits: null,
  27238. height: null,
  27239. href: null,
  27240. hrefLang: null,
  27241. horizAdvX: number,
  27242. horizOriginX: number,
  27243. horizOriginY: number,
  27244. id: null,
  27245. ideographic: number,
  27246. imageRendering: null,
  27247. initialVisibility: null,
  27248. in: null,
  27249. in2: null,
  27250. intercept: number,
  27251. k: number,
  27252. k1: number,
  27253. k2: number,
  27254. k3: number,
  27255. k4: number,
  27256. kernelMatrix: commaOrSpaceSeparated,
  27257. kernelUnitLength: null,
  27258. keyPoints: null,
  27259. // SEMI_COLON_SEPARATED
  27260. keySplines: null,
  27261. // SEMI_COLON_SEPARATED
  27262. keyTimes: null,
  27263. // SEMI_COLON_SEPARATED
  27264. kerning: null,
  27265. lang: null,
  27266. lengthAdjust: null,
  27267. letterSpacing: null,
  27268. lightingColor: null,
  27269. limitingConeAngle: number,
  27270. local: null,
  27271. markerEnd: null,
  27272. markerMid: null,
  27273. markerStart: null,
  27274. markerHeight: null,
  27275. markerUnits: null,
  27276. markerWidth: null,
  27277. mask: null,
  27278. maskContentUnits: null,
  27279. maskUnits: null,
  27280. mathematical: null,
  27281. max: null,
  27282. media: null,
  27283. mediaCharacterEncoding: null,
  27284. mediaContentEncodings: null,
  27285. mediaSize: number,
  27286. mediaTime: null,
  27287. method: null,
  27288. min: null,
  27289. mode: null,
  27290. name: null,
  27291. navDown: null,
  27292. navDownLeft: null,
  27293. navDownRight: null,
  27294. navLeft: null,
  27295. navNext: null,
  27296. navPrev: null,
  27297. navRight: null,
  27298. navUp: null,
  27299. navUpLeft: null,
  27300. navUpRight: null,
  27301. numOctaves: null,
  27302. observer: null,
  27303. offset: null,
  27304. onAbort: null,
  27305. onActivate: null,
  27306. onAfterPrint: null,
  27307. onBeforePrint: null,
  27308. onBegin: null,
  27309. onCancel: null,
  27310. onCanPlay: null,
  27311. onCanPlayThrough: null,
  27312. onChange: null,
  27313. onClick: null,
  27314. onClose: null,
  27315. onCopy: null,
  27316. onCueChange: null,
  27317. onCut: null,
  27318. onDblClick: null,
  27319. onDrag: null,
  27320. onDragEnd: null,
  27321. onDragEnter: null,
  27322. onDragExit: null,
  27323. onDragLeave: null,
  27324. onDragOver: null,
  27325. onDragStart: null,
  27326. onDrop: null,
  27327. onDurationChange: null,
  27328. onEmptied: null,
  27329. onEnd: null,
  27330. onEnded: null,
  27331. onError: null,
  27332. onFocus: null,
  27333. onFocusIn: null,
  27334. onFocusOut: null,
  27335. onHashChange: null,
  27336. onInput: null,
  27337. onInvalid: null,
  27338. onKeyDown: null,
  27339. onKeyPress: null,
  27340. onKeyUp: null,
  27341. onLoad: null,
  27342. onLoadedData: null,
  27343. onLoadedMetadata: null,
  27344. onLoadStart: null,
  27345. onMessage: null,
  27346. onMouseDown: null,
  27347. onMouseEnter: null,
  27348. onMouseLeave: null,
  27349. onMouseMove: null,
  27350. onMouseOut: null,
  27351. onMouseOver: null,
  27352. onMouseUp: null,
  27353. onMouseWheel: null,
  27354. onOffline: null,
  27355. onOnline: null,
  27356. onPageHide: null,
  27357. onPageShow: null,
  27358. onPaste: null,
  27359. onPause: null,
  27360. onPlay: null,
  27361. onPlaying: null,
  27362. onPopState: null,
  27363. onProgress: null,
  27364. onRateChange: null,
  27365. onRepeat: null,
  27366. onReset: null,
  27367. onResize: null,
  27368. onScroll: null,
  27369. onSeeked: null,
  27370. onSeeking: null,
  27371. onSelect: null,
  27372. onShow: null,
  27373. onStalled: null,
  27374. onStorage: null,
  27375. onSubmit: null,
  27376. onSuspend: null,
  27377. onTimeUpdate: null,
  27378. onToggle: null,
  27379. onUnload: null,
  27380. onVolumeChange: null,
  27381. onWaiting: null,
  27382. onZoom: null,
  27383. opacity: null,
  27384. operator: null,
  27385. order: null,
  27386. orient: null,
  27387. orientation: null,
  27388. origin: null,
  27389. overflow: null,
  27390. overlay: null,
  27391. overlinePosition: number,
  27392. overlineThickness: number,
  27393. paintOrder: null,
  27394. panose1: null,
  27395. path: null,
  27396. pathLength: number,
  27397. patternContentUnits: null,
  27398. patternTransform: null,
  27399. patternUnits: null,
  27400. phase: null,
  27401. ping: spaceSeparated,
  27402. pitch: null,
  27403. playbackOrder: null,
  27404. pointerEvents: null,
  27405. points: null,
  27406. pointsAtX: number,
  27407. pointsAtY: number,
  27408. pointsAtZ: number,
  27409. preserveAlpha: null,
  27410. preserveAspectRatio: null,
  27411. primitiveUnits: null,
  27412. propagate: null,
  27413. property: commaOrSpaceSeparated,
  27414. r: null,
  27415. radius: null,
  27416. referrerPolicy: null,
  27417. refX: null,
  27418. refY: null,
  27419. rel: commaOrSpaceSeparated,
  27420. rev: commaOrSpaceSeparated,
  27421. renderingIntent: null,
  27422. repeatCount: null,
  27423. repeatDur: null,
  27424. requiredExtensions: commaOrSpaceSeparated,
  27425. requiredFeatures: commaOrSpaceSeparated,
  27426. requiredFonts: commaOrSpaceSeparated,
  27427. requiredFormats: commaOrSpaceSeparated,
  27428. resource: null,
  27429. restart: null,
  27430. result: null,
  27431. rotate: null,
  27432. rx: null,
  27433. ry: null,
  27434. scale: null,
  27435. seed: null,
  27436. shapeRendering: null,
  27437. side: null,
  27438. slope: null,
  27439. snapshotTime: null,
  27440. specularConstant: number,
  27441. specularExponent: number,
  27442. spreadMethod: null,
  27443. spacing: null,
  27444. startOffset: null,
  27445. stdDeviation: null,
  27446. stemh: null,
  27447. stemv: null,
  27448. stitchTiles: null,
  27449. stopColor: null,
  27450. stopOpacity: null,
  27451. strikethroughPosition: number,
  27452. strikethroughThickness: number,
  27453. string: null,
  27454. stroke: null,
  27455. strokeDashArray: commaOrSpaceSeparated,
  27456. strokeDashOffset: null,
  27457. strokeLineCap: null,
  27458. strokeLineJoin: null,
  27459. strokeMiterLimit: number,
  27460. strokeOpacity: number,
  27461. strokeWidth: null,
  27462. style: null,
  27463. surfaceScale: number,
  27464. syncBehavior: null,
  27465. syncBehaviorDefault: null,
  27466. syncMaster: null,
  27467. syncTolerance: null,
  27468. syncToleranceDefault: null,
  27469. systemLanguage: commaOrSpaceSeparated,
  27470. tabIndex: number,
  27471. tableValues: null,
  27472. target: null,
  27473. targetX: number,
  27474. targetY: number,
  27475. textAnchor: null,
  27476. textDecoration: null,
  27477. textRendering: null,
  27478. textLength: null,
  27479. timelineBegin: null,
  27480. title: null,
  27481. transformBehavior: null,
  27482. type: null,
  27483. typeOf: commaOrSpaceSeparated,
  27484. to: null,
  27485. transform: null,
  27486. transformOrigin: null,
  27487. u1: null,
  27488. u2: null,
  27489. underlinePosition: number,
  27490. underlineThickness: number,
  27491. unicode: null,
  27492. unicodeBidi: null,
  27493. unicodeRange: null,
  27494. unitsPerEm: number,
  27495. values: null,
  27496. vAlphabetic: number,
  27497. vMathematical: number,
  27498. vectorEffect: null,
  27499. vHanging: number,
  27500. vIdeographic: number,
  27501. version: null,
  27502. vertAdvY: number,
  27503. vertOriginX: number,
  27504. vertOriginY: number,
  27505. viewBox: null,
  27506. viewTarget: null,
  27507. visibility: null,
  27508. width: null,
  27509. widths: null,
  27510. wordSpacing: null,
  27511. writingMode: null,
  27512. x: null,
  27513. x1: null,
  27514. x2: null,
  27515. xChannelSelector: null,
  27516. xHeight: number,
  27517. y: null,
  27518. y1: null,
  27519. y2: null,
  27520. yChannelSelector: null,
  27521. z: null,
  27522. zoomAndPan: null
  27523. }
  27524. });
  27525. // node_modules/hast-util-to-estree/node_modules/property-information/lib/find.js
  27526. var valid = /^data[-\w.:]+$/i;
  27527. var dash = /-[a-z]/g;
  27528. var cap = /[A-Z]/g;
  27529. function find(schema, value) {
  27530. const normal = normalize(value);
  27531. let prop = value;
  27532. let Type = Info;
  27533. if (normal in schema.normal) {
  27534. return schema.property[schema.normal[normal]];
  27535. }
  27536. if (normal.length > 4 && normal.slice(0, 4) === "data" && valid.test(value)) {
  27537. if (value.charAt(4) === "-") {
  27538. const rest = value.slice(5).replace(dash, camelcase);
  27539. prop = "data" + rest.charAt(0).toUpperCase() + rest.slice(1);
  27540. } else {
  27541. const rest = value.slice(4);
  27542. if (!dash.test(rest)) {
  27543. let dashes = rest.replace(cap, kebab);
  27544. if (dashes.charAt(0) !== "-") {
  27545. dashes = "-" + dashes;
  27546. }
  27547. value = "data" + dashes;
  27548. }
  27549. }
  27550. Type = DefinedInfo;
  27551. }
  27552. return new Type(prop, value);
  27553. }
  27554. function kebab($0) {
  27555. return "-" + $0.toLowerCase();
  27556. }
  27557. function camelcase($0) {
  27558. return $0.charAt(1).toUpperCase();
  27559. }
  27560. // node_modules/hast-util-to-estree/node_modules/property-information/lib/hast-to-react.js
  27561. var hastToReact = {
  27562. classId: "classID",
  27563. dataType: "datatype",
  27564. itemId: "itemID",
  27565. strokeDashArray: "strokeDasharray",
  27566. strokeDashOffset: "strokeDashoffset",
  27567. strokeLineCap: "strokeLinecap",
  27568. strokeLineJoin: "strokeLinejoin",
  27569. strokeMiterLimit: "strokeMiterlimit",
  27570. typeOf: "typeof",
  27571. xLinkActuate: "xlinkActuate",
  27572. xLinkArcRole: "xlinkArcrole",
  27573. xLinkHref: "xlinkHref",
  27574. xLinkRole: "xlinkRole",
  27575. xLinkShow: "xlinkShow",
  27576. xLinkTitle: "xlinkTitle",
  27577. xLinkType: "xlinkType",
  27578. xmlnsXLink: "xmlnsXlink"
  27579. };
  27580. // node_modules/hast-util-to-estree/node_modules/property-information/index.js
  27581. var html3 = merge([xml, xlink, xmlns, aria, html2], "html");
  27582. var svg2 = merge([xml, xlink, xmlns, aria, svg], "svg");
  27583. // node_modules/hast-util-to-estree/node_modules/space-separated-tokens/index.js
  27584. function stringify3(values) {
  27585. return values.join(" ").trim();
  27586. }
  27587. // node_modules/hast-util-to-estree/node_modules/style-to-object/index.mjs
  27588. var import_index = __toESM(require_style_to_object(), 1);
  27589. var style_to_object_default = import_index.default;
  27590. // node_modules/hast-util-to-estree/lib/handlers/element.js
  27591. var own7 = {}.hasOwnProperty;
  27592. var cap2 = /[A-Z]/g;
  27593. var dashSomething = /-([a-z])/g;
  27594. var tableCellElement = /* @__PURE__ */ new Set(["td", "th"]);
  27595. function element(node2, state) {
  27596. const parentSchema = state.schema;
  27597. let schema = parentSchema;
  27598. const props = node2.properties || {};
  27599. if (parentSchema.space === "html" && node2.tagName.toLowerCase() === "svg") {
  27600. schema = svg2;
  27601. state.schema = schema;
  27602. }
  27603. const children = state.all(node2);
  27604. const attributes = [];
  27605. let prop;
  27606. let alignValue;
  27607. let styleProperties;
  27608. for (prop in props) {
  27609. if (own7.call(props, prop)) {
  27610. let value = props[prop];
  27611. const info = find(schema, prop);
  27612. let attributeValue;
  27613. if (value === null || value === void 0 || value === false || typeof value === "number" && Number.isNaN(value) || !value && info.boolean) {
  27614. continue;
  27615. }
  27616. prop = state.elementAttributeNameCase === "react" && info.space ? hastToReact[info.property] || info.property : info.attribute;
  27617. if (Array.isArray(value)) {
  27618. value = info.commaSeparated ? stringify2(value) : stringify3(value);
  27619. }
  27620. if (prop === "style") {
  27621. let styleObject = typeof value === "object" ? value : parseStyle(String(value), node2.tagName);
  27622. if (state.stylePropertyNameCase === "css") {
  27623. styleObject = transformStylesToCssCasing(styleObject);
  27624. }
  27625. const cssProperties = [];
  27626. let cssProp;
  27627. for (cssProp in styleObject) {
  27628. if (own7.call(styleObject, cssProp)) {
  27629. cssProperties.push({
  27630. type: "Property",
  27631. method: false,
  27632. shorthand: false,
  27633. computed: false,
  27634. key: name(cssProp) ? { type: "Identifier", name: cssProp } : { type: "Literal", value: cssProp },
  27635. value: { type: "Literal", value: String(styleObject[cssProp]) },
  27636. kind: "init"
  27637. });
  27638. }
  27639. }
  27640. styleProperties = cssProperties;
  27641. attributeValue = {
  27642. type: "JSXExpressionContainer",
  27643. expression: { type: "ObjectExpression", properties: cssProperties }
  27644. };
  27645. } else if (value === true) {
  27646. attributeValue = null;
  27647. } else if (state.tableCellAlignToStyle && tableCellElement.has(node2.tagName) && prop === "align") {
  27648. alignValue = String(value);
  27649. continue;
  27650. } else {
  27651. attributeValue = { type: "Literal", value: String(value) };
  27652. }
  27653. if (name(prop, { jsx: true })) {
  27654. attributes.push({
  27655. type: "JSXAttribute",
  27656. name: { type: "JSXIdentifier", name: prop },
  27657. value: attributeValue
  27658. });
  27659. } else {
  27660. attributes.push({
  27661. type: "JSXSpreadAttribute",
  27662. argument: {
  27663. type: "ObjectExpression",
  27664. properties: [
  27665. {
  27666. type: "Property",
  27667. method: false,
  27668. shorthand: false,
  27669. computed: false,
  27670. key: { type: "Literal", value: String(prop) },
  27671. // @ts-expect-error No need to worry about `style` (which has a
  27672. // `JSXExpressionContainer` value) because that’s a valid identifier.
  27673. value: attributeValue || { type: "Literal", value: true },
  27674. kind: "init"
  27675. }
  27676. ]
  27677. }
  27678. });
  27679. }
  27680. }
  27681. }
  27682. if (alignValue !== void 0) {
  27683. if (!styleProperties) {
  27684. styleProperties = [];
  27685. attributes.push({
  27686. type: "JSXAttribute",
  27687. name: { type: "JSXIdentifier", name: "style" },
  27688. value: {
  27689. type: "JSXExpressionContainer",
  27690. expression: { type: "ObjectExpression", properties: styleProperties }
  27691. }
  27692. });
  27693. }
  27694. const cssProp = state.stylePropertyNameCase === "css" ? transformStyleToCssCasing("textAlign") : "textAlign";
  27695. styleProperties.push({
  27696. type: "Property",
  27697. method: false,
  27698. shorthand: false,
  27699. computed: false,
  27700. key: name(cssProp) ? { type: "Identifier", name: cssProp } : { type: "Literal", value: cssProp },
  27701. value: { type: "Literal", value: alignValue },
  27702. kind: "init"
  27703. });
  27704. }
  27705. state.schema = parentSchema;
  27706. const result = {
  27707. type: "JSXElement",
  27708. openingElement: {
  27709. type: "JSXOpeningElement",
  27710. attributes,
  27711. name: state.createJsxElementName(node2.tagName),
  27712. selfClosing: children.length === 0
  27713. },
  27714. closingElement: children.length > 0 ? {
  27715. type: "JSXClosingElement",
  27716. name: state.createJsxElementName(node2.tagName)
  27717. } : null,
  27718. children
  27719. };
  27720. state.inherit(node2, result);
  27721. return result;
  27722. }
  27723. function parseStyle(value, tagName) {
  27724. const result = {};
  27725. try {
  27726. style_to_object_default(value, iterator);
  27727. } catch (error) {
  27728. const cause = (
  27729. /** @type {Error} */
  27730. error
  27731. );
  27732. const exception = new Error(
  27733. "Could not parse `style` attribute on `" + tagName + "`",
  27734. { cause }
  27735. );
  27736. throw exception;
  27737. }
  27738. return result;
  27739. function iterator(name2, value2) {
  27740. let key = name2;
  27741. if (key.slice(0, 2) !== "--") {
  27742. if (key.slice(0, 4) === "-ms-") key = "ms-" + key.slice(4);
  27743. key = key.replace(dashSomething, toCamel);
  27744. }
  27745. result[key] = value2;
  27746. }
  27747. }
  27748. function transformStylesToCssCasing(domCasing) {
  27749. const cssCasing = {};
  27750. let from;
  27751. for (from in domCasing) {
  27752. if (own7.call(domCasing, from)) {
  27753. cssCasing[transformStyleToCssCasing(from)] = domCasing[from];
  27754. }
  27755. }
  27756. return cssCasing;
  27757. }
  27758. function transformStyleToCssCasing(from) {
  27759. let to = from.replace(cap2, toDash);
  27760. if (to.slice(0, 3) === "ms-") to = "-" + to;
  27761. return to;
  27762. }
  27763. function toCamel(_, $1) {
  27764. return $1.toUpperCase();
  27765. }
  27766. function toDash($0) {
  27767. return "-" + $0.toLowerCase();
  27768. }
  27769. // node_modules/estree-util-attach-comments/lib/index.js
  27770. var own8 = {}.hasOwnProperty;
  27771. var emptyComments = [];
  27772. function attachComments(tree, comments) {
  27773. const list3 = comments ? [...comments].sort(compare) : emptyComments;
  27774. if (list3.length > 0) walk2(tree, { comments: list3, index: 0 });
  27775. }
  27776. function walk2(node2, state) {
  27777. if (state.index === state.comments.length) {
  27778. return;
  27779. }
  27780. const children = [];
  27781. const comments = [];
  27782. let key;
  27783. for (key in node2) {
  27784. if (own8.call(node2, key)) {
  27785. const value = node2[key];
  27786. if (value && typeof value === "object" && key !== "comments") {
  27787. if (Array.isArray(value)) {
  27788. let index3 = -1;
  27789. while (++index3 < value.length) {
  27790. if (value[index3] && typeof value[index3].type === "string") {
  27791. children.push(value[index3]);
  27792. }
  27793. }
  27794. } else if (typeof value.type === "string") {
  27795. children.push(value);
  27796. }
  27797. }
  27798. }
  27799. }
  27800. children.sort(compare);
  27801. comments.push(...slice(state, node2, false, { leading: true, trailing: false }));
  27802. let index2 = -1;
  27803. while (++index2 < children.length) {
  27804. walk2(children[index2], state);
  27805. }
  27806. comments.push(
  27807. ...slice(state, node2, true, {
  27808. leading: false,
  27809. trailing: children.length > 0
  27810. })
  27811. );
  27812. if (comments.length > 0) {
  27813. node2.comments = comments;
  27814. }
  27815. }
  27816. function slice(state, node2, compareEnd, fields) {
  27817. const result = [];
  27818. while (state.comments[state.index] && compare(state.comments[state.index], node2, compareEnd) < 1) {
  27819. result.push(Object.assign({}, state.comments[state.index++], fields));
  27820. }
  27821. return result;
  27822. }
  27823. function compare(left, right, compareEnd) {
  27824. const field = compareEnd ? "end" : "start";
  27825. if (left.range && right.range) {
  27826. return left.range[0] - right.range[compareEnd ? 1 : 0];
  27827. }
  27828. if (left.loc && left.loc.start && right.loc && right.loc[field]) {
  27829. return left.loc.start.line - right.loc[field].line || left.loc.start.column - right.loc[field].column;
  27830. }
  27831. if ("start" in left && field in right) {
  27832. return left.start - right[field];
  27833. }
  27834. return Number.NaN;
  27835. }
  27836. // node_modules/hast-util-to-estree/lib/handlers/mdx-expression.js
  27837. function mdxExpression2(node2, state) {
  27838. const estree = node2.data && node2.data.estree;
  27839. const comments = estree && estree.comments || [];
  27840. let expression;
  27841. if (estree) {
  27842. state.comments.push(...comments);
  27843. attachComments(estree, estree.comments);
  27844. expression = estree.body[0] && estree.body[0].type === "ExpressionStatement" && estree.body[0].expression || void 0;
  27845. }
  27846. if (!expression) {
  27847. expression = { type: "JSXEmptyExpression" };
  27848. state.patch(node2, expression);
  27849. }
  27850. const result = { type: "JSXExpressionContainer", expression };
  27851. state.inherit(node2, result);
  27852. return result;
  27853. }
  27854. // node_modules/hast-util-to-estree/lib/handlers/mdx-jsx-element.js
  27855. function mdxJsxElement(node2, state) {
  27856. const parentSchema = state.schema;
  27857. let schema = parentSchema;
  27858. const attrs = node2.attributes || [];
  27859. let index2 = -1;
  27860. if (node2.name && parentSchema.space === "html" && node2.name.toLowerCase() === "svg") {
  27861. schema = svg2;
  27862. state.schema = schema;
  27863. }
  27864. const children = state.all(node2);
  27865. const attributes = [];
  27866. while (++index2 < attrs.length) {
  27867. const attr = attrs[index2];
  27868. const value = attr.value;
  27869. let attributeValue;
  27870. if (attr.type === "mdxJsxAttribute") {
  27871. if (value === null || value === void 0) {
  27872. attributeValue = null;
  27873. } else if (typeof value === "object") {
  27874. const estree = value.data && value.data.estree;
  27875. const comments = estree && estree.comments || [];
  27876. let expression;
  27877. if (estree) {
  27878. state.comments.push(...comments);
  27879. attachComments(estree, estree.comments);
  27880. expression = estree.body[0] && estree.body[0].type === "ExpressionStatement" && estree.body[0].expression || void 0;
  27881. }
  27882. attributeValue = {
  27883. type: "JSXExpressionContainer",
  27884. expression: expression || { type: "JSXEmptyExpression" }
  27885. };
  27886. state.inherit(value, attributeValue);
  27887. } else {
  27888. attributeValue = { type: "Literal", value: String(value) };
  27889. }
  27890. const attribute = {
  27891. type: "JSXAttribute",
  27892. name: state.createJsxAttributeName(attr.name),
  27893. value: attributeValue
  27894. };
  27895. state.inherit(attr, attribute);
  27896. attributes.push(attribute);
  27897. } else {
  27898. const estree = attr.data && attr.data.estree;
  27899. const comments = estree && estree.comments || [];
  27900. let argumentValue;
  27901. if (estree) {
  27902. state.comments.push(...comments);
  27903. attachComments(estree, estree.comments);
  27904. argumentValue = estree.body[0] && estree.body[0].type === "ExpressionStatement" && estree.body[0].expression && estree.body[0].expression.type === "ObjectExpression" && estree.body[0].expression.properties && estree.body[0].expression.properties[0] && estree.body[0].expression.properties[0].type === "SpreadElement" && estree.body[0].expression.properties[0].argument || void 0;
  27905. }
  27906. const attribute = {
  27907. type: "JSXSpreadAttribute",
  27908. argument: argumentValue || { type: "ObjectExpression", properties: [] }
  27909. };
  27910. state.inherit(attr, attribute);
  27911. attributes.push(attribute);
  27912. }
  27913. }
  27914. state.schema = parentSchema;
  27915. const result = node2.name ? {
  27916. type: "JSXElement",
  27917. openingElement: {
  27918. type: "JSXOpeningElement",
  27919. attributes,
  27920. name: state.createJsxElementName(node2.name),
  27921. selfClosing: children.length === 0
  27922. },
  27923. closingElement: children.length > 0 ? {
  27924. type: "JSXClosingElement",
  27925. name: state.createJsxElementName(node2.name)
  27926. } : null,
  27927. children
  27928. } : {
  27929. type: "JSXFragment",
  27930. openingFragment: { type: "JSXOpeningFragment" },
  27931. closingFragment: { type: "JSXClosingFragment" },
  27932. children
  27933. };
  27934. state.inherit(node2, result);
  27935. return result;
  27936. }
  27937. // node_modules/hast-util-to-estree/lib/handlers/mdxjs-esm.js
  27938. function mdxjsEsm2(node2, state) {
  27939. const estree = node2.data && node2.data.estree;
  27940. const comments = estree && estree.comments || [];
  27941. if (estree) {
  27942. state.comments.push(...comments);
  27943. attachComments(estree, comments);
  27944. state.esm.push(...estree.body);
  27945. }
  27946. }
  27947. // node_modules/hast-util-whitespace/lib/index.js
  27948. var re = /[ \t\n\f\r]/g;
  27949. function whitespace(thing) {
  27950. return typeof thing === "object" ? thing.type === "text" ? empty4(thing.value) : false : empty4(thing);
  27951. }
  27952. function empty4(value) {
  27953. return value.replace(re, "") === "";
  27954. }
  27955. // node_modules/hast-util-to-estree/lib/handlers/root.js
  27956. function root2(node2, state) {
  27957. const children = state.all(node2);
  27958. const cleanChildren = [];
  27959. let index2 = -1;
  27960. let queue;
  27961. while (++index2 < children.length) {
  27962. const child = children[index2];
  27963. if (child.type === "JSXExpressionContainer" && child.expression.type === "Literal" && whitespace(String(child.expression.value))) {
  27964. if (queue) queue.push(child);
  27965. } else {
  27966. if (queue) cleanChildren.push(...queue);
  27967. cleanChildren.push(child);
  27968. queue = [];
  27969. }
  27970. }
  27971. const result = {
  27972. type: "JSXFragment",
  27973. openingFragment: { type: "JSXOpeningFragment" },
  27974. closingFragment: { type: "JSXClosingFragment" },
  27975. children: cleanChildren
  27976. };
  27977. state.inherit(node2, result);
  27978. return result;
  27979. }
  27980. // node_modules/hast-util-to-estree/lib/handlers/text.js
  27981. function text4(node2, state) {
  27982. const value = String(node2.value || "");
  27983. if (value) {
  27984. const result = { type: "Literal", value };
  27985. state.inherit(node2, result);
  27986. const container = { type: "JSXExpressionContainer", expression: result };
  27987. state.patch(node2, container);
  27988. return container;
  27989. }
  27990. }
  27991. // node_modules/hast-util-to-estree/lib/handlers/index.js
  27992. var handlers2 = {
  27993. comment,
  27994. doctype: ignore2,
  27995. element,
  27996. mdxFlowExpression: mdxExpression2,
  27997. mdxJsxFlowElement: mdxJsxElement,
  27998. mdxJsxTextElement: mdxJsxElement,
  27999. mdxTextExpression: mdxExpression2,
  28000. mdxjsEsm: mdxjsEsm2,
  28001. root: root2,
  28002. text: text4
  28003. };
  28004. function ignore2() {
  28005. }
  28006. // node_modules/hast-util-to-estree/node_modules/zwitch/index.js
  28007. var own9 = {}.hasOwnProperty;
  28008. function zwitch(key, options) {
  28009. const settings = options || {};
  28010. function one2(value, ...parameters) {
  28011. let fn = one2.invalid;
  28012. const handlers3 = one2.handlers;
  28013. if (value && own9.call(value, key)) {
  28014. const id = String(value[key]);
  28015. fn = own9.call(handlers3, id) ? handlers3[id] : one2.unknown;
  28016. }
  28017. if (fn) {
  28018. return fn.call(this, value, ...parameters);
  28019. }
  28020. }
  28021. one2.handlers = settings.handlers || {};
  28022. one2.invalid = settings.invalid;
  28023. one2.unknown = settings.unknown;
  28024. return one2;
  28025. }
  28026. // node_modules/hast-util-to-estree/lib/state.js
  28027. var own10 = {}.hasOwnProperty;
  28028. var tableElements = /* @__PURE__ */ new Set(["table", "tbody", "thead", "tfoot", "tr"]);
  28029. function createState2(options) {
  28030. const one2 = zwitch("type", {
  28031. invalid,
  28032. unknown,
  28033. handlers: { ...handlers2, ...options.handlers }
  28034. });
  28035. return {
  28036. // Current space.
  28037. elementAttributeNameCase: options.elementAttributeNameCase || "react",
  28038. schema: options.space === "svg" ? svg2 : html3,
  28039. stylePropertyNameCase: options.stylePropertyNameCase || "dom",
  28040. tableCellAlignToStyle: options.tableCellAlignToStyle !== false,
  28041. // Results.
  28042. comments: [],
  28043. esm: [],
  28044. // Useful functions.
  28045. all: all2,
  28046. createJsxAttributeName,
  28047. createJsxElementName,
  28048. handle,
  28049. inherit,
  28050. patch: patch2
  28051. };
  28052. function handle(node2) {
  28053. return one2(node2, this);
  28054. }
  28055. }
  28056. function invalid(value) {
  28057. throw new Error("Cannot handle value `" + value + "`, expected node");
  28058. }
  28059. function unknown(node2) {
  28060. ok(node2 && typeof node2 === "object");
  28061. ok("type" in node2);
  28062. throw new Error("Cannot handle unknown node `" + node2.type + "`");
  28063. }
  28064. function all2(parent) {
  28065. const children = parent.children || [];
  28066. let index2 = -1;
  28067. const results = [];
  28068. const ignoreLineBreak = this.schema.space === "html" && parent.type === "element" && tableElements.has(parent.tagName.toLowerCase());
  28069. while (++index2 < children.length) {
  28070. const child = children[index2];
  28071. if (ignoreLineBreak && child.type === "text" && child.value === "\n") {
  28072. continue;
  28073. }
  28074. const result = this.handle(child);
  28075. if (Array.isArray(result)) {
  28076. results.push(...result);
  28077. } else if (result) {
  28078. results.push(result);
  28079. }
  28080. }
  28081. return results;
  28082. }
  28083. function inherit(from, to) {
  28084. const left = (
  28085. /** @type {Record<string, unknown> | undefined} */
  28086. from.data
  28087. );
  28088. let right;
  28089. let key;
  28090. patch2(from, to);
  28091. if (left) {
  28092. for (key in left) {
  28093. if (own10.call(left, key) && key !== "estree") {
  28094. if (!right) right = {};
  28095. right[key] = left[key];
  28096. }
  28097. }
  28098. if (right) {
  28099. to.data = right;
  28100. }
  28101. }
  28102. }
  28103. function patch2(from, to) {
  28104. const p = position2(from);
  28105. if (p && p.start.offset !== void 0 && p.end.offset !== void 0) {
  28106. to.start = p.start.offset;
  28107. to.end = p.end.offset;
  28108. to.loc = {
  28109. start: { line: p.start.line, column: p.start.column - 1 },
  28110. end: { line: p.end.line, column: p.end.column - 1 }
  28111. };
  28112. to.range = [p.start.offset, p.end.offset];
  28113. }
  28114. }
  28115. function createJsxAttributeName(name2) {
  28116. const node2 = createJsxNameFromString(name2);
  28117. if (node2.type === "JSXMemberExpression") {
  28118. throw new Error("Member expressions in attribute names are not supported");
  28119. }
  28120. return node2;
  28121. }
  28122. function createJsxElementName(name2) {
  28123. return createJsxNameFromString(name2);
  28124. }
  28125. function createJsxNameFromString(name2) {
  28126. if (name2.includes(".")) {
  28127. const names = name2.split(".");
  28128. let part = names.shift();
  28129. ok(part, "Expected `part` to be defined");
  28130. let node2 = { type: "JSXIdentifier", name: part };
  28131. while (part = names.shift()) {
  28132. node2 = {
  28133. type: "JSXMemberExpression",
  28134. object: node2,
  28135. property: { type: "JSXIdentifier", name: part }
  28136. };
  28137. }
  28138. return node2;
  28139. }
  28140. if (name2.includes(":")) {
  28141. const parts = name2.split(":");
  28142. return {
  28143. type: "JSXNamespacedName",
  28144. namespace: { type: "JSXIdentifier", name: parts[0] },
  28145. name: { type: "JSXIdentifier", name: parts[1] }
  28146. };
  28147. }
  28148. return { type: "JSXIdentifier", name: name2 };
  28149. }
  28150. // node_modules/hast-util-to-estree/lib/index.js
  28151. function toEstree(tree, options) {
  28152. const state = createState2(options || {});
  28153. let result = state.handle(tree);
  28154. const body = state.esm;
  28155. if (result) {
  28156. if (result.type !== "JSXFragment" && result.type !== "JSXElement") {
  28157. result = {
  28158. type: "JSXFragment",
  28159. openingFragment: { type: "JSXOpeningFragment" },
  28160. closingFragment: { type: "JSXClosingFragment" },
  28161. children: [result]
  28162. };
  28163. state.patch(tree, result);
  28164. }
  28165. const statement = { type: "ExpressionStatement", expression: result };
  28166. state.patch(tree, statement);
  28167. body.push(statement);
  28168. }
  28169. const program = {
  28170. type: "Program",
  28171. body,
  28172. sourceType: "module",
  28173. comments: state.comments
  28174. };
  28175. state.patch(tree, program);
  28176. return program;
  28177. }
  28178. // node_modules/@mdx-js/mdx/lib/plugin/rehype-recma.js
  28179. function rehypeRecma(options) {
  28180. return function(tree) {
  28181. return toEstree(tree, options);
  28182. };
  28183. }
  28184. // node_modules/@mdx-js/mdx/node_modules/unist-util-is/lib/index.js
  28185. var convert2 = (
  28186. // Note: overloads in JSDoc can’t yet use different `@template`s.
  28187. /**
  28188. * @type {(
  28189. * (<Condition extends string>(test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & {type: Condition}) &
  28190. * (<Condition extends Props>(test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Condition) &
  28191. * (<Condition extends TestFunction>(test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Predicate<Condition, Node>) &
  28192. * ((test?: null | undefined) => (node?: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node) &
  28193. * ((test?: Test) => Check)
  28194. * )}
  28195. */
  28196. /**
  28197. * @param {Test} [test]
  28198. * @returns {Check}
  28199. */
  28200. function(test) {
  28201. if (test === null || test === void 0) {
  28202. return ok3;
  28203. }
  28204. if (typeof test === "function") {
  28205. return castFactory2(test);
  28206. }
  28207. if (typeof test === "object") {
  28208. return Array.isArray(test) ? anyFactory2(test) : propsFactory2(test);
  28209. }
  28210. if (typeof test === "string") {
  28211. return typeFactory2(test);
  28212. }
  28213. throw new Error("Expected function, string, or object as test");
  28214. }
  28215. );
  28216. function anyFactory2(tests) {
  28217. const checks2 = [];
  28218. let index2 = -1;
  28219. while (++index2 < tests.length) {
  28220. checks2[index2] = convert2(tests[index2]);
  28221. }
  28222. return castFactory2(any);
  28223. function any(...parameters) {
  28224. let index3 = -1;
  28225. while (++index3 < checks2.length) {
  28226. if (checks2[index3].apply(this, parameters)) return true;
  28227. }
  28228. return false;
  28229. }
  28230. }
  28231. function propsFactory2(check) {
  28232. const checkAsRecord = (
  28233. /** @type {Record<string, unknown>} */
  28234. check
  28235. );
  28236. return castFactory2(all3);
  28237. function all3(node2) {
  28238. const nodeAsRecord = (
  28239. /** @type {Record<string, unknown>} */
  28240. /** @type {unknown} */
  28241. node2
  28242. );
  28243. let key;
  28244. for (key in check) {
  28245. if (nodeAsRecord[key] !== checkAsRecord[key]) return false;
  28246. }
  28247. return true;
  28248. }
  28249. }
  28250. function typeFactory2(check) {
  28251. return castFactory2(type);
  28252. function type(node2) {
  28253. return node2 && node2.type === check;
  28254. }
  28255. }
  28256. function castFactory2(testFunction) {
  28257. return check;
  28258. function check(value, index2, parent) {
  28259. return Boolean(
  28260. looksLikeANode2(value) && testFunction.call(
  28261. this,
  28262. value,
  28263. typeof index2 === "number" ? index2 : void 0,
  28264. parent || void 0
  28265. )
  28266. );
  28267. }
  28268. }
  28269. function ok3() {
  28270. return true;
  28271. }
  28272. function looksLikeANode2(value) {
  28273. return value !== null && typeof value === "object" && "type" in value;
  28274. }
  28275. // node_modules/@mdx-js/mdx/node_modules/unist-util-visit-parents/lib/color.node.js
  28276. function color3(d) {
  28277. return "\x1B[33m" + d + "\x1B[39m";
  28278. }
  28279. // node_modules/@mdx-js/mdx/node_modules/unist-util-visit-parents/lib/index.js
  28280. var empty5 = [];
  28281. var CONTINUE3 = true;
  28282. var EXIT3 = false;
  28283. var SKIP3 = "skip";
  28284. function visitParents2(tree, test, visitor, reverse) {
  28285. let check;
  28286. if (typeof test === "function" && typeof visitor !== "function") {
  28287. reverse = visitor;
  28288. visitor = test;
  28289. } else {
  28290. check = test;
  28291. }
  28292. const is3 = convert2(check);
  28293. const step = reverse ? -1 : 1;
  28294. factory(tree, void 0, [])();
  28295. function factory(node2, index2, parents) {
  28296. const value = (
  28297. /** @type {Record<string, unknown>} */
  28298. node2 && typeof node2 === "object" ? node2 : {}
  28299. );
  28300. if (typeof value.type === "string") {
  28301. const name2 = (
  28302. // `hast`
  28303. typeof value.tagName === "string" ? value.tagName : (
  28304. // `xast`
  28305. typeof value.name === "string" ? value.name : void 0
  28306. )
  28307. );
  28308. Object.defineProperty(visit4, "name", {
  28309. value: "node (" + color3(node2.type + (name2 ? "<" + name2 + ">" : "")) + ")"
  28310. });
  28311. }
  28312. return visit4;
  28313. function visit4() {
  28314. let result = empty5;
  28315. let subresult;
  28316. let offset2;
  28317. let grandparents;
  28318. if (!test || is3(node2, index2, parents[parents.length - 1] || void 0)) {
  28319. result = toResult3(visitor(node2, parents));
  28320. if (result[0] === EXIT3) {
  28321. return result;
  28322. }
  28323. }
  28324. if ("children" in node2 && node2.children) {
  28325. const nodeAsParent = (
  28326. /** @type {UnistParent} */
  28327. node2
  28328. );
  28329. if (nodeAsParent.children && result[0] !== SKIP3) {
  28330. offset2 = (reverse ? nodeAsParent.children.length : -1) + step;
  28331. grandparents = parents.concat(nodeAsParent);
  28332. while (offset2 > -1 && offset2 < nodeAsParent.children.length) {
  28333. const child = nodeAsParent.children[offset2];
  28334. subresult = factory(child, offset2, grandparents)();
  28335. if (subresult[0] === EXIT3) {
  28336. return subresult;
  28337. }
  28338. offset2 = typeof subresult[1] === "number" ? subresult[1] : offset2 + step;
  28339. }
  28340. }
  28341. }
  28342. return result;
  28343. }
  28344. }
  28345. }
  28346. function toResult3(value) {
  28347. if (Array.isArray(value)) {
  28348. return value;
  28349. }
  28350. if (typeof value === "number") {
  28351. return [CONTINUE3, value];
  28352. }
  28353. return value === null || value === void 0 ? empty5 : [value];
  28354. }
  28355. // node_modules/@mdx-js/mdx/node_modules/unist-util-visit/lib/index.js
  28356. function visit3(tree, testOrVisitor, visitorOrReverse, maybeReverse) {
  28357. let reverse;
  28358. let test;
  28359. let visitor;
  28360. if (typeof testOrVisitor === "function" && typeof visitorOrReverse !== "function") {
  28361. test = void 0;
  28362. visitor = testOrVisitor;
  28363. reverse = visitorOrReverse;
  28364. } else {
  28365. test = testOrVisitor;
  28366. visitor = visitorOrReverse;
  28367. reverse = maybeReverse;
  28368. }
  28369. visitParents2(tree, test, overload, reverse);
  28370. function overload(node2, parents) {
  28371. const parent = parents[parents.length - 1];
  28372. const index2 = parent ? parent.children.indexOf(node2) : void 0;
  28373. return visitor(node2, index2, parent);
  28374. }
  28375. }
  28376. // node_modules/@mdx-js/mdx/lib/plugin/rehype-remove-raw.js
  28377. function rehypeRemoveRaw() {
  28378. return function(tree) {
  28379. visit3(tree, "raw", function(_, index2, parent) {
  28380. if (parent && typeof index2 === "number") {
  28381. parent.children.splice(index2, 1);
  28382. return index2;
  28383. }
  28384. });
  28385. };
  28386. }
  28387. // node_modules/@mdx-js/mdx/node_modules/collapse-white-space/index.js
  28388. var js = /\s+/g;
  28389. var html4 = /[\t\n\v\f\r ]+/g;
  28390. function collapseWhiteSpace(value, options) {
  28391. if (!options) {
  28392. options = {};
  28393. } else if (typeof options === "string") {
  28394. options = { style: options };
  28395. }
  28396. const replace = options.preserveLineEndings ? replaceLineEnding : replaceSpace;
  28397. return String(value).replace(
  28398. options.style === "html" ? html4 : js,
  28399. options.trim ? trimFactory(replace) : replace
  28400. );
  28401. }
  28402. function replaceLineEnding(value) {
  28403. const match = /\r?\n|\r/.exec(value);
  28404. return match ? match[0] : " ";
  28405. }
  28406. function replaceSpace() {
  28407. return " ";
  28408. }
  28409. function trimFactory(replace) {
  28410. return dropOrReplace;
  28411. function dropOrReplace(value, index2, all3) {
  28412. return index2 === 0 || index2 + value.length === all3.length ? "" : replace(value);
  28413. }
  28414. }
  28415. // node_modules/@mdx-js/mdx/lib/plugin/remark-mark-and-unravel.js
  28416. function remarkMarkAndUnravel() {
  28417. return function(tree) {
  28418. visit3(tree, function(node2, index2, parent) {
  28419. let offset2 = -1;
  28420. let all3 = true;
  28421. let oneOrMore = false;
  28422. if (parent && typeof index2 === "number" && node2.type === "paragraph") {
  28423. const children = node2.children;
  28424. while (++offset2 < children.length) {
  28425. const child = children[offset2];
  28426. if (child.type === "mdxJsxTextElement" || child.type === "mdxTextExpression") {
  28427. oneOrMore = true;
  28428. } else if (child.type === "text" && collapseWhiteSpace(child.value, { style: "html", trim: true }) === "") {
  28429. } else {
  28430. all3 = false;
  28431. break;
  28432. }
  28433. }
  28434. if (all3 && oneOrMore) {
  28435. offset2 = -1;
  28436. const newChildren = [];
  28437. while (++offset2 < children.length) {
  28438. const child = children[offset2];
  28439. if (child.type === "mdxJsxTextElement") {
  28440. child.type = "mdxJsxFlowElement";
  28441. }
  28442. if (child.type === "mdxTextExpression") {
  28443. child.type = "mdxFlowExpression";
  28444. }
  28445. if (child.type === "text" && /^[\t\r\n ]+$/.test(String(child.value))) {
  28446. } else {
  28447. newChildren.push(child);
  28448. }
  28449. }
  28450. parent.children.splice(index2, 1, ...newChildren);
  28451. return index2;
  28452. }
  28453. }
  28454. if (node2.type === "mdxJsxFlowElement" || node2.type === "mdxJsxTextElement") {
  28455. const data2 = node2.data || (node2.data = {});
  28456. data2._mdxExplicitJsx = true;
  28457. }
  28458. });
  28459. };
  28460. }
  28461. // node_modules/@mdx-js/mdx/lib/node-types.js
  28462. var nodeTypes = (
  28463. /** @type {const} */
  28464. [
  28465. "mdxFlowExpression",
  28466. "mdxJsxFlowElement",
  28467. "mdxJsxTextElement",
  28468. "mdxTextExpression",
  28469. "mdxjsEsm"
  28470. ]
  28471. );
  28472. // node_modules/@mdx-js/mdx/lib/core.js
  28473. var removedOptions = [
  28474. "compilers",
  28475. "filepath",
  28476. "hastPlugins",
  28477. "mdPlugins",
  28478. "skipExport",
  28479. "wrapExport"
  28480. ];
  28481. var warned = false;
  28482. function createProcessor(options) {
  28483. const settings = options || {};
  28484. let index2 = -1;
  28485. while (++index2 < removedOptions.length) {
  28486. const key = removedOptions[index2];
  28487. if (key in settings) {
  28488. unreachable(
  28489. "Unexpected removed option `" + key + "`; see <https://mdxjs.com/migrating/v2/> on how to migrate"
  28490. );
  28491. }
  28492. }
  28493. if (settings.format === "detect") {
  28494. unreachable(
  28495. "Unexpected `format: 'detect'`, which is not supported by `createProcessor`, expected `'mdx'` or `'md'`"
  28496. );
  28497. }
  28498. if ((settings.jsxRuntime === "classic" || settings.pragma || settings.pragmaFrag || settings.pragmaImportSource) && !warned) {
  28499. warned = true;
  28500. console.warn(
  28501. "Unexpected deprecated option `jsxRuntime: 'classic'`, `pragma`, `pragmaFrag`, or `pragmaImportSource`; see <https://mdxjs.com/migrating/v3/> on how to migrate"
  28502. );
  28503. }
  28504. const pipeline = unified().use(remarkParse);
  28505. if (settings.format !== "md") {
  28506. pipeline.use(remarkMdx);
  28507. }
  28508. const remarkRehypeOptions = settings.remarkRehypeOptions || {};
  28509. pipeline.use(remarkMarkAndUnravel).use(settings.remarkPlugins || []).use(remarkRehype, {
  28510. ...remarkRehypeOptions,
  28511. allowDangerousHtml: true,
  28512. passThrough: [...remarkRehypeOptions.passThrough || [], ...nodeTypes]
  28513. }).use(settings.rehypePlugins || []);
  28514. if (settings.format === "md") {
  28515. pipeline.use(rehypeRemoveRaw);
  28516. }
  28517. pipeline.use(rehypeRecma, settings).use(recmaDocument, settings).use(recmaJsxRewrite, settings);
  28518. if (!settings.jsx) {
  28519. pipeline.use(recmaJsxBuild, settings);
  28520. }
  28521. pipeline.use(recmaStringify, settings).use(settings.recmaPlugins || []);
  28522. return pipeline;
  28523. }
  28524. // node_modules/@mdx-js/mdx/lib/compile.js
  28525. function compile(vfileCompatible, compileOptions) {
  28526. const { file, options } = resolveFileAndOptions(vfileCompatible, compileOptions);
  28527. return createProcessor(options).process(file);
  28528. }
  28529. function compileSync(vfileCompatible, compileOptions) {
  28530. const { file, options } = resolveFileAndOptions(vfileCompatible, compileOptions);
  28531. return createProcessor(options).processSync(file);
  28532. }
  28533. // node_modules/@mdx-js/mdx/lib/util/resolve-evaluate-options.js
  28534. function resolveEvaluateOptions(options) {
  28535. const {
  28536. Fragment,
  28537. baseUrl,
  28538. development,
  28539. jsx: jsx2,
  28540. jsxDEV,
  28541. jsxs,
  28542. useMDXComponents,
  28543. ...rest
  28544. } = options || {};
  28545. if (!Fragment) throw new Error("Expected `Fragment` given to `evaluate`");
  28546. if (development) {
  28547. if (!jsxDEV) throw new Error("Expected `jsxDEV` given to `evaluate`");
  28548. } else {
  28549. if (!jsx2) throw new Error("Expected `jsx` given to `evaluate`");
  28550. if (!jsxs) throw new Error("Expected `jsxs` given to `evaluate`");
  28551. }
  28552. return {
  28553. compiletime: {
  28554. ...rest,
  28555. development,
  28556. outputFormat: "function-body",
  28557. providerImportSource: useMDXComponents ? "#" : void 0
  28558. },
  28559. runtime: { Fragment, baseUrl, jsx: jsx2, jsxDEV, jsxs, useMDXComponents }
  28560. };
  28561. }
  28562. // node_modules/@mdx-js/mdx/lib/run.js
  28563. var AsyncFunction = Object.getPrototypeOf(run).constructor;
  28564. async function run(code2, options) {
  28565. return new AsyncFunction(String(code2))(options);
  28566. }
  28567. function runSync(code2, options) {
  28568. return new Function(String(code2))(options);
  28569. }
  28570. // node_modules/@mdx-js/mdx/lib/evaluate.js
  28571. async function evaluate(file, options) {
  28572. const { compiletime, runtime } = resolveEvaluateOptions(options);
  28573. return run(await compile(file, compiletime), runtime);
  28574. }
  28575. function evaluateSync(file, options) {
  28576. const { compiletime, runtime } = resolveEvaluateOptions(options);
  28577. return runSync(compileSync(file, compiletime), runtime);
  28578. }
  28579. // Annotate the CommonJS export names for ESM import in node:
  28580. 0 && (module.exports = {
  28581. compile,
  28582. compileSync,
  28583. createProcessor,
  28584. evaluate,
  28585. evaluateSync,
  28586. nodeTypes,
  28587. run,
  28588. runSync
  28589. });